Skip to main content
Response Healing is an automatic post-processing step that fixes malformed JSON in model responses. When you request structured output via response_format, some providers occasionally return slightly broken JSON — Response Healing silently repairs it before returning the response to your application.

When It Activates

Response Healing only activates when both conditions are met:
  1. response_format is set to json_schema or json_object
  2. The response body is valid UTF-8 but contains fixable JSON syntax errors
It does not activate for plain text responses, streaming responses, or responses that are correctly-formed JSON.

What Gets Fixed

What Cannot Be Fixed

Enabling Response Healing

Response Healing is enabled by default when using structured output formats. You can also enable it explicitly via the plugins array:

Detecting Healed Responses

When a response was repaired, the response includes a flag in the metadata:

Limitations

  • Non-streaming only — Response Healing requires the full response body to be available before repair can be attempted. It is not applied to streaming responses.
  • Will not repair all JSON — Truncated output (e.g. from hitting max_tokens) cannot be completed.
  • Schema validation — Healing fixes syntax errors, not semantic errors. A healed response still needs to pass your own schema validation.