Could the Gemini Developer API team clarify the documented counting and billing behavior for gemini-4-neon and gemini-4-hydrogen on REST v1beta?
This is a general API-specification question. No live verification request has been submitted for this configuration.
Proposed request shape
- Text only, a single user Content, native
generationConfig.responseJsonSchema. thinkingConfig.thinkingLevel: "MEDIUM",maxOutputTokens: 8000, intended single candidate (candidateCount: 1).- No tools, cached content, or prior model-turn history.
The troubleshooting guide lists candidate count as unsupported on Gemini 3/4. If the proposed candidateCount: 1 field is inadmissible, please identify the valid single-candidate form before assuming this configuration is supported.
Let C be one immutable logical GenerateContentRequest, including model, contents, and generationConfig. We propose:
- Counting:
POST /v1beta/models/{model}:countTokens, body{"generateContentRequest": C}. - Generation:
POST /v1beta/models/{model}:generateContent, with the same model in the URL and a body equal toCwith onlymodelomitted.contents, native schema, and other generation settings remain identical.
1. Counting coverage and an input upper bound
Does countTokens.totalTokens for this complete request include every input component reported in usageMetadata.promptTokenCount, including native JSON schema and request framing/protocol tokens?
For these models, is there a documented guarantee of equality, or a finite upper-bound relationship:
promptTokenCount(C) <= totalTokens(C) + E(C, model, API)?
If so, please provide the documentation or written clarification stating the bound, the applicable model/API scope, and any exclusions. We need a pre-request input limit, not an observed average or safety factor. If no such guarantee is offered, please state that explicitly; we will keep the evaluation paused.
2. Applicability of unbilled token counting
Does the Billing FAQ’s unbilled GetTokens statement apply to the direct Developer API models/{model}:countTokens method for both named models, including the complete generateContentRequest form above? Please clarify the charge treatment of successful and rejected/failed counting requests and cite the applicable specification.
If the answer depends on a different supported request shape or product, please identify that scope rather than assuming equivalence. Please provide a public reference or a product-team clarification with an explicit scope. If project-specific diagnostics or live calls would be required, please first describe those prerequisites; no credentials or diagnostic attachments are included here.
References:
- Counting tokens REST reference:
https://aistudio.google.com/api-reference/tokens/count-tokens - GenerateContent REST reference:
https://aistudio.google.com/api-reference/generate-content/generate-content - Billing FAQ: Is GetTokens billed?:
https://aistudio.google.com/docs/billing#is-gettokens-billed - Troubleshooting: model parameters:
https://aistudio.google.com/docs/troubleshooting#check-api