Skip to main content
Claude Code talks to the Anthropic Messages API. The Grid speaks that API, so you can run Claude Code on Grid models by changing where it sends requests.
Claude Code’s own system prompt and tools are about 13k tokens before you type anything. Only models with a large context window fit. Today that is qwen-2.5-32b (32k). Smaller models answer with a 400 that names the context limit.

Setup

1

Get a key

Create a compute API key in the dashboard under Settings → API keys and add credits. Requests are billed from those credits.
2

Pick a model that fits

List the models and their context sizes:
Use one whose max_input_tokens is well above 13k.
3

Point Claude Code at the Grid

The key goes out as x-api-key. If you prefer a Bearer header, set ANTHROPIC_AUTH_TOKEN instead of ANTHROPIC_API_KEY. The Grid accepts both.
Claude Code also uses a smaller “fast” model for some background tasks. If those requests fail because the default name is not a Grid model, point it at a Grid model too. The variable name depends on your Claude Code version (for example ANTHROPIC_DEFAULT_HAIKU_MODEL, or ANTHROPIC_SMALL_FAST_MODEL on older versions), so check the Claude Code settings docs for yours.

What to expect

  • Grid models, not Claude. You get open models served by Singularity Layer nodes. They are smaller than Claude, so expect simpler answers and less reliable multi-step tool use.
  • Streaming works. Claude Code always streams, which also avoids the timeout on long non-streaming replies.
  • Your own tools work. File edits, shell commands and other Claude Code tools are defined by the client, so they run normally.
  • Some features do not. Extended thinking with a budget, web search, web fetch and other server tools, PDF and document input, and prompt caching are not available on the Grid. Claude Code keeps working, but features that need them fail or are skipped.
  • Cost. Each turn is billed per token from your credits, like any Grid call. usage.cost_usd on each reply shows the charge.

Troubleshooting