# Chalk CLI Reference: AI Router
source: https://docs.chalk.ai/cli#ai-router

Configure coding harnesses to send model requests directly to Chalk Router, inspect available models, and diagnose protocol or configuration problems.

## `chalk router api-key create`
source: https://docs.chalk.ai/cli?command=router_api_key_create

```bash
chalk router api-key create
```

Create a Router API key explicitly. Chalk login remains the preferred authentication for local harnesses because it refreshes automatically. The raw key is returned exactly once.

**Flags**

- `--description <description>` (string)
  Description of the Router API key
- `--provider <provider>` (string)
  Restrict the key to one provider kind
- `--model <model>` (string[], default `[]`)
  Restrict the key to a model ID (repeatable)
- `--connection-id <id>` (string)
  Restrict the key to one provider connection
- `--model-floor <model>` (string)
  Set the model-as-judge downgrade floor
- `--downgradable <downgradable>` (bool, default `false`)
  Allow model-as-judge downgrades for this key
- `--usage-pool <pool-id>` (string)
  Attach the key to a usage pool
- `--label <key=value>` (string[], default `[]`)
  Label in key=value form (repeatable)

## `chalk router api-key list`
source: https://docs.chalk.ai/cli?command=router_api_key_list

```bash
chalk router api-key list
```

List Router API keys without exposing secrets

**Flags**

- `--limit <count>` (int, default `40`)
  Maximum rows to return
- `--cursor <cursor>` (string)
  Pagination cursor returned by a previous request

## `chalk router api-key revoke`
source: https://docs.chalk.ai/cli?command=router_api_key_revoke

```bash
chalk router api-key revoke <key-hash>
```

Revoke a Router API key

**Arguments**

- `key-hash` (string)
  Non-secret key hash returned by `chalk router api-key list`.

## `chalk router claude launch`
source: https://docs.chalk.ai/cli?command=router_claude_launch

```bash
chalk router claude launch [claude arguments]
```

Start a Claude Code session that talks to Chalk Router. The router settings are written to a temporary file and handed to Claude Code with '--settings', so ~/.claude/settings.json is never read or rewritten and every other session keeps its usual configuration. Arguments after '--' are forwarded to the claude binary. Chalk exits with Claude Code's exit code and removes the temporary settings file when the session ends. Append a Claude Code context-window variant to any model to widen the session window, as in '--model anthropic/claude-opus-5[1m]' for the 1M window.

**Arguments**

- `claude arguments` (string)
  Arguments forwarded to the claude binary; separate them from Chalk's own flags with '--'.

**Flags**

- `--model <model>` (string)
  Model ID to configure for the harness
- `--opus <model>` (string)
  Claude Opus slot model
- `--sonnet <model>` (string)
  Claude Sonnet slot model
- `--haiku <model>` (string)
  Claude Haiku slot model
- `--fable <model>` (string)
  Claude Fable slot model
- `--subagent <model>` (string)
  Claude subagent model

**Example**

```
$ chalk router claude launch
$ chalk router claude launch --model <model-id>

# Claude Code's context-window variants work on any router model.
$ chalk router claude launch --model 'anthropic/claude-opus-5[1m]'

$ chalk router claude launch --opus <model-id> --sonnet <model-id>
$ chalk router claude launch -- --continue
```

## `chalk router claude off`
source: https://docs.chalk.ai/cli?command=router_claude_off

```bash
chalk router claude off
```

Restore claude settings managed by Chalk Router

**Flags**

- `--config-path <path>` (string)
  Override the harness configuration path

## `chalk router claude on`
source: https://docs.chalk.ai/cli?command=router_claude_on

```bash
chalk router claude on
```

Route claude through Chalk Router

**Flags**

- `--model <model>` (string)
  Model ID to configure for the harness
- `--config-path <path>` (string)
  Override the harness configuration path
- `--router-api-key-stdin <router-api-key-stdin>` (bool, default `false`)
  Read a static Router API key from stdin instead of using the preferred refreshable Chalk login
- `--opus <model>` (string)
  Claude Opus slot model
- `--sonnet <model>` (string)
  Claude Sonnet slot model
- `--haiku <model>` (string)
  Claude Haiku slot model
