Retries and idempotency
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.
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.
Retry Order
Finishing a partially completed order
Step 1. Retry all technical failures in one call. The request body is empty.
curl -X POST 'https://api.lumean.app/api/public/orders/{order}/items/retry-failed' \
-H 'Accept: application/json' \
-H 'X-API-KEY: YOUR_API_KEY'const res = await fetch('https://api.lumean.app/api/public/orders/{order}/items/retry-failed', {
method: 'POST',
headers: {
'Accept': 'application/json',
'X-API-KEY': 'YOUR_API_KEY',
},
});
const data = await res.json();
console.log(data);import requests
url = "https://api.lumean.app/api/public/orders/{order}/items/retry-failed"
headers = {
"Accept": "application/json",
"X-API-KEY": "YOUR_API_KEY",
}
res = requests.request("POST", url, headers=headers)
print(res.status_code, res.json())<?php
$ch = curl_init('https://api.lumean.app/api/public/orders/{order}/items/retry-failed');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Accept: application/json',
'X-API-KEY: YOUR_API_KEY',
]);
$res = curl_exec($ch);
curl_close($ch);
echo $res;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.
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.
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.
- What happened
No chunks were queued. Bulk retry
POST /orders/{order}/items/retry-failedreturned 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 samereasonwith code 400.- What to do right now
Check the order status before the call. Other bulk retry refusals differ by
reason. 409stitch_in_progressmeans the order is being stitched: wait and retry. 422generative_not_supportedmeans the task has no chunk retry, as withsfxandmusic. 422nothing_to_retrymeans there are no failed chunks.
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
- What happened
The order was not created and no money was charged. Body:
{"success": false, "message": "…", "reason": "content_blocked"}, with noerrors: the request fields are not the problem. Chunk retry and chunk regeneration return the samereason.- What to do right now
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.
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.
Do
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.
Don't
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.
# 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.
This page for AI
Updated 10/18/2026 · API version 1.0.0