Skip to main content
Grok CLI is a third-party terminal client that works with OpenAI-compatible endpoints. Routeway provides a compatible endpoint, so you can use Grok CLI with your Routeway API key to access Grok models and many others.
Requires a valid Routeway API key. Get yours from the dashboard.

Setup

1

Install Grok CLI

Requires Node.js 18 or newer:
npm install -g @vibe-kit/grok-cli
Verify the installation:
grok --version
If you encounter permission issues, try sudo (macOS/Linux) or run the command prompt as administrator (Windows).
2

Configure environment variables

Grok CLI reads GROK_BASE_URL and GROK_API_KEY from your environment:
export GROK_BASE_URL="https://api.routeway.ai/v1"
export GROK_API_KEY="YOUR_ROUTEWAY_API_KEY"
To make these persistent, add them to your shell profile (e.g. ~/.zshrc or ~/.bashrc).
3

Start using Grok CLI

Launch with a specific model:
grok --model grok-3
Since you’re connected to Routeway, you can use any available model:
# Grok models
grok --model grok-3
grok --model grok-3-fast
grok --model grok-3-mini

# Other providers through Routeway
grok --model gpt-4.1
grok --model claude-sonnet-4.5
grok --model gemini-2.5-flash
Browse all available models at routeway.ai/models.

Available Grok Models

ModelDescription
grok-3xAI flagship model
grok-3-fastFaster, more cost-effective version
grok-3-miniLightweight version

Known Limitations

Grok CLI has limited compatibility with thinking/reasoning models. When you use a thinking model, the full reasoning content may be shown in the output. If you want first-party CLI support for Routeway, consider Claude Code or Codex CLI.

Troubleshooting

IssueSolution
401 UnauthorizedCheck your API key is correct and has credits
GROK_BASE_URL not setEnsure the environment variable is exported
Model not foundVerify the model name at routeway.ai/models
Command not found: grokRun npm install -g @vibe-kit/grok-cli again
Thinking content flooding outputUse a non-thinking model variant