{"openapi":"3.1.0","info":{"title":"Hawklance API","version":"2026-11-01","description":"Генерация видео со звуком по описанию, фото и шаблонам трендов. Предварительная версия: рендер пока эмулируется, поле simulated в ответе это показывает.","contact":{"email":"hello@hawklance.ai"}},"servers":[{"url":"https://api.hawklance.ai/v1"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Видео","description":"Создание ролика, статус, отмена и удаление. Генерация идёт асинхронно: создайте видео и следите за статусом запросами или вебхуком."},{"name":"Файлы","description":"Фото, видео и аудио для генераций. Файл принадлежит режиму ключа, которым загружен."},{"name":"Шаблоны","description":"Каталог трендов и поля, которые нужны каждому шаблону."},{"name":"Модели","description":"Доступные модели и их возможности."},{"name":"Баланс","description":"Остаток токенов и лимиты аккаунта."}],"paths":{"/videos":{"post":{"operationId":"createVideo","tags":["Видео"],"summary":"Создать видео","description":"Ставит ролик в очередь и сразу отвечает. Передайте prompt либо template. Боевой ключ сразу списывает токены; при ошибке рендера или отмене они возвращаются.","parameters":[{"name":"Idempotency-Key","in":"header","description":"Повтор с тем же ключом вернёт уже созданное видео, а не новое. Пригодится при обрыве сети.","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVideo"},"example":{"template":"novyy-obraz","inputs":{"person":["file_3Hq9XkLs2VbN7mPz0RtYc4Wd"],"new_look":["file_7Bv1NcXz5QwE2rTy8UiOp3As"]},"quality":"720p","metadata":{"order_id":"4815"}}}}},"responses":{"200":{"description":"Повтор с тем же Idempotency-Key: заголовок Idempotent-Replayed: true.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Video"},"example":{"id":"vid_8fK2mQxLp0ZrT4nYw7Vb1sDc","object":"video","mode":"test","status":"succeeded","progress":1,"model":"hawklance-4.8","template":"novyy-obraz","prompt":null,"inputs":{"person":["file_3Hq9XkLs2VbN7mPz0RtYc4Wd"],"new_look":["file_7Bv1NcXz5QwE2rTy8UiOp3As"]},"images":["file_3Hq9XkLs2VbN7mPz0RtYc4Wd","file_7Bv1NcXz5QwE2rTy8UiOp3As"],"duration_seconds":10,"aspect_ratio":"9:16","quality":"720p","width":768,"height":1344,"seed":482910375,"cost":{"tokens":390,"charged":false},"estimated_seconds":12,"output":{"url":"https://firsts3.ru/hawklance/templates/novyy-obraz/preview.mp4?v=2","poster_url":"https://firsts3.ru/hawklance/templates/novyy-obraz/poster.jpg","expires_at":"2026-11-02T18:04:12.000Z"},"error":null,"metadata":{"order_id":"4815"},"simulated":true,"created_at":"2026-11-02T12:04:00.000Z","finished_at":"2026-11-02T12:04:12.000Z"}}}},"202":{"description":"Видео в очереди.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Video"},"example":{"id":"vid_8fK2mQxLp0ZrT4nYw7Vb1sDc","object":"video","mode":"test","status":"queued","progress":0,"model":"hawklance-4.8","template":"novyy-obraz","prompt":null,"inputs":{"person":["file_3Hq9XkLs2VbN7mPz0RtYc4Wd"],"new_look":["file_7Bv1NcXz5QwE2rTy8UiOp3As"]},"images":["file_3Hq9XkLs2VbN7mPz0RtYc4Wd","file_7Bv1NcXz5QwE2rTy8UiOp3As"],"duration_seconds":10,"aspect_ratio":"9:16","quality":"720p","width":768,"height":1344,"seed":482910375,"cost":{"tokens":390,"charged":false},"estimated_seconds":12,"output":null,"error":null,"metadata":{"order_id":"4815"},"simulated":true,"created_at":"2026-11-02T12:04:00.000Z","finished_at":null}}}},"400":{"description":"Неверное поле: param показывает какое.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request_error","code":"missing_input","message":"person needs at least 1 file(s).","param":"inputs.person","request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}},"401":{"description":"Ключ не передан, неверен или отозван.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"authentication_error","code":"invalid_api_key","message":"This API key is not valid or has been revoked.","param":null,"request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}},"402":{"description":"Не хватает токенов или достигнут месячный лимит.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"billing_error","code":"insufficient_balance","message":"This video costs 390 tokens. Top up the balance.","param":null,"request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}},"404":{"description":"Такого шаблона нет.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request_error","code":"template_not_found","message":"Template unknown not found. See GET /v1/templates.","param":"template","request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}},"429":{"description":"Превышен лимит запросов или одновременных видео.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"rate_limit_error","code":"rate_limit_exceeded","message":"Rate limit of 30 requests per minute exceeded.","param":null,"request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}}}},"get":{"operationId":"listVideos","tags":["Видео"],"summary":"Список видео","description":"Видео режима, которому принадлежит ключ.","parameters":[{"name":"limit","in":"query","description":"Сколько записей вернуть, от 1 до 100.","schema":{"type":"integer","default":20,"minimum":1,"maximum":100}},{"name":"after","in":"query","description":"next_cursor предыдущей страницы.","schema":{"type":"string"}},{"name":"status","in":"query","description":"Только видео в этом статусе.","schema":{"$ref":"#/components/schemas/VideoStatus"}}],"responses":{"200":{"description":"Список, новые сверху.","content":{"application/json":{"schema":{"type":"object","required":["object","data","has_more","next_cursor"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Video"}},"has_more":{"type":"boolean","description":"Есть ли ещё страницы."},"next_cursor":{"type":["string","null"],"description":"Значение для параметра after на следующей странице."}}},"example":{"object":"list","data":[{"id":"vid_8fK2mQxLp0ZrT4nYw7Vb1sDc","object":"video","mode":"test","status":"succeeded","progress":1,"model":"hawklance-4.8","template":"novyy-obraz","prompt":null,"inputs":{"person":["file_3Hq9XkLs2VbN7mPz0RtYc4Wd"],"new_look":["file_7Bv1NcXz5QwE2rTy8UiOp3As"]},"images":["file_3Hq9XkLs2VbN7mPz0RtYc4Wd","file_7Bv1NcXz5QwE2rTy8UiOp3As"],"duration_seconds":10,"aspect_ratio":"9:16","quality":"720p","width":768,"height":1344,"seed":482910375,"cost":{"tokens":390,"charged":false},"estimated_seconds":12,"output":{"url":"https://firsts3.ru/hawklance/templates/novyy-obraz/preview.mp4?v=2","poster_url":"https://firsts3.ru/hawklance/templates/novyy-obraz/poster.jpg","expires_at":"2026-11-02T18:04:12.000Z"},"error":null,"metadata":{"order_id":"4815"},"simulated":true,"created_at":"2026-11-02T12:04:00.000Z","finished_at":"2026-11-02T12:04:12.000Z"}],"has_more":false,"next_cursor":null}}}},"401":{"description":"Ключ не передан, неверен или отозван.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"authentication_error","code":"invalid_api_key","message":"This API key is not valid or has been revoked.","param":null,"request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}}}}},"/videos/{id}":{"get":{"operationId":"getVideo","tags":["Видео"],"summary":"Получить видео","description":"Статус и результат. Опрашивайте не чаще раза в 5 секунд или подпишитесь на вебхук.","parameters":[{"name":"id","in":"path","required":true,"description":"Идентификатор видео.","schema":{"type":"string"}}],"responses":{"200":{"description":"Видео.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Video"},"example":{"id":"vid_8fK2mQxLp0ZrT4nYw7Vb1sDc","object":"video","mode":"test","status":"succeeded","progress":1,"model":"hawklance-4.8","template":"novyy-obraz","prompt":null,"inputs":{"person":["file_3Hq9XkLs2VbN7mPz0RtYc4Wd"],"new_look":["file_7Bv1NcXz5QwE2rTy8UiOp3As"]},"images":["file_3Hq9XkLs2VbN7mPz0RtYc4Wd","file_7Bv1NcXz5QwE2rTy8UiOp3As"],"duration_seconds":10,"aspect_ratio":"9:16","quality":"720p","width":768,"height":1344,"seed":482910375,"cost":{"tokens":390,"charged":false},"estimated_seconds":12,"output":{"url":"https://firsts3.ru/hawklance/templates/novyy-obraz/preview.mp4?v=2","poster_url":"https://firsts3.ru/hawklance/templates/novyy-obraz/poster.jpg","expires_at":"2026-11-02T18:04:12.000Z"},"error":null,"metadata":{"order_id":"4815"},"simulated":true,"created_at":"2026-11-02T12:04:00.000Z","finished_at":"2026-11-02T12:04:12.000Z"}}}},"401":{"description":"Ключ не передан, неверен или отозван.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"authentication_error","code":"invalid_api_key","message":"This API key is not valid or has been revoked.","param":null,"request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}},"404":{"description":"Video не найден(о) или принадлежит другому режиму.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request_error","code":"not_found","message":"Video not found.","param":null,"request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}}}},"delete":{"operationId":"deleteVideo","tags":["Видео"],"summary":"Удалить видео","description":"Удаляет завершённое видео и файл результата. Идущее сначала отмените.","parameters":[{"name":"id","in":"path","required":true,"description":"Идентификатор видео.","schema":{"type":"string"}}],"responses":{"200":{"description":"Удалено.","content":{"application/json":{"schema":{"type":"object","required":["id","object","deleted"],"properties":{"id":{"type":"string"},"object":{"const":"video"},"deleted":{"const":true}}},"example":{"id":"vid_8fK2mQxLp0ZrT4nYw7Vb1sDc","object":"video","deleted":true}}}},"401":{"description":"Ключ не передан, неверен или отозван.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"authentication_error","code":"invalid_api_key","message":"This API key is not valid or has been revoked.","param":null,"request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}},"404":{"description":"Video не найден(о) или принадлежит другому режиму.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request_error","code":"not_found","message":"Video not found.","param":null,"request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}},"409":{"description":"Видео ещё идёт.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request_error","code":"video_running","message":"Cancel the video before deleting it.","param":null,"request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}}}}},"/videos/{id}/cancel":{"post":{"operationId":"cancelVideo","tags":["Видео"],"summary":"Отменить видео","description":"Останавливает незавершённое видео и возвращает токены.","parameters":[{"name":"id","in":"path","required":true,"description":"Идентификатор видео.","schema":{"type":"string"}}],"responses":{"200":{"description":"Отменено.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Video"},"example":{"id":"vid_8fK2mQxLp0ZrT4nYw7Vb1sDc","object":"video","mode":"test","status":"canceled","progress":0,"model":"hawklance-4.8","template":"novyy-obraz","prompt":null,"inputs":{"person":["file_3Hq9XkLs2VbN7mPz0RtYc4Wd"],"new_look":["file_7Bv1NcXz5QwE2rTy8UiOp3As"]},"images":["file_3Hq9XkLs2VbN7mPz0RtYc4Wd","file_7Bv1NcXz5QwE2rTy8UiOp3As"],"duration_seconds":10,"aspect_ratio":"9:16","quality":"720p","width":768,"height":1344,"seed":482910375,"cost":{"tokens":390,"charged":false},"estimated_seconds":12,"output":null,"error":null,"metadata":{"order_id":"4815"},"simulated":true,"created_at":"2026-11-02T12:04:00.000Z","finished_at":"2026-11-02T12:04:12.000Z"}}}},"401":{"description":"Ключ не передан, неверен или отозван.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"authentication_error","code":"invalid_api_key","message":"This API key is not valid or has been revoked.","param":null,"request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}},"404":{"description":"Video не найден(о) или принадлежит другому режиму.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request_error","code":"not_found","message":"Video not found.","param":null,"request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}},"409":{"description":"Видео уже завершилось.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request_error","code":"video_finished","message":"This video is already succeeded.","param":null,"request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}}}}},"/files":{"post":{"operationId":"uploadFile","tags":["Файлы"],"summary":"Загрузить файл","description":"Фото и аудио до 25 МБ, видео до 200 МБ. Форматы: JPG, PNG, WebP, HEIC, AVIF; MP4, MOV, WebM; MP3, M4A, AAC, WAV, OGG.","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"Сам файл."}}}}}},"responses":{"201":{"description":"Файл принят.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/File"},"example":{"id":"file_3Hq9XkLs2VbN7mPz0RtYc4Wd","object":"file","mode":"test","kind":"image","name":"portrait.jpg","bytes":482113,"content_type":"image/jpeg","created_at":"2026-11-02T12:03:41.000Z"}}}},"400":{"description":"Файла нет в запросе.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request_error","code":"invalid_parameter","message":"Send the file as multipart/form-data, in the field «file».","param":"file","request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}},"401":{"description":"Ключ не передан, неверен или отозван.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"authentication_error","code":"invalid_api_key","message":"This API key is not valid or has been revoked.","param":null,"request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}},"413":{"description":"Файл слишком большой.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request_error","code":"file_too_large","message":"Files are limited to 25 MB.","param":"file","request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}},"415":{"description":"Формат не поддерживается.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request_error","code":"unsupported_file_type","message":"Upload an image, a video or an audio file.","param":"file","request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}}}},"get":{"operationId":"listFiles","tags":["Файлы"],"summary":"Список файлов","description":"Файлы режима, которому принадлежит ключ.","parameters":[{"name":"limit","in":"query","description":"Сколько записей вернуть, от 1 до 100.","schema":{"type":"integer","default":20,"minimum":1,"maximum":100}}],"responses":{"200":{"description":"Список, новые сверху.","content":{"application/json":{"schema":{"type":"object","required":["object","data","has_more","next_cursor"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/File"}},"has_more":{"type":"boolean","description":"Есть ли ещё страницы."},"next_cursor":{"type":["string","null"],"description":"Значение для параметра after на следующей странице."}}},"example":{"object":"list","data":[{"id":"file_3Hq9XkLs2VbN7mPz0RtYc4Wd","object":"file","mode":"test","kind":"image","name":"portrait.jpg","bytes":482113,"content_type":"image/jpeg","created_at":"2026-11-02T12:03:41.000Z"}],"has_more":false,"next_cursor":null}}}},"401":{"description":"Ключ не передан, неверен или отозван.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"authentication_error","code":"invalid_api_key","message":"This API key is not valid or has been revoked.","param":null,"request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}}}}},"/files/{id}":{"get":{"operationId":"getFile","tags":["Файлы"],"summary":"Получить файл","description":"Сведения о загруженном файле.","parameters":[{"name":"id","in":"path","required":true,"description":"Идентификатор файла.","schema":{"type":"string"}}],"responses":{"200":{"description":"Файл.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/File"},"example":{"id":"file_3Hq9XkLs2VbN7mPz0RtYc4Wd","object":"file","mode":"test","kind":"image","name":"portrait.jpg","bytes":482113,"content_type":"image/jpeg","created_at":"2026-11-02T12:03:41.000Z"}}}},"401":{"description":"Ключ не передан, неверен или отозван.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"authentication_error","code":"invalid_api_key","message":"This API key is not valid or has been revoked.","param":null,"request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}},"404":{"description":"File не найден(о) или принадлежит другому режиму.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request_error","code":"not_found","message":"File not found.","param":null,"request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}}}}},"/templates":{"get":{"operationId":"listTemplates","tags":["Шаблоны"],"summary":"Список шаблонов","description":"Весь открытый каталог. Обновляется: держите id шаблонов в настройках, а не в коде.","parameters":[{"name":"limit","in":"query","description":"Сколько записей вернуть, от 1 до 100.","schema":{"type":"integer","default":20,"minimum":1,"maximum":100}},{"name":"after","in":"query","description":"next_cursor предыдущей страницы.","schema":{"type":"string"}},{"name":"section","in":"query","description":"Только шаблоны этого раздела.","schema":{"type":"string"}}],"responses":{"200":{"description":"Список, новые сверху.","content":{"application/json":{"schema":{"type":"object","required":["object","data","has_more","next_cursor"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Template"}},"has_more":{"type":"boolean","description":"Есть ли ещё страницы."},"next_cursor":{"type":["string","null"],"description":"Значение для параметра after на следующей странице."}}},"example":{"object":"list","data":[{"id":"novyy-obraz","object":"template","name":"Новый образ","section":"UGC-контент","description":"Смена образа по щелчку: было — стало.","duration_seconds":10,"aspect_ratios":["9:16"],"poster_url":"https://firsts3.ru/hawklance/templates/novyy-obraz/poster.jpg","preview_url":"https://firsts3.ru/hawklance/templates/novyy-obraz/preview.mp4?v=2","inputs":[{"name":"person","type":"images","title":"Ваше фото ДО","description":"По пояс или в полный рост, лицо хорошо видно, один человек.","required":true,"min_count":1,"max_count":1},{"name":"new_look","type":"images","title":"Ваш новый образ","description":"Вы в новом наряде или сам наряд целиком.","required":true,"min_count":1,"max_count":1}]}],"has_more":false,"next_cursor":null}}}},"401":{"description":"Ключ не передан, неверен или отозван.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"authentication_error","code":"invalid_api_key","message":"This API key is not valid or has been revoked.","param":null,"request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}}}}},"/templates/{id}":{"get":{"operationId":"getTemplate","tags":["Шаблоны"],"summary":"Получить шаблон","description":"Поля inputs показывают, что передать в POST /videos.","parameters":[{"name":"id","in":"path","required":true,"description":"Идентификатор шаблона.","schema":{"type":"string"}}],"responses":{"200":{"description":"Шаблон.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Template"},"example":{"id":"novyy-obraz","object":"template","name":"Новый образ","section":"UGC-контент","description":"Смена образа по щелчку: было — стало.","duration_seconds":10,"aspect_ratios":["9:16"],"poster_url":"https://firsts3.ru/hawklance/templates/novyy-obraz/poster.jpg","preview_url":"https://firsts3.ru/hawklance/templates/novyy-obraz/preview.mp4?v=2","inputs":[{"name":"person","type":"images","title":"Ваше фото ДО","description":"По пояс или в полный рост, лицо хорошо видно, один человек.","required":true,"min_count":1,"max_count":1},{"name":"new_look","type":"images","title":"Ваш новый образ","description":"Вы в новом наряде или сам наряд целиком.","required":true,"min_count":1,"max_count":1}]}}}},"401":{"description":"Ключ не передан, неверен или отозван.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"authentication_error","code":"invalid_api_key","message":"This API key is not valid or has been revoked.","param":null,"request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}},"404":{"description":"Такого шаблона нет.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"invalid_request_error","code":"template_not_found","message":"Template unknown not found.","param":null,"request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}}}}},"/models":{"get":{"operationId":"listModels","tags":["Модели"],"summary":"Список моделей","description":"Модели и их возможности.","responses":{"200":{"description":"Список, новые сверху.","content":{"application/json":{"schema":{"type":"object","required":["object","data","has_more","next_cursor"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Model"}},"has_more":{"type":"boolean","description":"Есть ли ещё страницы."},"next_cursor":{"type":["string","null"],"description":"Значение для параметра after на следующей странице."}}},"example":{"object":"list","data":[{"id":"hawklance-4.8","object":"model","name":"Hawklance 4.8","description":"Видео со звуком по описанию, фото и шаблонам трендов.","qualities":["480p","720p"],"coming_soon_qualities":["1080p"],"aspect_ratios":["9:16","16:9"],"max_duration_seconds":15,"max_images":9,"sound":true}],"has_more":false,"next_cursor":null}}}},"401":{"description":"Ключ не передан, неверен или отозван.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"authentication_error","code":"invalid_api_key","message":"This API key is not valid or has been revoked.","param":null,"request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}}}}},"/balance":{"get":{"operationId":"getBalance","tags":["Баланс"],"summary":"Получить баланс","description":"Токены на балансе, расход за месяц, лимиты и цена секунды.","responses":{"200":{"description":"Баланс.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Balance"},"example":{"object":"balance","tokens":22590,"month_spend_tokens":7410,"monthly_limit_tokens":100000,"tier":"tier-1","tokens_per_second":{"480p":29,"720p":39}}}}},"401":{"description":"Ключ не передан, неверен или отозван.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"error":{"type":"authentication_error","code":"invalid_api_key","message":"This API key is not valid or has been revoked.","param":null,"request_id":"req_5tGh2KjL9QwZx3Vb7Nm0Pc1R"}}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"hl_test_… или hl_live_…"}},"schemas":{"VideoStatus":{"type":"string","enum":["queued","running","succeeded","failed","canceled"]},"CreateVideo":{"type":"object","additionalProperties":false,"properties":{"prompt":{"type":"string","maxLength":12000,"description":"Описание ролика. Обязательно, если нет template."},"template":{"type":"string","description":"Идентификатор шаблона. Обязателен, если нет prompt."},"inputs":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"description":"Значения полей шаблона: id файлов или текст. Поля — в GET /templates/{id}."},"images":{"type":"array","items":{"type":"string"},"maxItems":9,"description":"Id фото для своего описания, по порядку <Picture 1>, <Picture 2>…"},"model":{"type":"string","enum":["hawklance-4.8"],"default":"hawklance-4.8","description":"Модель."},"duration_seconds":{"type":"integer","minimum":5,"maximum":15,"default":5,"description":"Длина ролика. У шаблона своя длина, поле не передаётся."},"aspect_ratio":{"type":"string","enum":["9:16","16:9"],"default":"9:16","description":"Формат. У шаблона — из его aspect_ratios."},"quality":{"type":"string","enum":["480p","720p"],"default":"480p","description":"Качество. 1080p — скоро."},"seed":{"type":"integer","minimum":0,"description":"Число для повторяемого результата."},"metadata":{"type":"object","additionalProperties":{"type":"string"},"description":"Ваши метки, вернутся в ответе и вебхуке."},"simulate":{"type":"string","enum":["success","failed","moderated"],"default":"success","description":"Только с тестовым ключом: чем закончится ролик."}}},"Video":{"type":"object","required":["id","object","mode","status","progress","model","template","prompt","images","duration_seconds","aspect_ratio","quality","width","height","seed","cost","estimated_seconds","output","error","metadata","simulated","created_at","finished_at"],"properties":{"id":{"type":"string","description":"Начинается с vid_."},"object":{"const":"video"},"mode":{"type":"string","enum":["test","live"],"description":"Режим ключа."},"status":{"$ref":"#/components/schemas/VideoStatus","description":"queued → running → succeeded, failed или canceled."},"progress":{"type":"number","minimum":0,"maximum":1,"description":"Доля готовности."},"model":{"type":"string"},"template":{"type":["string","null"]},"prompt":{"type":["string","null"],"description":"Ваше описание. Описание шаблона не показывается."},"inputs":{"type":["object","null"]},"images":{"type":"array","items":{"type":"string"}},"duration_seconds":{"type":"number"},"aspect_ratio":{"type":"string"},"quality":{"type":"string"},"width":{"type":"integer"},"height":{"type":"integer"},"seed":{"type":"integer"},"cost":{"type":"object","required":["tokens","charged"],"properties":{"tokens":{"type":"integer","description":"Цена ролика."},"charged":{"type":"boolean","description":"Списаны ли токены сейчас."}}},"estimated_seconds":{"type":"integer","description":"Сколько примерно займёт генерация с момента создания."},"output":{"type":["object","null"],"required":["url","poster_url","expires_at"],"properties":{"url":{"type":"string","description":"Ссылка на MP4."},"poster_url":{"type":"string","description":"Ссылка на постер."},"expires_at":{"type":"string","format":"date-time","description":"Ссылка действует 6 часов; свежую даст новый запрос."}}},"error":{"type":["object","null"],"required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},"metadata":{"type":"object","additionalProperties":{"type":"string"}},"simulated":{"type":"boolean","description":"true — рендер эмулируется, в output лежит пример. Пропадёт, когда рендер подключат."},"created_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"}}},"File":{"type":"object","required":["id","object","mode","kind","name","bytes","content_type","created_at"],"properties":{"id":{"type":"string","description":"Начинается с file_."},"object":{"const":"file"},"mode":{"type":"string","enum":["test","live"]},"kind":{"type":"string","enum":["image","audio","video"]},"name":{"type":"string"},"bytes":{"type":"integer"},"content_type":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}},"Template":{"type":"object","required":["id","object","name","section","description","duration_seconds","aspect_ratios","poster_url","preview_url","inputs"],"properties":{"id":{"type":"string"},"object":{"const":"template"},"name":{"type":"string"},"section":{"type":"string"},"description":{"type":"string"},"duration_seconds":{"type":"number"},"aspect_ratios":{"type":"array","items":{"type":"string"}},"poster_url":{"type":"string"},"preview_url":{"type":"string"},"inputs":{"type":"array","description":"Поля шаблона.","items":{"type":"object","required":["name","type","title","description","required"],"properties":{"name":{"type":"string"},"type":{"type":"string","enum":["images","video","audio","text","choice"]},"title":{"type":"string"},"description":{"type":"string"},"required":{"type":"boolean"},"min_count":{"type":"integer"},"max_count":{"type":"integer"},"options":{"type":"array","items":{"type":"string"}},"default":{"type":"string"},"max_length":{"type":"integer"}}}}}},"Model":{"type":"object","required":["id","object","name","description","qualities","aspect_ratios","max_duration_seconds"],"properties":{"id":{"type":"string"},"object":{"const":"model"},"name":{"type":"string"},"description":{"type":"string"},"qualities":{"type":"array","items":{"type":"string"}},"coming_soon_qualities":{"type":"array","items":{"type":"string"}},"aspect_ratios":{"type":"array","items":{"type":"string"}},"max_duration_seconds":{"type":"integer"},"max_images":{"type":"integer"},"sound":{"type":"boolean"}}},"Balance":{"type":"object","required":["object","tokens","month_spend_tokens","monthly_limit_tokens","tier","tokens_per_second"],"properties":{"object":{"const":"balance"},"tokens":{"type":"integer","description":"Токены на балансе."},"month_spend_tokens":{"type":"integer","description":"Потрачено боевыми ключами с начала месяца."},"monthly_limit_tokens":{"type":["integer","null"],"description":"Ваш месячный лимит; null — не задан."},"tier":{"type":"string","description":"Уровень лимитов."},"tokens_per_second":{"type":"object","additionalProperties":{"type":"integer"},"description":"Цена секунды по качеству."}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["type","code","message","param","request_id"],"properties":{"type":{"type":"string","enum":["authentication_error","permission_error","invalid_request_error","billing_error","rate_limit_error","server_error"]},"code":{"type":"string","description":"Постоянный код для вашего кода."},"message":{"type":"string","description":"Описание для человека, на английском."},"param":{"type":["string","null"],"description":"Поле, в котором ошибка."},"request_id":{"type":"string","description":"Идентификатор запроса: по нему запрос ищется в журнале."}}}}}}}}