Grok

Grok Installation and Setup

Connect Grok with a Passion8 API key through Cline, Grok Build or Codex. Configure the base URL, config.toml and CC Switch, then verify requests and troubleshoot.

To use Grok through Passion8, you need a Passion8 API key, an enabled model ID and https://passion8.cc/v1. Use Cline for VS Code; official Grok Build and existing Codex users can follow the configuration-file guides on this page. An xAI account or official OAuth login is not required for this gateway setup.

#Choose your workflow

ScenarioGuideConnection
Code, read files and review diffs in VS CodeCline editor setupPassion8 URL, key and model; no xAI login
Call Grok from your applicationGrok API and SDKOpenAI compatible Chat / Responses
Complete a reviewable small changeGrok coding workflowRules, plan, edits and tests
Use official Grok Build or an existing Codex clientDetailed steps belowManual configuration or CC Switch

Cline is a third-party editor client. The verified xAI official coding entry is Grok Build with TUI, headless and ACP. A marketplace extension sharing the Grok name does not establish xAI authorship.

There are two ways to connect Grok models through Passion8:

MethodBest fitConfiguration
Official xAI Grok Build CLINative grok TUI, headless and agent commands~/.grok/config.toml
Codex CLI / Codex AppKeep the Codex workflow while changing the model to Grok~/.codex/auth.json and ~/.codex/config.toml, or CC-Switch's GPT provider

Both use https://passion8.cc/v1. Examples use grok-4.7; select an ID actually available in the console model catalog.

Grok Build and Codex are different clients. Grok Build reads ~/.grok/config.toml; Codex reads ~/.codex/auth.json and ~/.codex/config.toml. Do not mix their configuration files.

#Method 1: official Grok Build CLI

This guide preserves the original Grok Build v0.2.93 integration steps and updates them against official installation, custom-model and Grok 4.7 documentation checked on 2026-10-11. Check your version with grok --version. If fields change, use grok inspect to see discovered configuration, model and authentication sources.

#Install Grok CLI

Run the official installation script:

curl -fsSL https://x.ai/cli/install.sh | bash

Open a new terminal and check the command:

which grok
grok --version

On macOS / Linux / WSL, which grok usually points to ~/.local/bin/grok, linked to ~/.grok/bin/grok. On Windows use Get-Command grok instead of which.

If macOS / Linux / WSL reports grok: command not found, add ~/.local/bin to PATH and reopen the terminal:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

Update with:

grok update

#Prepare the connection

ItemValue
Passion8 API keyCreate under Tokens and copy the complete key
Base URLhttps://passion8.cc/v1
Model IDUse the console catalog; this example uses grok-4.7
Configuration file~/.grok/config.toml

Check your executable and version:

which grok
grok --version

Paths under ~/.local/bin/grok or ~/.grok/bin/grok are typical for Grok Build; check the version and installation source as well.

Store the key in api_key:

[model.passion8-grok]
model = "grok-4.7"
base_url = "https://passion8.cc/v1"
name = "grok-4.7"
context_window = 500000
api_key = "sk-YOUR_PASSION8_API_KEY"

[models]
default = "passion8-grok"

default is the section alias from [model.passion8-grok], not the upstream model ID. The ID is the model value.

The original Build version displayed a default 200,000-token context for custom models without context_window. The current official Grok 4.7 page lists 500,000 tokens, so 500000 matches that model. Check other models separately. Restart or use /new before reviewing /context again.

#Use an environment variable instead

To keep the key out of config.toml, set env_key to the variable's name:

[model.passion8-grok]
model = "grok-4.7"
base_url = "https://passion8.cc/v1"
name = "grok-4.7"
context_window = 500000
env_key = "PASSION8_API_KEY"

[models]
default = "passion8-grok"

Then configure your shell:

echo 'export PASSION8_API_KEY="sk-YOUR_PASSION8_API_KEY"' >> ~/.zshrc
source ~/.zshrc

#Test the gateway

Check the key, endpoint and model availability with curl:

curl -s https://passion8.cc/v1/models \
  -H "Authorization: Bearer $PASSION8_API_KEY"

Then make a short request:

curl -s https://passion8.cc/v1/chat/completions \
  -H "Authorization: Bearer $PASSION8_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "grok-4.7",
    "messages": [{"role": "user", "content": "reply with OK"}],
    "max_tokens": 10
  }'

