Recommended endpoint
Minimal request
cURL example
Python example
Node.js example
Best practices
- Set
responseMimeTypeexplicitly for structured output - Put the expected field shape into the prompt when output requirements are strict
- Parse and validate JSON on the server before exposing it downstream
