Terza Inference
START

Claude Code, Codex, Cursor and other tools

Terza Inference speaks the Anthropic Messages API and the OpenAI API, so coding agents and editors can use it with a base URL and your Terza key. Create a key under API keys in the console first.

Claude Code

Point Claude Code at Terza with environment variables, then start it as usual:

export ANTHROPIC_BASE_URL=https://terza.si
export ANTHROPIC_AUTH_TOKEN=terza_sk_your_key
export ANTHROPIC_MODEL=claude-sonnet-5-5
export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-haiku-5-5
claude

To make it permanent, put the same values in ~/.claude/settings.json:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://terza.si",
    "ANTHROPIC_AUTH_TOKEN": "terza_sk_your_key",
    "ANTHROPIC_MODEL": "claude-sonnet-5-5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5"
  }
}
  • ANTHROPIC_MODEL is the main model; ANTHROPIC_DEFAULT_HAIKU_MODEL is the small model Claude Code uses for quick background tasks (older versions call it ANTHROPIC_SMALL_FAST_MODEL).
  • Use any Claude model listed under Models in the console, for example claude-opus-5-5 for the hardest work.
  • Streaming, tool use and token counting work as with the official API. Each request is billed to your balance at the selected miner’s quote.

Claude Code with CC Switch

CC Switch is a free desktop app for macOS, Windows and Linux that keeps several providers for Claude Code and switches between them in one click, without editing files by hand.

  1. Install CC Switch from its releases page. On macOS you can also run brew tap farion1231/ccswitch and brew install --cask cc-switch.
  2. Open CC Switch and select Claude Code.
  3. Select + (Add Provider) and choose the custom configuration.
  4. Fill in the provider:
    FieldValue
    NameTerza Inference
    Base URLhttps://terza.si (without /v1; Claude Code adds it)
    API keyYour Terza key (terza_sk_…)
    Haiku modelclaude-haiku-5-5
    Sonnet modelclaude-sonnet-5-5
    Opus modelclaude-opus-5-5
  5. Save, then select Enable on the Terza Inference card.
  6. Start a new Claude Code session and run /status: it should show https://terza.si as the base URL. Your requests then appear under Usage in the console.

If you prefer to edit the configuration yourself, CC Switch shows it as JSON. It is the same as the settings.json above:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://terza.si",
    "ANTHROPIC_AUTH_TOKEN": "terza_sk_your_key",
    "ANTHROPIC_MODEL": "claude-sonnet-5-5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5-5",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5-5"
  }
}
  • To go back to your Claude subscription, enable the official provider in CC Switch and sign in again if asked.
  • Claude Code speaks the Anthropic protocol, so use Claude models here. For GPT models, use Codex below; for Gemini, DeepSeek, Kimi, GLM or Qwen, use Cursor or another OpenAI-compatible tool.

Codex

Codex uses the OpenAI Responses API, which Terza serves for the GPT models (gpt-6.1-sol, gpt-6.1-terra, gpt-6-sol, gpt-6-astra, gpt-6-luna). Add Terza as a provider in ~/.codex/config.toml:

model_provider = "terza"
model = "gpt-6.1-sol"
model_reasoning_effort = "medium"
disable_response_storage = true

[model_providers.terza]
name = "Terza Inference"
base_url = "https://terza.si/v1"
env_key = "TERZA_API_KEY"
wire_api = "responses"

Then start Codex with your key in the environment:

export TERZA_API_KEY=terza_sk_your_key
codex

With CC Switch, select Codex instead of Claude Code, add a custom provider with the base URL https://terza.si/v1, your key and model gpt-6.1-sol, and enable it.

  • Shell commands, file edits, patches and sub-agents work as with the official API. Each request is billed at the selected miner’s quote; failed requests are free.
  • Codex’s built-in web search is not available through Terza; requests are sent without it.
  • Earlier reasoning is not carried between turns, because consecutive requests may be served by different miners. The conversation and tool results are.

Cursor

  1. Open Cursor Settings → Models.
  2. Under API Keys, paste your Terza key into OpenAI API Key.
  3. Turn on Override OpenAI Base URL and enter https://terza.si/v1.
  4. Add the models you want by their Terza IDs, for example gpt-6.1-sol, claude-sonnet-5-5, gemini-3.8-flash or deepseek-v4.1-flash, and turn them on. Select Verify when Cursor asks.
  5. Open the chat (Ctrl+L or Cmd+L), pick one of those models and send a message.
  • Cursor sends these requests from its own servers to https://terza.si/v1, so do not restrict the key to your own IP address.
  • Agent mode works: reading and editing files and running commands use standard tool calling, which every Terza chat model supports. Ask and Plan work too.
  • Tab completion always uses Cursor’s own model, and Auto model selection picks Cursor’s models, so neither is billed by Terza. Pick a Terza model by name instead of Auto.
  • Turning on the base URL override sends every OpenAI-key model through Terza, so only turn on models that are listed in the console.

Other tools

Anything with an OpenAI-compatible setting works the same way: Cline, Continue, Roo Code, Open WebUI, LangChain, LlamaIndex and the official SDKs.

SettingValue
OpenAI-compatible base URLhttps://terza.si/v1
Anthropic-compatible base URLhttps://terza.si
API keyYour Terza key (terza_sk_…)
ModelAny model ID from the console’s Models page

Give each tool its own key with a monthly budget, so you can see its spending under Usage and revoke it without affecting anything else.