Gemini API 400 (INVALID_ARGUMENT / FAILED_PRECONDITION)
Is there an outage right now?
Gemini API / AI Studio official status is operational. If this error persists, it is likely an implementation or environment issue on your side.
View Gemini API / AI Studio status →What this error means
400 means the request is invalid: a bad parameter, a malformed body, an invalid API key, or—as FAILED_PRECONDITION—billing not enabled or the free tier not available in your region.
Common causes
- •Invalid or out-of-range parameter (e.g. an unsupported generationConfig value)
- •Malformed request body or wrong field names
- •Invalid API key, or a key restricted to other APIs
- •FAILED_PRECONDITION: billing not enabled, or free tier unavailable in your region
- •Unsupported file type / inline data too large
How to fix
- 1.Read the error detail—it identifies the bad field
- 2.Validate the request body and parameter ranges
- 3.Check the API key is valid and allowed to call the Generative Language API
- 4.Enable billing, or use a supported region
- 5.Verify file MIME types and size limits
When waiting helps (and when it won't)
Request/config error—waiting will not help. Fix the parameter, key, or billing/region named in the detail.
Alternatives when Gemini API / AI Studio is down
Related errors
FAQ
What is 400 INVALID_ARGUMENT?
400 means the request is invalid: a bad parameter, a malformed body, an invalid API key, or—as FAILED_PRECONDITION—billing not enabled or the free tier not available in your region.
How do I fix 400 INVALID_ARGUMENT?
Read the error detail—it identifies the bad field / Validate the request body and parameter ranges / Check the API key is valid and allowed to call the Generative Language API / Enable billing, or use a supported region / Verify file MIME types and size limits