Grok models for OpenCode
Drop-in OpenAI-compatible proxy for Grok. Use with OpenCode via @ai-sdk/openai. Credit-based billing from D1 pricing.
OpenAI-compatible
API
OpenCode ready
Config
Install in OpenCode
Base URL
https://grok.claudible.io/v1
Copy this into ~/.config/opencode/opencode.json (or project opencode.json). Replace your_api_key_here with your Claudible key.
Steps
- Install OpenCode if needed
- Paste the config below and set your API key
- Run opencode and pick model grok/grok-4.5 or grok/grok-4.5-cli
{
"$schema": "https://opencode.ai/config.json",
"lsp": true,
"provider": {
"grok": {
"npm": "@ai-sdk/openai",
"options": {
"apiKey": "your_api_key_here",
"baseURL": "https://grok.claudible.io/v1"
},
"models": {
"grok-4.5-cli": {
"id": "grok-4.5-cli",
"provider": {
"npm": "@ai-sdk/openai",
"api": "https://grok.claudible.io/v1"
}
},
"grok-4.5": {
"id": "grok-4.5",
"provider": {
"npm": "@ai-sdk/openai",
"api": "https://grok.claudible.io/v1"
}
}
}
}
},
"model": "grok/grok-4.5"
}
baseURL must end with /v1. Models: grok-4.5 (api.x.ai) and grok-4.5-cli (CLI proxy).
Quick test
curl https://grok.claudible.io/v1/models \
-H "Authorization: Bearer YOUR_API_KEY"
Models & pricing
| Model | Input miss | Cache hit | Output |
|---|---|---|---|
grok-4.5 | 20 | 5 | 50 |
grok-4.5-cli | 20 | 5 | 50 |
credits / 1M tokens. Same rates power billing and /health.