Skip to main content
Errors come back as JSON with a status code and a message:
Unlike OpenRouter, the body has no top-level user_id and no provider or routing details in error.metadata; when nemonist knows the kind of error, error.metadata holds only error_type. A model the key’s allowed models exclude is 403, where OpenRouter answers 404. See Migrating from OpenRouter.

Rate limits

A 429 carries the wait in its headers, when it knows one:
  • Retry-After: seconds to wait. nemonist’s own limits (open streams, requests a minute) send it, and so does a provider that sends it.
  • X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset: the window’s limit, what is left, and when it resets, in milliseconds since the epoch (not seconds). Endpoints with a fixed per-key limit, such as the datasets endpoints (30 a minute), send these and no Retry-After, the same as OpenRouter.
When neither is present, back off as below.

Retries

Retry 408, 429 and 5xx with exponential backoff and jitter. Do not retry 400, 401, 402, 403 or 413 unchanged. Every endpoint’s own errors are listed in the API Reference.