> For the complete documentation index, see [llms.txt](https://docs.warp.dev/llms.txt).
> Markdown versions of each page are available by appending .md to any URL.

# Models and usage in the Warp Agent CLI

Choose models in the Warp Agent CLI, bring your own API key, and track usage balances and per-response cost.

The Warp Agent CLI gives you the same model options as the Warp app. You can pick the model that powers your conversations, bring your own provider API keys, route requests through custom model routers, and see what every response costs as you work.

## Choosing a model

Run `/model` to open the model picker. You can also click the model name in the [statusline](https://docs.warp.dev/agents/cli/configuration/#statusline) to open the same picker.

Models that your plan or your team’s settings don’t allow appear disabled in the picker.

Your choice is saved as the base model of your active profile, so it persists across sessions. See [permissions and profiles](https://docs.warp.dev/agents/cli/permissions-and-profiles/) for how profiles work in the CLI. For the full list of supported models and to learn more about how Warp’s Auto models pick for you, see [Model choice](https://docs.warp.dev/agents/inference/model-choice/).

## Bring your own API key

The CLI supports [Bring Your Own API Key (BYOK)](https://docs.warp.dev/agents/inference/bring-your-own-api-key/) for OpenAI, Anthropic, and Google models, and can connect an [X Premium or SuperGrok subscription](https://docs.warp.dev/agents/inference/grok-subscription/) for Grok models. Requests routed through your account do not consume Warp-provided inference usage. Applicable [platform charges](https://docs.warp.dev/support-and-community/plans-and-billing/platform-credits/) still apply.

The CLI and Warp app store provider keys separately. Configure a key in each surface you use.

Run `/api-keys` to open the key management menu. It lists each provider with its connection state, plus a Warp credit fallback toggle:

-   **Set a key** - Press `Enter` on OpenAI, Anthropic, or Google and enter the key. Input is masked, so the key never appears in your transcript or shell history, and it’s saved to your device’s secure storage. Warp does not retain these personal provider keys on its servers.
-   **Replace or clear a key** - On a connected provider, `Enter` loads the stored key (still masked) for editing, and saving an empty field clears it. `Ctrl+X` clears the highlighted provider’s key from the list.
-   **Connect X Premium or SuperGrok** - Press `Enter` on the subscription row and the CLI opens your browser to sign in to your xAI account. `Ctrl+X` disconnects it. Running `/connect-grok` jumps straight to this row and starts the sign-in.
-   **Warp credit fallback** - Press `Enter` to toggle whether a request that fails through your key is retried with Warp-provided inference, consuming your available usage. See [failover and fallback behavior](https://docs.warp.dev/agents/inference/bring-your-own-api-key/#failover-and-fallback-behavior).

You can also store or clear keys outside a session with the `--set-provider-api-key` and `--clear-provider-api-key` flags. See the [Warp Agent CLI reference](https://docs.warp.dev/agents/cli/reference/#command-line-flags). X Premium/SuperGrok connections can only be managed from inside a session, with `/api-keys` or `/connect-grok`.

Note

Warp’s built-in Auto models always use Warp-provided inference, even with BYOK configured. To bill through your own account, select a specific provider model, or use a [custom router](https://docs.warp.dev/agents/inference/custom-routers/#using-your-own-api-keys-byok) whose targets your keys cover. See [BYOK usage and billing behavior](https://docs.warp.dev/agents/inference/bring-your-own-api-key/#byok-usage-and-billing-behavior) for the full rules.

## Custom model routing

[Custom routers](https://docs.warp.dev/agents/inference/custom-routers/) appear in the `/model` picker alongside individual models. Select one and each prompt resolves to a concrete model using the routing logic you defined.

The CLI loads the same router definitions as the Warp app. These are YAML files in `~/.warp/custom_model_routers/`, plus any team-synced routers your admin shares. [Authoring a router as a file](https://docs.warp.dev/agents/inference/custom-routers/#author-a-router-as-a-file) documents the file format.

## Usage and cost

The CLI shows usage at three levels:

-   **Account usage** - Run `/usage` to open a read-only panel with your current account or workspace’s plan, balances, consumption, and billing links. Press `Esc` to close it. This is not conversation-level usage.
-   **Conversation total** - Once usage is reported, the [statusline](https://docs.warp.dev/agents/cli/configuration/#statusline) shows the conversation’s accumulated usage. Accounts billed in credits always see credits. If your account bills in dollars and your CLI supports unit switching, click the usage entry to switch between credits and Warp’s reported dollar charges.
-   **Per-response details** - Run `/cost` to hide or show the latest completed response’s elapsed time and usage.

## Related pages

-   [Model choice](https://docs.warp.dev/agents/inference/model-choice/) - Supported models and how automatic model selection works.
-   [Bring Your Own API Key](https://docs.warp.dev/agents/inference/bring-your-own-api-key/) - How BYOK works, key storage, and billing behavior.
-   [SuperGrok subscription](https://docs.warp.dev/agents/inference/grok-subscription/) - Use Grok models through your xAI account.
-   [Custom routers](https://docs.warp.dev/agents/inference/custom-routers/) - Define routing logic that picks a model per task.
-   [Warp Agent CLI reference](https://docs.warp.dev/agents/cli/reference/) - Flags and slash commands, including the API key commands.
