Skip to content

Structured output

POST
/v1beta/models/gemini-2.5-pro:generateContent
  • Use JSON Schema to constrain the model's structured output
  • Define the format via generationConfig.responseMimeType and responseSchema
  • Suitable for extraction, classification, list generation, and other scenarios
  • Official docs: Structured output

Authorizations

bearer
Type
HTTP (bearer)

Request Body

application/json
object
object[]
Required
object
Required

Generation configuration

Responses

Success

application/json

Playground

Authorization
Body

Samples