Google announces support for JSON Schema and complete property ordering in the Gemini API.

Today, we're announcing improvements to structured output in the Gemini API, with expanded support for JSON Schema and better adherence to object structure in the output environment.
Systematic results enable AI models to generate responses that ensure adherence to a specific schema, which is important for operations such as data extraction and data quantification. It is also important for the communication of agents: The output of one agent becomes the input of another person, enabling multi-agent systems to interact without translation layers.
Extended extension json Schema
We have now added JSON Schema support to all supported Gemini Models. This enables libraries like Pydantic (Python) or ZOD (JavaScript / Traycript) to work out of the box with the Gemini API. It builds on the existing Gemini API object schema support based on OpenApi 3.0 for structured output and calling.
This update also adds support for JONSON SCHOMA keywords, including:
- anyfs conditional structures (unions)
- $Ref is repeated schemas
- minimum and maximum numerical constraints
- Additional pronyeries with type: 'null'
- prefixiems of the living array
Complete logistics
One of the key updates we've made is that the API now maintains the same order as the order of the keys in the schema. This is supported on all Gemini 2.5 models and beyond and works on the OpenAI compatibility API. You can see this in action in this content thread using Pydantic:



