Skip to main content

Minimal request

cURL example

Python example

Node.js example

Best practices

  • Set responseMimeType explicitly 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