verboo code

Guide

Structured output

Request predictable JSON for direct integration with your code.

On this page

Use JSON Schema

cURL
curl https://code.verboo.ai/router/v1/chat/completions \
  -H "Authorization: Bearer $VERBOO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "<MODEL_ID>",
    "messages": [{"role": "user", "content": "Extract: Ana, ana@example.com"}],
    "response_format": {"type": "json_schema", "json_schema": {
      "name": "contact", "strict": true, "schema": {
        "type": "object",
        "properties": {"name": {"type": "string"}, "email": {"type": "string"}},
        "required": ["name", "email"], "additionalProperties": false
      }
    }}
  }'

Parse message.content as JSON and validate it again in your backend before persisting data or taking actions.

Available modes

TypeBehavior
json_schemaConstrains output to the supplied schema when supported.
json_objectRequests valid JSON without enforcing a complete structure.

Plan availability

Structured output may require plan enablement. If unavailable, the API returns 403 with code structured_output_not_enabled.

Validation and fallback

  • Use small, explicit schemas with additionalProperties: false.
  • Validate output server-side even with strict: true.
  • Handle refusal, truncation, and empty content before parsing.