Overview
Complete API reference for The Grid's market-priced AI inference platform. Covers the Consumption API for OpenAI- and Anthropic-compatible inference, the Trading API for market data and orders, and th
The Grid exposes its inference market over HTTP. This section covers what to call, how to authenticate, and how the routing layer behaves at runtime. Per-endpoint schemas and parameter tables live in the OpenAPI blocks on each page.
Three HTTP APIs
We expose three HTTP surfaces. Most teams only ever hit the Consumption API for inference.
Consumption API
What you call for inference. One routing engine, two request shapes:
OpenAI Chat Completions format at
https://api.thegrid.ai/v1. Auth header:Authorization: Bearer <consumption-key>. If your code already talks to OpenAI, swap the base URL and the model name and you're done.Anthropic Messages format at
https://messages-beta.api.thegrid.ai/v1. Auth header:x-api-key: <consumption-key>. Same routing engine, same instruments, same consumption key value. Different request shape so the Anthropic SDK and Claude Code drop in without changes.
Both URLs hit the same Consumption API. Anthropic Messages is not a separate API; it's the Consumption API in a different request format. Pick whichever surface your stack prefers.
See Consumption API.
Trading API
Everything beyond inference. This is what you call to:
Fetch instrument specifications and live market data
Read your balances and account positions
See past purchases and trade history
Place orders directly on the order book
Transfer tokens between Trading and Consumption accounts
Base URL: https://trading.api.thegrid.ai/v1. Auth: Ed25519-signed requests. See Authentication for the signing scheme.
If you only consume inference and let Auto Mode buy on your behalf, you don't need the Trading API. The moment you want to look at your account balance, list past trades, or place a limit order yourself, you do.
Platform API
Account control plane for automation: OAuth 2.0 device login, programmatic creation of consumption and trading keys, and account settings (Auto Mode vs Advanced Mode, funding automation).
Base URL: https://platform.api.thegrid.ai/v1. Auth: OAuth bearer (grid_at_*) or browser session from the dashboard.
Agents and integrations typically start here with Programmatic onboarding, then call Consumption and Trading with the keys they create.
See Platform API.
Diagnostics
Each API surface has a safe read-only diagnostics endpoint for onboarding and support:
Platform diagnostics checks OAuth/session auth, email/legal readiness, account status, account mode, and key availability.
Consumption diagnostics checks a Consumption API key, account status, visible model catalog count, and account mode without making an inference request.
Trading diagnostics checks signed Trading auth, account mode/status, visible trading accounts, routable markets, and order-control readiness.
Run grid diagnostics in the CLI, or call the endpoints directly. See Diagnostics.
Authentication at a glance
We issue two credential types for inference and trading, plus OAuth tokens for account control:
Consumption keys for the Consumption API. Bearer header on the OpenAI-compatible host,
x-api-keyheader on the Anthropic Messages host. The same key value works on both.Trading keys for the Trading API. An Ed25519 keypair you generate locally; you register the public key in the dashboard or via the Platform API and sign every request with the private key. Three headers ride with each request:
x-thegrid-signature,x-thegrid-timestamp, andx-thegrid-fingerprint.OAuth access tokens (
grid_at_*) for the Platform API — device login, key management, and account settings. Not a substitute for consumption keys on inference endpoints.
Trading keys cover the entire Trading API surface, not just order placement. Reading your balance, fetching instrument specs, listing past trades, transferring between accounts: all of that needs a Trading key.
Create keys in the dashboard at app.thegrid.ai/profile/api-keys or programmatically after OAuth login. Full details: Authentication.
Routing behavior
Requests to the Consumption API return an HTTP 307 Temporary Redirect on the way to the routing layer that fulfills inference. The OpenAI SDK, Anthropic SDK, requests, httpx, and most other libraries follow this transparently. cURL needs -L. If your environment locks down outbound traffic, api.thegrid.ai is the only domain you need to allowlist — the redirect target lives on the same host. See Request routing and redirects for the full client compatibility list.
Where to start
Programmatic onboarding: OAuth device flow → keys → first API calls.
Authentication: Consumption keys (Bearer / x-api-key), Trading keys (Ed25519), and OAuth tokens.
Consumption API: chat completions and messages endpoints with full OpenAPI specs.
Trading API: instruments, markets, orders, accounts, transfers, price history.
Platform API: OAuth device flow, key CRUD, account settings.
Diagnostics: safe read-only checks for Platform, Consumption, and Trading auth paths.
Errors and rate limits: status code catalog, retry guidance, rate limit behavior.
Request routing and redirects: the 307 from the Consumption API and which clients need configuration.
Last updated
Was this helpful?