Grok 4.7 API pricing and access
Run Grok 4.7 (model ID grok-4.7) through Code By AI for ≈$0.016667 per 1M input tokens and $0.05 per 1M output tokens, with no monthly subscription.
What Grok 4.7 is for
Choose tasks supported by this model’s catalog channel and review its output before use.
Your price
≈$0.016667
per 1M tokens, USD
| Your price | |
|---|---|
| Input | ≈$0.016667 |
| Cache read | ≈$0.004167 |
| Output | $0.05 |
What grok-4.7 costs in a typical month
On Code By AI, 20M input tokens and 2M output tokens cost $0.43.
How to use grok-4.7
Create an API key and run the OpenCode setup command on the API Keys page. In your OpenCode config, merge the entry below into provider.codebyai.models without removing existing models. Open a new terminal and run opencode -m codebyai/grok-4.7.
{
"grok-4.7": {
"name": "grok-4.7"
}
}No key yet? Create one
Claude Code, Codex and Gemini CLI compatibility
A client can call grok-4.7 only when it speaks the endpoint that serves this model. The table shows what works and the minimum configuration.
- Claude CodeNot applicable
Not applicable: the Anthropic Messages endpoint serves Claude models only.
Open the Claude Code guide - CodexNot applicable
Grok supports Chat Completions (/v1/chat/completions) but not Responses (/v1/responses), which Codex CLI requires.
Open the Codex guide - Gemini CLINot applicable
Not applicable: the Gemini generateContent endpoint serves the Gemini family only.
Open the Gemini CLI guide
Compare other Grok models
Your price /1M
Grok 4.7 FAQ
Get started
Four steps to your first request
- 01
Create a free account
Sign up with Google, GitHub or email and set a password. No card is required.
- 02
Generate an API key
Create a key in one click from the dashboard. It lets your CLI authenticate with Code By AI.
- 03
Top up your balance
Add credit before your first request; usage is charged per token from your balance.
- 04
Point your CLI at Code By AI
Export one base-URL variable, or add a model provider block to config.toml. The setup guides list the exact lines for each agent.
No card required to sign up · API usage requires a top-up