Grok · Best AI for
Best Grok model for writing code
Only xAI models, scored against every current AI on the same tests, so you can see which one to pick and how it stacks up.
Answer: Grok 4.7 (54/100 · $3 per 1M tokens)

Grok 4.7. It scores 54/100 for writing code, #17 among all 35 current models (the overall leader, GPT-6 Astra, scores 91).
All 3 Grok models for writing code
Score = share of all of today's AI models it beats on this job's tests (100 = best of all). Bar in coral = the overall #1, for reference.
Score, price and memory side by side
Cost per job = one long request (≈ 20K tokens read, 2K written), using list API prices.
Quick answers
Which Grok model is best for writing code?
Grok 4.7. It scores 54/100 for writing code, #17 among all 35 current models (the overall leader, GPT-6 Astra, scores 91).
About Grok 4.7 →What's the runner-up?
Grok 4.6, scoring 49 at $3 per million tokens.
See the details →Which is the best value?
Grok 4.6: it scores 49 (vs 54 for Grok 4.7) and costs $3 per million tokens instead of $3.
See the details →How does it compare with the overall best for writing code?
GPT-6 Astra scores 91 vs 54, but costs about 6.7× as much per token.
Best AI for writing code →How are these ranked?
Each model's score is the share of current AI models it beats on the writing code tests, weighted towards newer and harder tests. Only xAI models, scored against every current AI on the same tests, so you can see which one to pick and how it stacks up.
How scores work →More ways to pick for writing code
Grok for other jobs
24 jobs · scores update automatically from public test results · data as of November 21, 2026