Skip to content

Grok

Use these configurations with a CE API key assigned to a Grok group. The examples use grok-4.5.

For the exact base URL and API key, open API Keys, choose the key, and click Use Key.

Grok CLI

Put the following content in ~/.grok/config.toml on macOS or Linux, or %userprofile%\.grok\config.toml on Windows.

toml
[models]
default = "grok"
web_search = "grok"

[model."grok"]
model = "grok-4.5"
base_url = "https://codex-easy.ai/v1"
name = "Grok 4.5"
api_key = "<your-ce-api-key>"
api_backend = "responses"
context_window = 1000000
supports_backend_search = true

Claude Code

This configuration pins Claude Code's model roles to grok-4.5.

Current session

sh
export ANTHROPIC_BASE_URL="https://codex-easy.ai"
export ANTHROPIC_AUTH_TOKEN="<your-ce-api-key>"
export ANTHROPIC_MODEL="grok-4.5"
export ANTHROPIC_DEFAULT_OPUS_MODEL="grok-4.5"
export ANTHROPIC_DEFAULT_SONNET_MODEL="grok-4.5"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="grok-4.5"
export ANTHROPIC_DEFAULT_FABLE_MODEL="grok-4.5"
export CLAUDE_CODE_SUBAGENT_MODEL="grok-4.5"
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC="1"
export CLAUDE_CODE_ATTRIBUTION_HEADER="0"
bat
set ANTHROPIC_BASE_URL=https://codex-easy.ai
set ANTHROPIC_AUTH_TOKEN=<your-ce-api-key>
set ANTHROPIC_MODEL=grok-4.5
set ANTHROPIC_DEFAULT_OPUS_MODEL=grok-4.5
set ANTHROPIC_DEFAULT_SONNET_MODEL=grok-4.5
set ANTHROPIC_DEFAULT_HAIKU_MODEL=grok-4.5
set ANTHROPIC_DEFAULT_FABLE_MODEL=grok-4.5
set CLAUDE_CODE_SUBAGENT_MODEL=grok-4.5
set CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
set CLAUDE_CODE_ATTRIBUTION_HEADER=0
powershell
$env:ANTHROPIC_BASE_URL="https://codex-easy.ai"
$env:ANTHROPIC_AUTH_TOKEN="<your-ce-api-key>"
$env:ANTHROPIC_MODEL="grok-4.5"
$env:ANTHROPIC_DEFAULT_OPUS_MODEL="grok-4.5"
$env:ANTHROPIC_DEFAULT_SONNET_MODEL="grok-4.5"
$env:ANTHROPIC_DEFAULT_HAIKU_MODEL="grok-4.5"
$env:ANTHROPIC_DEFAULT_FABLE_MODEL="grok-4.5"
$env:CLAUDE_CODE_SUBAGENT_MODEL="grok-4.5"
$env:CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC="1"
$env:CLAUDE_CODE_ATTRIBUTION_HEADER="0"

settings.json

json
{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "env": {
    "ANTHROPIC_BASE_URL": "https://codex-easy.ai",
    "ANTHROPIC_AUTH_TOKEN": "<your-ce-api-key>",
    "ANTHROPIC_MODEL": "grok-4.5",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "grok-4.5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "grok-4.5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "grok-4.5",
    "ANTHROPIC_DEFAULT_FABLE_MODEL": "grok-4.5",
    "CLAUDE_CODE_SUBAGENT_MODEL": "grok-4.5",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
    "CLAUDE_CODE_ATTRIBUTION_HEADER": "0"
  }
}

On Windows, use %USERPROFILE%\.claude\settings.json.

Codex CLI / App

Put the following content at the beginning of ~/.codex/config.toml on macOS or Linux, or %userprofile%\.codex\config.toml on Windows.

toml
model_provider = "codex-everywhere"
model = "grok-4.5"
review_model = "grok-4.5"
model_reasoning_effort = "high"
model_context_window = 1000000
supports_websockets = false

[model_providers.codex-everywhere]
name = "codex-everywhere"
base_url = "https://codex-easy.ai"
wire_api = "responses"

Add the API key to ~/.codex/auth.json or %userprofile%\.codex\auth.json:

json
{
  "OPENAI_API_KEY": "<your-ce-api-key>"
}

OpenCode

See the Grok provider example in the OpenCode guide.