Nbility logoNbility Docs

Search documentation

Search guides and API reference content

HTTP status codes and error response format

Error Response Format

All errors return a JSON body in the following format:

{
  "error": {
    "message": "A human-readable error description",
    "type": "error_type",
    "code": "error_code"
  }
}

HTTP Status Codes

StatusMeaning
200Success
400Bad Request — invalid parameters or request body
401Unauthorized — missing or invalid API key
403Forbidden — insufficient permissions
404Not Found — resource or endpoint does not exist
429Too Many Requests — rate limit exceeded or insufficient quota
500Internal Server Error — server or upstream error
503Service Unavailable — upstream service unavailable

Common Error Codes

CodeHTTP StatusDescription
invalid_request_body400Request body could not be parsed, check JSON format
invalid_request400Parameter validation failed
invalid_api_key401API key is missing or invalid
insufficient_quota429Account quota exhausted
upstream_error500Upstream provider returned an error
unmarshal_response_body_failed500Failed to parse upstream response

Async Task Status

For async tasks (video, image generation tasks), the task status field uses:

StatusDescription
IN_PROGRESSTask is being processed, poll again later
SUCCESSTask completed, result URL is available
FAILURETask failed, check the reason field

Rate Limiting

When the rate limit is exceeded, the response will include:

{
  "error": {
    "message": "Rate limit exceeded. Please try again later.",
    "type": "requests",
    "code": "rate_limit_exceeded"
  }
}

Note Implement exponential backoff when handling 429 errors to avoid repeated failures.