Google CloudBetaVerified 2026-11-11

Gemini structured output (Vertex AI / Agent Platform)

Constrain Gemini output to a JSON schema or a single enum value (response_mime_type text/x.enum) with response_schema. Google Cloud now documents this under the Gemini Enterprise Agent Platform name. No probabilities are documented on the structured-output page.1

PricingUSD, as published

ItemValue
List price3.8 Flash $0.75/1M in23
Free tierNot published

Per-token Gemini pricing; for example Gemini 3.8 Flash is $0.75 / $3.75 per 1M input/output tokens (introductory, through 2026-12-31), then $1.50 / $7.50 from 2027-01-01 (non-global endpoints cost 10% more). The response schema counts toward the input token limit.23 [Verified 2026-11-11 on https://cloud.google.com/vertex-ai/generative-ai/pricing (no change) and https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/control-generated-output]

New: Gemini 4 Carbon and Gemini 4 Argon (Standard tier, global endpoint) cost $2 input / $10 output per 1M tokens through Nov 30, 2026 (promotional, paid as 50% credits back on net spend), then $4 / $20 from Dec 1, 2026; non-global endpoints cost 10% more and the Cyber Permissive variants get no promotion. From Nov 13, 2026, a Gemini 4 completion longer than 32K tokens is billed for retrievable tokens even if the request then fails on a timeout.2 [Verified 2026-11-11 on https://cloud.google.com/vertex-ai/generative-ai/pricing]

Estimate cost at 10k to 10M requests, or set your own usage.

LimitsPer request

LimitValue
Context window1,048,576 (3.8 Flash)
Rate limitUsage tiers (PayGo)

Response schema size counts toward the input token limit; schema must be defined via the API (no console support).3 [Verified 2026-11-11 on https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/control-generated-output (page last updated 2026-11-10)]

StatusBeta

  • Changed: the supported-models list now adds Gemini 4 Carbon and Gemini 4 Carbon for cyber, next to Gemini 4 Argon and Gemini 4 Argon Cyber Permissive, Gemini 3.8 Flash and 3.8 Flash Cyber, 3.7 Flash, 3.6 Flash, 3.5 Flash and Flash-Lite, Gemini 3.1 Flash-Lite, Gemini 3.1 Pro and Gemini 3 Flash (preview), Gemini Robotics ER 2 (preview) and Gemini 2.5 Pro, Flash and Flash-Lite. It also lists open models: DeepSeek-V4.1-Flash, Gemma 4 26B A4B IT, GLM 5.2, Llama 4 Maverick and Scout, and gpt-oss 120B.3 [Verified 2026-11-11 on https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/control-generated-output (page last updated 2026-11-10)]
  • Correction: an earlier version of this page said you could read logprobs alongside the enum. The structured output page does not mention logprobs, so no probabilities are documented for this path. [Correction logged 2026-10-16]

Auth

MethodAPI key or ADC
DetailsGoogle Cloud credentials: Vertex docs offer an API key or Application Default Credentials (gcloud auth). [Verified 2026-10-16 on cloud.google.com Vertex AI docs (Get an API key / Configure application default credentials)]

FeaturesFrom lib/apiFeatures.js

YesNoN/ANot published
CapabilityStateNote
BatchBatch inference supportedYes1Batch inference supported
Structured JSON outputresponse_schema JSON or enumYesresponse_schema JSON or enum
Tool / function callingFunction calling supportedYes1Function calling supported
StreamingSchemas work with streamGenerateContentYes4Schemas work with streamGenerateContent
MCP supportRemote MCP server (/mcp/generate)Yes5Remote MCP server (/mcp/generate)
Fine-tuningTuning on 3.5 Flash, 2.5 modelsYes6Tuning on 3.5 Flash, 2.5 models
Official SDKsPython, Go, Node.js, JavaYes4Python, Go, Node.js, Java
SLA published99.5% Gemini inference SLAYes799.5% Gemini inference SLA
EU / data residencyeu multi-region ML processingYes1eu multi-region ML processing
Free tierNo Gemini free tier on Vertex pricingNot published281No Gemini free tier on Vertex pricing
Open source / self-hostNo self-hosting option documentedNot published281No self-hosting option documented

Fit and safety

Watch out

  • text/x.enum approximates a choice API but returns one label with no per-option probability on the page we checked; calibration is yours to build.
  • Same pattern applies: deterministic rules own hard constraints; the model is advisory; fail closed on errors.

How it works

  1. Set response_schema plus response_mime_type "application/json" for schema-valid JSON, or "text/x.enum" to force one value from an enum (Google’s example classifies an instrument into one of five labels).
  2. Google warns JSON mode without a response_schema is only a strong hint and can return malformed JSON.
  3. Complex schemas (long property names, big enums, many optional properties) can fail with a 400 InvalidArgument error.

Compare

Put Gemini structured output (Vertex AI / Agent Platform) side by side with other APIs on price, limits and features. Open the comparison table →

Deciding between a decision model and a generative LLM? See Decision model vs LLM: when to use which.

SourcesFootnotes

  1. 1cloud.google.com/vertex-ai/generative-ai/docs/models/gemini/3-8-flashcloud.google.com/vertex-ai/generative-ai/docs/models/gemini/3-8-flashVerified 2026-10-16
  2. 2Google Cloud: Agent Platform generative AI pricingcloud.google.com/vertex-ai/generative-ai/pricingVerified 2026-11-11
  3. 3Google Cloud: Structured outputcloud.google.com/vertex-ai/generative-ai/docs/multimodal/control-generatVerified 2026-11-11
  4. 4docs.cloud.google.com/vertex-ai/generative-ai/docs/multimodal/control-gedocs.cloud.google.com/vertex-ai/generative-ai/docs/multimodal/control-geVerified 2026-10-16
  5. 5docs.cloud.google.com/gemini-enterprise-agent-platform/reference/mcpdocs.cloud.google.com/gemini-enterprise-agent-platform/reference/mcpVerified 2026-10-16
  6. 6cloud.google.com/vertex-ai/generative-ai/docs/models/tune-modelscloud.google.com/vertex-ai/generative-ai/docs/models/tune-modelsVerified 2026-10-16
  7. 7cloud.google.com/vertex-ai/generative-ai/slacloud.google.com/vertex-ai/generative-ai/slaVerified 2026-10-16
  8. 8cloud.google.com/free/docs/free-cloud-featurescloud.google.com/free/docs/free-cloud-featuresChecked 2026-10-16