Gemini 3.6 Flash: OpenAI-compatible token limits, response fields and auth keys

Hello,

We are preparing a small, isolated diagnostic using Gemini
Developer API—not Vertex AI—with gemini-3.6-flash and the
non-streaming /v1beta/openai/chat/completions endpoint.

Before running it, could you clarify these points and provide
the relevant documentation?

  1. Is max_tokens supported as a hard generation budget?
    With max_tokens=2500 and reasoning_effort omitted, does
    this budget include thinking tokens?

  2. Which response fields are guaranteed, nullable or omittable:
    model, id, usage.prompt_tokens, usage.completion_tokens,
    usage.total_tokens and choices.finish_reason?

  3. Does completion_tokens include thinking? How should
    total_tokens be interpreted without reconstructing or
    inventing missing values?

  4. What supported read-only procedure can establish the
    key-to-project association and current Free-tier status
    without putting the secret key in a URL? Please distinguish
    API-key access from additional OAuth/IAM requirements.

  5. For authorization (“auth”) API keys, are both combinations
    supported:

    • models.get with x-goog-api-key;
    • /v1beta/openai/chat/completions with Authorization: Bearer?
      What service-account permissions or restrictions apply
      to each?

We are requesting technical clarification only—not increased
quotas, billing activation or changes to our account.

Thank you.

Hello @Era_Home,

  1. Yes — max_tokens is a hard cap on combined thinking + visible output (reasoning_effort omitted defaults to medium; set reasoning_effort: "none" for minimal thinking). See OpenAI thinking and token limits.

  2. model, choices[].finish_reason, and usage.{prompt_tokens,completion_tokens,total_tokens} are guaranteed non-null (0 when zero). id, choices[].message (when prompt-blocked), and choices[].message.content (when completion_tokens == 0 with thoughts excluded, or on tool_calls) can be omitted from the JSON object.

  3. completion_tokens always excludes thinking tokens (even if thought summaries are enabled); total_tokens includes them (thinking = total_tokens - (prompt_tokens + completion_tokens)). See thinking pricing.

  4. There is no supported read-only endpoint to query a key’s project or tier using an API key alone. Key-to-project lookup requires OAuth 2.0 (apikeys.keys.lookup) via the Cloud API Keys gRPC LookupKey method (or REST keys.lookupKey using POST with X-HTTP-Method-Override: GET and form body keyString=<KEY> to keep the key out of the URL). Tier status is only visible in AI Studio.

  5. Yes — the same auth key works across both endpoints (models.get with x-goog-api-key and /v1beta/openai/chat/completions with Authorization: Bearer). Auth keys run under their bound service account and require generativelanguage.googleapis.com in any configured API restrictions. See API keys.