Prerequisites
- An Arbytra API key
- Python 3.10+ with the OpenAI SDK (
pip install openai) or the arbytra SDK (pip install arbytra)- OR Node.js 18+ with the OpenAI SDK (
npm install openai) or@arbytra/sdk(npm install @arbytra/sdk)
- OR Node.js 18+ with the OpenAI SDK (
Choose a response format
Arbytra supports three response format types: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, Arbytra returns a 400 with a suggested alternative.
Check per-model support on the models page or via the Model directory.
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.
Arbytra 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