I am using the Gemini Developer API v1beta with gemini-3.8-flash on an existing free-tier project. models.get and countTokens succeed; a text-only generateContent request returned HTTP400 INVALID_ARGUMENT without usable diagnostic details on 2026-10-10 at 16:38:57 UTC. It had 67,962 counted input tokens, maxOutputTokens 8,192, candidateCount 1, thinkingLevel LOW, and no tools/cache.
The API reference/discovery defines generationConfig.responseFormat.text.mimeType as APPLICATION_JSON; the endpoint REST structured-output guide instead sends application/json. Which exact raw REST value is supported for this model? Can you identify the supported next diagnostic or prerequisite for this rejection without billing changes or private payload disclosure?
This report includes no key, headers, project/account identifiers, repository content, prompts or private provider responses. We have paused generation rather than retrying or changing models.
Hello @Bruno_Gouveia,
Thanks for reporting this, we will pass on the request to fix the documentation to the appropriate teams. On generateContent, generationConfig.responseFormat.text.mimeType requires "APPLICATION_JSON"; if you prefer to pass "application/json", you can use either of the following configurations today:
-
Using top-level responseMimeType and responseJsonSchema on generateContent: Pass "application/json" at the top level of generationConfig:
"generationConfig": {
"responseMimeType": "application/json",
"responseJsonSchema": { ... }
}
-
Using the Interactions API: Switch to v1beta/interactions, which accepts "mime_type": "application/json" in response_format:
"response_format": {
"type": "text",
"mime_type": "application/json",
"schema": { ... }
}
Thank you for clarifying the distinction. Our current generateContent request already uses generationConfig.responseMimeType: “application/json” together with responseJsonSchema, matching the first configuration you describe. Harmless structured generation has succeeded with that configuration; the discarded historical 400 detail is insufficient to prove its original cause.
The remaining issue is separate: subsequent bounded requests returned HTTP 503 UNAVAILABLE without usable field-level detail or an operation/result lookup identifier. We preserve those outcomes as unknown and have paused further generation rather than automatically retrying. Is there a supported, non-generation diagnostic or a secure support route for investigating these 503 responses? Please advise which non-sensitive request metadata would be useful; we will not post credentials, headers, private prompts, or repository content. No billing or model change is requested.