> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pikzels.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> The error body & what each error code means.

Every error returns this body. Handle errors by `code`, which may gain new values over time; `message` is a safe summary to show.

```json theme={"theme":"css-variables"}
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Public message"
  },
  "request_id": "18b2ad5e-2a9e-4d3f-b9a8-9f2a1e0b1234"
}
```

* `request_id` is also the `X-Request-Id` response header. Include it when contacting support.
* Validation errors add `error.details`, a list of field-level messages, each with a `message` & usually its `field`.
* A request that ends in an error is never charged. With `"async": true`, errors after the `202` arrive through the request's [status & result](https://docs.pikzels.com/async-requests.md).

## Error Codes

<table>
  <thead>
    <tr>
      <th>HTTP</th>
      <th>Code</th>
      <th>Typical Cause</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>400</td>
      <td>`VALIDATION_ERROR`</td>
      <td>A field is missing, unknown or invalid, or upscale does not accept the image's size or shape</td>
    </tr>

    <tr>
      <td>400</td>
      <td>`INVALID_IMAGE`</td>
      <td>Image cannot be fetched or decoded, or breaks the [image input rules](https://docs.pikzels.com/working-with-images.md)</td>
    </tr>

    <tr>
      <td>400</td>
      <td>`INVALID_PERSONA`</td>
      <td>A persona ID is not a valid UUID</td>
    </tr>

    <tr>
      <td>400</td>
      <td>`INVALID_STYLE`</td>
      <td>Style ID is not a valid UUID</td>
    </tr>

    <tr>
      <td>400</td>
      <td>`INVALID_AMOUNT`</td>
      <td>Amount is invalid or negative</td>
    </tr>

    <tr>
      <td>400</td>
      <td>`CONTENT_POLICY`</td>
      <td>Request blocked by content policy</td>
    </tr>

    <tr>
      <td>400</td>
      <td>`CANNOT_DELETE_PROCESSING`</td>
      <td>Persona or style is still processing</td>
    </tr>

    <tr>
      <td>400</td>
      <td>`SUPPORT_IMAGE_NOT_SUPPORTED`</td>
      <td>The [model](https://docs.pikzels.com/models.md) does not take support images</td>
    </tr>

    <tr>
      <td>400</td>
      <td>`MODEL_UNAVAILABLE`</td>
      <td>The model is not available for this endpoint</td>
    </tr>

    <tr>
      <td>400</td>
      <td>`PERSONA_NOT_SUPPORTED`</td>
      <td>The [model](https://docs.pikzels.com/models.md) does not take personas</td>
    </tr>

    <tr>
      <td>400</td>
      <td>`STYLE_NOT_SUPPORTED`</td>
      <td>The [model](https://docs.pikzels.com/models.md) does not take styles</td>
    </tr>

    <tr>
      <td>400</td>
      <td>`REQUEST_IN_PROGRESS`</td>
      <td>Result fetched before the request's status is COMPLETED</td>
    </tr>

    <tr>
      <td>401</td>
      <td>`MISSING_API_KEY`</td>
      <td>Missing `X-Api-Key` header</td>
    </tr>

    <tr>
      <td>401</td>
      <td>`INVALID_API_KEY_FORMAT`</td>
      <td>API key does not start with `pkz_`</td>
    </tr>

    <tr>
      <td>401</td>
      <td>`INVALID_API_KEY`</td>
      <td>API key is unknown</td>
    </tr>

    <tr>
      <td>401</td>
      <td>`API_KEY_INACTIVE`</td>
      <td>API key is disabled</td>
    </tr>

    <tr>
      <td>401</td>
      <td>`API_KEY_DELETED`</td>
      <td>API key was deleted</td>
    </tr>

    <tr>
      <td>402</td>
      <td>`INSUFFICIENT_CREDITS`</td>
      <td>API balance is too low, or the Smart Balance top-up cannot cover the request</td>
    </tr>

    <tr>
      <td>402</td>
      <td>`SMART_BALANCE_PAYMENT_FAILED`</td>
      <td>Smart Balance is paused after a failed top-up payment</td>
    </tr>

    <tr>
      <td>403</td>
      <td>`API_ACCESS_NOT_ENABLED`</td>
      <td>Account does not have API access</td>
    </tr>

    <tr>
      <td>403</td>
      <td>`ACCOUNT_SUSPENDED`</td>
      <td>Account is suspended</td>
    </tr>

    <tr>
      <td>403</td>
      <td>`BUILTIN_READ_ONLY`</td>
      <td>Built-in personas and styles cannot be updated or deleted</td>
    </tr>

    <tr>
      <td>404</td>
      <td>`PERSONA_NOT_FOUND`</td>
      <td>Persona ID is not one of your API personas or a built-in one, or it failed or was deleted</td>
    </tr>

    <tr>
      <td>404</td>
      <td>`STYLE_NOT_FOUND`</td>
      <td>Style ID is not one of your API styles or a built-in one, or it failed or was deleted</td>
    </tr>

    <tr>
      <td>404</td>
      <td>`NOT_FOUND`</td>
      <td>Requested resource or route was not found</td>
    </tr>

    <tr>
      <td>409</td>
      <td>`PERSONA_NOT_READY`</td>
      <td>Persona is still processing</td>
    </tr>

    <tr>
      <td>409</td>
      <td>`STYLE_NOT_READY`</td>
      <td>Style is still processing</td>
    </tr>

    <tr>
      <td>409</td>
      <td>`NAME_RESERVED`</td>
      <td>Persona or style name is reserved</td>
    </tr>

    <tr>
      <td>409</td>
      <td>`NAME_ALREADY_EXISTS`</td>
      <td>Persona or style name already in use</td>
    </tr>

    <tr>
      <td>409</td>
      <td>`CONFLICT`</td>
      <td>Request conflicts with existing state</td>
    </tr>

    <tr>
      <td>413</td>
      <td>`IMAGE_TOO_LARGE`</td>
      <td>Image or request body is over its [size limit](https://docs.pikzels.com/working-with-images.md)</td>
    </tr>

    <tr>
      <td>422</td>
      <td>`GENERATION_REJECTED`</td>
      <td>Request could not be processed</td>
    </tr>

    <tr>
      <td>429</td>
      <td>`TOO_MANY_REQUESTS`</td>
      <td>The account's limit of requests in flight is reached</td>
    </tr>

    <tr>
      <td>499</td>
      <td>`CANCELLED`</td>
      <td>Generation was cancelled</td>
    </tr>

    <tr>
      <td>500</td>
      <td>`GENERATION_FAILED`</td>
      <td>Generation request failed</td>
    </tr>

    <tr>
      <td>500</td>
      <td>`INTERNAL_ERROR`</td>
      <td>Unexpected server error</td>
    </tr>

    <tr>
      <td>503</td>
      <td>`SERVICE_UNDER_MAINTENANCE`</td>
      <td>A maintenance window is active. GET requests still work</td>
    </tr>

    <tr>
      <td>504</td>
      <td>`GENERATION_TIMEOUT`</td>
      <td>Thumbnail generation took over 300 seconds, or an input image download timed out</td>
    </tr>

    <tr>
      <td>504</td>
      <td>`SCORING_TIMEOUT`</td>
      <td>Scoring took over 120 seconds</td>
    </tr>

    <tr>
      <td>504</td>
      <td>`TITLE_TIMEOUT`</td>
      <td>Title generation took over 60 seconds</td>
    </tr>
  </tbody>
</table>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.