If curl works but grok opens browser OAuth, inspect ~/.grok/config.toml.

#Verify Grok CLI

grok -p "Reply with exactly: RELAY_OK"

After receiving the answer, check the matching timestamp, model and usage in Passion8. The answer alone does not prove which endpoint handled the request.

#Common errors

SymptomCause to checkFix
Browser OAuth despite gateway settingsNo usable key or default modelCheck api_key / env_key and [models].default
env_key = "sk-..."Actual key used instead of variable nameUse api_key, or put a variable name in env_key
default = "grok-4.7"Model ID used instead of section aliasUse default = "passion8-grok"
/context displays 200kMissing custom context settingAdd the verified model limit and restart
GROK_BASE_URL / GROK_API_KEY ignoredCommunity-client settings usedConfigure official Build through ~/.grok/config.toml
curl works but CLI failsLocal configuration not selectedInspect discovered sources and authentication with grok inspect

#Authentication precedence

The original version's troubleshooting record observed:

model.api_key > model.env_key > current login session > XAI_API_KEY

If api_key is missing and env_key is incorrect, the client may fall back to a login session or open browser OAuth. Recheck behavior after client upgrades.

#Common commands

grok                         # Interactive TUI
grok "Explain this project"  # TUI with an initial instruction
grok -p "Explain auth"       # Run once, print and exit
grok logout                  # Sign out to remove an old session
grok inspect                 # Inspect configuration sources
grok --version               # Show version

Do not publish config.toml, shell configuration or screenshots containing keys. Create a separate Passion8 key for Grok so it can be revoked independently.

#Method 2: use Grok through Codex CLI / App

You can retain the Codex workflow and select Passion8's enabled Grok model. The client remains Codex while requests target Grok.

Why does it still identify itself as GPT?

Codex supplies its own system and identity instructions, so the assistant may still say GPT or Codex. Do not infer the backend from self-identification, speed or style. Check Passion8 usage and model billing records.

Do not copy every field from a normal GPT provider configuration. Grok or the Responses-compatible route may reject some parameters. Start with the configuration below.

#Configure through CC-Switch

Select the GPT / Codex provider area, add a provider and enter:

FieldValue
Provider namecustom or Passion8 Grok
API Base URLhttps://passion8.cc/v1
API keyYour Passion8 key
Modelgrok-4.7, if enabled for your account

Check that CC-Switch manages the Codex files:

FilePurpose
auth.jsonStores OPENAI_API_KEY
config.tomlProvider, model, wire_api, base_url and context budget

Manual and CC-Switch configurations should use the same verified fields. No machine-specific model_catalog_json path is needed here.

#auth.json

{
  "OPENAI_API_KEY": "sk-YOUR_PASSION8_API_KEY"
}

#config.toml

model_provider = "custom"
model = "grok-4.7"
model_reasoning_effort = "high"
model_context_window = 500000
model_auto_compact_token_limit = 475000

[model_providers]
[model_providers.custom]
name = "custom"
wire_api = "responses"
requires_openai_auth = true
base_url = "https://passion8.cc/v1"

The official Grok 4.7 page lists 500,000 tokens. The 500000 context budget and 475000 compaction threshold are client settings, not a guarantee of every gateway channel's limit. high is supported; the old none value is absent from this model's current supported list. Verify the saved file rather than allowing a catalog with an inflated window to delay compaction. Use /compact manually when needed.

#Manual configuration

Without CC-Switch, write the same auth.json and config.toml files with the same verified budget.

Files:

~/.codex/auth.json
~/.codex/config.toml

Test:

codex "Reply with: GROK_RELAY_OK"

Codex App uses the same configuration. After saving the provider, reopen the app or start a new session and test.

#Accounts, charges and troubleshooting

Create an account and token through the quickstart. See billing; official client subscriptions and Passion8 API balances are separate. For authentication, endpoint and model errors, see the FAQ. Actual models and rates follow the console.

#Verified sources

Checked 2026-10-11. The official catalog contains grok-4.7, with low, medium, high and xhigh reasoning efforts. Gateway access follows the console.

The current overview confirms model, base_url, name, env_key and [models].default. The direct api_key setting, authentication order and 200k display default come from the original version's integration record; verify them with grok inspect after upgrades.

Support

Need help?

For setup, billing, or model issues, email us. Check the status page for uptime.

WeChat / QQ support is available at the bottom right.