Set an output type when you need structured agent results
Answer: By default, agents produce plain text outputs. Use the output_type parameter for a particular type. Structured output asks models to adhere to a supplied JSON Schema.
Why it matters
By default, agents produce plain text outputs. Structured output is a feature supported by some model providers. You can use the output_type parameter.
A common choice is to use Pydantic objects. Models generate responses which adhere to a supplied JSON Schema. Dataclasses, lists, and TypedDict can also be wrapped.
When you pass an output_type, that tells the model to use structured outputs. You should therefore test the use of structured output. Specifying a JSON schema can introduce unknown effects on model task performance.
Default is textAgents produce plain text outputsoutput_typeUse the output_type parameterJSON SchemaAdhere to a supplied JSON Schema
See also
Claims
- id: C1 claim: Agents produce plain text outputs by default. source: S1 evidence: "By default, agents produce plain text"
- id: C2 claim: Passing output_type tells the model to use structured outputs. source: S1 evidence: "When you pass an
output_type, that tells the model to use"
- id: C3 claim: Structured output is meant to make model responses adhere to a supplied JSON Schema. source: S2 evidence: "responses which adhere to a supplied JSON Schema"
Sources
- [S1] Agents. OpenAI Agents SDK. https://github.com/openai/openai-agents-python/blob/main/docs/agents.md . License: MIT. Accessed 2026-11-22.
- [S2] Structured Output. Inspect AI. https://github.com/UKGovernmentBEIS/inspect_ai/blob/main/docs/structured.qmd . License: MIT. Accessed 2026-11-22.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: OpenAI Agents SDK agents.md (MIT); Inspect AI structured output docs (MIT). Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: OpenAI Agents SDK agents.md (MIT); Inspect AI structured output docs (MIT). Text was condensed and changed from the originals.
Cite this
iinventedlight. 2026. "Set an output type when you need structured agent results." iinventedlight Library, iil:note:q9qsann5, version of 2026-11-22. https://iinventedlight.com/library/notes/agents-sdk-output-types/. License: CC-BY-4.0.
@misc{iil_note_q9qsann5,
author = {{iinventedlight}},
title = {{Set an output type when you need structured agent results}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-22},
url = {https://iinventedlight.com/library/notes/agents-sdk-output-types/},
note = {Permanent ID iil:note:q9qsann5. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/agents-sdk-output-types.md.