# The Grid (thegrid.ai) > Agent-facing map for what The Grid is, which docs to read, and how to call the API. > > The Grid (thegrid.ai) is a real-time spot market for AI inference. Developers choose standardized Text, Code, or Agent instruments instead of choosing a single model vendor, then consume inference through OpenAI and Anthropic-compatible APIs at market-driven prices. ## Start here - Homepage: https://thegrid.ai - Drop your AI costs by up to 80% by letting suppliers compete for your LLM requests. - Pricing: https://thegrid.ai/pricing - Compare market-priced LLM outputs for Text, Code, and Agentic tasks and save up to 80% on costs - Instruments: https://thegrid.ai/instruments - Choose Text, Code, or Agent instruments across Standard, Prime, and Max tiers for each workload. - App signup: https://app.thegrid.ai/sign-up - Full agent context: https://thegrid.ai/llms-full.txt - Full readable context for agents: product, APIs, instruments, use cases, docs links, and disambiguation. - Brand facts JSON: https://thegrid.ai/brand-facts.json - Structured facts about The Grid's identity, product, instruments, APIs, docs, and disambiguation. - OpenAPI spec: https://thegrid.ai/openapi.json - OpenAPI spec for The Grid's Consumption and Trading APIs, including auth, endpoints, and instruments. - URL metadata JSON: https://thegrid.ai/url-metadata.json ## Documentation discovery - Docs root: https://thegrid.ai/docs - Docs index for agents: https://thegrid.ai/docs/llms.txt - Docs sitemap: https://thegrid.ai/docs/sitemap.xml - Docs page sitemap: https://thegrid.ai/docs/sitemap-pages.xml - Docs overview Markdown: https://thegrid.ai/docs/readme.md Agents should use https://thegrid.ai/docs/llms.txt to enumerate documentation pages. Prefer Markdown URLs ending in `.md` for retrieval. If a docs page does not answer your question directly, ask the docs with: ```http GET https://thegrid.ai/docs/readme.md?ask= ``` ## Important docs entrypoints - [Documentation overview](https://thegrid.ai/docs/readme.md): Start here to learn The Grid, pick an instrument, and make your first API call with familiar SDKs. - [Quickstart](https://thegrid.ai/docs/start-here/quickstart.md): Go from signup to your first Grid API call using OpenAI or Anthropic-compatible request formats. - [Choose an instrument](https://thegrid.ai/docs/start-here/choose-an-instrument.md): Pick a Text, Code, or Agent instrument and choose Standard, Prime, or Max. - [Programmatic onboarding](https://thegrid.ai/docs/start-here/programmatic-onboarding.md): Onboard an agent over HTTP: OAuth device login, create a consumption API key, and make your first inference call. - [Current instruments](https://thegrid.ai/docs/instrument-specifications/current-instruments.md): Compare live Text, Code, and Agent instruments by quality floor, context, output, and latency. - [Integrations](https://thegrid.ai/docs/integrations-and-best-practices/integrations.md): Set up The Grid in IDEs, coding agents, routers, and agent frameworks. - [Migrating from OpenAI](https://thegrid.ai/docs/integrations-and-best-practices/migrating-from-openai.md): Switch from OpenAI by changing the base URL, API key, and model string. - [Routing patterns](https://thegrid.ai/docs/integrations-and-best-practices/routing-patterns.md): Route workloads across various instruments: Prime by default, Max for hard tasks, Standard for volume. - [Troubleshooting](https://thegrid.ai/docs/integrations-and-best-practices/troubleshooting.md): Fix common Grid integration issues: auth, base URLs, model strings, balance, and rate limits. - [Any OpenAI-compatible tool](https://thegrid.ai/docs/integrations-and-best-practices/any-openai-compatible-tool.md): Generic setup for any client that can target the OpenAI Chat Completions API. - [API overview](https://thegrid.ai/docs/api-reference/api-reference.md): Overview of The Grid's HTTP APIs, authentication, routing behavior, and runtime errors. - [Authentication](https://thegrid.ai/docs/api-reference/authentication.md): Generate, use, and rotate API keys for The Grid's Consumption and Trading APIs. - [Consumption API](https://thegrid.ai/docs/api-reference/consumption-api.md): Run inference through The Grid using OpenAI Chat Completions or Anthropic Messages formats. - [Platform API](https://thegrid.ai/docs/api-reference/platform-api.md): OAuth login, programmatic API key and signing key management, and account settings. - [Errors and rate limits](https://thegrid.ai/docs/api-reference/errors-and-rate-limits.md): Understand Grid API errors, retryable failures, balance issues, and rate limits. - [Data handling and privacy](https://thegrid.ai/docs/data-handling-and-privacy/data-handling-and-privacy.md): What The Grid stores, what it does not, and how prompts, credentials, and usage records are handled. ## API quick facts - OpenAI-compatible base URL: `https://api.thegrid.ai/v1` - OpenAI-compatible auth: `Authorization: Bearer YOUR_GRID_API_KEY` - Anthropic-compatible Messages beta base URL: `https://messages-beta.api.thegrid.ai/v1` - Anthropic-compatible auth: `x-api-key: YOUR_GRID_API_KEY` - Platform API base URL (OAuth, key creation, settings): `https://platform.api.thegrid.ai/v1` - Use an instrument id as the model, for example `text-prime`, `code-prime`, or `agent-standard`. ## Onboard programmatically (agents and integrations) Agents can self-provision and start running inference without a human copying a key from the dashboard. Log in with OAuth, mint a consumption key, then call the Consumption API: 1. Request a device code: `POST https://platform.api.thegrid.ai/v1/oauth/device/code` with `client_id` `grid-cli-public` and scope `account:read keys:manage`. Approve once at the returned `verification_uri`. 2. Poll for tokens: `POST https://platform.api.thegrid.ai/v1/oauth/token` until you receive an `access_token` (`grid_at_*`). Tokens last about one hour; refresh with `grant_type=refresh_token`. 3. Create a consumption key: `POST https://platform.api.thegrid.ai/v1/api-keys` with the access token as Bearer. The secret is returned once, so store it immediately. 4. Run inference: `POST https://api.thegrid.ai/v1/chat/completions` with that key as Bearer and `text-prime` as the model. Full walkthrough: https://thegrid.ai/docs/start-here/programmatic-onboarding.md Platform API reference: https://thegrid.ai/docs/api-reference/platform-api.md ## Current instruments - Text Standard (`text-standard`): Price-optimized, high-throughput text. $0.035/1M tokens trailing 30-day blended average. Save up to 87%. - Text Prime (`text-prime`): Reliable models for everyday tasks. $0.120/1M tokens trailing 30-day blended average. Save up to 78%. - Text Max (`text-max`): Frontier models for complex reasoning. $1.709/1M tokens trailing 30-day blended average. Save up to 16%. - Code Standard (`code-standard`): Price-optimized, high-throughput code. $0.035/1M tokens trailing 30-day blended average. Save up to 79%. - Code Prime (`code-prime`): Reliable models for daily coding work. $0.120/1M tokens trailing 30-day blended average. Save up to 78%. - Code Max (`code-max`): Frontier models for complex coding tasks. $1.709/1M tokens trailing 30-day blended average. Save up to 50%. - Agent Standard (`agent-standard`): Price-optimized, high-throughput agents. $0.035/1M tokens trailing 30-day blended average. Save up to 79%. - Agent Prime (`agent-prime`): Reliable models for daily agent work. $0.120/1M tokens trailing 30-day blended average. Save up to 82%. - Agent Max (`agent-max`): Frontier models for complex agent tasks. $1.709/1M tokens trailing 30-day blended average. Save up to 16%. ## Disambiguation The Grid is the AI inference spot market at thegrid.ai, built by Spectral Labs. It is not Grid AI (grid.ai / Lightning AI), GridAI Technologies (NASDAQ: GRDX), DGrid (dgrid.ai), or the defunct The Grid website builder.