Quickstart

Get from sign-up to your first API call in three steps.

Three steps from sign-up to first call

  1. Sign up at thegrid.aiarrow-up-right. New accounts get a $25 signup credit (limited time), enough for millions of test calls on text-prime.

  2. Get an API key. Go to Settings → API Keysarrow-up-right in the dashboard and create a Consumption API key. Copy it now. We don't show it after this.

  3. Make your first call. Pick the API surface your code already speaks.

Make your first call

The Grid is compatible with both OpenAI and Anthropic messaging formats. The same Grid API key and instrument strings work on both. We route your request to the supplier offering the best price for that instrument.

OpenAI Chat Completions

Base URL: https://api.thegrid.ai/v1. Auth header: Authorization: Bearer YOUR_GRID_API_KEY. Model field: an instrument string like text-prime (Text Prime).

curl https://api.thegrid.ai/v1/chat/completions \
  -H "Authorization: Bearer YOUR_GRID_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "text-prime",
    "messages": [
      {"role": "user", "content": "What is a spot market for AI inference?"}
    ]
  }'

Anthropic Messages (beta)

Base URL: https://messages-beta.api.thegrid.ai/v1. Auth header: x-api-key: YOUR_GRID_API_KEY. Model field: an instrument string like text-prime.

That's it. You're live on The Grid. By default, your account runs in Auto Mode, so we handle token purchasing in the background as you call the API. Add credits at app.thegrid.aiarrow-up-right; we charge against your credit balance per request, and auto-reload tops your balance up when it runs low (configurable in the dashboard).

What to do next

Last updated

Was this helpful?