> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ccs.kaitran.ca/llms.txt
> Use this file to discover all available pages before exploring further.

# xAI (Grok) Provider

> Use xAI Grok through CCS as a CLIProxy device-code OAuth provider

# xAI (Grok) Provider

CCS supports **xAI (Grok)** through CLIProxy OAuth. The canonical provider ID
is `xai`; `grok` is a supported CLI alias for the same provider state.

## Quick Start

```bash theme={null}
ccs xai --auth
ccs xai --accounts
ccs xai --config
ccs xai "review this change"
ccs grok "review this change" # equivalent shortcut
```

Use `xai` in configuration and provider references. `grok` does not create a
separate account bucket, settings file, or model catalog.

## Authentication

xAI uses a **device-code OAuth flow**:

* Run `ccs xai --auth`, then complete authorization at the displayed xAI
  device URL with its verification code.
* No local callback port is used.
* `ccs xai --auth --headless` avoids launching a browser; it still displays
  the device URL and code, then polls for completion.
* CLIProxy manages token refresh after authorization.

`ccs grok --auth` starts the same OAuth flow. This provider shortcut is
separate from standalone API-key Grok integrations, including Grok WebSearch
or Docker CLI configuration.

## Accounts And Storage

xAI supports multiple accounts. CCS uses token metadata email when it is
available; otherwise it derives a stable account ID from the `xai-*.json`
filename suffix. If an ID collides, CCS uses `xai-1`, `xai-2`, and so on.

| Path                              | Purpose                                |
| --------------------------------- | -------------------------------------- |
| `~/.ccs/cliproxy/auth/xai-*.json` | xAI OAuth token files                  |
| `~/.ccs/cliproxy/accounts.json`   | account registry under `providers.xai` |
| `~/.ccs/xai.settings.json`        | local xAI provider settings when used  |

```bash theme={null}
ccs xai --accounts
ccs xai --use <account>
ccs xai --auth --add
ccs xai --logout
```

## Model Selection

Use the interactive picker to choose a configured route:

```bash theme={null}
ccs xai --config
```

The default is `grok-build-0.1`. When a live CLIProxy catalog is available it
is used first, followed by an unexpired local cache; the bundled static
catalog is a fallback when neither is usable.

The bundled static fallback catalog contains:

* `grok-build-0.1`
* `grok-4.5`
* `grok-4.3`
* `grok-4.20-0309-reasoning`
* `grok-4.20-0309-non-reasoning`
* `grok-4.20-multi-agent-0309`
* `grok-3-mini`
* `grok-3-mini-fast`
* `grok-composer-2.5-fast`

The default tier mapping is `grok-build-0.1` for default and Sonnet,
`grok-4.5` for Opus, and `grok-composer-2.5-fast` for Haiku.

## Backend Compatibility

xAI works with the default `original` CLIProxy backend as well as `plus`; it
is not a Plus-only provider. xAI does not participate in the CLIProxy quota
display.

## Related

* [Provider Overview](/providers/concepts/overview)
* [CLIProxy API](/features/proxy/cliproxy-api)
* [CLI Commands](/reference/cli-commands)
