Claude Code · Gatelum
POST /v1/messages is the native protocol that serves both the Anthropic SDK and Claude Code. A key may arrive in either header the gateway reads, Authorization: Bearer or x-api-key; the official client therefore needs no translation layer.
Example setup
- ANTHROPIC_BASE_URL
https://api.gatelum.com- ANTHROPIC_AUTH_TOKEN
glt_YOUR_KEY- ANTHROPIC_MODEL
anthropic/claude-sonnet-4.6
Install with one command
One command writes the gateway address, your key and the default models into the tool config. Existing files are backed up first.
curl -fsSL https://gatelum.com/install.sh | sh -s -- --key glt_YOUR_KEYPrefer to set it up yourself? The manual steps are right below.
Connection steps
Take the values from the catalog first. Then set ANTHROPIC_BASE_URL (the gateway address without
/v1) and ANTHROPIC_AUTH_TOKEN (your key), fill in ANTHROPIC_MODEL, and describe the background model with the pair ANTHROPIC_SMALL_FAST_MODEL and ANTHROPIC_DEFAULT_HAIKU_MODEL.To avoid exporting them in every terminal, put the variables in the env block of ~/.claude/settings.json (Windows: C:\Users\<name>\.claude\settings.json). The VS Code extension reads the same file; restart the editor after editing. For a project use .claude/settings.local.json — it stays out of git.
Do not add
/v1to ANTHROPIC_BASE_URL: Claude Code appends/v1/messagesitself. An extra/v1gives 404.Three model variables are mandatory. Names coming from Anthropic hold no meaning for the gateway, and 404 comes back from some tasks when no background model is set. The current spelling is ANTHROPIC_DEFAULT_HAIKU_MODEL; ANTHROPIC_SMALL_FAST_MODEL is the previous one. Specify both and stay independent of the version.
Start claude: reading and editing files, tool calls and streaming all work.
WebSearch works through the gateway: enable Web search on the key in the dashboard. Each executed search is billed separately from tokens at the catalog price; failed searches are free, and a request runs at most 5.
export ANTHROPIC_BASE_URL=https://api.gatelum.com
export ANTHROPIC_AUTH_TOKEN=glt_YOUR_KEY
export ANTHROPIC_MODEL=anthropic/claude-sonnet-4.6
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek/deepseek-v4.1-flash
export ANTHROPIC_SMALL_FAST_MODEL=deepseek/deepseek-v4.1-flash
claudeConnection check
Send one short request: it checks the key, the address and the chosen model.
curl https://api.gatelum.com/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: glt_YOUR_KEY" -H "anthropic-version: 2023-06-01" \
-d '{"model":"anthropic/claude-sonnet-4.6","max_tokens":64,"messages":[{"role":"user","content":"ping"}]}'A normal answer means the setup is correct. 401 points to the key, 404 to the address or model, 400 to the request format.
bad_request. A frame a tool returns also arrives, as its own user turn.
Attached files will not work: the top_k parameter and a document block produce parameter_not_supported. The thinking parameter is accepted, yet the answer stays the same, so MAX_THINKING_TOKENS is unnecessary.
WebSearch runs through the gateway when the key has Web search enabled in the dashboard: the gateway executes the search and returns web_search_tool_result blocks with sources. Each executed search costs the catalog price on top of tokens; a request runs at most 5 searches, and failed searches are free. The query goes to an external search provider. The flag is off by default; without it a WebSearch request gets 400 with an enable hint.
A prompt may hold at most 4,000,000 characters, with the model context on top of that; exceeding either limit gives an error instead of a trim. Claude Code puts max_tokens at 32,000, and that much is held, so keep headroom. cache_control is accepted yet never applied: on a model with a cached-input rate the cache runs by itself, and the token count shows up in usage.cache_read_input_tokens.functions. JSON output (response_format) is accepted on OpenAI-compatible routes, while a model reachable only through a direct Anthropic or Google connection answers unsupported_capability. The retired functions format behaves differently: it returns parameter_not_supported, so no parameter disappears without an explanation. Only models the catalog tags "Understands images" may accept pictures — they travel as an image_url part holding a data:image/png;base64,… address (PNG, JPEG and WebP are allowed, a file may weigh up to 5 MB, and a request carries at most 50). Remote addresses are never downloaded, while a model lacking the tag answers bad_request. Each error, bad_request as well as parameter_not_supported, states the reason plainly.Integration details
Claude Code uses the native Anthropic protocol, so no translation proxy is needed: set the gateway address and the key. Gatelum accepts /v1/messages and passes tool calls through unchanged.
After setup
Run claude and ask for a short answer. 401 points to the key, 404 to the address or model, 400 to the request format.
Choose a model for your task
Pick a task and a priority to see a recommended model, two alternatives, and the reason behind the choice.
Common questions
Should I add /v1 to the address?
Not at all. Claude Code adds /v1/messages on its own, so an additional /v1 leads to a 404.
Why three model variables?
Different parts of Claude Code use the main and background models. Without a background model some tasks return 404.
Do images and attached files work?
Base64 images work on vision models. Attached PDFs and the top_k parameter are refused.
Need a key?
Create an account, top up the balance and issue a key in the cabinet.