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

Installation

The client is already installed in every GRID session workspace and in the Python environment the GRID CLI prepares for skill run. No separate installation is needed. Start with the GRID installation guide.
If you previously installed the client from public PyPI, use a GRID session workspace or the CLI-managed Python environment for current versions. Existing public PyPI releases remain available as historical versions; no new releases are published there.

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. A key only works on the cluster it was created in. Anything the GRID CLI starts for you — including a robot workspace’s Python and notebooks — already has the active cluster’s key; a python you start yourself needs it exported. 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: