https://api.tera.gw, which is the wire format Claude Code speaks natively. Point it at Tera with a one-time config change and it runs on Tera models. No local proxy, no sidecar, no extra software.
How it works
Before you start
-
Get an API key (
sk-tera-...). - Have credits on your account.
-
Install Claude Code if you have not already:
Set it up with one prompt
Paste this into Claude Code (swap in your key):Prefer to edit settings.json by hand?
Prefer to edit settings.json by hand?
Add this to
~/.claude/settings.json, then relaunch Claude Code. The _NAME values are optional labels for the /model picker.Prefer shell environment variables?
Prefer shell environment variables?
Useful for trying Tera out, or for switching backends per terminal session. These apply to the current shell only, so add them to Pick one method. Values in
~/.zshrc or ~/.bashrc to persist.settings.json override shell variables, and mixing the two is hard to debug.Choosing models
Claude Code addresses models through three slots rather than one model name. It uses the Opus slot for hard reasoning, Sonnet for most turns, and Haiku for cheap background work such as file summaries and title generation. Any Tera model id works in any slot. All three show up in the/model picker, and you can switch between them anytime with /model.
These are starting points, not limits. Anything in the catalog can go in any slot, including
deepseek-ai/DeepSeek-V4-Pro, zai-org/GLM-5.2, Qwen/Qwen3-Coder-480B-A35B-Instruct, the openai/gpt-5.6-* family, and the anthropic/claude-* models. You can also set all three slots to the same model if you would rather have consistent behavior than tiered cost. Check the pricing page first, since the Haiku slot absorbs a lot of traffic.
To add more Tera models to the picker, set ANTHROPIC_CUSTOM_MODEL_OPTION to the model id.
Use the exact id from the model’s page, including vendor prefix and capitalization. deepseek-ai/DeepSeek-V4-Pro works; deepseek-v4-pro does not.
Don’t enable gateway model discovery (
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY).
Claude Code only auto-lists models whose id begins with claude/anthropic,
so most Tera ids won’t appear that way. The config above puts them in the
picker directly.Confirm it is working
Start Claude Code and run/status. The base URL should read https://api.tera.gw and the model line should show the Tera model you configured. Send a short message such as hi to confirm the request completes end to end.
Configuration reference
What is supported
Thinking and prompt caching differ by model
Two capabilities depend on which model you pick.
Everything else in the table above behaves the same across the catalog.
Token counting is approximate
Claude Code callscount_tokens to draw the context meter and decide when to compact. Tera returns a heuristic estimate rather than a per-model tokenizer count, so the context gauge is indicative rather than exact.
This does not affect billing. Usage is metered from the actual token counts reported by inference, exactly as on the OpenAI-compatible routes.
Troubleshooting
Requests 404 or 'model not found'
Requests 404 or 'model not found'
Make sure the base URL is exactly
https://api.tera.gw, with no /v1 suffix.
Claude Code appends the path itself.If the URL is right, check the model id. Ids are case-sensitive and include a
vendor prefix. Copy it verbatim from the model’s page and check for stray
spaces or quotes.401 / authentication error
401 / authentication error
Confirm you’re using your
sk-tera-... key. Tera accepts either
Authorization: Bearer or x-api-key, but do not set both
ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY.If you previously ran /login with an Anthropic account, that saved
credential can conflict. Run /status to see which credential is active, and
/logout to clear the saved login.402 / out of credits
402 / out of credits
Top up in your account, then retry.
Tera models aren't in the /model picker
Tera models aren't in the /model picker
They come from the
ANTHROPIC_DEFAULT_*_MODEL vars after a full relaunch,
not from auto-discovery. Add extras with ANTHROPIC_CUSTOM_MODEL_OPTION.Claude Code is still hitting Anthropic
Claude Code is still hitting Anthropic
Fully quit and relaunch after editing
settings.json, since env changes apply
at startup. If it persists, ANTHROPIC_BASE_URL is unset or misspelled. Run
/status to see the base URL actually in use.Config changes aren't taking effect
Config changes aren't taking effect
Work through these in order:
- Values in
~/.claude/settings.jsonoverride shell exports. Check theenvblock there for stale entries. - Shell exports apply only to the session that ran them, unless you added them to
~/.zshrcor~/.bashrc. - Fully quit and relaunch Claude Code.
- Run
/statusand read the base URL and model actually in use.
Subagents or background tasks fail
Subagents or background tasks fail
Those run on the Haiku slot and on
CLAUDE_CODE_SUBAGENT_MODEL. If you set
some slot variables but not others, fill in the rest.Other Anthropic-compatible tools
Anything that speaks the Anthropic Messages API configures the same way: point its base URL athttps://api.tera.gw and pass a Tera key. The endpoint is not specific to Claude Code.
For everything else, use the OpenAI-compatible routes at https://api.tera.gw/v1.
What next?
Browse models
Full catalog with context lengths and capabilities.
Pricing
Per-token rates. Worth checking before you pick your slots.
Tool calling
How function calling behaves across Tera models.
Authentication
Key formats, headers, and scoping.