Skip to main content
PRE-RELEASE: Harness commands are not GA yet and support only macOS and Linux for now. Their arguments, flags, and output may change.
Configure Claude Code, Codex (CLI or ChatGPT desktop app), and OpenCode CLI to use Baseten routes.

setup

Configure installed harnesses with your team’s routes and a routes API key. Setup offers a picker of installed harnesses when --harness is omitted. Repeat --harness to select several. The team’s routes with model metadata are added to each harness’s model picker, replacing it. Claude Code lists the routes that serve the Anthropic Messages API, and Codex lists the routes that serve the OpenAI Responses API. The first listed route is the default unless --route is set. Setup overwrites the harness’s integration settings without saving their previous values. Running it again refreshes them. The routes API key is created on first setup and reused afterward. Restart the harness after setup. For Codex, setup also signs out of OpenAI/ChatGPT and disables ChatGPT login while the Baseten harness is configured, and restarts Codex’s background server if one is running, asking first when Codex sessions are attached to it.

Options

TEXT
Route for lightweight background tasks (Claude Code and OpenCode). Defaults to deepseek-ai/DeepSeek-V4.1-Flash.
TEXT
Harness configuration directory. Requires exactly one —harness. Defaults to the harness’s own location.
BOOL
Preview the configuration without changing files or creating an API key.
TEXT
Route to fall back to when the default is unavailable (Claude Code). Defaults to the default route.
TEXT (repeatable)
Harness to apply to. May be repeated.One of: claude-code, codex, opencode
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
Name of the routes API key created in Baseten. Defaults to baseten-harness-hostname, numbered (-2, -3, …) if one of your keys has that name.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Default route. Defaults to the first route the harness lists.
TEXT
Route for subagents (Claude Code and OpenCode). Defaults to the harness’s own setting.
TEXT
Team name or ID whose routes to use. Defaults to the organization’s default team. Run ‘baseten org team list’ to see teams.
BOOL
Skip the interactive confirmation prompt. Required when stdin is not a terminal.
BOOL
Enable verbose logging

Examples

Configure installed harnesses interactively
Preview configuration for one harness
Apply a configuration without prompting

Filter output with --jq

Print the configuration file paths

Output

Text mode (--output text): The created key and follow-up commands. Use --dry-run or --verbose for the configuration of each harness, and --verbose for setting names. JSON mode (--output json): payload type cmd.HarnessPlanList.

status

Show the installed version, configuration path, and configured routes of each harness. Without --harness, shows every harness configured at its default path. Status reads local files only, so it works after the harness is uninstalled, but it doesn’t check the key or live routes. Rerun setup to refresh routes.

Options

TEXT
Harness configuration directory. Requires exactly one —harness. Defaults to the harness’s own location.
TEXT (repeatable)
Harness to apply to. May be repeated.One of: claude-code, codex, opencode
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
BOOL
Enable verbose logging

Examples

Inspect Codex configuration

Filter output with --jq

Print each harness’s state

Output

Text mode (--output text): Local configuration and configured routes. Use --verbose for setting names. JSON mode (--output json): payload type cmd.HarnessStatusList.

usage

Show your routes spend and token usage for the month so far, the period monthly spend limits apply to. This is a shortcut for baseten route usage --user-id <your-user-id> --start <first-of-this-month-utc> and takes the same flags. The only other difference is the text table, which totals each --group-by combination over the window instead of listing each day; JSON output is identical. Organization admins can pass --user-id for other users; other members only ever see usage from keys they created. Usage comes in whole UTC days: --start is snapped down to its day and --end is rounded up to the end of its day. Every bucket in the window is fetched, paging as needed, until --limit buckets are collected. This is the same spend that spend limits are checked against, and it can lag by up to 15 minutes. Model API costs use your prices and include tool calls. OpenAI, Anthropic, and xAI costs estimate what those providers charge and are not Baseten charges. Vertex and OpenAI-compatible usage isn’t included. Usage is retained for 92 days. For machine-readable streaming, prefer --output jsonl over --output json.

Options

TEXT
End of the range, exclusive, rounded up to the end of its UTC day. ISO 8601, local when no timezone is given. Defaults to now.
TEXT (repeatable)
default:"model"
Dimension to break usage down by. May be repeated.One of: user, model, provider
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
INTEGER
Maximum number of daily buckets, paging as needed. 0 for no limit.
TEXT (repeatable)
Only return usage for these models. May be repeated.
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT (repeatable)
Only return usage for these providers. May be repeated.One of: baseten-model-api, openai, anthropic, xai, vertex, openai-compatible
TEXT
Window from a relative time ago until now (e.g. ‘7d’). Mutually exclusive with —start and —end.
TEXT
Start of the range, inclusive, snapped down to its UTC day. ISO 8601, local when no timezone is given. Defaults to the start of the current UTC month.
TEXT (repeatable)
Only return usage from routes API keys created by these user IDs. May be repeated. Defaults to your own user ID.
BOOL
Enable verbose logging

Examples

Show your usage this month so far, by model
Show usage over the last 7 days by provider
Break August’s usage down by user and model for two users (admins)

Filter output with --jq

Stream each day’s cost per model as a JSONL stream

Output

Text mode (--output text): Table with one column per --group-by dimension, then INPUT, CACHED, and OUTPUT token counts and COST, totaled over the window, most expensive first, followed by an ALL totals row. A cost of ”-” means some of that usage couldn’t be priced. The window goes to stderr. With no usage in the window, prints “No usage in the selected window.” to stderr instead of a table. JSON mode (--output json): payload type managementapi.RoutesUsageBucket. One record per UTC day, as returned by the API: its date and the per-dimension usage in results, including days with no usage. cost_usd values are exact decimal strings.

teardown

Remove the Baseten integration settings so the harness’s own defaults apply. Previous values are not restored, and unrelated settings are kept. Without --harness, removes every integration configured at its default path. Teardown also deletes the routes API key the removed harnesses use, once no other harness on this machine uses it. It works after the harness is uninstalled. For Codex, teardown re-enables ChatGPT login and restarts Codex’s background server if one is running, asking first when Codex sessions are attached to it. Run codex login to sign back in.

Options

TEXT
Harness configuration directory. Requires exactly one —harness. Defaults to the harness’s own location.
BOOL
Preview removal without changing files.
TEXT (repeatable)
Harness to apply to. May be repeated.One of: claude-code, codex, opencode
TEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
default:"text"
Output formatOne of: text, json, jsonl, none
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
BOOL
Skip the interactive confirmation prompt. Required when stdin is not a terminal.
BOOL
Enable verbose logging

Examples

Preview removal
Remove integration settings without prompting

Filter output with --jq

List the settings teardown would remove

Output

Text mode (--output text): The settings removed from each harness. Use --verbose for configuration paths and setting names. JSON mode (--output json): payload type cmd.HarnessPlanList.