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

# Limits and retry handling

> Request windows, account concurrency, event streams, and safe recovery across API, CLI, and MCP.

These limits apply to the hosted Agent API, including requests made through the CLI and MCP server. Credits, request limits, and concurrent jobs are separate controls.

## Request limits

Each bucket is checked both per API key and per owning account. Multiple keys do not multiply the account allowance. Windows are fixed 60-second periods; unused capacity does not carry forward.

| Requests                                                                                                                 | Limit              | Shared scope                                   |
| ------------------------------------------------------------------------------------------------------------------------ | ------------------ | ---------------------------------------------- |
| Authenticated POST requests, including uploads, execution submissions, and cancellation                                  | 10 per 60 seconds  | All these POST endpoints                       |
| Authenticated GET requests, including capabilities, balance, execution state, conversations, and opening an event stream | 120 per 60 seconds | All these GET endpoints except asset downloads |
| GET asset downloads                                                                                                      | 20 per 60 seconds  | Asset download endpoints                       |
| DELETE requests                                                                                                          | 120 per 60 seconds | DELETE endpoints                               |

A connection to an event stream counts as one request; individual events are not separate HTTP requests. Other application surfaces can have their own limits. This is not a throughput or burst guarantee.

## Concurrent work

* Up to **two active managed image jobs per account**, including sprite-sheet jobs.
* Up to **four open execution event streams per API key**. Close disconnected or unused streams before opening more.
* A closed stream does not cancel a job or release its credit hold. Check execution state and reconnect to the same execution.

Keep your own queue. Start with one active job, especially when another application shares the account. Two simultaneous submissions can still exceed a request window when uploads, polling, and other callers share the same account.

## Response headers

Errors include `X-Request-ID`, `Cache-Control: no-store`, and `Pragma: no-cache`. Keep the request ID for support.

The current public contract does **not** promise `Retry-After`, remaining-request headers, or reset-time headers. Do not depend on their presence. If a future response includes `Retry-After`, honor it; otherwise use capped exponential backoff with jitter. A practical client policy starts at one second, doubles between attempts, caps at 60 seconds, and stops after a bounded number of retries. That is client guidance, not a server completion deadline.

## Decide what to do

For `/v1/execute`, distinguish synchronous HTTP errors from later execution failures. A `202` or open SSE stream does not guarantee admission. Non-retryable admission errors are returned in canonical execution state and `done`; credit and quota failures do not return submit-time `402`.

| Signal                                                       | Next action                                                                                                                                           |
| ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `429`, `rate_limited`                                        | Back off. For a known execution, resume or read its state.                                                                                            |
| Execution `failed` with `error.reason: insufficient_credits` | Add credits before deliberately creating a new attempt. Replaying the failed execution's key returns that same failure.                               |
| Execution `failed` with `error.reason: quota_exceeded`       | Resolve the account quota before creating a new attempt.                                                                                              |
| Execution still `queued`                                     | Keep following it. Retryable admission failures, including active-job limits, are retried by the service without exposing those errors to the caller. |
| `409`, `conflict`                                            | Compare the idempotency key and original request. Do not silently invent a new key.                                                                   |
| Lost response or temporary service error                     | Read saved execution state first. If no ID was received, replay the exact saved request with its original key.                                        |

Keep the same uploaded `input_asset_id` on a replay. Uploading the file again creates a different request, even when the local file is unchanged. A terminal failure is a completed attempt: submitting a replacement is a new operation that can incur a new charge.

See [idempotency and retries](/agent-api/idempotency-and-retries), [error details](/agent-api/errors), and the [multiple-image queue](/agent-api/multiple-images).
