All examples

Structured data extraction

Extract typed JSON objects from unstructured text using schema validation and JSON mode. Define your shape once, get predictable output every time.

JSON mode

Enforce valid JSON output at the token level. No stray text, no markdown fences — just parseable objects returned directly from the model.

Schema validation

Supply a Zod schema or JSON Schema definition. The model respects field names, types, and constraints — missing fields trigger automatic retries.

POST/v1/extract/structured
{
  "model": "meridian-3",
  "messages": [
    {
      "role": "user",
      "content": "Invoice #1042 — $3,200 due May 12"
    }
  ],
  "response_format": {
    "type": "json_schema",
    "json_schema": {
      "name": "invoice",
      "schema": {
        "type": "object",
        "properties": {
          "invoice_number": { "type": "string" },
          "amount_due": { "type": "number" },
          "due_date": { "type": "string" }
        },
        "required": ["invoice_number", "amount_due", "due_date"]
      }
    }
  }
}

Response

{
  "invoice_number": "1042",
  "amount_due": 3200,
  "due_date": "2026-05-12"
}