# Who reads the answer?

If a human reads the reply, plain text is fine. If code reads it, use structured output so parsing never breaks.

AI developers · Part 02: OpenAI API · Card 6 of 9 · Last updated 2026-10-13

## Analogy

HTML for people, JSON for machines. You wouldn't make your frontend regex-parse a paragraph to find the order total.

## In an agent

Inside an agent most outputs feed other steps, so structured output is the default and free text is the exception.

## Practice

### Flashcards

- **What is structured output?** A model reply forced to match a JSON schema, so code can parse it safely.

## Questions people ask

### How do I decide between free text and JSON output?

Ask who reads it. If a person reads it, free text is fine and often nicer. If code reads it, use structured output with a schema, so parsing never breaks. You would not make a frontend search a paragraph for an order total; do not make your agent's next step do it either.

### Why do agents mostly use structured output?

Inside an agent, most outputs are not shown to anyone. They choose a route, fill a tool's arguments or feed a report to another system. A schema guarantees the shape those steps expect. Free text is usually only the very last message, the answer the person actually reads.

## Related concepts

- [Structured output](https://studyvisually.com/learn/tech/ai-developers/openai-api/structured-output)
- [The OpenAI SDK](https://studyvisually.com/learn/tech/ai-developers/openai-api/openai-client)
- [Chat completion](https://studyvisually.com/learn/tech/ai-developers/openai-api/chat-completion)
- [Messages array](https://studyvisually.com/learn/tech/ai-developers/openai-api/messages-array)

Web page: https://studyvisually.com/learn/tech/ai-developers/openai-api/human-or-code-reader
Study this card in the app: https://studyvisually.com/app/learn?category=ai-developers&card=human-or-code-reader
