Skip to main content
Every error the Nonhumans API returns follows the same predictable shape so your agent can handle failures consistently — whether that’s retrying a rate-limited request, surfacing a human-readable message, or logging a request_id for support. This page documents all HTTP status codes, error codes, and recommended handling patterns.

Error Response Shape

When a request fails, the API responds with an appropriate HTTP status code and a JSON body containing an error object:
Always log the request_id in your agent’s error handling. It’s the fastest way to get help from the Nonhumans team when debugging an unexpected failure.

HTTP Status Codes

Error Codes

Handling Errors in TypeScript

The TypeScript SDK throws a typed NonhumansError for any non-2xx response. You can inspect the code field to branch on specific error types:

Handling Errors in Python

The Python SDK raises a NonhumansError exception hierarchy. Catch the base class or specific subclasses:

Retrying Failed Requests

For transient errors (429, 500, 503), implement exponential backoff:
400, 401, 403, 404, 409, and 422 errors are not retryable — the same request will produce the same error. Fix the underlying issue before retrying.

Getting Help

If you encounter an unexpected 500 or behavior that doesn’t match this reference, contact support and include:
  • The full error response JSON
  • The request_id from the error object
  • The endpoint and HTTP method you called
  • A sanitized version of your request body (remove secrets)