request_id when contacting support or correlating API responses with logs and webhook events.
Authentication and account errors
| HTTP status | Code | Recommended handling |
|---|---|---|
401 | missing_api_key | Send Authorization: Bearer <api_key>. |
401 | invalid_api_key | Check the key value and header format. |
401 | api_key_expired | Rotate to a non-expired key. |
401 | api_key_inactive | Reactivate or rotate the key. |
401 | api_key_revoked | Rotate to a new key. |
403 | api_key_environment_mismatch | Use a key from the correct environment. |
403 | email_not_verified | Verify the account email before using the API. |
403 | account_suspended | Contact support. |
403 | api_access_not_enabled | Ensure the account meets live API credit requirements. |
403 | payment_risk_restricted | Resolve the account billing or risk restriction. |
Request validation errors
| HTTP status | Code | Recommended handling |
|---|---|---|
400 | invalid_payload | Fix the JSON body before retrying. |
400 | invalid_idempotency_key | Send a valid Idempotency-Key header. |
400 | invalid_webhook_url | Use a public HTTPS webhook URL. |
422 | content_policy_violation | Remove unsupported content from the request. |
Source image item errors
Source image validation happens during item processing. These codes appear as itemerror_code values in enhancement status responses and webhooks, not as the create response for a valid enhancement request.
| Code | Recommended handling |
|---|---|
invalid_source_url | Use a public HTTP or HTTPS image URL that passes target validation. |
source_url_dns_failed | Fix the source image hostname or DNS configuration. |
source_url_redirect_limit | Reduce redirects to 3 or fewer. |
source_url_unreachable | Make the image URL reachable by the server. |
download_timeout | Improve source hosting reliability or retry later. |
file_too_large | Use an image under 10 MB. |
unsupported_file_type | Use JPEG, PNG, or WebP with a correct MIME type. |
Enhancement and credit errors
| HTTP status | Code | Recommended handling |
|---|---|---|
402 | insufficient_api_credits | Add paid API-eligible credits or reduce batch size. |
409 | idempotency_conflict | Use the same body for the same key, or create a new key for a new batch. |
429 | too_many_active_enhancements | Wait for an active batch to finish. |
429 | rate_limit_exceeded | Wait for Retry-After before retrying. |
404 | enhancement_not_found | Check the enhancement id and key environment. |
400 | invalid_enhancement_id | Send a valid UUID enhancement id. |
System errors
| HTTP status | Code | Recommended handling |
|---|---|---|
500 | rate_limit_unavailable | Retry later. |
503 | queue_unavailable | Retry later; reserved credits are refunded when queueing fails. |
500 | unexpected | Retry later or contact support with request_id. |
Retry guidance
| Situation | Retry? | How |
|---|---|---|
| Network timeout while creating an enhancement | Yes | Retry with the same Idempotency-Key and exact same body. |
429 rate_limit_exceeded | Yes | Wait for Retry-After. |
too_many_active_enhancements | Yes | Wait until an active enhancement reaches a terminal status. |
| Provider or storage failure on an item | Yes | Retry later with a new batch and new idempotency key. |
invalid_payload, invalid_source_url, unsupported_file_type | No | Fix the input first. |
insufficient_api_credits | No | Add paid credits or reduce batch size first. |
