---
title: "Retries and idempotency"
url: https://lumean.app/tr/developers/docs/guide/retries
locale: tr
description: "POST /orders has no idempotency key. Which retry is free, which is billed as a new order, and what to do after a dropped connection."
updated: 2026-10-18
source_locale: en
sources: [post-orders, get-orders, post-orders-order-retry, post-orders-order-items-retry-failed, post-orders-order-items-item-retry, post-orders-order-items-item-regenerate, get-orders-order-items-item-text]
errors: [content-blocked, policy-flagged, max-attempts-reached, invalid-order-status]
spec_version: 1.0.0
---

# Retries and idempotency

`POST /orders` has no idempotency key. Two identical requests create two orders and hold funds
twice. The `Idempotency-Key` header is accepted only when issuing reseller gift codes
(`POST /reseller/codes`).

## Ways to retry

| Call | Accepts | What it does | Cost |
| --- | --- | --- | --- |
| `POST /orders/{order}/items/retry-failed` | all `failed` chunks of the order | queues them for retry in one call and responds `202` with a `queued` and `skipped` plan | free, from the held remainder |
| `POST /orders/{order}/items/{item}/retry` | one `failed` or `policy_flagged` chunk | retries the chunk, optionally with new `text` | free within `free_length` |
| `POST /orders/{order}/items/{item}/regenerate` | one `completed` chunk | redoes a finished chunk with new text | paid, like a new generation |
| `POST /orders/{order}/retry` | the whole order | creates a new order with the same parameters | paid, like creating an order |

The bulk retry and the chunk retry accept only an order in `partially_completed`. Regeneration
works on a finished chunk as long as the per-chunk tracks have not been deleted under retention.
The whole-order retry, by contrast, does not accept `partially_completed`.

## Retrying a whole order

`POST /orders/{order}/retry` does not resume the original order. It takes its parameters and
creates a new order, with a new `id`, a new funds hold, and a new check of the key's token
quota. This is a second order, and it is billed in full.

The original order must be in `completed` or `result_delivered` and have no `failed` chunks.
The request body is usually empty. Billing and response codes are the same as for creation:
`402 insufficient_balance` or `insufficient_allowance`, and `429` for the token quota. In explicit top-up
confirmation mode, `402 payg_topup_required` and `409 quote_mismatch` are added, and
`confirm_payg_topup` and `quote_token` are then sent after a `402` response.

Use it when you need another identical result, for example after the files were deleted under
retention. It does not finish a partially completed order: `partially_completed` is not
accepted, and the new order is billed in full.

### POST /orders/{order}/retry

Retry Order

Справочник: https://lumean.app/tr/developers/docs/api/post-orders-order-retry

## Finishing a partially completed order

**Step 1. Retry all technical failures in one call.** The request body is empty.

Сниппет: https://lumean.app/tr/developers/docs/api/post-orders-order-items-retry-failed

A `202` response means the plan was accepted and the retry runs in the background. `data`
contains `queued[]`, the chunks queued for retry, and `skipped[]` with a reason for each skipped
chunk:

| `reason` in `skipped[]` | What to do |
| --- | --- |
| `policy_flagged` | Retry the chunk on its own with corrected text (step 2) |
| `max_attempts_reached` | All 5 attempts are used up. Only a new order will help |
| `insufficient_funds` | The chunk's held remainder is used up. Only a new order will help |
| `active_retry_exists` | A retry is already running. Wait for it |
| `superseded` | The chunk already has a successful version. Nothing to do |

Next to `reason` comes `reason_label`, the same reason as text in the account's language. Don't
parse it in code: the wording changes along with the translations.

**Step 2. Retry each `policy_flagged` chunk on its own, with different text.**

```bash
curl -s "$BASE/orders/<ORDER>/items/<ITEM>/text" -H "X-API-KEY: $KEY"
curl -s -X POST "$BASE/orders/<ORDER>/items/<ITEM>/retry" -H "X-API-KEY: $KEY" \
  -H "Content-Type: application/json" -d '{"text": "<corrected text>"}'
```

`GET .../items/{item}/text` returns the chunk's text along with its length limits:

| Field | Meaning |
| --- | --- |
| `free_length` | The length within which a retry is free |
| `max_billable_length` | The longest text accepted with a surcharge |
| `max_raw_length` | The chunk capacity in `capacity_unit` units: `chars`, or `utf8_bytes` for Fish Audio. Longer text gets a `422` |
| `surcharge_applies` | `true` means length beyond `free_length` is charged a surcharge |
| `original_text_length` | Same as `free_length`, kept for compatibility |

> [!WARNING]
> Text longer than `free_length` but no longer than `max_billable_length` is accepted with a
> surcharge. Check `surcharge_applies` before sending so the charge does not come as a surprise.

