Skip to content
Lumean

Realtime: connecting and subscribing

Order, voice clone and gift code statuses over WebSocket. Connecting, authorizing subscriptions, channels and events.

Order statuses arrive over WebSocket. The protocol is Pusher-compatible, so pusher-js and Laravel Echo both work. Lumean has no SDK of its own. Subscribing is free and does not consume the key's rate windows: only REST requests do.

Connection

ParameterValue
Host / port / schemews.lumean.app / 443 / wss (TLS required)
App key7c4dd881d8116ac76fe89aff71d8c2ff
clusterempty string (the server has no clusters)
Transports['ws', 'wss']
Auth endpointPOST https://api.lumean.app/api/public/broadcasting/auth
import Pusher from 'pusher-js'

const pusher = new Pusher('7c4dd881d8116ac76fe89aff71d8c2ff', {
  wsHost: 'ws.lumean.app', wsPort: 443, wssPort: 443,
  forceTLS: true, enabledTransports: ['ws', 'wss'], cluster: '',
  channelAuthorization: {
    endpoint: 'https://api.lumean.app/api/public/broadcasting/auth',
    headers: { 'X-API-KEY': process.env.LUMEAN_API_KEY },
  },
})

const ch = pusher.subscribe('private-orders.42')      // 42 = user_id of the key owner
ch.bind('status.changed', (e) => console.log(e.previous_status, '→', e.new_status))

The app key is public. It identifies the application, not you, so there is no need to hide it. The only secret is X-API-KEY. It is sent only to the auth endpoint and never appears in WebSocket frames.

Laravel Echo takes the same parameters (authEndpoint and auth.headers), but it adds the private- prefix itself: echo.private('orders.42').

Subscription authorization

A private channel requires a signature. The library gets it for you:

  1. It takes the socket_id from the pusher:connection_established frame.
  2. It sends socket_id and channel_name, with the private- prefix, to POST /broadcasting/auth with the X-API-KEY header.
  3. It puts the auth string from the response into the pusher:subscribe frame.

The response uses the Pusher format, outside the standard API envelope: it contains only auth, with no success or data. The required scope depends on the channel; see the Scope column in the channel table.

CodeCauseWhat to do
401The key is missing, unknown, deactivated or expiredRetrying will not help. Check the key with GET /key
403The key lacks this channel's scope, or the channel belongs to another user. The owner is checked against the user_id in the channel nameTake user_id from GET /user, not from your own configuration
429The auth endpoint's own limit of 1200 requests per minute was exceededDo not resubscribe in a loop: one connection carries all channels

Channels

ChannelWhat it sendsEventsParameterScope
private-orders.{userId}all orders on the account15numeric id of the key owner from GET /userorders.read
private-order.task.{orderId}a single order9order UUID (data.id from POST /orders)orders.read
private-chunks.preview.{userId}result of a background chunking preview1the same numeric userIdorders.read
private-cartesia-voice-clones.{userId}Cartesia voice cloning progress1the same numeric userIdvoices.read
private-fishaudio-voice-clones.{userId}Fish Audio voice cloning progress1the same numeric userIdvoices.read
private-giftcodes.{userId}gift codes and reseller status4the same numeric userIdreseller.read
GET/userGet profile of API key owner

Get profile of API key owner

ChannelEvents
private-orders.{userId}created, status.changed, item.status.changed, progress, bulk_retry.completed, paragraph_regenerate.completed, order.queue.updated, voice_search.queue.updated, renamed, stitch.changed, policy_cooldown.applied, policy_cooldown.cleared, archive.progress, archive.ready, archive.failed
private-order.task.{orderId}the same, except created, archive.* and policy_cooldown.*
private-chunks.preview.{userId}ready with the fields status, preview_id, summary, page
private-cartesia-voice-clones.{userId}, private-fishaudio-voice-clones.{userId}voice_clone.updated
private-giftcodes.{userId}issued, status.changed, reseller.status.changed, reseller.application.status.changed

The ready event carries no chunks. Fetch them with GET /orders/chunks/preview/{previewId}?page=1.

voice_clone.updated arrives on every clone status change: pending → cloning → ready or failed. Without WebSocket, read the status from the clone list.

Gift code events contain only code masks. The full code is returned by GET /reseller/codes and GET /reseller/codes/{uuid}.

Detect that an order is done by status.changed (previous_status → new_status), not by progress counters. The last chunk and the terminal status are different moments.

The progress event on two channels

private-orders.{userId}private-order.task.{orderId}
Identifierorder_id (UUID)task_id (the same order UUID)
Counterscompleted / totalchunks_done / chunks_total
Fraction donepercent, an integer 0..100progress, a number such as 42.5
Also—duration_seconds, eta_seconds, eta_confidence, timestamp

The event name is the same, but the fields differ. The only way to tell the events apart is the channel, so give each channel its own handler.

The progress and chunks_done fields on private-order.task.{orderId} are kept for compatibility and do not reflect actual progress. Take the fraction done from percent and completed/total on private-orders.{userId}. eta_seconds gives the time remaining. When eta_confidence is low, show it with a “≈” sign.

Both events count only the original chunks. Retries and regenerations are not included, so a reworked order may never reach 100.

Event names in Echo and pusher-js

Do

Echo, with a leading dot: echo.private('orders.42').listen('.status.changed', fn). pusher-js, without the dot: pusher.subscribe('private-orders.42').bind('status.changed', fn).

Don't

Pass a dotted name to pusher-js: bind('.status.changed'). There is no error and the connection stays alive, but no events arrive.

Without the dot, Echo prepends the Laravel event namespace to the name. A leading dot turns that off.

What events contain

  • created and status.changed carry an order snapshot without the chunk list. Instead they include items_summary: { total, by_status }. GET /orders/{order} returns the chunks.
  • Files arrive as metadata. POST /storage/url returns the download link.
  • renamed and archive.* cannot be triggered with an API key: renaming and archives exist only in the web dashboard. The event arrives if the owner did it there.
  • policy_cooldown.applied reports a cooldown before a request gets a 429. The cooldown is applied when a failed task is finalized, not in response to a request. Take the end time from retry_at (ISO-8601): the event goes through a queue, and retry_after can go stale on the way.
  • order.queue.updated reports that the order moved in the worker queue (every service except voice_search): { order_id, queue_position, queue_wait_seconds }. It arrives only when the position changed, at most once every ~2 s; moves between positions of 100 and above are not sent. When a worker takes the task or the order is cancelled, one frame arrives with queue_position: null. queue_wait_seconds is always null. After a reconnect, re-read GET /orders/{order}: a missed frame is not repeated.
429policy_cooldown_activepolicy_cooldown_active — order creation paused
What happened

Creating new orders is paused entirely, not just for the disputed text. The body has retry_after (seconds) and retry_at (ISO-8601), and the Retry-After header is set.

What to do right now

Waiting alone does not solve the problem. Fragments rejected by the policy go to the blocklist, and the same text gets a 422 content_blocked after the pause. Each new order that fails the policy again adds to the counter, and the next pause is longer. Edit the text. The API does not say what failed the check: the chunk comes back whole, and you have to rephrase the whole fragment. Any order that completes at least partially resets both the counter and the pause length.

Open the code page

WebSocket or polling

For a single short order, polling GET /orders/{order} is simpler. A connection and event handling pay off with a stream of orders or when a user watches the progress. Even with a subscription, REST stays the source of truth, because an event may not arrive. Waiting for an order without WebSocket is covered in The asynchronous order model.

This page for AI

Open .mdllm.md

Updated 11/06/2026 · API version 1.0.0