# Rate limits, daily limits and sizes

> Per-minute limits by class (read, write, expensive), daily limits, headers and backoff with sample code.

Source: https://flow-marketing.org/en/help/api-rate-limits · Question: How many requests may I send and what do I do on a 429?

The API counts requests per account, mode and class in one-minute windows. Every response to an authenticated, valid call carries RateLimit headers. On a 429 rate_limited, Retry-After and retry_after_s say how long to wait; some daily limits omit retry_after_s, then Retry-After applies.

On top come daily limits for new videos, AI fills, test renders, uploads and documents, plus size limits for requests and files. An error caused by a limit never costs anything.

## Requests per minute {#ratenbegrenzung}

Counted per account, mode (test or live) and class. A window lasts 60 seconds from the first request in it; then a new one starts.

| Class | Test | Live | Which calls |
| --- | --- | --- | --- |
| read | 120 | 600 | almost every `GET`, plus `POST /live/agents/{id}/estimate` |
| write | 30 | 120 | `POST`/`PATCH`/`PUT`/`DELETE` without expensive work, including `POST /estimates` |
| expensive | 20 | 60 | `POST /videos/{id}/render`, `POST /videos` with `brief` or `render: true`, `POST /videos/from-document` with `render: true`, `POST /documents/{id}/complete`, `POST /speech`, `POST /voices/design`, `POST /media`, `POST /webhooks/{id}/test`, delivery retry |

## Headers {#kopfzeilen}

On a 429 rate_limited the error body repeats the waiting time as retry_after_s. Not every code has the field: daily_upload_limit gives the waiting time only in the header, document_grenze in neither header nor body.

| Header | Meaning |
| --- | --- |
| `RateLimit-Limit` | requests allowed in the current window (for this call’s class) |
| `RateLimit-Remaining` | requests left in the window |
| `RateLimit-Reset` | seconds until the window restarts |
| `Retry-After` | seconds to wait – on most 429 and 503 and some 409 (`idempotency_in_progress`: 2, `upload_busy`: 5). If the header is missing, wait exponentially (1, 2, 4 … s) |
| `Request-Id` | id of the request, also `request_id` in the error body |

**Response 429**

```http
HTTP/1.1 429 Too Many Requests
Content-Type: application/problem+json; charset=utf-8
Request-Id: req_9fK2mQ1xZp7LmN0p
Flow-Version: 2026-11-20
RateLimit-Limit: 20
RateLimit-Remaining: 0
RateLimit-Reset: 41
Retry-After: 41

{
  "type": "https://flow-marketing.org/entwickler/doku/fehler#rate_limited",
  "title": "Too many requests.",
  "status": 429,
  "code": "rate_limited",
  "detail": "Limit of 20 requests per minute reached. Nothing was executed or charged – retry after 41 s.",
  "request_id": "req_9fK2mQ1xZp7LmN0p",
  "doc_url": "https://flow-marketing.org/entwickler/doku/fehler#rate_limited",
  "retry_after_s": 41
}
```

## Daily limits {#tageslimits}

“24 h” means the last 24 hours from now, not the calendar day.

| What | Limit | Code (status) | Note |
| --- | --- | --- | --- |
| New videos (previews) | 500 per 24 h and account | `daily_preview_limit` (429) | test and live together, `retry_after_s: 3600` |
| AI fills from `brief` | 300 per 24 h and account | `daily_ai_limit` (429) | sending `fields` directly still works |
| Test renders | 25 per 24 h and account | `daily_test_limit` (429) | correction renders do not count |
| Uploads | 200 per UTC day | `daily_upload_limit` (429) | `Retry-After` until midnight UTC |
| Documents (`POST /documents`) | 30 per 24 h and account | `document_grenze` (429) | no `Retry-After` and no `retry_after_s` |
| Concurrent upload checks | 3 per account | `upload_concurrency` (429) | complete again after 5 s |
| Active keys | 25 per account | `too_many_keys` (409) | revoke old keys |
| Webhooks | 10 per account | `too_many_webhooks` (409) |  |
| Waiting long polls (`?wait=`) | 10 per account | – | beyond that the API answers at once without waiting |

## Concurrent renders {#gleichzeitige-renders}

At most one render runs per video. A second start for the same video ends with 409 video_busy. You may render different videos in parallel; the limits then come from the “expensive” class, your balance and your monthly limit.

> **Note:** There is no fixed per-plan limit on concurrent renders today. The code concurrency_limit is reserved and not sent at the moment. If it appears later, handle it like a 429: wait, then retry.

## Sizes and lengths {#groessen}

