Skip to content
Lumean

The asynchronous order model

POST /orders responds right away, and the result arrives later. Order types, statuses, chunks, and how to find out an order is ready.

POST /orders does not generate anything by itself. It validates the request, holds funds and the key's token quota, queues the task, and responds with 201 and status created. The result arrives later, usually within minutes.

The creation response

FieldValue in the 201 response
idThe order UUID. Every later call goes to /orders/{order}/…
statuscreated
resultnull. The response has no files[] or service_files[]
total_chunksThe number of chunks the server split the text into. 0 means the text has not been split yet
completed_chunks, progress_percent0
eta_seconds, eta_atnull. An estimate exists only while the order is in_progress
price_unitsThe amount held, in LMC minor units. On a chunk, the field with the same name holds tokens

Store the id. Without it, the only way to find the order is through the list.

Order types

POST /orders takes either template_id or task_type, and one of them is required. A template sets the service and all its settings, so text-to-speech orders are created only from a template. An order without a template works where the service code matches the task type.

task_typeHow it is createdWhere the parameters goFiles in result.files[]
ttsonly with template_idinput_text at the request root1 merged track; subtitles go to service_files[]
sfxwithout a templatetask_data.text, plus duration_seconds, prompt_influence, loop, output_format1
musicwithout a templatetask_data.prompt, plus n_variants (1..4), music_length_ms, lyrics_text, force_instrumentalone file per variant, not merged
voice_searchwithout a templateaudio in input_files, task_data.top (1..50)none: the result is a list of similar voices
curl -s -X POST "$BASE/orders" -H "X-API-KEY: $KEY" -H "Content-Type: application/json" -d '{
  "task_type": "music",
  "task_data": { "prompt": "Lo-fi hip hop, calm, rainy night", "n_variants": 3,
                 "music_length_ms": 30000, "force_instrumental": true }
}'

The sound description goes in text for SFX and in prompt for Music. Put the keys at the root of task_data. GET /templates/config-options shows the same parameters inside sfx_settings and music_settings sections, but those wrappers do not belong in a request. With a wrapper, the required key ends up inside it, so a template or task_data gets a 422 saying the field is required. In an order's config_override, the wrapper is dropped without an error.

These orders are priced by the number of generations, not by length. sfx and voice_search cost one rate per order, and music costs the rate times n_variants. A thirty-second track costs the same as a ten-second one.

The server fills in missing keys from the service's default_config and keeps the values you sent. That is why an order's saved task_data can contain keys that were not in the request. Set skip_service_defaults: true to turn this off.

An API key can create only the four types in the table. The other TaskType values — image, txt2img, remix, image_edit, and voice_clone — pass validation, but the order gets a 422 with reason: service_not_found. cartesia_dub and elevenlabs_dub are dubs of a finished order: POST /orders doesn't create them either, only POST /orders/{order}/dub does (see Dubbing). The GET /orders?task_type[]=… filter accepts all eleven values.

422service_not_foundservice_not_found — service not found
What happened

The order was not created. The response is a 422 with reason: "service_not_found" and no errors. The request passed field validation, but no service was found for it.

What to do right now

Send only the types that an API key can create.

Open the code page

Order statuses

Value
created
pending
in_progress
completed
result_delivered
failed
compensated
cancelled
partially_completed

Terminal statuses: completed, result_delivered, failed, compensated, cancelled. An order in one of them no longer changes, so there is no need to keep polling it. File retention, 7 days by default, starts when the order reaches a terminal status.

Non-terminal statuses: created, pending, in_progress, partially_completed.

