Grok API: set reasoning effort explicitly and leave sampling near 0.7/0.95
xAI recommends temperature 0.7 and top_p 0.95, explicit reasoning effort on every request, streaming, and long client timeouts.
From xAI’s own recommended settings for Grok reasoning models:
| Setting | Recommendation |
|---|---|
| Sampling | temperature: 0.7, top_p: 0.95; quality usually drops when you stray |
| Reasoning effort | Set it explicitly every request; defaults differ by model |
| Streaming | Prefer it, so long generations don’t drop |
| Timeouts | At least 900 seconds per request |
max_output_tokens | Above your longest expected answer (it caps only the visible answer) |
Also log usage on every response. Cached tokens and reasoning tokens tell you whether your cache and effort settings are doing what you think.