Structured outputs
General guidance for requesting, validating, and consuming machine-readable output.
Working scaffold: The supported formats, schema dialect, request parameters, and model limitations require verification for ONE.
Define the contract
Describe the output fields, types, required values, and allowed alternatives. Keep the schema as small as the application needs and explain how version changes are handled.
Validate before use
Even when a service or model is asked to follow a schema, validate the returned data before passing it to application logic. Handle refusals, incomplete responses, malformed data, and schema-version mismatches explicitly. Never use generated output as authorization for an action.
Implementation checklist
- Confirm the API option and supported schema features.
- Identify which models or modes support the requested format.
- Set sensible size and retry limits.
- Validate the result locally and report validation failures.
- Keep prompts, schemas, and outputs free of secrets unless the data handling terms permit their use.