Skip to main content
The grid-cortex-client Python package provides a unified interface to all AI models hosted on GRID Cortex.

Installation

Inside a GRID session workspace the client is already installed — skip this step. On your own machine, install it with pip:
It is recommended that you use Python 3.10+

Authentication & Endpoint

Set up your API key (and endpoint, if needed):
  1. During onboarding General Robotics will give you a personal CORTEX API key.
  2. Export it so the client can pick it up automatically:
  3. If you run Cortex on-prem or on a managed cloud deployment, point the client at the Cortex API URL supplied with your deployment — the dedicated grid-… API hostname, not the admin-… portal hostname:
  4. You can also pass the key directly when constructing the client:

Quick Start (2 lines)

Get started with just two lines of code:
The result type depends on the model — see the individual model pages for details.

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:
You can also use the ModelType enum for IDE autocompletion:

Async & WebSocket Clients

AsyncCortexClient

For asyncio-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)
Pub/Sub (concurrent, non-blocking)
Each HubResult contains request_id, model, data, ok, and optional error.

Troubleshooting

401 Unauthorized – Check that your shell actually has GRID_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: