code, which may gain new values over time; message is a safe summary to show.
request_idis also theX-Request-Idresponse header. Include it when contacting support.- Validation errors add
error.details, a list of field-level messages, each with amessage& usually itsfield. - A request that ends in an error is never charged. With
"async": true, errors after the202arrive through the request’s status & result.
Error Codes
| HTTP | Code | Typical Cause |
|---|---|---|
| 400 | VALIDATION_ERROR | A field is missing, unknown or invalid, or upscale does not accept the image’s size or shape |
| 400 | INVALID_IMAGE | Image cannot be fetched or decoded, or breaks the image input rules |
| 400 | INVALID_PERSONA | A persona ID is not a valid UUID |
| 400 | INVALID_STYLE | Style ID is not a valid UUID |
| 400 | INVALID_AMOUNT | Amount is invalid or negative |
| 400 | CONTENT_POLICY | Request blocked by content policy |
| 400 | CANNOT_DELETE_PROCESSING | Persona or style is still processing |
| 400 | SUPPORT_IMAGE_NOT_SUPPORTED | The model does not take support images |
| 400 | MODEL_UNAVAILABLE | The model is not available for this endpoint |
| 400 | PERSONA_NOT_SUPPORTED | The model does not take personas |
| 400 | STYLE_NOT_SUPPORTED | The model does not take styles |
| 400 | REQUEST_IN_PROGRESS | Result fetched before the request’s status is COMPLETED |
| 401 | MISSING_API_KEY | Missing X-Api-Key header |
| 401 | INVALID_API_KEY_FORMAT | API key does not start with pkz_ |
| 401 | INVALID_API_KEY | API key is unknown |
| 401 | API_KEY_INACTIVE | API key is disabled |
| 401 | API_KEY_DELETED | API key was deleted |
| 402 | INSUFFICIENT_CREDITS | API balance is too low, or the Smart Balance top-up cannot cover the request |
| 402 | SMART_BALANCE_PAYMENT_FAILED | Smart Balance is paused after a failed top-up payment |
| 403 | API_ACCESS_NOT_ENABLED | Account does not have API access |
| 403 | ACCOUNT_SUSPENDED | Account is suspended |
| 403 | BUILTIN_READ_ONLY | Built-in personas and styles cannot be updated or deleted |
| 404 | PERSONA_NOT_FOUND | Persona ID is not one of your API personas or a built-in one, or it failed or was deleted |
| 404 | STYLE_NOT_FOUND | Style ID is not one of your API styles or a built-in one, or it failed or was deleted |
| 404 | NOT_FOUND | Requested resource or route was not found |
| 409 | PERSONA_NOT_READY | Persona is still processing |
| 409 | STYLE_NOT_READY | Style is still processing |
| 409 | NAME_RESERVED | Persona or style name is reserved |
| 409 | NAME_ALREADY_EXISTS | Persona or style name already in use |
| 409 | CONFLICT | Request conflicts with existing state |
| 413 | IMAGE_TOO_LARGE | Image or request body is over its size limit |
| 422 | GENERATION_REJECTED | Request could not be processed |
| 429 | TOO_MANY_REQUESTS | The account’s limit of requests in flight is reached |
| 499 | CANCELLED | Generation was cancelled |
| 500 | GENERATION_FAILED | Generation request failed |
| 500 | INTERNAL_ERROR | Unexpected server error |
| 503 | SERVICE_UNDER_MAINTENANCE | A maintenance window is active. GET requests still work |
| 504 | GENERATION_TIMEOUT | Thumbnail generation took over 300 seconds, or an input image download timed out |
| 504 | SCORING_TIMEOUT | Scoring took over 120 seconds |
| 504 | TITLE_TIMEOUT | Title generation took over 60 seconds |
