Skip to main content
Tera serves the Anthropic Messages API at 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

Tera translates each Anthropic request into its normal inference pipeline, so every model in the catalog is reachable from Claude Code, not just a fixed pair of coding models. Your key, rate limits, and billing behave exactly as they do on the OpenAI-compatible routes.

Before you start

  1. Get an API key (sk-tera-...).
  2. Have credits on your account.
  3. Install Claude Code if you have not already:

Set it up with one prompt

Paste this into Claude Code (swap in your key):
Claude Code edits its own config, you relaunch, and you are on Tera.
Add this to ~/.claude/settings.json, then relaunch Claude Code. The _NAME values are optional labels for the /model picker.
Useful for trying Tera out, or for switching backends per terminal session. These apply to the current shell only, so add them to ~/.zshrc or ~/.bashrc to persist.
Pick one method. Values in settings.json override shell variables, and mixing the two is hard to debug.
~/.claude/settings.json holds your API key in plaintext. Do not commit it. For per-project settings, use .claude/settings.local.json, which Claude Code gitignores by default.

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 calls count_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

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.
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.
Top up in your account, then retry.
They come from the ANTHROPIC_DEFAULT_*_MODEL vars after a full relaunch, not from auto-discovery. Add extras with ANTHROPIC_CUSTOM_MODEL_OPTION.
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.
Work through these in order:
  1. Values in ~/.claude/settings.json override shell exports. Check the env block there for stale entries.
  2. Shell exports apply only to the session that ran them, unless you added them to ~/.zshrc or ~/.bashrc.
  3. Fully quit and relaunch Claude Code.
  4. Run /status and read the base URL and model actually in use.
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 at https://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.