For gemini-3.8-flash through the Gemini Developer API (not Vertex/Agent Platform or Live API), does setting generationConfig.maxOutputTokens = 8192 enforce a combined ceiling of 8192 tokens for usageMetadata.thoughtsTokenCount + usageMetadata.candidatesTokenCount when thinkingConfig.thinkingLevel = HIGH?
We use the official Node.js SDK @google/genai 2.18.0 and generateContent, with a single text/JSON response and a response schema. There are no attachments, tools, grounding, explicit cache, or thought summaries. candidateCount is intentionally omitted because current documentation marks it unsupported for recent Flash models.
Please clarify:
- Whether
maxOutputTokensincludes raw thinking tokens, or only the visible response, for this exact model and endpoint. - If thinking is separate, the maximum chargeable thinking tokens per request at HIGH and the supported way to bound the combined amount without downgrading HIGH.
- Whether a request ending in HTTP 503 or client timeout can accrue billable tokens without returning
usageMetadata, and how that usage is identified. - Where the applicable official model/API documentation states this behavior.
Our planned test has at most 4096 input tokens and 8192 output tokens, with one initial generation and only one additional application-level attempt if the first returns HTTP 503. SDK automatic retries are disabled (retryOptions.attempts=1). The conditional estimate is USD 0.067584 for two fully used requests at the Standard prices shown on September 4, 2026. We have not enabled billing to test the budget assumption itself.
The documentation reviewed includes the GenerateContent API reference and the thinking guide. We understand that thinking tokens are billed as output; the question is whether the configurable generation ceiling also includes them for this exact model.
Thank you for any model-specific clarification or official documentation link.