- `--fable <model>` (string)
  Claude Fable slot model
- `--subagent <model>` (string)
  Claude subagent model

**Example**

```
$ chalk router claude on
$ chalk router claude on --model <model-id>
```

## `chalk router claude status`
source: https://docs.chalk.ai/cli?command=router_claude_status

```bash
chalk router claude status
```

Show claude router settings

**Flags**

- `--config-path <path>` (string)
  Override the harness configuration path

## `chalk router codex launch`
source: https://docs.chalk.ai/cli?command=router_codex_launch

```bash
chalk router codex launch [codex arguments]
```

Start a Codex session that talks to Chalk Router. Arguments after '--' are forwarded to the codex binary. Chalk exits with Codex's exit code. The router provider is passed as '-c' overrides rather than written anywhere, so ~/.codex/config.toml is left exactly as it is and every other Codex session keeps its usual provider. Codex speaks the OpenAI Responses protocol, so pick a model that serves it natively: an Anthropic model is rejected by the gateway with 'no configured provider can represent this request losslessly'.

**Arguments**

- `codex arguments` (string)
  Arguments forwarded to the codex binary; separate them from Chalk's own flags with '--'.

**Flags**

- `--model <model>` (string)
  Model ID to configure for the harness

**Example**

```
$ chalk router codex launch
$ chalk router codex launch --model openai/gpt-5.3-codex
$ chalk router codex launch -- exec "summarize this repository"
```

## `chalk router codex off`
source: https://docs.chalk.ai/cli?command=router_codex_off

```bash
chalk router codex off
```

Restore codex settings managed by Chalk Router

**Flags**

- `--config-path <path>` (string)
  Override the harness configuration path

## `chalk router codex on`
source: https://docs.chalk.ai/cli?command=router_codex_on

```bash
chalk router codex on
```

Route codex through Chalk Router

**Flags**

- `--model <model>` (string)
  Model ID to configure for the harness
- `--config-path <path>` (string)
  Override the harness configuration path
- `--router-api-key-stdin <router-api-key-stdin>` (bool, default `false`)
  Read a static Router API key from stdin instead of using the preferred refreshable Chalk login

**Example**

```
$ chalk router codex on
$ chalk router codex on --model <model-id>
```

## `chalk router codex resume`
source: https://docs.chalk.ai/cli?command=router_codex_resume

```bash
chalk router codex resume [session-id]
```

Resume an existing Codex session through Chalk Router. Codex's own resume picker only lists sessions recorded under the currently configured model provider, which hides direct-to-OpenAI sessions once Codex is routed. This command lists every local Codex session in the current directory, labeled with the provider that recorded it, and resumes the chosen one through the router without changing ~/.codex/config.toml. The session reuses the model already configured by 'chalk router codex on' or 'launch'; use '/model' inside Codex to change it. Sessions synced from a ChatGPT account live in OpenAI's backend, not on this machine, so they cannot be listed or resumed here.

**Arguments**

- `session-id` (string)
  Codex session id to resume; omit it to pick from the sessions recorded in this directory.

**Flags**

- `--all <all>` (bool, default `false`)
  List sessions from every directory, not just the current one

**Example**

```
$ chalk router codex resume
$ chalk router codex resume 01a06276-812d-7d71-a721-196717a9bdb2
$ chalk router codex resume --all
```

## `chalk router codex status`
source: https://docs.chalk.ai/cli?command=router_codex_status

```bash
chalk router codex status
```

Show codex router settings

**Flags**

- `--config-path <path>` (string)
  Override the harness configuration path

## `chalk router cursor off`
source: https://docs.chalk.ai/cli?command=router_cursor_off

```bash
chalk router cursor off
```

Restore cursor settings managed by Chalk Router

**Flags**

- `--config-path <path>` (string)
  Override the harness configuration path

## `chalk router cursor on`
source: https://docs.chalk.ai/cli?command=router_cursor_on

```bash
chalk router cursor on
```

Route cursor through Chalk Router

**Flags**

- `--model <model>` (string)
  Model ID to configure for the harness
- `--config-path <path>` (string)
  Override the harness configuration path
- `--router-api-key-stdin <router-api-key-stdin>` (bool, default `false`)
  Read a static Router API key from stdin instead of using the preferred refreshable Chalk login

