Every API sometimes says no. A good integration reads the error, waits when it should, and tells the user something useful. Here is how to handle Jenvu API errors.
Read the status code
The Jenvu API returns standard HTTP status codes with a short, plain message:
- 400: the request is not valid. Check the JSON and the model ID.
- 401: the API key is missing or wrong. Send it as
Authorization: Bearer YOUR_JENVU_KEY. - 402: your balance is too low. Top up in the dashboard.
- 429: too many requests at once. Slow down and try again.
- 5xx: a temporary problem on our side. Retry after a short wait.
Retry with a growing wait
For 429 and 5xx errors, retry with exponential backoff: wait 1 second, then 2, then 4, and stop after a few attempts. Add a little random delay so many clients don't retry at the same moment.
Don't retry what won't change
A 400 or 401 will fail again with the same request. Fix the request or the key instead of retrying.
Keep users informed
Show a short message such as "Busy right now, trying again…" instead of a raw error. Log the status code and time on your side, so you can spot patterns later.
Spread out heavy jobs
If you process many items, send them in small batches with a short pause between them. It is faster overall than hitting the limit and waiting.