Skip to main content
Free-form response particles being constrained into a structured object
Use a JSON schema when your application consumes the response.

Why structured outputs matter

Prompt instructions alone do not guarantee valid JSON. A schema makes the expected fields, types, required values, and allowed enums explicit. SERV forwards the schema to a compatible upstream provider and preserves the structured response format.
Validate the result at your application boundary. Handle refusals, truncation, invalid JSON, and invalid field values separately. Keep the schema small and use enums wherever the valid values are known. If the provider cannot honor the requested format, fail visibly rather than silently treating prose as valid application data.