For ElevenLabs orders, each attempt rejected by the content policy keeps a small fixed fee out
of the refunded funds. See [Limits and the 429 code](/developers/docs/guide/limits).

**Step 3. Wait for the result.** A bulk retry has no synchronous result. Poll
`GET /orders/{order}/items` or listen for the `bulk_retry.completed` event.

### 422 · `invalid_order_status` — invalid_order_status — order status does not allow this

| Что произошло | Что делать |
| --- | --- |
| No chunks were queued. Bulk retry `POST /orders/{order}/items/retry-failed` returned 422 `{"success": false, "message": "…", "reason": "invalid_order_status"}`. Cancelling an order (`POST /orders/{order}/cancel`) and retrying an order (`POST /orders/{order}/retry`) return the same `reason` with code 400. | Check the order status before the call. Other bulk retry refusals differ by `reason`. 409 `stitch_in_progress` means the order is being stitched: wait and retry. 422 `generative_not_supported` means the task has no chunk retry, as with `sfx` and `music`. 422 `nothing_to_retry` means there are no failed chunks. |

`Retry-After`: нет. Разбор: https://lumean.app/tr/developers/docs/errors/invalid-order-status

## Retrying and regenerating a chunk

`retry` accepts only a failed chunk: `failed` or `policy_flagged`. The `text` field is
optional; without it, the previous text is retried. A retry is free within the length already
paid for (`free_length`), and longer text is charged a surcharge.

`regenerate` accepts only a finished chunk (`completed`), and `text` is required. Regeneration
is always paid: it is billed again, for the length of the new text. The cost counts toward the
key's token quota, and if the quota is exceeded the call returns `429`.

Neither works for `sfx` and `music`, because their generation is one-shot. Regeneration is also
unavailable for `voice_search`, because the search result does not change.

The `can_retry` and `can_regenerate` flags reflect only the chunk status. They don't check the
task type or exhausted attempts, so a call can be refused even with `can_retry: true`, for
example with a `422` and `max_attempts_reached`.

## The `content_blocked` rejection

### 422 · `content_blocked` — content_blocked — text fragment is blocked

| Что произошло | Что делать |
| --- | --- |
| The order was not created and no money was charged. Body: `{"success": false, "message": "…", "reason": "content_blocked"}`, with no `errors`: the request fields are not the problem. Chunk retry and chunk regeneration return the same `reason`. | A retry with the same text gets the same refusal. Edit the fragment that failed the check. Matching works per chunk, so it is enough to fix that one fragment instead of rewriting the whole text. The API does not report why the text was blocked. The response has no such field. |

`Retry-After`: нет. Разбор: https://lumean.app/tr/developers/docs/errors/content-blocked

The text was already rejected by the content policy and is on the global blocklist. Matching is
done per chunk and by exact text. The same request returns the same `422`, and a chunk retry or
regeneration with that text gets the same rejection.

The rejection happens before the order is created, so no funds are held. The content policy
cooldown counts something else: orders that ended with an error because of rejected chunks. It
is described in [Limits and the 429 code](/developers/docs/guide/limits).

**Правильно**

Edit the problematic fragment. Matching is done per chunk, so in a long text it is enough to fix
one fragment instead of rewriting everything.

**Неправильно**

Retry the same text with exponential backoff. Every retry returns the same `422`, and the order
is never created.

The API does not return the reason for the block in any field.

## Dropped connection after `POST /orders`

If no response arrived, the order may or may not have been created. A blind retry in this
situation creates duplicates and double charges.

Before retrying, check the `GET /orders` list. It has no time filter: only `status`,
`template_id`, `task_type[]`, `page`, and `per_page` are available. Orders come newest first by
`created_at`, so the first page is enough; compare `created_at` yourself. The list can lag
behind order creation by up to 15 seconds, so don't check it immediately after the drop.

To make the order easier to find, put your own request identifier in the `name` field. It only
affects the download file name, and it lets you find the order in the list unambiguously.

```bash
# at creation
-d '{"template_id": "…", "input_text": "…", "name": "job-2026-09-04-0041"}'
# after a drop, before retrying: look for this name on the first page of the list
curl -s "$BASE/orders?per_page=20" -H "X-API-KEY: $KEY"
```

The server does not check `name` for duplicates: this is your client's own convention. A
subscription to `private-orders.{userId}` also helps: the `created` event arrives even if the
HTTP response was lost.

---

- Bu sayfa tarayıcıda: https://lumean.app/tr/developers/docs/guide/retries
- Makine tarafından okunabilir tam başvuru: https://api.lumean.app/docs/llm.md
