Guides

1M Context (Claude)

Enable real 1 million-token context on Claude models via a beta header.

Claude Code — env vars

Prismma serves real 1 million token context for Claude models. Use a bare model id (no [1m] suffix) and set ANTHROPIC_BETAS=context-1m-2025-08-07.

shell
# Claude Code — 1M context via Prismma (bare model id required; no [1m] suffix)
unset ANTHROPIC_API_KEY   # clear stale direct-Anthropic key — Claude Code prefers it
export ANTHROPIC_BASE_URL="https://api.prismma.ai"
export ANTHROPIC_AUTH_TOKEN="sk-eu-YOUR-KEY"   # Claude (group 2) key
export ANTHROPIC_BETAS="context-1m-2025-08-07"  # required — without it Claude Code compacts at 200K

claude   # launch Claude Code — now routed through Prismma

Alternative: settings.json

settings.json
// ~/.claude/settings.json  (alternative to env vars)
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.prismma.ai",
    "ANTHROPIC_AUTH_TOKEN": "sk-eu-YOUR-KEY",
    "ANTHROPIC_MODEL": "claude-opus-4-8",
    "ANTHROPIC_BETAS": "context-1m-2025-08-07",
    "ANTHROPIC_API_KEY": ""
  }
}
Important: Claude Code v2.x prefers ANTHROPIC_API_KEY over ANTHROPIC_AUTH_TOKEN when both are set — clear any stale ANTHROPIC_API_KEY first (unset ANTHROPIC_API_KEY) so it doesn't bypass the relay.
ANTHROPIC_BETAS=context-1m-2025-08-07 is required — without it Claude Code compacts context at 200K instead of using the full 1M window. Use bare model ids like claude-opus-4-8; the gateway now also accepts an [1m] suffix without erroring (verified 2026-07-23), but the header above is what actually enables the 1M window, not the suffix.