Any OpenAI-compatible tool
Any tool that targets OpenAI's Chat Completions API works with The Grid. Set the base URL, API key, and model. Tools built on OpenAI's Responses API (Codex and similar) don't work yet.
Any application, framework, IDE plugin, or agent that targets OpenAI's Chat Completions API can point at The Grid. The configuration is always the same three values:
Base URL
https://api.thegrid.ai/v1
API key
Your Grid API key from app.thegrid.ai/profile/api-keys
Model
An instrument string from our nine instruments: text-standard, text-prime, text-max, code-standard, code-prime, code-max, agent-standard, agent-prime, agent-max
If a tool has fields for base URL, API key, and model, and it speaks Chat Completions, you can use The Grid.
What works: Chat Completions API tools
Our Consumption API implements OpenAI's chat/completions interface. That's the surface our suppliers serve and the surface our market is priced against. Any tool that posts to a chat/completions endpoint with the OpenAI request body works as long as you set the three values above.
This covers the large majority of OpenAI-compatible tooling today: cross-provider routers, agent frameworks, IDE plugins, eval harnesses, and most application code written against the OpenAI SDK.
What doesn't work yet: Responses API tools
Tools built on OpenAI's newer Responses API (/v1/responses) don't work with The Grid yet. That includes Codex (the OpenAI CLI), and any tool that calls client.responses.create() or posts to a responses endpoint.
The Responses API has a different request and response shape from Chat Completions, and we don't expose a compatible endpoint today. If your tool only targets Responses, it can't run against The Grid right now. If your tool can be configured to use Chat Completions instead (most can), point it at our base URL using the configuration above.
Tools expose this configuration in three patterns
Most tools fall into one of these patterns.
Environment variables (CLI tools, scripts, agents):
export OPENAI_API_BASE=https://api.thegrid.ai/v1
export OPENAI_API_KEY=your-grid-api-keyThen set the model to an instrument string wherever the tool accepts it. Some tools use OPENAI_BASE_URL instead of OPENAI_API_BASE. Check the tool's docs.
JSON or YAML config files (IDE plugins, agent frameworks):
Field names vary. base_url, baseURL, api_base, and endpoint are all common. The values are always the same.
Popular SDKs
If you're writing custom code, here's how to wire up the most common SDKs against our Consumption API. The same three values apply: base URL, API key, and an instrument string in the model field.
What's supported
Through Chat Completions, we serve:
Streaming (server-sent events)
Function and tool calling
Structured outputs (JSON mode and JSON schema)
System, user, and assistant messages
Multi-turn conversations
max_tokens,temperature,top_p,stop, and standard generation parameters
What's not supported
These are OpenAI-specific products, not part of the inference contract:
The Responses API (
/v1/responses) and any tool built on it (Codex and similar)The Assistants API and Threads
File uploads and retrieval
Image generation (DALL-E)
Audio (Whisper, TTS)
Embeddings
Fine-tuning
Batch API
If a tool requires any of these, those calls go directly to whichever provider offers them. Chat completions still work through The Grid.
Common gotchas
Don't add /chat/completions to the base URL. Most clients append the path themselves. The base URL is https://api.thegrid.ai/v1, not https://api.thegrid.ai/v1/chat/completions. If you set the latter, your requests hit …/v1/chat/completions/chat/completions and 404.
Watch out for tools that auto-append /v1. Some SDKs and tools automatically append /v1 to whatever base URL you provide. If you set https://api.thegrid.ai/v1 and the tool adds another /v1, your requests hit https://api.thegrid.ai/v1/v1/chat/completions and fail with a 404. If your tool does this, set the base URL to https://api.thegrid.ai (without /v1).
No trailing slashes. Use https://api.thegrid.ai/v1, not https://api.thegrid.ai/v1/. A trailing slash on the base URL causes some clients to construct malformed paths.
Auth header is Bearer, not raw key. The header is Authorization: Bearer YOUR_KEY. The literal word Bearer, then a space, then your key. Most SDKs add the prefix automatically. If you're crafting requests by hand and you get a 401, check the header format.
Use the instrument string in the model field, not a model name. text-prime works. gpt-4o returns a 404. The full list of nine instruments lives in the spec docs.
Some clients follow redirects, some don't. We use 307 redirects on certain paths. If you're using curl, add -L to follow them. Most SDKs handle this automatically. See API reference → Request routing and redirects for details.
Tools built on the Anthropic SDK
The OpenAI-compatible endpoint above works for any tool that speaks chat/completions. For tools built around messages.create() from the Anthropic SDK, point them at our Messages API beta at https://messages-beta.api.thegrid.ai/v1 instead. See Migrating from Anthropic.
If you set the three values correctly and still get errors, the Troubleshooting page has the common ones with fixes.
Last updated
Was this helpful?