GrokAPI & Developersintermediate

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:

SettingRecommendation
Samplingtemperature: 0.7, top_p: 0.95; quality usually drops when you stray
Reasoning effortSet it explicitly every request; defaults differ by model
StreamingPrefer it, so long generations don’t drop
TimeoutsAt least 900 seconds per request
max_output_tokensAbove 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.

Sources

Related tips