You can force models to return valid JSON, optionally conforming to a specific schema.Documentation Index
Fetch the complete documentation index at: https://docs.auriko.ai/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- An Auriko API key
- Python 3.10+ with the OpenAI SDK (
pip install openai) or the auriko SDK (pip install auriko)- OR Node.js 18+ with the OpenAI SDK (
npm install openai) or@auriko/sdk(npm install @auriko/sdk)
- OR Node.js 18+ with the OpenAI SDK (
Choose a response format
Auriko supports three response format types:| Type | Description | Use case |
|---|---|---|
text | Default. Model returns plain text. | General chat, creative writing |
json_object | Model returns valid JSON. No schema enforcement. | Flexible JSON extraction |
json_schema | Model returns JSON matching a provided schema. | Typed data extraction, API responses |
json_schema and json_object are separate capabilities. json_schema has broader model support. Most Claude models support json_schema but not json_object. Claude Sonnet 4 and Opus 4 don’t support either mode.
If you request an unsupported mode, Auriko returns a 400 with a suggested alternative.
Check per-model support on the models page or via the Directory API.
json_schema appears as Structured Output, json_object as JSON Mode.Return JSON
To return any JSON output, setresponse_format to json_object:
json_schema instead.
Enforce schema
You can enforce a specific JSON structure by providing a schema:json_schema object requires a name field. The schema field accepts a standard JSON Schema definition.
Auriko automatically routes to providers that support your requested format. If no provider supports it, you get a clear error with suggestions.
Resources
Tool calling
Call functions from LLM responses
Routing options
Optimize for cost, latency, or throughput
Error handling
Handle errors and retries
Browse models
See which models support structured output and JSON mode