Skip to main content
Ask for JSON that follows a JSON Schema. Each endpoint uses its own field:

Tips

  • Keep schemas simple: objects, arrays, strings, numbers, booleans, enum, required, and additionalProperties: false. Check ranges and formats in your code.
  • If the model can’t honor a schema, the request fails with 400 upstream_invalid_request, and param names the field when known.
  • Set max_tokens high enough for the whole object. Output cut off by the limit isn’t valid JSON (finish_reason: "length" / stop_reason: "max_tokens").