Errors & retries
When something goes wrong you get an HTTP error code and a body like the one below. Check code in your code — the message is for people to read.
{
"error": {
"code": "USER_BUSY", // what went wrong — use this in your code
"message": "User u_1042 already has a …" // a readable explanation
}
}
Busy? Just try again
When you get a "busy" answer, nothing was charged, so it's always safe to send the request again.
| You get | What it means | What to do |
|---|---|---|
409 USER_BUSY | This user already has a request running. The error also has its job_id. | Tell the user their last photos are still being made. Send the new request once that one finishes. |
429 BUSINESS_BUSY | 50 of your users are already making photos. | Wait the number of seconds in the Retry-After header, then try again. |
429 TOO_MANY_REQUESTS | You're calling too often — usually checking the same job more than once every 10 seconds. | Wait the seconds in Retry-After, then check once every 15 seconds. |
503 TRY_LATER | We couldn't start it right now. | Wait 30 seconds and try again. If it happens again, wait longer (60 s, then 120 s). |
Other errors
| Code | What it means | What to do |
|---|---|---|
401 INVALID_API_KEY | The key is missing or wrong. | Check the X-Api-Key header. Did you rotate the key? |
400 INVALID_REQUEST | A field is missing or wrong. | The message says which field. |
402 NO_IMAGES_LEFT | Not enough photos left on your plan. | Buy a plan in your dashboard, or ask for fewer photos. |
404 MODEL_NOT_FOUND | That model_id isn't one of your models. | Get the right id from GET /models. |
400 GENDER_MISMATCH | The gender doesn't match the model. | Send the model's own gender. |
404 JOB_NOT_FOUND | No such job_id, or it's older than 30 days. | Check the id. |
403 ACCOUNT_BLOCKED | Your account is blocked. | Contact us. |
When a request fails
These show up in the error of a finished request (status failed). Nothing is charged.
| Code | What it means |
|---|---|
WRONG_TYPE | Clothing was sent to /products, or something that isn't clothing was sent to /clothing. |
CONTENT_BLOCKED | We couldn't use the photos — no clear item, different items in different photos, or content we don't make. |
GENERATION_FAILED | No photo could be made. Please try again. |
