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

# Errors

> Understand API error responses and retry behavior.

# Errors

Errors use one shape.

```json theme={null}
{
  "error": {
    "code": "invalid_request",
    "message": "duration_seconds must be between 5 and 120.",
    "request_id": "req_abc123"
  }
}
```

## Common codes

| Code                    | Meaning                                                     |
| ----------------------- | ----------------------------------------------------------- |
| `invalid_request`       | The request body, parameters, or uploaded file are invalid. |
| `authentication_failed` | The API key is missing, invalid, or expired.                |
| `permission_denied`     | The key does not have access to the requested resource.     |
| `not_found`             | The requested resource does not exist.                      |
| `rate_limited`          | The request exceeded the current rate limit.                |
| `provider_unavailable`  | A generation provider is temporarily unavailable.           |
| `internal_error`        | An unexpected error occurred.                               |

## Retrying requests

Retry transient `429`, `502`, `503`, and `504` responses with exponential backoff.

For billable creation endpoints, always include an `Idempotency-Key` header before retrying.
