Skip to main content
The baseten-switch CLI configures Baseten Switch, a local gateway that routes Claude Code and Codex CLI to Model APIs. The same CLI installs Pi’s direct Baseten provider without starting the gateway. The menu bar app and these commands edit the same configuration. For the first-success setup, see Coding agents. Baseten Switch is in beta. Its interfaces, configuration, and behavior can change between releases. It requires macOS 13 or newer on Apple Silicon or Intel.
Install with Homebrew:
The fully qualified formula name adds the tap and installs both Baseten Switch and its Baseten CLI dependency. Switch authenticates with the current Baseten CLI profile. Browser OAuth and API-key profiles both work. Upgrade with brew upgrade baseten-switch, then baseten-switch up.

setup

Verifies the Baseten CLI and its current credential, opens baseten auth login when needed, and creates the initial configuration. It never overwrites an existing configuration.

up

Installs the user launch agents, starts the local gateway, and opens the menu bar app.
--install
Also installs Baseten Switch.app in ~/Applications. After an upgrade, baseten-switch up adopts the new CLI and app version.

on

Turns Baseten routing on for Claude Code and Codex CLI.

off

Turns routing off. Saved model mappings stay editable, and requests fall back automatically when a route fails.

spend

Prints local spend telemetry. The menu bar app charts the same data against an estimate of native-provider cost.

claude on

Points new Claude Code sessions at the gateway. Sets ANTHROPIC_BASE_URL, CLAUDE_CODE_ATTRIBUTION_HEADER, and ENABLE_TOOL_SEARCH in ~/.claude/settings.json, and backs up the prior values first. Omitting the attribution block improves prompt-cache hit rates on the gateway. Restart Claude Code after enabling or disabling.

claude route

Pins a Claude model family to a Model APIs slug. The gateway hot-reloads configuration, so you don’t restart it.
Send a family back to its native provider:
Remove the pin so the family follows the global switch:
With no arguments, prints every family’s current mapping:

claude subagents

Rewrites Task and sidechain requests to a cheaper model, leaving your main loop untouched.
Leave the requested model alone:
Re-enable the model you configured earlier:

claude off

Restores the Claude Code settings that existed before claude on.

claude reasoning

Sets a reasoning policy for Claude Code. The gateway validates each choice against the model catalog.

codex on

Creates the managed baseten profile at ~/.codex/baseten.config.toml. It does not modify ~/.codex/config.toml. The first run may request permission to enable the parked Codex listener.

codex route

Sets the Baseten model for the managed profile. The profile stays byte-identical, so active sessions pick up the new target without a Codex restart.
Select the upstream model this way rather than with Codex’s -m flag. That flag overrides the profile’s compatibility model and breaks routing.

codex off

Removes the managed profile.

codex reasoning

Sets a reasoning policy for Codex CLI. The gateway validates each choice against the model catalog.

pi install

Writes Pi’s direct Baseten provider from the visible Model APIs catalog. Starts no gateway, installs no launch agents, and does not change another harness profile. The installer joins exact model IDs with the public models.dev catalog for reasoning and text/image input capabilities. Models without an exact match use conservative defaults and are reported during installation. The API key stays in the environment; Pi’s configuration stores only a $BASETEN_API_KEY reference.

pi status

Prints the installed direct provider.

pi uninstall

Removes only the managed Baseten provider.

status

Summarizes every local component, your authentication, and each harness’s routing.

doctor

Inspects the same path read-only and prints the first failure with a concrete fix.
--probe
Sends a small live request to verify the whole request path.

auth login

Delegates to the Baseten CLI, reloads the gateway, and prints the current identity.

uninstall

Removes managed harness settings, processes, launch agents, runtime residue, and the Mac app. Inspect the exact removal first with --dry-run. The default retains configuration, telemetry, logs, and backups.
--purge
Also deletes configuration, telemetry, logs, and backups. Pass --yes to skip confirmation.
Uninstall never removes Baseten CLI credentials or keychain entries.

Next steps

Coding agents

Install Switch and connect Claude Code, Codex CLI, or Pi.

Baseten CLI auth

Switch uses the current Baseten CLI profile.

Baseten Switch README

Upgrade, uninstall, and configuration fields.