**Example**

```
$ chalk router cursor on
$ chalk router cursor on --model <model-id>
```

## `chalk router cursor status`
source: https://docs.chalk.ai/cli?command=router_cursor_status

```bash
chalk router cursor status
```

Show cursor router settings

**Flags**

- `--config-path <path>` (string)
  Override the harness configuration path

## `chalk router doctor`
source: https://docs.chalk.ai/cli?command=router_doctor

```bash
chalk router doctor
```

Diagnose router, model, and harness configuration

**Flags**

- `--verbose <verbose>` (bool, default `false`)
  Show successful doctor checks as well as issues

## `chalk router model list`
source: https://docs.chalk.ai/cli?command=router_model_list

```bash
chalk router model list
```

List models available through Chalk Router

**Flags**

- `--search <term>` (string)
  Filter models by ID, name, provider, or capability

## `chalk router opencode off`
source: https://docs.chalk.ai/cli?command=router_opencode_off

```bash
chalk router opencode off
```

Restore opencode settings managed by Chalk Router

**Flags**

- `--config-path <path>` (string)
  Override the harness configuration path

## `chalk router opencode on`
source: https://docs.chalk.ai/cli?command=router_opencode_on

```bash
chalk router opencode on
```

Route opencode through Chalk Router

**Flags**

- `--model <model>` (string)
  Model ID to configure for the harness
- `--config-path <path>` (string)
  Override the harness configuration path
- `--router-api-key-stdin <router-api-key-stdin>` (bool, default `false`)
  Read a static Router API key from stdin instead of using the preferred refreshable Chalk login

**Example**

```
$ chalk router opencode on
$ chalk router opencode on --model <model-id>
```

## `chalk router opencode status`
source: https://docs.chalk.ai/cli?command=router_opencode_status

```bash
chalk router opencode status
```

Show opencode router settings

**Flags**

- `--config-path <path>` (string)
  Override the harness configuration path

## `chalk router status`
source: https://docs.chalk.ai/cli?command=router_status

```bash
chalk router status
```

Show LLM Router availability and harness configuration

## `chalk router usage-pool create`
source: https://docs.chalk.ai/cli?command=router_usage_pool_create

```bash
chalk router usage-pool create
```

Create a Router usage pool

**Flags**

- `--name <name>` (string)
  Usage pool name

## `chalk router usage-pool delete`
source: https://docs.chalk.ai/cli?command=router_usage_pool_delete

```bash
chalk router usage-pool delete <pool-id>
```

Delete a Router usage pool

**Arguments**

- `pool-id` (string)
  Usage pool ID returned by `chalk router usage-pool list`.

## `chalk router usage-pool list`
source: https://docs.chalk.ai/cli?command=router_usage_pool_list

```bash
chalk router usage-pool list
```

List Router usage pools

**Flags**

- `--limit <count>` (int, default `40`)
  Maximum rows to return
- `--cursor <cursor>` (string)
  Pagination cursor returned by a previous request

## `chalk router vscode off`
source: https://docs.chalk.ai/cli?command=router_vscode_off

```bash
chalk router vscode off
```

Restore vscode settings managed by Chalk Router

**Flags**

- `--config-path <path>` (string)
  Override the harness configuration path

## `chalk router vscode on`
source: https://docs.chalk.ai/cli?command=router_vscode_on

```bash
chalk router vscode on
```

Route vscode through Chalk Router

**Flags**

- `--model <model>` (string)
  Model ID to configure for the harness
- `--config-path <path>` (string)
  Override the harness configuration path
- `--router-api-key-stdin <router-api-key-stdin>` (bool, default `false`)
  Read a static Router API key from stdin instead of using the preferred refreshable Chalk login

**Example**

```
$ chalk router vscode on

# VS Code cannot refresh Chalk login automatically; optionally provide a Router API key securely.
$ chalk router vscode on --router-api-key-stdin
```

## `chalk router vscode status`
source: https://docs.chalk.ai/cli?command=router_vscode_status

```bash
chalk router vscode status
```

Show vscode router settings

**Flags**

- `--config-path <path>` (string)
  Override the harness configuration path
