POST /v1/json-repair
Repair fenced JSON and trailing commas
Clean JSON copied from a code block before passing it into a workflow.
2 credits · USD $0.002
Input schema
{
"type": "object",
"properties": {
"text": {
"type": "string",
"maxLength": 50000,
"x-maxUtf8Bytes": 50000
}
},
"required": [
"text"
]
}Request
curl -X POST 'https://staging.callmint.dev/v1/json-repair' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Idempotency-Key: unique-request-001' \
-H 'Content-Type: application/json' \
-d '{"text":"{\"name\":\"CallMint\",}"}'Response result
{
"value": {
"name": "CallMint"
},
"transformations": [
"removed_trailing_commas"
]
}Limitations
Only removes complete JSON code fences and trailing commas outside strings. Does not infer missing quotes, values or braces. The text field is limited to 50 KB of UTF-8.
All enabled routes accept a JSON object of at most 60,000 UTF-8 bytes. String limits are also measured in UTF-8 bytes.