Structured output
Require a Codex turn to return JSON that conforms to a schema.
Pass outputSchema to thread.run() when a caller needs machine-readable output. The SDK forwards a JSON Schema to the Codex CLI.
The final response is serialized according to the requested schema. Keep schemas small and explicit, and validate the result at your application boundary.
Aggiornato il 31 ago 2026