> Markdown representation of https://thegrid.ai/. Requesting that URL with `Accept: text/markdown` returns this document; so does https://thegrid.ai/index.md.
> Agent map: https://thegrid.ai/llms.txt. Full context: https://thegrid.ai/llms-full.txt. API contract: https://thegrid.ai/openapi.json.

# The Grid: the spot market for AI inference

Suppliers bid to serve your requests in real time. You pay the live clearing price per token, with no subscriptions, no rate limits tied to a plan, and no vendor lock-in.

## What you buy

You do not pick a model. You pick an **instrument**: a standardized task type and quality tier with a published specification covering the quality floor, context window, output length, and latency a supplier must meet. Pass the instrument id in the `model` field and The Grid routes the request to whichever qualifying supplier is cheapest right now.

| Instrument | Task | Tier | Price / 1M tokens | Context | Output | Recently served |
| --- | --- | --- | --- | --- | --- | --- |
| `text-standard` | Text | Standard | $0.035 | 128K | 16K+ | GPT-OSS 120B |
| `text-prime` | Text | Prime | $0.120 | 196K | 30K+ | MiniMax-M3, GLM-5.2, Kimi K2.6 |
| `text-max` | Text | Max | $1.709 | 1M | 128K | Claude Opus 5, Claude Opus 4.8 |
| `code-standard` | Code | Standard | $0.035 | 128K | 16K+ | GPT-OSS 120B |
| `code-prime` | Code | Prime | $0.120 | 196K | 30K+ | MiniMax-M3, Kimi K2.6 |
| `code-max` | Code | Max | $1.709 | 1M | 128K | Claude Opus 5, Claude Opus 4.8 |
| `agent-standard` | Agent | Standard | $0.035 | 128K | 16K+ | GPT-OSS 120B |
| `agent-prime` | Agent | Prime | $0.120 | 196K | 30K+ | MiniMax-M3, GLM-5.2, Kimi K2.6 |
| `agent-max` | Agent | Max | $1.709 | 1M | 128K | Claude Opus 5, Claude Opus 4.8 |

Lab Latest markets contract for the newest qualifying route from one model family:

| Instrument | Task | Tier | Price / 1M tokens | Context | Output | Recently served |
| --- | --- | --- | --- | --- | --- | --- |
| `gpt-sol-latest` | Lab | Latest | $1.821 | 1M | 128K | gpt-5.6-sol |
| `claude-opus-latest` | Lab | Latest | $1.709 | 1M | 128K | Claude Opus 5, Claude Opus 4.8 |
| `gemini-pro-latest` | Lab | Latest | $0.656 | 1M | 65K | Gemini 3.1 Pro Preview |
| `minimax-latest` | Lab | Latest | $0.118 | 1M | 512K | MiniMax-M3 |
| `glm-latest` | Lab | Latest | $0.355 | 1M | 128K | GLM-5.2 |
| `deepseek-pro-latest` | Lab | Latest | $0.444 | 1M | 384K | DeepSeek-V4-Pro |
| `kimi-latest` | Lab | Latest | $1.000 | 262K | 262K | Kimi K3, Kimi K2.7 Code |
| `bytedance-pro-latest` | Lab | Latest | $0.220 | 262K | 131K | seed-2-0-pro |

Prices move with the market. For live numbers: `GET https://api.thegrid.ai/v1/models` (no auth required).

## Why it costs less

- **Auto-buy.** You make an API call; The Grid finds the best qualifying supplier at the best available price, automatically. It behaves like pay-as-you-go, at market price instead of list price.
- **Automatic quality assurance.** Every tier has a benchmark specification covering intelligence index, throughput, and latency. Suppliers are evaluated continuously and replaced when they fall below it.
- **Zero lock-in.** Your integration targets `text-prime`, not a model vendor. Switch tiers at any time; there is no contract.
- **Limit orders.** Set the maximum price you will pay. If the market clears at or below it, your request fills, which makes batch work substantially cheaper.
- **Reselling.** Tokens held in a Trading account can be sold back on the same order book, so spend stays tied to what a workload actually consumes.

## Start in three lines

```bash
curl https://api.thegrid.ai/v1/chat/completions \
  -H "Authorization: Bearer $GRID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"text-prime","messages":[{"role":"user","content":"Hello"}]}'
```

The Consumption API speaks OpenAI Chat Completions; a beta endpoint speaks the Anthropic Messages format. Migrating means changing the base URL, the API key, and the model string. Your SDK and request shape stay the same.

New accounts get a $25 signup credit: https://app.thegrid.ai/sign-up

## For agents

An agent can onboard over HTTP without a human copying a key out of a dashboard:

1. `POST https://platform.api.thegrid.ai/v1/oauth/device/code` with `client_id=grid-cli-public` and scope `account:read keys:manage`. A person approves once at the returned `verification_uri`.
2. Poll `POST https://platform.api.thegrid.ai/v1/oauth/token` until an `access_token` comes back.
3. `POST https://platform.api.thegrid.ai/v1/api-keys` with that token to mint a consumption key.
4. Call `POST https://api.thegrid.ai/v1/chat/completions` with the key.

The Grid also runs an MCP server at `https://thegrid.ai/mcp` (Streamable HTTP, read-only, no auth) with tools for the instrument catalog, live prices, the API overview, and the documentation.

## Where next

- Pricing: https://thegrid.ai/pricing
- Instruments: https://thegrid.ai/instruments
- About: https://thegrid.ai/about
- Contact: https://thegrid.ai/contact
- Documentation: https://thegrid.ai/docs (agent index: https://thegrid.ai/docs/llms.txt)
- Full agent context: https://thegrid.ai/llms-full.txt
