Grok 4.7 + Claude Code: the catch
Grok 4.7 is served by xAI over an OpenAI-compatible API. Claude Code expects the Anthropic Messages API shape, so unlike DeepSeek/Kimi/Qwen (which offer Anthropic-compatible endpoints), Grok usually needs a small proxy that translates between the two. Once that translator is in place, Claude Code can drive Grok 4.7 like any other endpoint. This is the same setup as earlier Grok versions, only the model name changes.
The config
What to set
- A translating proxyRun a small proxy that accepts Anthropic-shaped requests and forwards them to xAI's OpenAI-compatible Grok API.
- ANTHROPIC_BASE_URLPoint Claude Code at your local proxy, not directly at xAI.
- ANTHROPIC_AUTH_TOKENYour xAI API key (or whatever the proxy expects), billed to your xAI account.
- ModelSelect the Grok 4.7 model using the exact name xAI's API exposes.
Why people want Grok 4.7 for coding
What Grok 4.7 brings
| Reason | Detail |
|---|---|
| Speed | xAI's coding-tuned models are built for fast responses in the edit-run-read loop |
| Cost | Competitive per-token pricing for routine coding |
| Another fallback | One more provider to switch to when others are capped |
On routine work, renaming, small refactors, boilerplate, reading a stack trace and proposing a fix, Grok's speed matters more than raw reasoning, because you're waiting on the model dozens of times per task. Where you still want to test carefully is multi-step tool calling through the proxy. Run one real agent task end to end before you trust Grok 4.7 for long autonomous loops.
The cleaner option: skip the proxy
Because Grok 4.7 is OpenAI-compatible, the friction is entirely Claude Code's Anthropic-only assumption. An agent that speaks OpenAI-compatible endpoints natively doesn't need a translating proxy at all, you add Grok 4.7 as a provider with its base URL and key, and it just works. That removes the extra service and the restart-to-switch dance.
What that looks like with Wuwei
No proxy
OpenAI-compatible providers like xAI/Grok connect directly, no Anthropic-shape translator to run.
Grok 4.7 in the model list
Pick it next to Claude, DeepSeek, Kimi, Qwen and GLM; switch in a click.
Free, open source, local
MIT-licensed, runs on your machine, reads your real files; you only pay xAI's usage.
FAQ
Can Claude Code use Grok 4.7?
Yes, with an extra step. Grok 4.7's xAI API is OpenAI-compatible, so Claude Code needs a small translating proxy in front (point ANTHROPIC_BASE_URL at the proxy, use your xAI key, pick a Grok 4.7 model). Agents that speak OpenAI-compatible endpoints natively skip the proxy.
Do I need a proxy for Grok 4.7 in Claude Code?
Usually yes, Grok is OpenAI-compatible, not Anthropic-shaped. A translating proxy sits between Claude Code and xAI. Or use an agent like Wuwei that connects OpenAI-compatible providers directly with no proxy.
Is Grok 4.7 good for coding?
xAI's coding-tuned Grok models are fast and cost-competitive, a reasonable pick for routine agent coding. Test tool-calling on a real task before relying on it for heavy loops.
How is Grok 4.7 different from older Grok in Claude Code?
The setup is the same, OpenAI-compatible, so it needs a proxy. Only the model name changes. Use the exact Grok 4.7 model string xAI's API exposes.