REAL PAYMENTSBase (chain id 8453) · USDC payments have real value. Paid upstream failures are not automatically refunded.
Guide · Evals

How often does your model return valid JSON?

Structured output looks fine in the three examples you tried by hand. This guide checks seven real-looking classifier outputs against one schema and shows where each one fails — the kind of report you want before changing a prompt or a model.

The example, run through the real engine

This is the exact input and an excerpt of the report LLM Output Batch Validator returns for it. The full report also carries input and report SHA-256 hashes for verification.

Input
{
  "schema": {
    "type": "object",
    "required": [
      "intent",
      "confidence"
    ],
    "properties": {
      "intent": {
        "type": "string",
        "enum": [
          "refund",
          "shipping",
          "other"
        ]
      },
      "confidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      }
    },
    "additionalProperties": false
  },
  "outputs": [
    "{\"intent\": \"refund\", \"confidence\": 0.92}",
    "```json\n{\"intent\": \"shipping\", \"confidence\": 0.8}\n```",
    "{intent: 'refund', confidence: 0.7,}",
    "{\"intent\": \"Refund\", \"confidence\": 0.9}",
    "{\"intent\": \"other\", \"confidence\": 87}",
    "{\"intent\": \"refund\", \"confidence\": 0.6, \"reason\": \"late\"}",
    "I think this is about a refund."
  ]
}
Report excerpt: summary, items, topRules
{
  "summary": {
    "valid": 3,
    "invalid": 3,
    "unparseable": 1,
    "repaired": 2,
    "validRate": 0.4286
  },
  "items": [
    {
      "index": 0,
      "status": "valid",
      "repaired": false
    },
    {
      "index": 1,
      "status": "valid",
      "repaired": true
    },
    {
      "index": 2,
      "status": "valid",
      "repaired": true
    },
    {
      "index": 3,
      "status": "invalid",
      "repaired": false,
      "violations": [
        {
          "path": "/intent",
          "rule": "enum"
        }
      ]
    },
    {
      "index": 4,
      "status": "invalid",
      "repaired": false,
      "violations": [
        {
          "path": "/confidence",
          "rule": "maximum"
        }
      ]
    },
    {
      "index": 5,
      "status": "invalid",
      "repaired": false,
      "violations": [
        {
          "path": "/reason",
          "rule": "additionalProperties"
        }
      ]
    },
    {
      "index": 6,
      "status": "unparseable"
    }
  ],
  "topRules": [
    {
      "key": "additionalProperties",
      "count": 1
    },
    {
      "key": "enum",
      "count": 1
    },
    {
      "key": "maximum",
      "count": 1
    },
    {
      "key": "unparseable",
      "count": 1
    }
  ]
}
0.022223 USDC per call · paid with x402 on Base

No account is needed to pay: an agent with its own wallet answers the HTTP 402 quote, or a human approves each payment through the local Agent Spend bridge. Payment settles before delivery; there is no automatic refund.

01Three valid, two of them only after repair

The first output is valid as sent. The second is wrapped in a ```json fence and the third uses unquoted keys, single quotes and a trailing comma; both become valid after syntax repair and are marked repaired: true, so you can see how much your pipeline depends on repair.

02The failures a parser does not catch

Three outputs parse but break the contract: "Refund" with a capital R fails the enum at /intent, a confidence of 87 instead of 0.87 fails the maximum at /confidence, and an invented "reason" field fails additionalProperties. The last output is a sentence, not JSON, and is reported as unparseable rather than "repaired" into a string.

The valid rate here is 3 of 7 (0.4286). topRules and topPaths aggregate the batch, so with 200 outputs you see at once whether the problem is casing, scale or extra fields.

03Turn the report into a fix

Casing errors usually mean the enum belongs in the prompt or the provider's structured-output mode; scale errors mean the field needs a description with its range; extra fields mean additionalProperties: false should be in the schema you send to the model. Re-run the same batch after each change and compare the rate.

Questions

Which JSON Schema features are supported?

A bounded subset: type, enum, properties, required, items, additionalProperties, string length, item count and numeric bounds. No $ref, regex patterns, formats or composition.

Can I turn repair off?

Yes. Pass repair: false to measure what your model returns before any cleanup.

How many outputs per call?

Up to 200 outputs of up to 32 KiB each, within 128 KiB of total input.

What does it cost?

0.022223 USDC per call on Base mainnet, including the platform fee. The exact 402 quote is authoritative.

Next steps