Overview

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.

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.

Two HTTP APIs

We expose two HTTP APIs. Most teams only ever hit the first one.

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.

Authentication at a glance

We issue two key types, one per API:

  • Consumption keys for the Consumption API. Bearer header on the OpenAI-compatible host, x-api-key header 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 and sign every request with the private key. Three headers ride with each request: x-thegrid-signature, x-thegrid-timestamp, and x-thegrid-fingerprint.

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.

Both key types live in the dashboard at app.thegrid.ai/profile/api-keysarrow-up-right. Full generation and signing details are on the Authentication page.

Routing behavior

Requests to the Consumption API return an HTTP 307 Temporary Redirect on the way to the supplier serving your 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, allowlist the supplier domains alongside api.thegrid.ai. See Request routing and redirects for the full client compatibility list.

Where to start

Last updated

Was this helpful?