Google Gemini API error
Gemini API 416 out_of_range: what it means and how to fix it
Error message
416 out_of_rangeRetry? NoLast verified 1 documented fix2 sources
What it means
A request parameter is outside the valid range.
Causes
- Parameter value outside its allowed range, for example candidate count outside 1-8, or temperature or topP outside 0.0-1.0
How to fix it
- Fix 1.
Check parameter values and limits. Use the models page to find the maximum output tokens for your model.
More Gemini API errors
All 30 Gemini API errorsFAQ
What does the Gemini API error "416 out_of_range" mean?
A request parameter is outside the valid range.
How do I fix Gemini API "416 out_of_range"?
Check parameter values and limits. Use the models page to find the maximum output tokens for your model.
Should I retry Gemini API "416 out_of_range"?
No. The official docs treat this error as not retryable: fix the cause before sending the request again.
Sources
Last verified against 2 sources: Gemini API's official docs and official SDK repositories.
- ai.google.devhttps://ai.google.dev/gemini-api/docs/api-errors
- ai.google.devhttps://ai.google.dev/gemini-api/docs/troubleshooting
Newsletter
Know when the APIs change
One email per week. New model releases, API changes, what broke, and how developers are working around it.