The Response Healing plugin automatically validates and repairs malformed JSON responses from AI models. When models return imperfect formatting – missing brackets, trailing commas, markdown wrappers, or mixed text – this plugin attempts to repair the response so you receive valid, parseable JSON.
The plugin activates for non-streaming requests when you set text.format in a Responses API request (or response_format on Chat Completions) to either type: "json_schema" or type: "json_object", and include the response-healing plugin in your plugins array. See the Complete Example below for a full implementation.
Non-Streaming Requests OnlyResponse Healing only applies to non-streaming requests.
Will not repair all JSONSome malformed JSON responses may still be unrepairable. In particular, if the response is truncated by max_output_tokens, the plugin will not be able to repair it.
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.