Errors
Every response uses the same envelope, so success and failure are easy to branch on.
Response envelope
A success wraps its payload; a failure carries a human-readable message and, for validation errors, a list of field issues.
// success
{ "ok": true, "data": { /* ... */ } }
// failure
{
"ok": false,
"message": "Validation failed",
"issues": [{ "path": "url", "message": "Required" }]
}Validation
Request bodies are validated at the boundary. When a field is wrong, the response lists each problem with a stable path and a message, so you can map errors back to your inputs.
HTTP status codes
400— invalid body or parameters401— missing or invalid API key402— insufficient credit balance for a paid action403— your plan doesn't include API access404— unknown capability or resource502— an upstream provider failed