Structured Outputs
Structured Outputs is a feature that guarantees responses from language models adhere strictly to your supplied JSON schema. Langbase supports Structured Outputs in pipe and agent primitives. You can read our API reference for pipes and agents.
Structured Outputs offer benefits such as:
- Boost reliability: By enforcing schema, the chances of runtime errors are reduced.
- Eliminate post-processing: Responses are already shaped exactly as you expect, no need for manual parsing.
- Explicit refusals: If the model can’t fulfill a request, it returns a clear, standardized error or refusal—making handling edge cases easier and safer.
Learn how to use Structured Outputs in Langbase.