Open History to see the last commit
Structured output returns a typed object from the model. Pick the page for the shape you need:
- Overview: what structured output is, which schema libraries work, provider support, and which page to read.
- One-Shot Extraction: one prompt in, one typed object out. Use it when you do not need streaming or chat history.
- Streaming UIs:
useChat({ outputSchema })fills a UI field by field withpartialandfinal. - Multi-Turn Chat: each completed run adds a typed response to the message history. The
dataof itsstructured-outputpart has the type of your schema. - With Tools: use
outputSchemawith the agent loop, including server-tool approvals and client tools.
Need a coding agent in a sandbox that reads files and then returns a typed object? See Harness Agents.