Installation
Install the GRID Cortex client package using pip:It is recommended that you use Python 3.10+
Authentication & Endpoint
Set up your API key (and endpoint, if needed):
- During onboarding General Robotics will give you a personal CORTEX API key.
- Export it so the client can pick it up automatically:
- If you run Cortex on-prem or on a managed cloud deployment, point the client at your instance:
- You can also pass the key directly when constructing the client:
Unified API
Every model is called through the same function:model_id— the model identifier (e.g."zoedepth","gsam2","pi05")**kwargs— model-specific inputs (image_input,prompt,left_image, etc.)
Discovery
List all available models and get per-model documentation at runtime:ModelType enum for IDE autocompletion:
Async & WebSocket Clients
AsyncCortexClient
Forasyncio-based applications, use AsyncCortexClient — same API as CortexClient but with await:
CortexHubClient (WebSocket)
For high-throughput pipelines,CortexHubClient provides a persistent WebSocket connection. It supports two patterns:
Request-response (simple)
HubResult contains request_id, model, data, ok, and optional error.
Troubleshooting
401 Unauthorized – Check that your shell actually hasGRID_CORTEX_API_KEY exported and that the key is correct.
Timeout / connection errors – If you are on-prem/managed cloud, confirm GRID_CORTEX_BASE_URL points to your instance. You can also adjust the default 30 s timeout: