Skip to main content
Every error is an RFC 9457 problem document with a stable error_code and, when there is a self-service fix, a resolve object that says who fixes it and where. Branch on error_code, not on the status alone: two 402s can mean “add a credential” and “stop, the plan needs attention”, and only one of them is worth retrying.

The envelope

That is a real response to GET /v1/entities?q=altman. detail names the endpoint to use and gives a worked example; a 422 from a bad parameter names the parameter in errors[]. Read it once, change the request, and send it once.

What to do by status

Two 402 codes deserve emphasis because they are the ones clients retry into the ground: spend_limit_exceeded and credits_depleted do not clear on their own, and every retry is another rejected request. Surface resolve.message to the person who owns the account and stop.

A retry wrapper

Retry only where the table says to, and let the server pace you.
The wrapper never retries a 4xx other than 429, so a billing state, a bad parameter, or a constructed slug surfaces as one clear exception instead of a burst of identical requests.

Parameters that cause avoidable errors

  • Omit optional parameters you do not need. A placeholder such as x, -, or __omit__ is a real filter value; it fails validation or matches nothing.
  • One name per concept. q is the free-text query wherever one exists (/v1/podcasts/search, /v1/companies, /v1/entities/search); /v1/entities lists and filters and takes no q. Sending q, query, and search together does not hedge; it trips validation.
  • Slugs come from responses. A constructed slug returns 404; resolve the name and take the slug from the result. See From an empty page to the data.