Skip to main content
Docs

One endpoint,
every model.

Tare is an OpenAI-compatible gateway in front of every model you use — ours and the ones you bring yourself. One base URL, one key, and every token accounted for.

GuidesCoding tools

Coding tools

What this covers: using Tare as the model upstream for coding tools such as Claude Code, Codex, Cursor, Cline and OpenCode. Calls use your own Tare API key and go through your own routes and billing.

Switch Claude Code and Codex with one command

On macOS, Linux and WSL, run:

Code / Terminal
bash <(curl -fsSL https://www.jamerly.ai/tare/connect.sh)

The script asks once for your Tare API key, then takes Claude Code and Codex one at a time: it asks whether to switch that tool, lists the models in your routes with their prices, and has you pick its models (for Claude Code, a main model and a small model for background tasks). It makes one test call for that tool and only then writes its file: the env block in ~/.claude/settings.json, or ~/.codex/config.toml. A tool you say no to is not touched. If the test call fails, the script asks before writing anyway. Other settings in those files are left alone, and each file gets a .bak-tare-<time> backup first. Restart claude or codex to pick up the change.

OptionPurpose
--key <key>Use this key without asking
--model <model>, --fast-model <model>Use these models without asking (--model applies to both tools)
--claude-only, --codex-onlySwitch only that tool, without asking
--restorePut back the configuration from before the switch, asking for each tool
-yNo questions: switch every tool installed on this machine, with the default models

Run it again to change models. The sections below show what the script writes, for configuring by hand.

Address

Each coding tool speaks one API. https://tare.jamerly.ai accepts all three, so the address is always the same; only whether to add /v1 depends on the tool.

API the tool speaksToolsAddress
OpenAI Chat CompletionsCursor, Cline, Roo Code, Kilo Code, Continue, OpenCode, Aider, Zed, Cherry Studio and similarhttps://tare.jamerly.ai/v1
Anthropic MessagesClaude Codehttps://tare.jamerly.ai
OpenAI ResponsesCodex CLIhttps://tare.jamerly.ai/v1

With a local node installed, any of the three can point at the node on the same machine instead: http://127.0.0.1:8090 (add /v1 for the OpenAI shapes). Calls through your own node send LOCAL_NODE channels and subscription channels out from your own network.

What you need

  • An Inference key (Console → API Keys → Create). Create one per tool so usage and limits can be read separately.
  • A model name from GET /v1/models or the Routing page, for example moonshotai/kimi-k3, anthropic/claude-sonnet-5.5 or openai/gpt-6.1-sol.

Every tool can use every model in your routes. Claude Code can call Kimi, GLM or GPT; Tare translates between the two APIs, streaming and tool calls included. Coding tools depend on tool calling, so pick models that support it.

Claude Code

Add this to ~/.claude/settings.json (or to .claude/settings.json inside a project to scope it to that project):

Code / Terminal
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://tare.jamerly.ai",
    "ANTHROPIC_AUTH_TOKEN": "<your Tare Inference key>",
    "ANTHROPIC_MODEL": "anthropic/claude-sonnet-5.5",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "anthropic/claude-opus-5.5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "anthropic/claude-sonnet-5.5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "z-ai/glm-5.3"
  }
}

Or set them for the current shell only:

Code / Terminal
export ANTHROPIC_BASE_URL=https://tare.jamerly.ai
export ANTHROPIC_AUTH_TOKEN=<your Tare Inference key>
export ANTHROPIC_MODEL=moonshotai/kimi-k3
claude
VariablePurpose
ANTHROPIC_BASE_URLNo /v1; Claude Code appends /v1/messages itself
ANTHROPIC_AUTH_TOKENYour Tare key, sent as Authorization: Bearer. ANTHROPIC_API_KEY also works; the node accepts both headers
ANTHROPIC_MODELDefault model
ANTHROPIC_DEFAULT_OPUS_MODEL / _SONNET_MODEL / _HAIKU_MODELThe models behind the three tiers in /model. Claude Code runs background tasks such as titles and summaries on the Haiku tier, so a cheaper model there saves money

No Anthropic login is needed once these are set. With a non-Claude model, Claude Code prints a notice at startup that it does not recognize the model name and assumes a 200k context window. Calls are not affected.

Codex CLI

Add this to ~/.codex/config.toml:

Code / Terminal
model = "openai/gpt-6.1-sol"
model_provider = "tare"

[model_providers.tare]
name = "Tare"
base_url = "https://tare.jamerly.ai/v1"
env_key = "TARE_API_KEY"
wire_api = "responses"

The key is read from the variable named in env_key:

Code / Terminal
export TARE_API_KEY=<your Tare Inference key>
codex

wire_api must be responses. model can be any model in your routes.

OpenAI-compatible tools

In Cursor, Cline, Roo Code, Kilo Code, Continue, Zed, Cherry Studio and similar tools, choose OpenAI Compatible in the model settings (some call it Custom OpenAI or Override OpenAI Base URL) and fill in three values:

SettingValue
Base URLhttps://tare.jamerly.ai/v1
API KeyYour Tare Inference key
ModelA model name from your routes, for example moonshotai/kimi-k3

For OpenCode, put this in opencode.json at the project root (or in ~/.config/opencode/opencode.json):

Code / Terminal
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "tare": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Tare",
      "options": {
        "baseURL": "https://tare.jamerly.ai/v1",
        "apiKey": "{env:TARE_API_KEY}"
      },
      "models": {
        "moonshotai/kimi-k3": { "name": "Kimi K3" },
        "z-ai/glm-5.3": { "name": "GLM 5.3" }
      }
    }
  },
  "model": "tare/moonshotai/kimi-k3"
}

Using your own subscriptions and channels

Calls from a tool follow your routes exactly like calls from application code:

  • To send a model to your own upstream account, add it under Channels and point a route at it.
  • To use a coding subscription you already pay for (GLM Coding Plan, Kimi For Coding and others), create a subscription channel as in Sharing a subscription and give it a route.
  • To use capacity sold on the Token Market, add the listing to a route.

Checking it works, and usage

  • Console → Call Traces, filtered by key, shows one row per call: model, channel, tokens and cost.
  • A single session makes many calls (every file read and every command is one), so usage runs far higher than chat. Set a lifetime limit on the key (see API keys) so a runaway task stops at the limit.
SymptomCause
401Wrong key, or the key is disabled or expired
404 / model not foundThe model name is not in your routes; use a name from GET /v1/models
403Blocked by a limit, budget, source IP rule or data protection; see Errors

Related: Quickstart, Local Nodes, Routing.

Docs last updated Nov 27, 2026, 12:56 (UTC+8)