Errors
Errors use standard HTTP status codes and a single, predictable JSON shape.
Error shape
{
"error": {
"code": "not_found",
"message": "Material not found.",
"status": 404
}
}Status codes
| Status | Code | Meaning |
|---|---|---|
400 | invalid_request | Malformed parameters or body. |
401 | missing_api_key / invalid_api_key | Authentication failed. |
404 | not_found | The resource does not exist. |
429 | rate_limited | Too many requests — back off and retry. |
500 | internal_error | Something went wrong on our end. |
Handling errors
Always branch on response.ok (or the status code) before parsing data. The error.code field is stable and safe to switch on; error.message is human-readable and
may change.