{
    "asyncapi": "2.6.0",
    "info": {
        "title": "Lumean Public API (WebSocket)",
        "version": "1.0.0",
        "description": "## Public WebSocket API (X-API-KEY) Real-time события заказов и клонов голоса Cartesia и Fish Audio для клиентов Public API. Протокол — Pusher-совместимый,\nподходят стандартные библиотеки: **pusher-js** или **Laravel Echo**. ### Подключение | Параметр | Значение |\n| --- | --- |\n| Хост / порт / схема | `ws.lumean.app` / `443` / `wss` (TLS обязателен) |\n| App key (публичный) | `7c4dd881d8116ac76fe89aff71d8c2ff` |\n| Auth-эндпоинт | `POST https://api.lumean.app/api/public/broadcasting/auth` | ```js\nimport 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': 'ВАШ_API_КЛЮЧ' }, },\n}); const ch = pusher.subscribe('private-orders.42'); // 42 = ID владельца ключа\nch.bind('status.changed', (e) => console.log(e.new_status, e.order.id));\n``` ### Авторизация подписки Приватные каналы (`private-*`) требуют авторизации: клиентская библиотека\nавтоматически шлёт `POST https://api.lumean.app/api/public/broadcasting/auth` с заголовком\n`X-API-KEY` и подставляет полученный токен сама. Право ключа зависит от канала:\nканалы заказов и превью чанков — `orders.read`, клоны голоса Cartesia и Fish Audio\n(`private-cartesia-voice-clones.{userId}`, `private-fishaudio-voice-clones.{userId}`) — `voices.read`, подарочные коды реселлера\n(`private-giftcodes.{userId}`) — `reseller.read`. Подписаться можно\nтолько на свои каналы (иначе `403`). > Имена событий: в pusher-js — без ведущей точки (`bind('status.changed')`), в\n> Laravel Echo — с точкой (`.listen('.status.changed')`). Каналы, события и схемы payload — в секциях ниже."
    },
    "servers": {
        "public": {
            "url": "ws.lumean.app:443",
            "protocol": "wss",
            "description": "WebSocket-сервер, совместимый с протоколом Pusher.",
            "security": [
                {
                    "apiKey": []
                }
            ],
            "x-app-key": "7c4dd881d8116ac76fe89aff71d8c2ff"
        }
    },
    "channels": {
        "private-orders.{userId}": {
            "description": "События по всем вашим заказам сразу. `{userId}` — числовой идентификатор владельца ключа, его отдаёт `GET /user`.",
            "parameters": {
                "userId": {
                    "schema": {
                        "type": "integer"
                    }
                }
            },
            "bindings": {
                "ws": {
                    "method": "GET",
                    "bindingVersion": "latest"
                }
            },
            "subscribe": {
                "operationId": "private_orders_userId_subscribe",
                "message": {
                    "oneOf": [
                        {
                            "$ref": "#/components/messages/private_orders_userId__policy_cooldown_applied"
                        },
                        {
                            "$ref": "#/components/messages/private_orders_userId__paragraph_regenerate_completed"
                        },
                        {
                            "$ref": "#/components/messages/private_orders_userId__order_queue_updated"
                        },
                        {
                            "$ref": "#/components/messages/private_orders_userId__created"
                        },
                        {
                            "$ref": "#/components/messages/private_orders_userId__progress"
                        },
                        {
                            "$ref": "#/components/messages/private_orders_userId__voice_search_queue_updated"
                        },
                        {
                            "$ref": "#/components/messages/private_orders_userId__bulk_retry_completed"
                        },
                        {
                            "$ref": "#/components/messages/private_orders_userId__renamed"
                        },
                        {
                            "$ref": "#/components/messages/private_orders_userId__status_changed"
                        },
                        {
                            "$ref": "#/components/messages/private_orders_userId__archive_ready"
                        },
                        {
                            "$ref": "#/components/messages/private_orders_userId__item_status_changed"
                        },
                        {
                            "$ref": "#/components/messages/private_orders_userId__policy_cooldown_cleared"
                        },
                        {
                            "$ref": "#/components/messages/private_orders_userId__archive_failed"
                        },
                        {
                            "$ref": "#/components/messages/private_orders_userId__stitch_changed"
                        },
                        {
                            "$ref": "#/components/messages/private_orders_userId__archive_progress"
                        }
                    ]
                }
            }
        },
        "private-order.task.{orderId}": {
            "description": "События одного заказа. `{orderId}` — UUID из ответа `POST /orders`. Чужой заказ недоступен: авторизация подписки вернёт `403`.",
            "parameters": {
                "orderId": {
                    "schema": {
                        "type": "string",
                        "format": "uuid"
                    }
                }
            },
            "bindings": {
                "ws": {
                    "method": "GET",
                    "bindingVersion": "latest"
                }
            },
            "subscribe": {
                "operationId": "private_order_task_orderId_subscribe",
                "message": {
                    "oneOf": [
                        {
                            "$ref": "#/components/messages/private_order_task_orderId__paragraph_regenerate_completed"
                        },
                        {
                            "$ref": "#/components/messages/private_order_task_orderId__order_queue_updated"
                        },
                        {
                            "$ref": "#/components/messages/private_order_task_orderId__voice_search_queue_updated"
                        },
                        {
                            "$ref": "#/components/messages/private_order_task_orderId__bulk_retry_completed"
                        },
                        {
                            "$ref": "#/components/messages/private_order_task_orderId__renamed"
                        },
                        {
                            "$ref": "#/components/messages/private_order_task_orderId__status_changed"
                        },
                        {
                            "$ref": "#/components/messages/private_order_task_orderId__item_status_changed"
                        },
                        {
                            "$ref": "#/components/messages/private_order_task_orderId__stitch_changed"
                        },
                        {
                            "$ref": "#/components/messages/private_order_task_orderId__progress"
                        }
                    ]
                }
            }
        },
        "private-chunks.preview.{userId}": {
            "description": "Результат фонового расчёта превью разбиения текста на чанки. Приходит для больших текстов, отправленных в `POST /orders/chunks/preview`. `{userId}` — числовой идентификатор владельца ключа, его отдаёт `GET /user`.",
            "parameters": {
                "userId": {
                    "schema": {
                        "type": "integer"
                    }
                }
            },
            "bindings": {
                "ws": {
                    "method": "GET",
                    "bindingVersion": "latest"
                }
            },
            "subscribe": {
                "operationId": "private_chunks_preview_userId_subscribe",
                "message": {
                    "$ref": "#/components/messages/private_chunks_preview_userId__ready"
                }
            }
        },
        "private-cartesia-voice-clones.{userId}": {
            "description": "Ход клонирования ваших голосов Cartesia: событие на каждое изменение статуса клона, созданного через `POST /voices/cartesia/clones` (или в кабинете). `{userId}` — числовой идентификатор владельца ключа, его отдаёт `GET /user`. Право ключа — `voices.read`.",
            "parameters": {
                "userId": {
                    "schema": {
                        "type": "integer"
                    }
                }
            },
            "bindings": {
                "ws": {
                    "method": "GET",
                    "bindingVersion": "latest"
                }
            },
            "subscribe": {
                "operationId": "private_cartesia_voice_clones_userId_subscribe",
                "message": {
                    "$ref": "#/components/messages/private_cartesia_voice_clones_userId__voice_clone_updated"
                }
            }
        },
        "private-fishaudio-voice-clones.{userId}": {
            "description": "Ход клонирования ваших голосов Fish Audio: событие на каждое изменение статуса клона, созданного через `POST /voices/fishaudio/clones` (или в кабинете). `{userId}` — числовой идентификатор владельца ключа, его отдаёт `GET /user`. Право ключа — `voices.read`.",
            "parameters": {
                "userId": {
                    "schema": {
                        "type": "integer"
                    }
                }
            },
            "bindings": {
                "ws": {
                    "method": "GET",
                    "bindingVersion": "latest"
                }
            },
            "subscribe": {
                "operationId": "private_fishaudio_voice_clones_userId_subscribe",
                "message": {
                    "$ref": "#/components/messages/private_fishaudio_voice_clones_userId__voice_clone_updated"
                }
            }
        },
        "private-giftcodes.{userId}": {
            "description": "Подарочные коды и статус реселлера владельца ключа: выпуск партии, смена статуса кода, смена статуса реселлера и его заявки. Значения кодов в событиях не передаются — только маски; полный код отдают `GET /reseller/codes` и `GET /reseller/codes/{uuid}`. `{userId}` — числовой идентификатор владельца ключа, его отдаёт `GET /user`. Право ключа — `reseller.read`.",
            "parameters": {
                "userId": {
                    "schema": {
                        "type": "integer"
                    }
                }
            },
            "bindings": {
                "ws": {
                    "method": "GET",
                    "bindingVersion": "latest"
                }
            },
            "subscribe": {
                "operationId": "private_giftcodes_userId_subscribe",
                "message": {
                    "oneOf": [
                        {
                            "$ref": "#/components/messages/private_giftcodes_userId__status_changed"
                        },
                        {
                            "$ref": "#/components/messages/private_giftcodes_userId__issued"
                        },
                        {
                            "$ref": "#/components/messages/private_giftcodes_userId__reseller_application_status_changed"
                        },
                        {
                            "$ref": "#/components/messages/private_giftcodes_userId__reseller_status_changed"
                        }
                    ]
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "apiKey": {
                "type": "httpApiKey",
                "name": "X-API-KEY",
                "in": "header",
                "description": "Подписка авторизуется запросом `POST /api/public/broadcasting/auth` с заголовком `X-API-KEY`. Право ключа зависит от канала: заказы и превью чанков — `orders.read`, клоны голоса Cartesia и Fish Audio — `voices.read`, подарочные коды реселлера — `reseller.read`. Клиентские библиотеки делают этот запрос сами — достаточно указать эндпоинт и заголовок."
            }
        },
        "messages": {
            "private_orders_userId__policy_cooldown_applied": {
                "name": "policy_cooldown.applied",
                "title": "Policy cooldown applied",
                "summary": "Policy cooldown applied",
                "payload": {
                    "type": "object",
                    "required": [
                        "reason",
                        "minutes",
                        "retry_after",
                        "retry_at",
                        "level",
                        "threshold"
                    ],
                    "properties": {
                        "reason": {
                            "type": "string",
                            "example": "policy_cooldown_active"
                        },
                        "minutes": {
                            "type": "integer",
                            "example": 1
                        },
                        "retry_after": {
                            "type": "integer",
                            "example": 0
                        },
                        "retry_at": {
                            "type": "string",
                            "example": "1970-01-01T00:00:01+00:00"
                        },
                        "level": {
                            "type": "integer",
                            "example": 1
                        },
                        "threshold": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                }
            },
            "private_orders_userId__paragraph_regenerate_completed": {
                "name": "paragraph_regenerate.completed",
                "title": "Paragraph regenerate completed",
                "summary": "Paragraph regenerate completed",
                "payload": {
                    "type": "object",
                    "required": [
                        "order_id",
                        "paragraph_index",
                        "created_count",
                        "failed_count"
                    ],
                    "properties": {
                        "order_id": {
                            "type": "string",
                            "example": "01a0d8c6-86d3-70b5-a86e-5a12b1d860df"
                        },
                        "paragraph_index": {
                            "type": "integer",
                            "example": 1
                        },
                        "created_count": {
                            "type": "integer",
                            "example": 1
                        },
                        "failed_count": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                }
            },
            "private_orders_userId__order_queue_updated": {
                "name": "order.queue.updated",
                "title": "Order queue updated",
                "summary": "Сдвинулось место заказа в очереди исполнителей — для всех типов задач, кроме `voice_search`. `queue_position` — сколько заказов стоит впереди, `0` — следующий; `null` — заказ вышел из очереди (исполнитель взял его в работу или заказ отменён), бейдж очереди пора убрать. Приходит только при изменении позиции, не чаще раза в ~2 с; сдвиги в зоне от 100 заказов не рассылаются — точное число в `GET /orders/{order}`. Позиция считается в заказах, а не в людях; несколько исполнителей берут задачи одновременно, поэтому число может уменьшаться скачками и работа может начаться при позиции больше нуля. `queue_wait_seconds` всегда `null`. Пропущенный кадр не повторяется: после переподключения перечитайте заказ по REST.",
                "payload": {
                    "type": "object",
                    "required": [
                        "order_id",
                        "queue_position",
                        "queue_wait_seconds"
                    ],
                    "properties": {
                        "order_id": {
                            "type": "string",
                            "example": "example"
                        },
                        "queue_position": {
                            "type": [
                                "integer",
                                "null"
                            ],
                            "example": 1
                        },
                        "queue_wait_seconds": {
                            "type": [
                                "integer",
                                "null"
                            ],
                            "example": 1
                        }
                    }
                }
            },
            "private_orders_userId__created": {
                "name": "created",
                "title": "Created",
                "summary": "Создан новый заказ.",
                "payload": {
                    "type": "object",
                    "required": [
                        "order",
                        "items_summary"
                    ],
                    "properties": {
                        "order": {
                            "type": "object",
                            "description": "Снимок заказа без списка чанков — он не помещается в лимит размера WebSocket-сообщения. Статус здесь всегда `created`; сами чанки берите из `GET /orders/{order}`.",
                            "properties": {
                                "id": {
                                    "type": "integer",
                                    "example": 1024
                                },
                                "uuid": {
                                    "type": "string",
                                    "format": "uuid"
                                },
                                "user_id": {
                                    "type": "integer",
                                    "example": 7
                                },
                                "status": {
                                    "type": "string",
                                    "enum": [
                                        "created",
                                        "queued",
                                        "processing",
                                        "completed",
                                        "failed",
                                        "cancelled"
                                    ],
                                    "example": "created"
                                },
                                "task_type": {
                                    "type": "string",
                                    "nullable": true
                                },
                                "total_amount": {
                                    "type": "number",
                                    "example": 12.5
                                },
                                "created_at": {
                                    "type": "string",
                                    "format": "date-time"
                                },
                                "template": {
                                    "type": "object"
                                }
                            }
                        },
                        "items_summary": {
                            "type": "object",
                            "description": "Сводка по чанкам заказа вместо полного списка.",
                            "required": [
                                "total",
                                "by_status"
                            ],
                            "properties": {
                                "total": {
                                    "type": "integer",
                                    "example": 12
                                },
                                "by_status": {
                                    "type": "object",
                                    "description": "Сколько чанков в каждом статусе: `pending`, `processing`, `completed`, `failed`, `policy_flagged`.",
                                    "additionalProperties": {
                                        "type": "integer"
                                    },
                                    "example": {
                                        "pending": 12
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "private_orders_userId__progress": {
                "name": "progress",
                "title": "Progress",
                "summary": "Обновился общий прогресс заказа.",
                "payload": {
                    "type": "object",
                    "description": "Прогресс по исходным чанкам заказа. Повторы и перегенерации в него не входят.",
                    "required": [
                        "order_id",
                        "completed",
                        "total",
                        "percent"
                    ],
                    "properties": {
                        "order_id": {
                            "type": "string",
                            "format": "uuid",
                            "example": "019bb198-78f5-7082-8550-fee362917f2e"
                        },
                        "completed": {
                            "type": "integer",
                            "example": 3
                        },
                        "total": {
                            "type": "integer",
                            "example": 7
                        },
                        "percent": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 100,
                            "example": 43
                        }
                    }
                }
            },
            "private_orders_userId__voice_search_queue_updated": {
                "name": "voice_search.queue.updated",
                "title": "Voice search queue updated",
                "summary": "Сдвинулась очередь поиска голоса — только для заказов `voice_search`, которые проверяются по одному. `queue_position` — сколько заказов стоит впереди, `0` — ваш заказ обрабатывается сейчас. `queue_wait_seconds` — оценка ожидания в секундах (оценка, а не обещание) или `null`, пока нет статистики. Те же значения приходят в полях заказа в REST.",
                "payload": {
                    "type": "object",
                    "required": [
                        "order_id",
                        "queue_position",
                        "queue_wait_seconds"
                    ],
                    "properties": {
                        "order_id": {
                            "type": "string",
                            "example": "example"
                        },
                        "queue_position": {
                            "type": "integer",
                            "example": 1
                        },
                        "queue_wait_seconds": {
                            "type": [
                                "integer",
                                "null"
                            ],
                            "example": 1
                        }
                    }
                }
            },
            "private_orders_userId__bulk_retry_completed": {
                "name": "bulk_retry.completed",
                "title": "Bulk retry completed",
                "summary": "Bulk retry completed",
                "payload": {
                    "type": "object",
                    "required": [
                        "order_id",
                        "created_count",
                        "failed_count"
                    ],
                    "properties": {
                        "order_id": {
                            "type": "string",
                            "example": "01a0d8c6-86b5-706a-958a-a626ddb3ba3d"
                        },
                        "created_count": {
                            "type": "integer",
                            "example": 1
                        },
                        "failed_count": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                }
            },
            "private_orders_userId__renamed": {
                "name": "renamed",
                "title": "Renamed",
                "summary": "Renamed",
                "payload": {
                    "type": "object",
                    "required": [
                        "order"
                    ],
                    "properties": {
                        "order": {
                            "type": "object",
                            "required": [
                                "id",
                                "user_id",
                                "name",
                                "template",
                                "template_id",
                                "task_type",
                                "status",
                                "price_units",
                                "price_formatted",
                                "currency_asset",
                                "total_tokens",
                                "total_duration_ms",
                                "tokens_from_quota",
                                "tokens_from_payg",
                                "tokens_spent",
                                "task_data",
                                "result",
                                "created_at",
                                "updated_at",
                                "files_expire_at",
                                "files_expired",
                                "retention",
                                "eta_seconds",
                                "eta_at",
                                "completed_chunks",
                                "total_chunks",
                                "progress_percent",
                                "stitching",
                                "paragraphs"
                            ],
                            "properties": {
                                "id": {
                                    "type": "string",
                                    "example": "01a173d9-514e-702b-a6c6-d041139e1b4c"
                                },
                                "user_id": {
                                    "type": "integer",
                                    "example": 360
                                },
                                "name": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "example": "example"
                                },
                                "template": {
                                    "type": "object",
                                    "required": [
                                        "id",
                                        "user_id",
                                        "slug",
                                        "name",
                                        "service_key",
                                        "service",
                                        "config",
                                        "is_public",
                                        "folder_id",
                                        "created_at",
                                        "updated_at"
                                    ],
                                    "properties": {
                                        "id": {
                                            "type": "string",
                                            "example": "01a173d9-514d-7382-b078-e25da5ec43df"
                                        },
                                        "user_id": {
                                            "type": "integer",
                                            "example": 361
                                        },
                                        "slug": {
                                            "type": "string",
                                            "example": "6d6a2541-3dbc-39a7-ab54-dcee5447d303"
                                        },
                                        "name": {
                                            "type": "string",
                                            "example": "laudantium"
                                        },
                                        "service_key": {
                                            "type": "string",
                                            "example": "example"
                                        },
                                        "service": {
                                            "type": [
                                                "object",
                                                "null"
                                            ],
                                            "description": "Может прийти пустым (`null`)."
                                        },
                                        "config": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "is_public": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "folder_id": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "description": "Может прийти пустым (`null`)."
                                        },
                                        "created_at": {
                                            "type": "string",
                                            "format": "date-time",
                                            "example": "2026-10-25T16:16:24+00:00"
                                        },
                                        "updated_at": {
                                            "type": "string",
                                            "format": "date-time",
                                            "example": "2026-10-25T16:16:24+00:00"
                                        }
                                    }
                                },
                                "template_id": {
                                    "type": "string",
                                    "example": "01a173d9-514d-7382-b078-e25da5ec43df"
                                },
                                "task_type": {
                                    "type": "string",
                                    "enum": [
                                        "tts",
                                        "image",
                                        "txt2img",
                                        "remix",
                                        "image_edit",
                                        "voice_clone",
                                        "sfx",
                                        "music",
                                        "voice_search",
                                        "cartesia_dub",
                                        "elevenlabs_dub"
                                    ],
                                    "example": "tts"
                                },
                                "status": {
                                    "type": "string",
                                    "enum": [
                                        "created",
                                        "pending",
                                        "in_progress",
                                        "completed",
                                        "result_delivered",
                                        "failed",
                                        "compensated",
                                        "cancelled",
                                        "partially_completed"
                                    ],
                                    "example": "created"
                                },
                                "price_units": {
                                    "type": "number",
                                    "example": 57.33
                                },
                                "price_formatted": {
                                    "type": "number",
                                    "example": 0.57
                                },
                                "currency_asset": {
                                    "type": "object",
                                    "required": [
                                        "id",
                                        "code",
                                        "kind",
                                        "precision",
                                        "name",
                                        "deleted_at",
                                        "created_at",
                                        "updated_at"
                                    ],
                                    "properties": {
                                        "id": {
                                            "type": [
                                                "integer",
                                                "null"
                                            ],
                                            "description": "Может прийти пустым (`null`)."
                                        },
                                        "code": {
                                            "type": "string",
                                            "example": "LUMC"
                                        },
                                        "kind": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "description": "Может прийти пустым (`null`)."
                                        },
                                        "precision": {
                                            "type": "integer",
                                            "example": 2
                                        },
                                        "name": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "description": "Может прийти пустым (`null`)."
                                        },
                                        "deleted_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        },
                                        "created_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        },
                                        "updated_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        }
                                    }
                                },
                                "total_tokens": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "total_duration_ms": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "tokens_from_quota": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "tokens_from_payg": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "tokens_spent": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "task_data": {
                                    "type": [
                                        "object",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "result": {
                                    "type": [
                                        "object",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "created_at": {
                                    "type": "string",
                                    "format": "date-time",
                                    "example": "2026-10-25T16:16:24+00:00"
                                },
                                "updated_at": {
                                    "type": "string",
                                    "format": "date-time",
                                    "example": "2026-10-25T16:16:24+00:00"
                                },
                                "files_expire_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "format": "date-time"
                                },
                                "files_expired": {
                                    "type": "boolean",
                                    "example": false
                                },
                                "retention": {
                                    "type": "object",
                                    "required": [
                                        "chunks",
                                        "files"
                                    ],
                                    "properties": {
                                        "chunks": {
                                            "type": "object",
                                            "required": [
                                                "expires_at",
                                                "expired",
                                                "expires_early",
                                                "reason"
                                            ],
                                            "properties": {
                                                "expires_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "expired": {
                                                    "type": "boolean",
                                                    "example": false
                                                },
                                                "expires_early": {
                                                    "type": "boolean",
                                                    "example": false
                                                },
                                                "reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Может прийти пустым (`null`)."
                                                }
                                            }
                                        },
                                        "files": {
                                            "type": "object",
                                            "required": [
                                                "expires_at",
                                                "expired"
                                            ],
                                            "properties": {
                                                "expires_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "expired": {
                                                    "type": "boolean",
                                                    "example": false
                                                }
                                            }
                                        }
                                    }
                                },
                                "eta_seconds": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "eta_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "format": "date-time"
                                },
                                "completed_chunks": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "total_chunks": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "progress_percent": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "stitching": {
                                    "type": "boolean",
                                    "example": false
                                },
                                "paragraphs": {
                                    "type": [
                                        "array",
                                        "null"
                                    ],
                                    "items": {
                                        "type": "object"
                                    },
                                    "description": "Может прийти пустым (`null`)."
                                }
                            }
                        }
                    }
                }
            },
            "private_orders_userId__status_changed": {
                "name": "status.changed",
                "title": "Status changed",
                "summary": "Сменился статус заказа.",
                "payload": {
                    "type": "object",
                    "required": [
                        "order",
                        "items_summary",
                        "previous_status",
                        "new_status"
                    ],
                    "properties": {
                        "order": {
                            "type": "object",
                            "description": "Снимок заказа без списка чанков — изменения по каждому чанку приходят отдельными событиями `item.status.changed`."
                        },
                        "items_summary": {
                            "type": "object",
                            "description": "Сводка по чанкам заказа вместо полного списка.",
                            "required": [
                                "total",
                                "by_status"
                            ],
                            "properties": {
                                "total": {
                                    "type": "integer",
                                    "example": 12
                                },
                                "by_status": {
                                    "type": "object",
                                    "description": "Сколько чанков в каждом статусе: `pending`, `processing`, `completed`, `failed`, `policy_flagged`.",
                                    "additionalProperties": {
                                        "type": "integer"
                                    },
                                    "example": {
                                        "completed": 10,
                                        "failed": 2
                                    }
                                }
                            }
                        },
                        "previous_status": {
                            "type": "string",
                            "enum": [
                                "created",
                                "pending",
                                "in_progress",
                                "completed",
                                "result_delivered",
                                "failed",
                                "compensated",
                                "cancelled",
                                "partially_completed"
                            ]
                        },
                        "new_status": {
                            "type": "string",
                            "enum": [
                                "created",
                                "pending",
                                "in_progress",
                                "completed",
                                "result_delivered",
                                "failed",
                                "compensated",
                                "cancelled",
                                "partially_completed"
                            ]
                        }
                    }
                }
            },
            "private_orders_userId__archive_ready": {
                "name": "archive.ready",
                "title": "Archive ready",
                "summary": "Archive ready",
                "payload": {
                    "type": "object",
                    "description": "ZIP-архив собран и готов к скачиванию. Приходит только для крупных заказов, собираемых в фоне.",
                    "required": [
                        "order_id",
                        "archive_id",
                        "url",
                        "expires_at"
                    ],
                    "properties": {
                        "order_id": {
                            "type": "string",
                            "format": "uuid",
                            "example": "019bb198-78f5-7082-8550-fee362917f2e"
                        },
                        "archive_id": {
                            "type": "string",
                            "format": "uuid",
                            "example": "019bb1a0-2c41-71f2-9f0b-6a3d0e8c4b17"
                        },
                        "url": {
                            "type": "string",
                            "format": "uri",
                            "description": "Готовая ссылка на ZIP. Качается обычным `GET` без заголовков авторизации, с хранилища, а не с API.",
                            "example": "https://s3.example.com/archives/1/019bb1a0.zip?X-Amz-Signature=..."
                        },
                        "size": {
                            "type": "integer",
                            "nullable": true,
                            "description": "Размер архива в байтах; `null`, если хранилище его не сообщило.",
                            "example": 104857600
                        },
                        "expires_at": {
                            "type": "string",
                            "format": "date-time",
                            "description": "Когда ссылка перестанет работать (ISO 8601) — не позже суток с момента готовности. После этого запросите архив заново.",
                            "example": "2026-07-30T12:00:00+00:00"
                        }
                    }
                }
            },
            "private_orders_userId__item_status_changed": {
                "name": "item.status.changed",
                "title": "Item status changed",
                "summary": "Сменился статус чанка заказа.",
                "payload": {
                    "type": "object",
                    "required": [
                        "item",
                        "previous_status",
                        "new_status"
                    ],
                    "properties": {
                        "item": {
                            "type": "object",
                            "description": "Индекс чанка, его статус, путь к файлу результата и длительность аудио.",
                            "properties": {
                                "id": {
                                    "type": "string",
                                    "format": "uuid"
                                },
                                "chunk_index": {
                                    "type": "integer",
                                    "nullable": true,
                                    "example": 3
                                },
                                "status": {
                                    "type": "string",
                                    "enum": [
                                        "pending",
                                        "processing",
                                        "completed",
                                        "failed",
                                        "policy_flagged"
                                    ]
                                },
                                "result_file": {
                                    "type": "object",
                                    "nullable": true
                                },
                                "duration_ms": {
                                    "type": "integer",
                                    "nullable": true,
                                    "example": 12480
                                }
                            }
                        },
                        "previous_status": {
                            "type": "string"
                        },
                        "new_status": {
                            "type": "string"
                        },
                        "completed_chunks": {
                            "type": "integer",
                            "example": 3
                        },
                        "total_chunks": {
                            "type": "integer",
                            "example": 7
                        },
                        "progress_percent": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 100,
                            "example": 43
                        },
                        "stitching": {
                            "type": "boolean",
                            "example": false,
                            "description": "Идёт ли склейка аудио заказа. Последний готовый чанк многочанкового заказа означает начало склейки, а не готовность: при `true` результат ещё не финальный."
                        }
                    }
                }
            },
            "private_orders_userId__policy_cooldown_cleared": {
                "name": "policy_cooldown.cleared",
                "title": "Policy cooldown cleared",
                "summary": "Policy cooldown cleared",
                "payload": {
                    "type": "object",
                    "required": [
                        "was_blocked",
                        "strikes",
                        "level"
                    ],
                    "properties": {
                        "was_blocked": {
                            "type": "boolean",
                            "example": true
                        },
                        "strikes": {
                            "type": "integer",
                            "example": 0
                        },
                        "level": {
                            "type": "integer",
                            "example": 0
                        }
                    }
                }
            },
            "private_orders_userId__archive_failed": {
                "name": "archive.failed",
                "title": "Archive failed",
                "summary": "Archive failed",
                "payload": {
                    "type": "object",
                    "description": "Фоновая сборка ZIP-архива не удалась. Событие терминальное: ни `progress`, ни `ready` по этому `archive_id` больше не придут, поэтому именно по нему убирайте индикатор прогресса — иначе он останется на экране навсегда.",
                    "required": [
                        "order_id",
                        "archive_id",
                        "reason"
                    ],
                    "properties": {
                        "order_id": {
                            "type": "string",
                            "format": "uuid",
                            "example": "019bb198-78f5-7082-8550-fee362917f2e"
                        },
                        "archive_id": {
                            "type": "string",
                            "format": "uuid",
                            "example": "019bb1a0-2c41-71f2-9f0b-6a3d0e8c4b17"
                        },
                        "reason": {
                            "type": "string",
                            "enum": [
                                "order_not_found",
                                "build_failed"
                            ],
                            "description": "Машиночитаемый код причины — текст для пользователя подбирайте на своей стороне.",
                            "example": "build_failed"
                        }
                    }
                }
            },
            "private_orders_userId__stitch_changed": {
                "name": "stitch.changed",
                "title": "Stitch changed",
                "summary": "Stitch changed",
                "payload": {
                    "type": "object",
                    "required": [
                        "order_id",
                        "order_status",
                        "stitching",
                        "stitch"
                    ],
                    "properties": {
                        "order_id": {
                            "type": "string",
                            "example": "01a12b4f-d2ba-70ef-b1a8-14aff97d1da2"
                        },
                        "order_status": {
                            "type": "string",
                            "example": "created"
                        },
                        "stitching": {
                            "type": "boolean",
                            "example": false
                        },
                        "stitch": {
                            "type": "object",
                            "required": [
                                "id",
                                "status",
                                "paragraph_index",
                                "restitch"
                            ],
                            "properties": {
                                "id": {
                                    "type": "string",
                                    "example": "01a12b4f-d2bc-7117-83c6-a16f11eac8f4"
                                },
                                "status": {
                                    "type": "string",
                                    "example": "pending"
                                },
                                "paragraph_index": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "restitch": {
                                    "type": "boolean",
                                    "example": false
                                }
                            }
                        }
                    }
                }
            },
            "private_orders_userId__archive_progress": {
                "name": "archive.progress",
                "title": "Archive progress",
                "summary": "Archive progress",
                "payload": {
                    "type": "object",
                    "description": "Прогресс фоновой сборки ZIP-архива. Приходит только для крупных заказов (`mode=job`); небольшой архив отдаётся синхронно, и событий по нему нет. Значения приходят с шагом около 20% — не рассчитывайте на каждый процент; последним придёт кадр, где `files_done` равно `files_total`.",
                    "required": [
                        "order_id",
                        "archive_id",
                        "percent",
                        "files_done",
                        "files_total"
                    ],
                    "properties": {
                        "order_id": {
                            "type": "string",
                            "format": "uuid",
                            "example": "019bb198-78f5-7082-8550-fee362917f2e"
                        },
                        "archive_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "Тот же `archive_id`, что пришёл в ответе на запрос архива, — по нему сопоставляйте события с карточкой.",
                            "example": "019bb1a0-2c41-71f2-9f0b-6a3d0e8c4b17"
                        },
                        "percent": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 100,
                            "example": 40
                        },
                        "files_done": {
                            "type": "integer",
                            "example": 8
                        },
                        "files_total": {
                            "type": "integer",
                            "example": 20
                        }
                    }
                }
            },
            "private_order_task_orderId__paragraph_regenerate_completed": {
                "name": "paragraph_regenerate.completed",
                "title": "Paragraph regenerate completed",
                "summary": "Paragraph regenerate completed",
                "payload": {
                    "type": "object",
                    "required": [
                        "order_id",
                        "paragraph_index",
                        "created_count",
                        "failed_count"
                    ],
                    "properties": {
                        "order_id": {
                            "type": "string",
                            "example": "01a0d8c6-86d3-70b5-a86e-5a12b1d860df"
                        },
                        "paragraph_index": {
                            "type": "integer",
                            "example": 1
                        },
                        "created_count": {
                            "type": "integer",
                            "example": 1
                        },
                        "failed_count": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                }
            },
            "private_order_task_orderId__order_queue_updated": {
                "name": "order.queue.updated",
                "title": "Order queue updated",
                "summary": "Сдвинулось место заказа в очереди исполнителей — для всех типов задач, кроме `voice_search`. `queue_position` — сколько заказов стоит впереди, `0` — следующий; `null` — заказ вышел из очереди (исполнитель взял его в работу или заказ отменён), бейдж очереди пора убрать. Приходит только при изменении позиции, не чаще раза в ~2 с; сдвиги в зоне от 100 заказов не рассылаются — точное число в `GET /orders/{order}`. Позиция считается в заказах, а не в людях; несколько исполнителей берут задачи одновременно, поэтому число может уменьшаться скачками и работа может начаться при позиции больше нуля. `queue_wait_seconds` всегда `null`. Пропущенный кадр не повторяется: после переподключения перечитайте заказ по REST.",
                "payload": {
                    "type": "object",
                    "required": [
                        "order_id",
                        "queue_position",
                        "queue_wait_seconds"
                    ],
                    "properties": {
                        "order_id": {
                            "type": "string",
                            "example": "example"
                        },
                        "queue_position": {
                            "type": [
                                "integer",
                                "null"
                            ],
                            "example": 1
                        },
                        "queue_wait_seconds": {
                            "type": [
                                "integer",
                                "null"
                            ],
                            "example": 1
                        }
                    }
                }
            },
            "private_order_task_orderId__voice_search_queue_updated": {
                "name": "voice_search.queue.updated",
                "title": "Voice search queue updated",
                "summary": "Сдвинулась очередь поиска голоса — только для заказов `voice_search`, которые проверяются по одному. `queue_position` — сколько заказов стоит впереди, `0` — ваш заказ обрабатывается сейчас. `queue_wait_seconds` — оценка ожидания в секундах (оценка, а не обещание) или `null`, пока нет статистики. Те же значения приходят в полях заказа в REST.",
                "payload": {
                    "type": "object",
                    "required": [
                        "order_id",
                        "queue_position",
                        "queue_wait_seconds"
                    ],
                    "properties": {
                        "order_id": {
                            "type": "string",
                            "example": "example"
                        },
                        "queue_position": {
                            "type": "integer",
                            "example": 1
                        },
                        "queue_wait_seconds": {
                            "type": [
                                "integer",
                                "null"
                            ],
                            "example": 1
                        }
                    }
                }
            },
            "private_order_task_orderId__bulk_retry_completed": {
                "name": "bulk_retry.completed",
                "title": "Bulk retry completed",
                "summary": "Bulk retry completed",
                "payload": {
                    "type": "object",
                    "required": [
                        "order_id",
                        "created_count",
                        "failed_count"
                    ],
                    "properties": {
                        "order_id": {
                            "type": "string",
                            "example": "01a0d8c6-86b5-706a-958a-a626ddb3ba3d"
                        },
                        "created_count": {
                            "type": "integer",
                            "example": 1
                        },
                        "failed_count": {
                            "type": "integer",
                            "example": 1
                        }
                    }
                }
            },
            "private_order_task_orderId__renamed": {
                "name": "renamed",
                "title": "Renamed",
                "summary": "Renamed",
                "payload": {
                    "type": "object",
                    "required": [
                        "order"
                    ],
                    "properties": {
                        "order": {
                            "type": "object",
                            "required": [
                                "id",
                                "user_id",
                                "name",
                                "template",
                                "template_id",
                                "task_type",
                                "status",
                                "price_units",
                                "price_formatted",
                                "currency_asset",
                                "total_tokens",
                                "total_duration_ms",
                                "tokens_from_quota",
                                "tokens_from_payg",
                                "tokens_spent",
                                "task_data",
                                "result",
                                "created_at",
                                "updated_at",
                                "files_expire_at",
                                "files_expired",
                                "retention",
                                "eta_seconds",
                                "eta_at",
                                "completed_chunks",
                                "total_chunks",
                                "progress_percent",
                                "stitching",
                                "paragraphs"
                            ],
                            "properties": {
                                "id": {
                                    "type": "string",
                                    "example": "01a173d9-514e-702b-a6c6-d041139e1b4c"
                                },
                                "user_id": {
                                    "type": "integer",
                                    "example": 360
                                },
                                "name": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "example": "example"
                                },
                                "template": {
                                    "type": "object",
                                    "required": [
                                        "id",
                                        "user_id",
                                        "slug",
                                        "name",
                                        "service_key",
                                        "service",
                                        "config",
                                        "is_public",
                                        "folder_id",
                                        "created_at",
                                        "updated_at"
                                    ],
                                    "properties": {
                                        "id": {
                                            "type": "string",
                                            "example": "01a173d9-514d-7382-b078-e25da5ec43df"
                                        },
                                        "user_id": {
                                            "type": "integer",
                                            "example": 361
                                        },
                                        "slug": {
                                            "type": "string",
                                            "example": "6d6a2541-3dbc-39a7-ab54-dcee5447d303"
                                        },
                                        "name": {
                                            "type": "string",
                                            "example": "laudantium"
                                        },
                                        "service_key": {
                                            "type": "string",
                                            "example": "example"
                                        },
                                        "service": {
                                            "type": [
                                                "object",
                                                "null"
                                            ],
                                            "description": "Может прийти пустым (`null`)."
                                        },
                                        "config": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        },
                                        "is_public": {
                                            "type": "boolean",
                                            "example": false
                                        },
                                        "folder_id": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "description": "Может прийти пустым (`null`)."
                                        },
                                        "created_at": {
                                            "type": "string",
                                            "format": "date-time",
                                            "example": "2026-10-25T16:16:24+00:00"
                                        },
                                        "updated_at": {
                                            "type": "string",
                                            "format": "date-time",
                                            "example": "2026-10-25T16:16:24+00:00"
                                        }
                                    }
                                },
                                "template_id": {
                                    "type": "string",
                                    "example": "01a173d9-514d-7382-b078-e25da5ec43df"
                                },
                                "task_type": {
                                    "type": "string",
                                    "enum": [
                                        "tts",
                                        "image",
                                        "txt2img",
                                        "remix",
                                        "image_edit",
                                        "voice_clone",
                                        "sfx",
                                        "music",
                                        "voice_search",
                                        "cartesia_dub",
                                        "elevenlabs_dub"
                                    ],
                                    "example": "tts"
                                },
                                "status": {
                                    "type": "string",
                                    "enum": [
                                        "created",
                                        "pending",
                                        "in_progress",
                                        "completed",
                                        "result_delivered",
                                        "failed",
                                        "compensated",
                                        "cancelled",
                                        "partially_completed"
                                    ],
                                    "example": "created"
                                },
                                "price_units": {
                                    "type": "number",
                                    "example": 57.33
                                },
                                "price_formatted": {
                                    "type": "number",
                                    "example": 0.57
                                },
                                "currency_asset": {
                                    "type": "object",
                                    "required": [
                                        "id",
                                        "code",
                                        "kind",
                                        "precision",
                                        "name",
                                        "deleted_at",
                                        "created_at",
                                        "updated_at"
                                    ],
                                    "properties": {
                                        "id": {
                                            "type": [
                                                "integer",
                                                "null"
                                            ],
                                            "description": "Может прийти пустым (`null`)."
                                        },
                                        "code": {
                                            "type": "string",
                                            "example": "LUMC"
                                        },
                                        "kind": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "description": "Может прийти пустым (`null`)."
                                        },
                                        "precision": {
                                            "type": "integer",
                                            "example": 2
                                        },
                                        "name": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "description": "Может прийти пустым (`null`)."
                                        },
                                        "deleted_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        },
                                        "created_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        },
                                        "updated_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        }
                                    }
                                },
                                "total_tokens": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "total_duration_ms": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "tokens_from_quota": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "tokens_from_payg": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "tokens_spent": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "task_data": {
                                    "type": [
                                        "object",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "result": {
                                    "type": [
                                        "object",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "created_at": {
                                    "type": "string",
                                    "format": "date-time",
                                    "example": "2026-10-25T16:16:24+00:00"
                                },
                                "updated_at": {
                                    "type": "string",
                                    "format": "date-time",
                                    "example": "2026-10-25T16:16:24+00:00"
                                },
                                "files_expire_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "format": "date-time"
                                },
                                "files_expired": {
                                    "type": "boolean",
                                    "example": false
                                },
                                "retention": {
                                    "type": "object",
                                    "required": [
                                        "chunks",
                                        "files"
                                    ],
                                    "properties": {
                                        "chunks": {
                                            "type": "object",
                                            "required": [
                                                "expires_at",
                                                "expired",
                                                "expires_early",
                                                "reason"
                                            ],
                                            "properties": {
                                                "expires_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "expired": {
                                                    "type": "boolean",
                                                    "example": false
                                                },
                                                "expires_early": {
                                                    "type": "boolean",
                                                    "example": false
                                                },
                                                "reason": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Может прийти пустым (`null`)."
                                                }
                                            }
                                        },
                                        "files": {
                                            "type": "object",
                                            "required": [
                                                "expires_at",
                                                "expired"
                                            ],
                                            "properties": {
                                                "expires_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                },
                                                "expired": {
                                                    "type": "boolean",
                                                    "example": false
                                                }
                                            }
                                        }
                                    }
                                },
                                "eta_seconds": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "eta_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "format": "date-time"
                                },
                                "completed_chunks": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "total_chunks": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "progress_percent": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "stitching": {
                                    "type": "boolean",
                                    "example": false
                                },
                                "paragraphs": {
                                    "type": [
                                        "array",
                                        "null"
                                    ],
                                    "items": {
                                        "type": "object"
                                    },
                                    "description": "Может прийти пустым (`null`)."
                                }
                            }
                        }
                    }
                }
            },
            "private_order_task_orderId__status_changed": {
                "name": "status.changed",
                "title": "Status changed",
                "summary": "Сменился статус заказа.",
                "payload": {
                    "type": "object",
                    "required": [
                        "order",
                        "items_summary",
                        "previous_status",
                        "new_status"
                    ],
                    "properties": {
                        "order": {
                            "type": "object",
                            "description": "Снимок заказа без списка чанков — изменения по каждому чанку приходят отдельными событиями `item.status.changed`."
                        },
                        "items_summary": {
                            "type": "object",
                            "description": "Сводка по чанкам заказа вместо полного списка.",
                            "required": [
                                "total",
                                "by_status"
                            ],
                            "properties": {
                                "total": {
                                    "type": "integer",
                                    "example": 12
                                },
                                "by_status": {
                                    "type": "object",
                                    "description": "Сколько чанков в каждом статусе: `pending`, `processing`, `completed`, `failed`, `policy_flagged`.",
                                    "additionalProperties": {
                                        "type": "integer"
                                    },
                                    "example": {
                                        "completed": 10,
                                        "failed": 2
                                    }
                                }
                            }
                        },
                        "previous_status": {
                            "type": "string",
                            "enum": [
                                "created",
                                "pending",
                                "in_progress",
                                "completed",
                                "result_delivered",
                                "failed",
                                "compensated",
                                "cancelled",
                                "partially_completed"
                            ]
                        },
                        "new_status": {
                            "type": "string",
                            "enum": [
                                "created",
                                "pending",
                                "in_progress",
                                "completed",
                                "result_delivered",
                                "failed",
                                "compensated",
                                "cancelled",
                                "partially_completed"
                            ]
                        }
                    }
                }
            },
            "private_order_task_orderId__item_status_changed": {
                "name": "item.status.changed",
                "title": "Item status changed",
                "summary": "Сменился статус чанка заказа.",
                "payload": {
                    "type": "object",
                    "required": [
                        "item",
                        "previous_status",
                        "new_status"
                    ],
                    "properties": {
                        "item": {
                            "type": "object",
                            "description": "Индекс чанка, его статус, путь к файлу результата и длительность аудио.",
                            "properties": {
                                "id": {
                                    "type": "string",
                                    "format": "uuid"
                                },
                                "chunk_index": {
                                    "type": "integer",
                                    "nullable": true,
                                    "example": 3
                                },
                                "status": {
                                    "type": "string",
                                    "enum": [
                                        "pending",
                                        "processing",
                                        "completed",
                                        "failed",
                                        "policy_flagged"
                                    ]
                                },
                                "result_file": {
                                    "type": "object",
                                    "nullable": true
                                },
                                "duration_ms": {
                                    "type": "integer",
                                    "nullable": true,
                                    "example": 12480
                                }
                            }
                        },
                        "previous_status": {
                            "type": "string"
                        },
                        "new_status": {
                            "type": "string"
                        },
                        "completed_chunks": {
                            "type": "integer",
                            "example": 3
                        },
                        "total_chunks": {
                            "type": "integer",
                            "example": 7
                        },
                        "progress_percent": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 100,
                            "example": 43
                        },
                        "stitching": {
                            "type": "boolean",
                            "example": false,
                            "description": "Идёт ли склейка аудио заказа. Последний готовый чанк многочанкового заказа означает начало склейки, а не готовность: при `true` результат ещё не финальный."
                        }
                    }
                }
            },
            "private_order_task_orderId__stitch_changed": {
                "name": "stitch.changed",
                "title": "Stitch changed",
                "summary": "Stitch changed",
                "payload": {
                    "type": "object",
                    "required": [
                        "order_id",
                        "order_status",
                        "stitching",
                        "stitch"
                    ],
                    "properties": {
                        "order_id": {
                            "type": "string",
                            "example": "01a12b4f-d2ba-70ef-b1a8-14aff97d1da2"
                        },
                        "order_status": {
                            "type": "string",
                            "example": "created"
                        },
                        "stitching": {
                            "type": "boolean",
                            "example": false
                        },
                        "stitch": {
                            "type": "object",
                            "required": [
                                "id",
                                "status",
                                "paragraph_index",
                                "restitch"
                            ],
                            "properties": {
                                "id": {
                                    "type": "string",
                                    "example": "01a12b4f-d2bc-7117-83c6-a16f11eac8f4"
                                },
                                "status": {
                                    "type": "string",
                                    "example": "pending"
                                },
                                "paragraph_index": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "description": "Может прийти пустым (`null`)."
                                },
                                "restitch": {
                                    "type": "boolean",
                                    "example": false
                                }
                            }
                        }
                    }
                }
            },
            "private_order_task_orderId__progress": {
                "name": "progress",
                "title": "Progress",
                "summary": "Прогресс выполнения заказа в реальном времени.",
                "payload": {
                    "type": "object",
                    "required": [
                        "task_id",
                        "progress",
                        "chunks_done",
                        "chunks_total"
                    ],
                    "properties": {
                        "task_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "UUID заказа — совпадает с `{orderId}` канала."
                        },
                        "progress": {
                            "type": "number",
                            "description": "Поле сохранено для совместимости и **не отражает прогресс** — ориентируйтесь на события `progress` канала заказов или на `eta_seconds`.",
                            "example": 42.5
                        },
                        "chunks_done": {
                            "type": "integer",
                            "description": "Поле сохранено для совместимости и **не отражает число готовых частей** — считайте готовность по событиям `item.status.changed`."
                        },
                        "chunks_total": {
                            "type": "integer",
                            "description": "Всего частей в заказе."
                        },
                        "duration_seconds": {
                            "type": "number",
                            "description": "Сколько секунд задача уже выполняется. Это прошедшее время, а не оставшееся."
                        },
                        "eta_seconds": {
                            "type": [
                                "integer",
                                "null"
                            ],
                            "description": "Оценка оставшегося времени в секундах. Считается по статистике сервиса на стороне API.",
                            "example": 95
                        },
                        "eta_confidence": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "enum": [
                                "high",
                                "medium",
                                "low",
                                null
                            ],
                            "description": "Насколько можно доверять оценке: `high` — статистика по чанкам такого же размера, `medium` — по сервису в целом, `low` — данных мало, показывайте оценку со знаком «≈»."
                        },
                        "timestamp": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                }
            },
            "private_chunks_preview_userId__ready": {
                "name": "ready",
                "title": "Ready",
                "summary": "Ready",
                "payload": {
                    "type": "object",
                    "required": [
                        "status",
                        "preview_id",
                        "summary",
                        "page"
                    ],
                    "description": "Async-превью готово — ограниченное уведомление: итоги по всему тексту (`summary`) и мета первой страницы (`page`). Сами чанки в это событие не входят — их нужно отдельно запросить через `GET /orders/chunks/preview/{previewId}?page=1`.",
                    "properties": {
                        "status": {
                            "type": "string",
                            "enum": [
                                "ready"
                            ],
                            "example": "ready"
                        },
                        "preview_id": {
                            "type": "string",
                            "description": "Контентный идентификатор превью (sha256 от текста+шаблона+режима). Используйте для пагинации (`GET .../{previewId}`) и повторного preflight-запроса.",
                            "example": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2"
                        },
                        "summary": {
                            "type": "object",
                            "description": "Итоги по всему тексту — не только по текущей странице чанков.",
                            "properties": {
                                "chunks_count": {
                                    "type": "integer",
                                    "example": 342
                                },
                                "total_effective_length": {
                                    "type": "integer",
                                    "description": "Суммарная billable-длина по всем чанкам, в символах (паузы не считаются).",
                                    "example": 680000
                                },
                                "total_price_units": {
                                    "type": "integer",
                                    "example": 680000
                                },
                                "pause_count": {
                                    "type": "integer",
                                    "example": 12
                                },
                                "total_pause_seconds": {
                                    "type": "number",
                                    "example": 30
                                },
                                "caps_ok": {
                                    "type": "boolean",
                                    "example": true
                                },
                                "caps_exceeded": {
                                    "type": "string",
                                    "nullable": true,
                                    "enum": [
                                        "count",
                                        "single",
                                        "total",
                                        "chunks",
                                        null
                                    ],
                                    "example": null
                                },
                                "paragraphs_count": {
                                    "type": "integer",
                                    "nullable": true,
                                    "description": "Число абзацев, или `null` вне абзацного режима.",
                                    "example": null
                                },
                                "paragraphs": {
                                    "type": "array",
                                    "nullable": true,
                                    "description": "Агрегат по абзацам. `null` означает либо «превью не абзацное», либо «абзацев больше лимита broadcast-payload» — во втором случае `paragraphs_count` остаётся числом, а полный список абзацев берите через `GET /orders/chunks/preview/{previewId}`.",
                                    "items": {
                                        "type": "object",
                                        "properties": {
                                            "paragraph_index": {
                                                "type": "integer",
                                                "example": 0
                                            },
                                            "chunks_count": {
                                                "type": "integer",
                                                "example": 3
                                            },
                                            "first_chunk_index": {
                                                "type": "integer",
                                                "description": "Сквозной номер первого чанка абзаца — по нему абзац находится в постраничном списке чанков.",
                                                "example": 0
                                            },
                                            "text_length": {
                                                "type": "integer",
                                                "example": 2400
                                            },
                                            "effective_length": {
                                                "type": "integer",
                                                "example": 2380
                                            },
                                            "price_units": {
                                                "type": "integer",
                                                "example": 2380
                                            }
                                        }
                                    }
                                }
                            }
                        },
                        "page": {
                            "type": "object",
                            "description": "Мета первой страницы чанков. Сами чанки — отдельным `GET`-запросом с пагинацией по `preview_id`.",
                            "properties": {
                                "current_page": {
                                    "type": "integer",
                                    "example": 1
                                },
                                "per_page": {
                                    "type": "integer",
                                    "example": 100
                                },
                                "total": {
                                    "type": "integer",
                                    "description": "Всего чанков в разбиении (по всем страницам).",
                                    "example": 342
                                },
                                "has_more": {
                                    "type": "boolean",
                                    "example": true
                                }
                            }
                        }
                    }
                }
            },
            "private_cartesia_voice_clones_userId__voice_clone_updated": {
                "name": "voice_clone.updated",
                "title": "Voice clone updated",
                "summary": "Клон голоса Cartesia создан или сменил статус (`pending` → `cloning` → `ready` либо `failed`; `archived` после удаления; `review` — на проверке у модератора: в образце похожий голос публичного артиста, после одобрения — `pending`, иначе `banned`). `voice_id` появляется только у `ready` — его кладут в `tts_settings.voice_id` шаблона Cartesia.",
                "payload": {
                    "type": "object",
                    "required": [
                        "voice_clone"
                    ],
                    "properties": {
                        "voice_clone": {
                            "type": "object",
                            "required": [
                                "id",
                                "provider",
                                "display_name",
                                "status",
                                "voice_id",
                                "attempts",
                                "error",
                                "created_at"
                            ],
                            "properties": {
                                "id": {
                                    "type": "string",
                                    "format": "uuid"
                                },
                                "provider": {
                                    "type": "string",
                                    "enum": [
                                        "cartesia"
                                    ]
                                },
                                "display_name": {
                                    "type": "string"
                                },
                                "language": {
                                    "type": "string",
                                    "nullable": true,
                                    "example": "ru"
                                },
                                "description": {
                                    "type": "string",
                                    "nullable": true
                                },
                                "status": {
                                    "type": "string",
                                    "enum": [
                                        "pending",
                                        "cloning",
                                        "ready",
                                        "failed",
                                        "archived",
                                        "banned"
                                    ],
                                    "description": "Статус клона. `banned` — клон заблокирован модератором: в новые заказы не берётся и не удаляется, причина — в `ban_reason`."
                                },
                                "voice_id": {
                                    "type": "string",
                                    "nullable": true,
                                    "description": "Идентификатор голоса Cartesia — значение для `tts_settings.voice_id` шаблона. Есть только у клона в статусе `ready`, иначе `null`."
                                },
                                "attempts": {
                                    "type": "integer",
                                    "example": 1
                                },
                                "error": {
                                    "type": "object",
                                    "nullable": true,
                                    "properties": {
                                        "reason": {
                                            "type": "string",
                                            "description": "processing_error, max_retries, network, timeout, dispatch_failed"
                                        },
                                        "message": {
                                            "type": "string",
                                            "nullable": true
                                        }
                                    }
                                },
                                "created_at": {
                                    "type": "string",
                                    "format": "date-time"
                                },
                                "completed_at": {
                                    "type": "string",
                                    "format": "date-time",
                                    "nullable": true
                                },
                                "failed_at": {
                                    "type": "string",
                                    "format": "date-time",
                                    "nullable": true
                                },
                                "banned_at": {
                                    "type": "string",
                                    "format": "date-time",
                                    "nullable": true
                                },
                                "ban_reason": {
                                    "type": "string",
                                    "nullable": true,
                                    "description": "Причина блокировки клона модератором либо `null`."
                                }
                            }
                        }
                    }
                }
            },
            "private_fishaudio_voice_clones_userId__voice_clone_updated": {
                "name": "voice_clone.updated",
                "title": "Voice clone updated",
                "summary": "Клон голоса Fish Audio создан или сменил статус (`pending` → `cloning` → `ready` либо `failed`; `archived` после удаления; `review` — на проверке у модератора: в образце похожий голос публичного артиста, после одобрения — `pending`; `banned` — заблокирован модератором). `voice_id` появляется только у `ready` — его кладут в `tts_settings.voice_id` шаблона Fish Audio.",
                "payload": {
                    "type": "object",
                    "required": [
                        "voice_clone"
                    ],
                    "properties": {
                        "voice_clone": {
                            "type": "object",
                            "required": [
                                "id",
                                "provider",
                                "display_name",
                                "status",
                                "voice_id",
                                "attempts",
                                "error",
                                "created_at"
                            ],
                            "properties": {
                                "id": {
                                    "type": "string",
                                    "format": "uuid"
                                },
                                "provider": {
                                    "type": "string",
                                    "enum": [
                                        "fishaudio"
                                    ]
                                },
                                "display_name": {
                                    "type": "string"
                                },
                                "language": {
                                    "type": "string",
                                    "nullable": true,
                                    "example": "ru"
                                },
                                "description": {
                                    "type": "string",
                                    "nullable": true
                                },
                                "status": {
                                    "type": "string",
                                    "enum": [
                                        "pending",
                                        "cloning",
                                        "ready",
                                        "failed",
                                        "archived",
                                        "banned"
                                    ],
                                    "description": "Статус клона. `banned` — клон заблокирован модератором: в новые заказы не берётся и не удаляется, причина — в `ban_reason`."
                                },
                                "voice_id": {
                                    "type": "string",
                                    "nullable": true,
                                    "description": "Идентификатор голоса Fish Audio (строка из 32 hex-символов, не UUID) — значение для `tts_settings.voice_id` шаблона. Есть только у клона в статусе `ready`, иначе `null`."
                                },
                                "attempts": {
                                    "type": "integer",
                                    "example": 1
                                },
                                "error": {
                                    "type": "object",
                                    "nullable": true,
                                    "properties": {
                                        "reason": {
                                            "type": "string",
                                            "description": "processing_error, max_retries, network, timeout, dispatch_failed, unbanned"
                                        },
                                        "message": {
                                            "type": "string",
                                            "nullable": true
                                        }
                                    }
                                },
                                "created_at": {
                                    "type": "string",
                                    "format": "date-time"
                                },
                                "completed_at": {
                                    "type": "string",
                                    "format": "date-time",
                                    "nullable": true
                                },
                                "failed_at": {
                                    "type": "string",
                                    "format": "date-time",
                                    "nullable": true
                                },
                                "banned_at": {
                                    "type": "string",
                                    "format": "date-time",
                                    "nullable": true
                                },
                                "ban_reason": {
                                    "type": "string",
                                    "nullable": true,
                                    "description": "Причина блокировки клона модератором либо `null`."
                                }
                            }
                        }
                    }
                }
            },
            "private_giftcodes_userId__status_changed": {
                "name": "status.changed",
                "title": "Status changed",
                "summary": "Сменился статус подарочного кода.",
                "payload": {
                    "type": "object",
                    "required": [
                        "gift_code"
                    ],
                    "properties": {
                        "gift_code": {
                            "type": "object",
                            "required": [
                                "uuid",
                                "code_masked",
                                "nominal",
                                "nominal_formatted",
                                "source",
                                "funding",
                                "status",
                                "activatable_at",
                                "redeemed_at",
                                "cancelled_at",
                                "created_at",
                                "currency_asset"
                            ],
                            "properties": {
                                "uuid": {
                                    "type": "string",
                                    "example": "a2467160-ceab-4ab6-8095-7a0fafda7648"
                                },
                                "code_masked": {
                                    "type": "string",
                                    "example": "LUM-****-****-SNKG"
                                },
                                "nominal": {
                                    "type": "integer",
                                    "example": 10000000000
                                },
                                "nominal_formatted": {
                                    "type": "number",
                                    "example": 100000000
                                },
                                "source": {
                                    "type": "string",
                                    "enum": [
                                        "purchase",
                                        "reseller"
                                    ],
                                    "example": "purchase"
                                },
                                "funding": {
                                    "type": "string",
                                    "enum": [
                                        "rub",
                                        "crypto",
                                        "mixed"
                                    ],
                                    "example": "crypto"
                                },
                                "status": {
                                    "type": "string",
                                    "enum": [
                                        "active",
                                        "refunding",
                                        "redeemed",
                                        "refunded",
                                        "cancelled",
                                        "annulled"
                                    ],
                                    "example": "active"
                                },
                                "activatable_at": {
                                    "type": "string",
                                    "example": "2026-10-10T14:47:14+00:00"
                                },
                                "redeemed_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "example": "2026-10-10T14:48:14+00:00",
                                    "format": "date-time"
                                },
                                "cancelled_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "example": "2026-10-10T14:48:14+00:00",
                                    "format": "date-time"
                                },
                                "created_at": {
                                    "type": "string",
                                    "example": "2026-10-10T14:48:14+00:00"
                                },
                                "currency_asset": {
                                    "type": "object",
                                    "required": [
                                        "code",
                                        "precision"
                                    ],
                                    "properties": {
                                        "code": {
                                            "type": "string",
                                            "example": "LUMC"
                                        },
                                        "precision": {
                                            "type": "integer",
                                            "example": 2
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "private_giftcodes_userId__issued": {
                "name": "issued",
                "title": "Issued",
                "summary": "Выпущена партия подарочных кодов: сводка партии без значений кодов.",
                "payload": {
                    "type": "object",
                    "required": [
                        "batch"
                    ],
                    "properties": {
                        "batch": {
                            "type": "object",
                            "required": [
                                "uuid",
                                "source",
                                "codes_count",
                                "nominal_total",
                                "nominal_total_formatted",
                                "created_at",
                                "currency_asset"
                            ],
                            "properties": {
                                "uuid": {
                                    "type": "string",
                                    "example": "0a926d68-e974-4220-aab2-7952b111f170"
                                },
                                "source": {
                                    "type": "string",
                                    "enum": [
                                        "purchase",
                                        "reseller"
                                    ],
                                    "example": "purchase"
                                },
                                "codes_count": {
                                    "type": "integer",
                                    "example": 1
                                },
                                "nominal_total": {
                                    "type": "integer",
                                    "example": 0
                                },
                                "nominal_total_formatted": {
                                    "type": "number",
                                    "example": 0
                                },
                                "created_at": {
                                    "type": "string",
                                    "example": "2026-10-10T14:48:13+00:00"
                                },
                                "currency_asset": {
                                    "type": "object",
                                    "required": [
                                        "code",
                                        "precision"
                                    ],
                                    "properties": {
                                        "code": {
                                            "type": "string",
                                            "example": "LUMC"
                                        },
                                        "precision": {
                                            "type": "integer",
                                            "example": 2
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "private_giftcodes_userId__reseller_application_status_changed": {
                "name": "reseller.application.status.changed",
                "title": "Reseller application status changed",
                "summary": "Сменился статус заявки на роль реселлера.",
                "payload": {
                    "type": "object",
                    "required": [
                        "application"
                    ],
                    "properties": {
                        "application": {
                            "type": "object",
                            "required": [
                                "id",
                                "status",
                                "admin_comment",
                                "reviewed_at",
                                "created_at"
                            ],
                            "properties": {
                                "id": {
                                    "type": "integer",
                                    "example": 14
                                },
                                "status": {
                                    "type": "string",
                                    "enum": [
                                        "pending",
                                        "approved",
                                        "rejected",
                                        "withdrawn"
                                    ],
                                    "example": "pending"
                                },
                                "admin_comment": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "example": "example"
                                },
                                "reviewed_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "example": "2026-10-10T14:48:15+00:00",
                                    "format": "date-time"
                                },
                                "created_at": {
                                    "type": "string",
                                    "example": "2026-10-10T14:48:15+00:00"
                                }
                            }
                        }
                    }
                }
            },
            "private_giftcodes_userId__reseller_status_changed": {
                "name": "reseller.status.changed",
                "title": "Reseller status changed",
                "summary": "Сменился статус реселлера.",
                "payload": {
                    "type": "object",
                    "required": [
                        "reseller"
                    ],
                    "properties": {
                        "reseller": {
                            "type": "object",
                            "required": [
                                "id",
                                "status",
                                "discount_bps",
                                "blocked_reason",
                                "approved_at",
                                "currency_asset"
                            ],
                            "properties": {
                                "id": {
                                    "type": "integer",
                                    "example": 1
                                },
                                "status": {
                                    "type": "string",
                                    "enum": [
                                        "active",
                                        "blocked",
                                        "revoked"
                                    ],
                                    "example": "active"
                                },
                                "discount_bps": {
                                    "type": "integer",
                                    "example": 0
                                },
                                "blocked_reason": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "example": "example"
                                },
                                "approved_at": {
                                    "type": "string",
                                    "example": "2026-10-12T15:55:20+00:00"
                                },
                                "currency_asset": {
                                    "type": "object",
                                    "required": [
                                        "code",
                                        "precision"
                                    ],
                                    "properties": {
                                        "code": {
                                            "type": "string",
                                            "example": "LUMC"
                                        },
                                        "precision": {
                                            "type": "integer",
                                            "example": 2
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}