> ## 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 |
| - | - | - |
| Input upload POST requests (`/v1/input-assets` and its upload steps) | 10 per 60 seconds | Upload endpoints; also shared with browser video uploads |
| Other authenticated POST requests, including quotes, execution submissions, and cancellation | 10 per 60 seconds | All other POST endpoints; also shared with browser video submissions |
| 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 **two active Video admissions per account**, additionally subject to shared service capacity. This is a separate Video allowance, not two extra image slots.
* Up to **four open image/sprite execution event streams per API key**, or **three Video 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 image and sprite requests to `/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` for those requests.

**Video is different:** accepting a quote can immediately return `402 insufficient_credits` or `429 too_many_active_jobs`. A successful Video acceptance is `202` JSON. See [Video errors and recovery](/agent-api/video-jobs#common-errors). The table below describes image/sprite admission.

| 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).

## Prompt lengths

Image prompts, Video quote prompts, and sprite `options.animation_prompt` each have a **4,000-character limit**, including spaces and line breaks. Sprite animation instructions must be nonblank and cannot be combined with a preset `action`. See [sprite options](/agent-api/sprite-sheet#animation-options) and [Video settings](/agent-api/video-settings).


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