Configure coding tools with the tare CLI
tare integrate sets up popular AI coding tools to send their model calls through a Tetrate Agent Router gateway, using existing Agent Router credentials. Instead of copying a base URL and API key into each tool by hand, one command reads the logged-in session and writes the tool's config.
Persona: Developer configuring a local coding tool against an Agent Router gateway.
Estimated time: 5 to 10 minutes once the CLI is installed and authenticated.
Outcomes
By the end of this guide:
- The
tareCLI is installed and authenticated against the management plane. - The data plane (gateway) to route through is identified by its dataplane id.
- At least one coding tool is configured through
tare integrate, optionally previewed with a dry run first. - Keys and backed-up config files can be rotated or cleaned up safely.
Prerequisites
-
Install the
tareCLI:curl -fsSL https://tare.tetrate.ai/tools/install.sh | bashtare --version -
Log in so the CLI can reuse the session (data plane, model catalog, and API key):
tare api login --base-url https://api.example.tetrate.ai--base-urlis the management plane API host, not the gateway Base URL shown in the Console. Replace the example withhttps://api.<tenant>.tetrate.ai, using the same<tenant>hostname segment as the Admin Console (https://dashboard.<tenant>.tetrate.ai) and Console (https://router.<tenant>.tetrate.ai) URLs from the Tetrate provisioning email. The full hostname map is in Self-hosted prerequisites.Login can be skipped by passing
--gateway-url,--api-key, and--modelexplicitly, but then nothing is reused from the account. -
Know which data plane (gateway) to route through. List them with:
tare integrate dataplanesExample output:
DATAPLANE NAME GATEWAY URLacme-prod Acme Production https://acme-prod.gateway.example.comacme-dev Acme Dev https://acme-dev.gateway.example.com--dataplanetakes the workspace id from the DATAPLANE column (for exampleacme-prod), not the display name.
Step 1: list the supported tools
This command shows every supported tool, whether it is detected on the machine, and where its config file would go:
tare integrate list
Supported tools include Aider, Claude Code, Claude Cowork, Cline, Coder, Codex, Continue, Hermes, and OpenClaw.
Step 2: preview a change (dry run)
tare integrate <tool> --dry-run --dataplane <name>
Prints exactly what would be set, with the API key masked, and confirms no file is written.
Claude Code
tare integrate claude-code --dry-run --dataplane acme-prod
Detected Claude Code: found `claude` at /Users/you/.local/bin/claude
Claude Code (/Users/you/.claude/settings.json):
set env.ANTHROPIC_BASE_URL = https://acme-prod.gateway.example.com
set env.ANTHROPIC_API_KEY = sk-test1...
set env.ANTHROPIC_MODEL = claude-sonnet-5
--dry-run: no changes written.
Codex
Codex writes two files (config.toml for the provider block, .env for the key):
tare integrate codex --dry-run --dataplane acme-prod
Detected Codex: found `codex` at /Users/you/.bun/bin/codex
Codex (/Users/you/.codex/config.toml):
/Users/you/.codex/config.toml:
set model = gpt-5
set model_provider = agentrouter
set [model_providers.agentrouter] base_url/env_key/wire_api
/Users/you/.codex/.env:
set AGENTROUTER_API_KEY = sk-test1...
--dry-run: no changes written.
Step 3: apply a change
tare integrate <tool> --dataplane <name> --yes
For example:
tare integrate claude-code --dataplane acme-prod --yes
On apply:
- The command reuses the logged-in session's data plane, model catalog, and API key by default. Override any of them with
--gateway-url,--api-key, or--model. - It mints a new inference key only if one is not already cached for that profile and data plane; otherwise it reuses the cached key.
- If a config file already exists, it is backed up first (
<file>.bak-<timestamp>) before being overwritten. - The written file gets
0600permissions (owner read/write only). - After writing, it makes one call to the configured gateway to confirm the key works, and reports the result.
Claude Code: managed mode vs. passthrough mode
The --passthrough flag applies to Claude Code only. Claude Cowork runs in gateway mode with Agent Router billing; subscription passthrough is not supported there.
tare integrate claude-code supports two modes:
- Managed (default). Sets
env.ANTHROPIC_BASE_URL,env.ANTHROPIC_API_KEY, andenv.ANTHROPIC_MODELin~/.claude/settings.json. Every Claude Code call goes through the Agent Router gateway using the issued key. - Passthrough (
--passthrough). Keeps the existingclaude /loginsession for model calls, so usage is billed to the existing Claude plan. The Agent Router key is only sent as anx-tars-api-keyheader for attribution;ANTHROPIC_API_KEYis left unset.
tare integrate claude-code --dataplane acme-prod --passthrough --yes
Trade-off: while managed mode's ANTHROPIC_API_KEY is set, Claude Code disables claude.ai connectors, because an explicit API key takes precedence over the claude.ai login. Choose passthrough mode where connectors are needed, or remove the env block from ~/.claude/settings.json.
For the full Claude Code walkthrough (install, verify with /status, troubleshooting), see Connect Claude Code.
Known issues
Some newer model names reject temperature=0. Several OpenAI-compatible tools (Aider and similar) default to temperature=0 for any model they do not recognize by name. If the selected model rejects a temperature of 0, the first request fails immediately with something like 'temperature' is deprecated for this model, even though the model works fine otherwise.
Workaround: pin a non-zero temperature for that model in the tool's own per-model settings. For Aider, add an entry to .aider.model.settings.yml with extra_params: {temperature: 1}.
Cleanup and rotation
- An apply either mints a new inference key or reuses a cached one. Check which before revoking anything: revoking a key still referenced by a tool's config breaks that tool until the integration is re-applied.
- To rotate a key, revoke the old one (
tare api keys revoke <key-id>), then re-runtare integrate <tool> --dataplane <name> --yesto mint and write a fresh one. - Backed-up config files (
<file>.bak-<timestamp>) build up with every apply. Clean them out periodically where the history is not needed.
Where to go next