PRE-RELEASE: Harness commands are not GA yet and support only macOS and Linux for now. Their arguments, flags, and output may change.
setup
--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. An explicit --primary-route takes precedence over the team’s default for that harness. Without either, setup uses the first listed route. Pass --team when you belong to more than one team.
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 for the same profile, user, and team afterward. With --use-session-credential, the session’s API key is installed instead and never created or deleted by this CLI.
Setup records its team and options so harness sync can replay them. Setup enables deferred tool loading for Claude Code and Codex. 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.
For OpenCode, setup writes the original settings format, which OpenCode 1 and 2 both read, unless the file already has OpenCode 2’s native settings, in which case it writes those.
Options
TEXT
Route for lightweight background tasks (Claude Code and OpenCode). Defaults to the team’s default for the harness, else 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 primary route.
TEXT (repeatable)
Harness to apply to. May be repeated.One of:
claude-code, codex, opencode, piTEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
Name of the routes API key, if setup creates one. Defaults to
baseten-harness-HOSTNAME-SUFFIX, where SUFFIX is six random hexadecimal characters.TEXT
default:"text"
Output formatOne of:
text, json, jsonl, noneTEXT
Primary route. Defaults to the team’s default for the harness, else the first route the harness lists.
TEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Route for subagents (Claude Code and OpenCode). Defaults to the harness’s own setting.
TEXT
Team name or ID whose routes to use. Needed unless there is only one team. Run ‘baseten org team list’ to see teams.
BOOL
Install the session’s API key (BASETEN_API_KEY or an API-key profile) as the harness credential instead of creating a routes API key. The key is never created, rotated, or deleted by this CLI. Mutually exclusive with —key-name.
BOOL
Skip the interactive confirmation prompt. Required when stdin is not a terminal.
BOOL
Enable verbose logging
Examples
Configure installed harnesses interactivelyFilter 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
--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. Run baseten harness sync to refresh recorded integrations.
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, piTEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
default:"text"
Output formatOne of:
text, json, jsonl, noneTEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
BOOL
Enable verbose logging
Examples
Inspect Codex configurationFilter 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.
sync
harness setup. Sync takes no harness selection: to change what is configured, run harness setup or harness teardown. Stored routes the team has removed fall back to their defaults with a warning. Only harnesses whose record matches the current profile are synced, and a machine with no record needs harness setup first. Harnesses set up with --use-session-credential re-resolve the session’s API key; when it is unavailable, sync errors instead of creating a replacement.
When nothing changes, sync does nothing and exits 0, so it is safe to run from a schedule; pass --yes to skip the prompt when changes are found. For Codex, sync restarts the app-server daemon like setup does, asking first when sessions are attached unless --yes is passed; an in-progress turn is interrupted, and thread history is preserved. A declined or failed restart is retried on the next sync.
Options
BOOL
Preview the refresh without changing files or creating an API key.
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, noneTEXT
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
Refresh every configured harness, as a scheduled run doesFilter output with --jq
Print the configuration files a sync would change
Output
Text mode (--output text): The refreshed configuration of each harness, like setup. Use --dry-run to preview, and --verbose for per-harness details.
JSON mode (--output json): payload type cmd.HarnessPlanList.
harness-defaults
--harness to narrow the output; without it, every harness is shown. Defaults can be changed on app.baseten.co or by API by an admin; this command only reads them.
Options
TEXT (repeatable)
Harness to show. May be repeated. Defaults to every harness.One of:
claude-code, codex, opencode, piTEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
default:"text"
Output formatOne of:
text, json, jsonl, noneTEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
TEXT
Team name or ID whose defaults to show. Defaults to your only team; required if you belong to more than one. Run ‘baseten org team list’ to see teams.
BOOL
Enable verbose logging
Examples
Show every harness’s defaults for your only teamFilter output with --jq
Print the primary route for Claude Code
Output
Text mode (--output text): Table with columns: HARNESS, PRIMARY, BACKGROUND. Each route is followed by its source in parentheses; ’-’ means no default is set. JSON includes the team and each default’s full route and source.
JSON mode (--output json): payload type cmd.HarnessDefaultsList.
usage
--team narrows it to one team. The window is this UTC month so far, the period monthly spend limits apply to, unless --start, --end, or --since narrows or moves it; the limit is only shown for this month so far.
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.
For filters, token counts, or other users’ usage, use baseten route usage. 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
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
default:"text"
Output formatOne of:
text, json, jsonl, noneTEXT
Use a specific stored profile for this command, overriding BASETEN_PROFILE and the current profile
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
Team name or ID to show. Without it, every team you’re in.
BOOL
Enable verbose logging
Examples
Show your spend this month in each of your teamsFilter output with --jq
Stream each day’s cost per team and model as a JSONL stream
Output
Text mode (--output text): The month and when limits reset go to stderr. Then, for each team, a line with the team, what you spent there this month and your limit there, with the team’s default when yours differs from it, ending in “limit reached” or “team limit reached” when your requests there are rejected; on a terminal, a chart of spend per day per model from the first of the month; and a line per model with its spend and share, most expensive first. Text output shows the five most expensive models and combines the rest into an “other” row; JSON retains every model. A cost of ”-” means some of that usage couldn’t be priced. With no teams, prints “No usage this month.” to stderr. For a window other than this month so far, the month line is the window instead, and the team line is what you spent there in it, with no limit.
JSON mode (--output json): payload type managementapi.RoutesUsageBucket.
One record per UTC day, as returned by the API: its date and the per-team, per-model usage in results, including days with no usage. cost_usd values are exact decimal strings.
teardown
--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, except a key installed with --use-session-credential, whose lifecycle this CLI does not own. It forgets the recorded setup so harness sync no longer refreshes the removed harnesses. 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, piTEXT
Filter JSON output with a jq expression; implies —output json (or jsonl for streamed commands)
TEXT
default:"text"
Output formatOne of:
text, json, jsonl, noneTEXT
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 removalFilter 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.