# Paqshot errors and limits

> Rate limits, error codes and retries in the Paqshot API.

## Limits

- Generation: 50 images per hour.
- Other writes: 500 requests per 15 minutes. Reads: 2000 requests per 15 minutes.
- Maximum request size: 50 MB, product photo up to 10 MB.
- Higher limits are available on request.

## Error codes

| Status | When | What to do |
|---|---|---|
| 400 | Invalid parameter, e.g. `Invalid aspect ratio`, image too large, no image, template or prompt | Fix the request as the message says. |
| 402 | `Insufficient credits` | Your plan is used up. Top up or change your plan. |
| 429 | Rate limit exceeded | Wait for `retryAfter` and retry. |
| 503 | `Service temporarily unavailable`, `retryable: true` | The model is overloaded. Retry shortly. |
| 500 | Generation or save failed | Check your token and retry. If it keeps happening, contact us. |

## Error format

```json
{
  "success": false,
  "error": "Insufficient credits",
  "message": "You don't have enough credits to generate an image."
}
```

## Retries

Retry on 429 and 503 with an increasing delay (e.g. 5, 10, 20 seconds). Do not retry on 400 or 402.