| What | Limit | Error |
| --- | --- | --- |
| JSON body of a request | 64 KB | `413 payload_too_large` |
| Content-Type on `POST`/`PATCH`/`PUT` | `application/json` (a type other than JSON is rejected) | `415 unsupported_media_type` |
| `brief` | 2,000 characters | `422 validation_failed` (`too_long`) |
| Length of a video | 180 seconds | `422` |
| `Idempotency-Key` | 200 characters, no control characters | `400 invalid_parameter` |
| Image or logo (upload) | 15 MB, at most 50 megapixels; PNG, JPEG, WebP – no SVG | `upload_size`, `upload_image_too_large`, `upload_type` |
| Document (upload) | 50 MB | `upload_size` |
| Upload link (PUT) | valid for 15 minutes | – |
| Download links of finished renders | valid for 24 hours | get new ones with `GET /renders/{id}` |
| Entries in `errors[]` | at most 50 | – |
| MCP for developers (`/api/turbo/mcp`) | 120 messages per minute and IP, batches up to 20, body 64 KB | JSON-RPC error |

> **Note:** The JSON body may be at most 64 KB (also x-limits.body_max_bytes in the OpenAPI file). Never send files in the JSON body – use POST /uploads.

## Recommended backoff {#backoff}

1. On 429 rate_limited and 503: wait as long as Retry-After (or retry_after_s) says, if present – otherwise exponentially as for 500.
2. On 409 idempotency_in_progress or upload_busy: wait briefly (2 or 5 seconds) and repeat the same call with the same Idempotency-Key.
3. On 500 without Retry-After: wait exponentially – 1, 2, 4, 8 seconds, at most 60 – plus some jitter. At most 5 attempts.
4. Only retry POST and PATCH automatically when they carry an Idempotency-Key.
5. Do not retry daily limits (daily_*) in a loop. Stop and continue later.
6. Do not retry any other 4xx: fix the request first.

**JavaScript**

```js
const BASE = 'https://flow-marketing.org/api/turbo/v1'
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
const TRANSIENT = new Set(['rate_limited', 'upload_concurrency', 'idempotency_in_progress', 'upload_busy'])

export async function flowFetch(path, { method = 'GET', body, idempotencyKey, maxAttempts = 5 } = {}) {
  // POST/PATCH are only repeated with an Idempotency-Key – otherwise a retry could create a second video.
  const retryable = method === 'GET' || Boolean(idempotencyKey)
  for (let attempt = 1; ; attempt++) {
    const res = await fetch(BASE + path, {
      method,
      headers: {
        Authorization: `Bearer ${process.env.FLOW_API_KEY}`,
        'Content-Type': 'application/json',
        ...(idempotencyKey ? { 'Idempotency-Key': idempotencyKey } : {}),
      },
      body: body === undefined ? undefined : JSON.stringify(body),
    })
    if (res.ok) return res.json()
    const problem = await res.json().catch(() => ({}))
    const transient = TRANSIENT.has(problem.code) || res.status === 500 || res.status === 503
    if (!transient || !retryable || attempt >= maxAttempts) {
      throw Object.assign(new Error(`${res.status} ${problem.code}: ${problem.detail}`), { status: res.status, problem })
    }
    const retryAfter = Number(res.headers.get('retry-after') ?? problem.retry_after_s)
    const backoff = Math.min(60, 2 ** (attempt - 1))
    const seconds = Number.isFinite(retryAfter) && retryAfter > 0 ? retryAfter : backoff
    await sleep(seconds * 1000 + Math.random() * 250)
  }
}
```

**Python**

```python
import os, random, time, requests

BASE = "https://flow-marketing.org/api/turbo/v1"
TRANSIENT = {"rate_limited", "upload_concurrency", "idempotency_in_progress", "upload_busy"}

def flow_request(method, path, body=None, idempotency_key=None, max_attempts=5):
    headers = {"Authorization": f"Bearer {os.environ['FLOW_API_KEY']}"}
    if idempotency_key:
        headers["Idempotency-Key"] = idempotency_key
    # POST/PATCH are only repeated with an Idempotency-Key.
    retryable = method == "GET" or idempotency_key is not None
    for attempt in range(1, max_attempts + 1):
        r = requests.request(method, BASE + path, headers=headers, json=body, timeout=40)
        if r.ok:
            return r.json()
        try:
            problem = r.json()
        except ValueError:
            problem = {}
        code = problem.get("code")
        transient = code in TRANSIENT or r.status_code in (500, 503)
        if not (transient and retryable) or attempt == max_attempts:
            raise RuntimeError(f"{r.status_code} {code}: {problem.get('detail')} (request_id {problem.get('request_id')})")
        retry_after = r.headers.get("Retry-After") or problem.get("retry_after_s")
        seconds = float(retry_after) if retry_after else min(60, 2 ** (attempt - 1))
        time.sleep(seconds + random.random() / 4)
```

## See also

- [Idempotency](https://flow-marketing.org/en/help/api-idempotency)
- [Error codes](https://flow-marketing.org/en/help/api-error-codes)
- [OpenAPI file](https://flow-marketing.org/api/turbo/v1/openapi.json)