Order lifecycleNine order statuses with the terminal ones marked.runningcreatedpendingin_progresscompletedterminalresult_deliveredterminalpartially_completednot terminalfailedterminalcompensatedterminalcancelledterminal
StatusTerminalWhat to do
created, pendingnoWait. The order can still be cancelled in these statuses
in_progressnoWait and watch completed_chunks and progress_percent. It cannot be cancelled
partially_completednoProcessing has ended and some chunks failed. Finished files can be downloaded. Retry the failed chunks or cancel the order
completedyesGet links for result.files[] with POST /storage/url
result_deliveredyesSame as completed: the files are available until retention ends
failed, compensatedyesNo files. result may contain only user_message, a human-readable reason for the failure. Create a new order
cancelledyesThe order was cancelled with POST /orders/{order}/cancel. From created or pending, funds and quota are returned in full. From partially_completed, finished chunks stay paid and the funds for failed ones are returned

failed and compensated both mean the order ended with an error. An ordinary execution failure ends in compensated, and by then the charge has already been returned. user_message is translated for display to a person, so do not branch on it in code.

Cancellation is accepted in created, pending, and partially_completed. In any other status, POST /orders/{order}/cancel returns 400.

Partially completed orders

An order moves to partially_completed when some of its chunks fail. The finished chunks are kept, and the failed ones wait for a decision: a retry or a cancellation. This status is not terminal. A handler that treats everything except created, pending, and in_progress as final will leave such an order unfinished, even though it can still reach completed.

202policy_flaggedpolicy_flagged — chunk rejected by the content policy
What happened

This is not an HTTP error. The code comes as the value of OrderItem.status and as the reason in the skipped[] array of the 202 response to POST /orders/{order}/items/retry-failed. The order then moves to partially_completed. This status is not final: finished chunks stay in place, and rejected ones wait for action.

What to do right now

Fetch the current chunk text, rephrase the disputed fragment, and retry that chunk on its own with the new text. The API does not report the rejection reason, so edit at your discretion. Retry limits: no more than 5 attempts, and chunk retry is not available for sfx and music. GET /orders/{order}/items/{item}/text returns the length limits: within free_length a retry is free, up to max_billable_length it comes with a surcharge. POST /orders/{order}/retry does not fit here: it does not accept orders in partially_completed.

Open the code page

Retries and idempotency explains how to retry failed chunks. POST /orders/{order}/retry does not help here: it does not accept partially_completed and creates a new paid order.

Chunks

Before generation, the server splits the text into chunks (OrderItem), and the work is done chunk by chunk. In this documentation, "chunk" and "fragment" mean the same thing. The API fields are chunk_index, total_chunks, and completed_chunks.

Chunk statuses differ from order statuses:

Chunk statusMeaning
pendingWaiting to be processed
processingBeing processed
completedDone
failedTechnical error
policy_flaggedRejected by the content policy

Chunks come in items[] on every order, both in GET /orders/{order} and in the GET /orders list. GET /orders/{order}/items returns them on their own. Retries and regenerations are stored as separate records with the same chunk_index and a parent_item_id reference, so the length of items[] differs from total_chunks. Track progress with completed_chunks and total_chunks: they count only the original chunks.

Finding out an order is ready

Do

Subscribe to private-order.task.{orderId} (one order) or private-orders.{userId} (all orders on the account) and listen for status.changed, item.status.changed, and progress. Each event arrives at the moment of the transition, with no extra requests.

Don't

Poll GET /orders/{order} every second. That is dozens of extra requests per order, they use up the key's request rate limit, and you still get up to a second of delay.

Polling works too, especially for short orders. Use an interval of 2–5 seconds, since every request counts toward the key's rate limit. eta_seconds and eta_at help pick the pause. One GET /orders?status=in_progress request checks several orders at once. Cap the number of attempts: failed is an answer too.

A bulk chunk retry works the same way. A 202 response means the plan was accepted. The result arrives later, as a bulk_retry.completed event or in GET /orders/{order}/items.

Three channels relate to orders: private-orders.{userId}, private-order.task.{orderId}, and private-chunks.preview.{userId}. The other channels and the event format are described in Realtime.

Result files

result.files[] holds file paths, not links. POST /storage/url returns a download link. Request it soon after completed, because files are kept for a limited time. Files, links and storage explains how to check that a file is still available.

This page for AI

Open .mdllm.md

Updated 11/06/2026 · API version 1.0.0