Structured Output — ML Junction docs

Use output.format.type=json_object for valid JSON without a schema, or json_schema for a validated object. A JSON Schema request automatically sets requirements.json_schema to required. Syntax healing is off by default so strict output never mutates silently.

{
  "model": "gpt-5.5",
  "messages": [
    {
      "role": "user",
      "content": "Extract the incident severity, summary, and action items."
    }
  ],
  "output": {
    "max_tokens": 2000,
    "format": {
      "type": "json_schema",
      "name": "incident",
      "strict": true,
      "schema": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "severity": {
            "type": "string",
            "enum": ["low", "medium", "high", "critical"]
          },
          "summary": {
            "type": "string"
          },
          "action_items": {
            "type": "array",
            "items": { "type": "string" }
          }
        },
        "required": ["severity", "summary", "action_items"]
      }
    },
    "validation": {
      "enabled": true,
      "heal_syntax": true,
      "model_repair": false,
      "max_repair_attempts": 1
    }
  },
  "requirements": {
    "json_schema": "required"
  }
}
Validation field · Default · Behavior
enabled · true · Validate the model output
heal_syntax · false · Opt in to repairing safe JSON syntax defects before schema validation
model_repair · false · Allow an additional model-assisted repair pass
max_repair_attempts · 1 · Zero through two repair attempts

When stream=true and the output format is not text, the gateway switches to buffered streaming so invalid partial JSON is not exposed as a successful response.

Canonical URL: https://mljunction.com/docs/structured-output