Официальный API VEO 3.1 для преобразования текста в видео
Справочник по официальному API VEO 3.1 для преобразования текста в видео и интерактивный Playground — тело JSON-запроса, трёхэтапный асинхронный поток, гибкая длительность 4 / 6 / 8 секунд, тарификация по каждому запросу.
POST
/
v1
/
videos
Text-to-video: submit a generation task from text prompt
Интерактивный Playground справа поддерживает отладку в реальном времени. Укажите свой ключ API в Authorization (формат Bearer sk-xxx), введите prompt, выберите модель / секунды / metadata.resolution, затем отправьте. Default группа работает — отдельный переключатель группы не нужен.
Область применения: Эта страница охватывает «генерацию видео только по тексту» — без тела input_reference, application/json. Для генерации по референсному изображению используйте эндпоинт Image-to-Video (тот же эндпоинт + загрузка input_reference).
⚠️ Три наиболее распространенные ошибки
Поле длины называется seconds (а не duration) и должно быть строкой"4" / "6" / "8". Если назвать его duration, это будет молча проигнорировано → length откатится к значению по умолчанию 4 сек. (ловушка «отправили 8s, получили 4s»); передача числа завершается parse_request_failed: cannot unmarshal number into Go struct field ... duration of type string
Не передавайте generateAudio — upstream возвращает INVALID_ARGUMENT. Описывайте аудиосценарий (ambient, dialogue, BGM) в prompt вместо этого
При 1080p / 4k seconds должно быть "8" — "4" / "6" будут отклонены upstream
Трехшаговый асинхронный процесс — на этой странице описан только шаг 1 (отправка)
import requestsimport timeAPI_KEY = "sk-your-api-key"BASE_URL = "https://api.apiyi.com/v1"HEADERS = {"Authorization": f"Bearer {API_KEY}"}# Step 1: submit (JSON body)resp = requests.post( f"{BASE_URL}/videos", headers={**HEADERS, "Content-Type": "application/json"}, json={ "model": "veo-3.1-fast-generate-preview", "prompt": "A coastal lighthouse at dusk, slow push-in, steady camera, ocean ambience and distant seabirds", "seconds": "8", # must be a string "size": "1280x720", "metadata": { "resolution": "720p", "aspectRatio": "16:9" } }, timeout=30 # POST is just an enqueue; 30 sec is enough).json()task_id = resp.get("task_id") or resp["id"]print(f"Task ID: {task_id}, status: {resp['status']}")# Step 2: poll (3 min for 720p/1080p, 10 min for 4K)deadline = time.time() + 180while time.time() < deadline: s = requests.get(f"{BASE_URL}/videos/{task_id}", headers=HEADERS).json() print(f"Status: {s['status']}, progress: {s.get('progress', 0)}%") if s["status"] == "completed": break if s["status"] == "failed": raise RuntimeError(f"Generation failed: {s}") time.sleep(8)# Step 3: download with retrytime.sleep(4)for i in range(8): try: with requests.get( f"{BASE_URL}/videos/{task_id}/content", headers=HEADERS, stream=True, timeout=180 ) as r: r.raise_for_status() with open("output.mp4", "wb") as f: for chunk in r.iter_content(chunk_size=8192): f.write(chunk) break except requests.HTTPError as e: # 400 = status just flipped to completed (window up to ~20 s): keep waiting; 502 etc.: one more try at most if i == 7 or (e.response.status_code != 400 and i >= 1): raise time.sleep(4)print("Saved: output.mp4")
Если у вас уже есть task_id (полученный при отправке задачи или отображаемый в логах вашей консоли), просто замените два плейсхолдера ниже и выполните:
Когда в JSON-ответе отображается status: "completed", вы можете скачать результат; если отображается in_progress, подождите несколько секунд и проверьте снова.
Для эндпоинта /content требуется заголовок Authorization — прямое открытие URL в адресной строке браузера вернет 401. -f --retry 7 --retry-delay 4 --retry-all-errors обрабатывает ошибку 400 сразу после переключения status на completed (примерно до 20 секунд). Без -f curl посчитает 400 успешным ответом и запишет JSON с ошибкой в output.mp4; без --retry-all-errors параметр --retry вообще не будет повторять попытку при 400 (требуется curl 7.71+).
veo-3.1-fast-generate-preview ($0.3/req) или veo-3.1-generate-preview ($1.2/req)
prompt
string
Да
—
Описание видео; опишите сцену, действие, камеру, освещение, намерение аудио (не передавайте generateAudio)
seconds
string
Нет
"8"
Длительность видео, строковое перечисление: "4" / "6" / "8". Поле — seconds, а не duration (если указать duration, это будет тихо проигнорировано и значение вернется к 4 сек). 1080p/4k должны быть "8"
size
string
Нет
1280x720
Пиксели вывода, например 1280x720 / 1920x1080 / 3840x2160; более низкий приоритет, чем у metadata.resolution
metadata.resolution
string
Нет
720p
720p / 1080p / 4k; более высокий приоритет, чем у size
metadata.aspectRatio
string
Нет
16:9
16:9 (альбомная ориентация) или 9:16 (портретная ориентация)
metadata.seed
int
Нет
—
Случайный seed. Фиксированный seed группирует результаты по стилю (но невозможно побайтно воспроизвести)
metadata.negativePrompt
string
Нет
—
Негативный prompt; рекомендуется "blurry, watermark, distorted, low quality"
Не передавайте поле generateAudio! Veo 3.1 изначально поддерживает аудио; передача этого параметра возвращает INVALID_ARGUMENT. Чтобы управлять аудио, впишите намерение в prompt: "waves, distant seabirds, low wind sounds".
Берите ID задачи из id: ответ на отправку также может содержать task_id (то же значение), но ответы при опросе содержат только id; безопасный шаблон — resp.get("task_id") or resp["id"] (в примерах выше это уже учтено)
Используйте скачивание через /content как надежный источник данных: GET /v1/videos/{task_id}/content возвращает бинарный поток MP4 (требуется заголовок авторизации) и работает для каждой задачи. Завершенный ответ может также содержать video_url (прямая ссылка, без авторизации) и expires_at (примерно через 24 часа); это не гарантируется для каждой задачи и подходит только для временного предварительного просмотра. Фронтенд не может обращаться к /content напрямую — скачивайте на стороне сервера и повторно размещайте в собственном OSS / CDN
progress имеет низкую детализацию — переключается только между несколькими фиксированными шагами, не используйте его для индикаторов выполнения в процентах
status: "failed" обычно содержит error.message с указанием причины (проверка контента, ошибки в параметрах или невозможность получить сгенерированный файл). Неудачные задачи не тарифицируются, а списанные средства возвращаются автоматически; скорректируйте prompt и повторите попытку
/content иногда возвращает 400 сразу после того, как status меняется на completed; повторите попытку через 4 секунды (это уже заложено во всех примерах кода выше)
Этот эндпоинт представляет собой точку входа для асинхронных задач. Тарификация происходит, когда задача достигает completed, с оплатой за запрос в зависимости от названия модели (быстрая $0.3 / стандартная $1.2, см. Тарифы). Сами отправка POST-запроса, опрос и скачивание не тарифицируются; неудачные задачи также не тарифицируются.
Video generation prompt; describe in detail: scene + subject + action + camera + lighting + style.
Audio intent also goes in the prompt (e.g. "waves, distant seabirds, low wind sounds"). Do not pass generateAudio — upstream rejects with INVALID_ARGUMENT.
Пример:
"A coastal lighthouse at dusk, slow push-in, waves lapping the rocks, distant seabirds, cinematic lighting, steady camera"
Video length. The field name is seconds (not duration), a string enum (not number):
"4" — 4 sec, 720p only
"6" — 6 sec, 720p only
"8" — 8 sec (default), required at 1080p / 4k
Sending duration instead is silently ignored → length falls back to the default 4 sec (720p returns no error but only outputs 4 sec; 1080p/4k errors with ... but got 4). Passing a number (8) returns parse_request_failed: cannot unmarshal number into Go struct field ... duration of type string.
Task completion Unix timestamp (seconds); only present for completed status
Пример:
1775025090
Была ли эта страница полезной?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"API易文档中心","description":"企业级专业稳定的AI大模型API中转站,一个令牌、无限模型。支持OpenAI、Claude、Gemini、DeepSeek、Qwen等400+热门AI模型。","colors":{"primary":"#2563eb","light":"#3b82f6","dark":"#1d4ed8"},"logo":{"light":"https://mintcdn.com/apiyillc/LjCT1O0GrSur6F2v/logo/light.svg?fit=max\u0026auto=format\u0026n=LjCT1O0GrSur6F2v\u0026q=85\u0026s=4119ef17a74cc54be127f34578d8b5fa","dark":"https://mintcdn.com/apiyillc/LjCT1O0GrSur6F2v/logo/dark.svg?fit=max\u0026auto=format\u0026n=LjCT1O0GrSur6F2v\u0026q=85\u0026s=1f046ae9580247d96549ade642b5ecc4"},"favicon":"https://mintcdn.com/apiyillc/OMY6ItCc2mC1yzgA/logo/logo.webp?fit=max\u0026auto=format\u0026n=OMY6ItCc2mC1yzgA\u0026q=85\u0026s=62a7977ef801070e689df2d0291b9d13","api":{"openapi":["api-reference/nano-banana-2-generate-openapi.yaml","api-reference/nano-banana-2-edit-openapi.yaml","api-reference/nano-banana-2-generate-openapi-en.yaml","api-reference/nano-banana-2-edit-openapi-en.yaml","api-reference/nano-banana-pro-generate-openapi.yaml","api-reference/nano-banana-pro-edit-openapi.yaml","api-reference/nano-banana-pro-generate-openapi-en.yaml","api-reference/nano-banana-pro-edit-openapi-en.yaml","api-reference/gpt-image-2-all-generate-openapi.yaml","api-reference/gpt-image-2-all-edit-openapi.yaml","api-reference/gpt-image-2-all-generate-openapi-en.yaml","api-reference/gpt-image-2-all-edit-openapi-en.yaml","api-reference/gpt-image-2-all-chat-openapi.yaml","api-reference/gpt-image-2-all-chat-openapi-en.yaml","api-reference/gpt-image-2-vip-generate-openapi.yaml","api-reference/gpt-image-2-vip-edit-openapi.yaml","api-reference/gpt-image-2-vip-chat-openapi.yaml","api-reference/gpt-image-2-vip-generate-openapi-en.yaml","api-reference/gpt-image-2-vip-edit-openapi-en.yaml","api-reference/gpt-image-2-vip-chat-openapi-en.yaml"],"playground":{"display":"interactive","proxy":true},"examples":{"defaults":"required"}},"navbar":{"links":[{"href":"https://api.apiyi.com","label":"首页"},{"href":"https://imagen.apiyi.com","label":"AI出图"},{"href":"https://icover.ai","label":"AI视频"}],"primary":{"type":"button","label":"控制台","href":"https://api.apiyi.com/account/profile"}},"footer":{"socials":{"website":"https://api.apiyi.com"},"links":[{"header":"AI 集成","items":[{"label":"skill.md","href":"https://docs.apiyi.com/skill.md"},{"label":"llms.txt","href":"https://docs.apiyi.com/llms.txt"},{"label":"llms-full.txt","href":"https://docs.apiyi.com/llms-full.txt"},{"label":"model-registry.json","href":"https://docs.apiyi.com/model-registry.json"},{"label":"AI 开发者套件(中文)","href":"/developer-kit"},{"label":"AI Developer Kit (EN)","href":"/en/developer-kit"}]},{"header":"用户口碑 / Wall of Love","items":[{"label":"用户口碑(中文)","href":"/wall-of-love"},{"label":"Wall of Love (EN)","href":"/en/wall-of-love"}]}]},"seo":{"indexing":"all"},"icons":{"library":"lucide"},"banner":{"content":"🚀 **gemini-4-argon 和 Nano Banana 2.1 均已上线 | Now Live**:[详情 Details](https://docs.apiyi.com/changelog)","dismissible":true},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","aistudio"],"display":"header"},"metadata":{"timestamp":false},"styling":{"latex":true},"navigation":{"global":{"anchors":[]},"languages":[{"language":"zh","href":""},{"language":"en","navbar":{"links":[{"href":"https://api.apiyi.com","label":"Home"},{"href":"https://imagen.apiyi.com","label":"AI Image"},{"href":"https://icover.ai","label":"AI Video"}],"primary":{"type":"button","label":"Console","href":"https://api.apiyi.com/account/profile"}},"href":"en"},{"language":"zh-Hant","banner":{"content":"本頁由程式自動轉換為繁體中文,用詞以台灣正體為準;如有歧義請以[簡體中文版](/)為準。","dismissible":true},"footer":{"socials":{"website":"https://api.apiyi.com"},"links":[{"header":"AI 整合","items":[{"label":"skill.md","href":"https://docs.apiyi.com/skill.md"},{"label":"llms.txt","href":"https://docs.apiyi.com/llms.txt"},{"label":"llms-full.txt","href":"https://docs.apiyi.com/llms-full.txt"},{"label":"model-registry.json","href":"https://docs.apiyi.com/model-registry.json"},{"label":"AI 開發者套件(中文)","href":"/developer-kit"},{"label":"AI Developer Kit (EN)","href":"/en/developer-kit"}]},{"header":"使用者口碑 / Wall of Love","items":[{"label":"使用者口碑(中文)","href":"/wall-of-love"},{"label":"Wall of Love (EN)","href":"/en/wall-of-love"}]}]},"navbar":{"links":[{"href":"https://api.apiyi.com","label":"首頁"},{"href":"https://imagen.apiyi.com","label":"AI出圖"},{"href":"https://icover.ai","label":"AI影片"}],"primary":{"type":"button","label":"控制台","href":"https://api.apiyi.com/account/profile"}},"href":"zh-Hant"},{"language":"ja","banner":{"content":"このページは AI により翻訳されています。内容に相違がある場合は[English 版](/en)を正としてください。","dismissible":true},"footer":{"socials":{"website":"https://api.apiyi.com"},"links":[{"header":"AI統合","items":[{"label":"skill.md","href":"https://docs.apiyi.com/skill.md"},{"label":"llms.txt","href":"https://docs.apiyi.com/llms.txt"},{"label":"llms-full.txt","href":"https://docs.apiyi.com/llms-full.txt"},{"label":"model-registry.json","href":"https://docs.apiyi.com/model-registry.json"},{"label":"AI開発者キット(中国語)","href":"/developer-kit"},{"label":"AI Developer Kit (EN)","href":"/en/developer-kit"}]},{"header":"ユーザーの声 / Wall of Love","items":[{"label":"ユーザーの声(中国語)","href":"/wall-of-love"},{"label":"Wall of Love(英語)","href":"/en/wall-of-love"}]}]},"navbar":{"links":[{"href":"https://api.apiyi.com","label":"ホーム"},{"href":"https://imagen.apiyi.com","label":"AI画像生成"},{"href":"https://icover.ai","label":"AI動画生成"}],"primary":{"type":"button","label":"コンソール","href":"https://api.apiyi.com/account/profile"}},"href":"ja"},{"language":"ko","banner":{"content":"이 페이지는 AI로 번역되었습니다. 내용이 다를 경우 [English 버전](/en)을 기준으로 하십시오.","dismissible":true},"footer":{"socials":{"website":"https://api.apiyi.com"},"links":[{"header":"AI 통합","items":[{"label":"skill.md","href":"https://docs.apiyi.com/skill.md"},{"label":"llms.txt","href":"https://docs.apiyi.com/llms.txt"},{"label":"llms-full.txt","href":"https://docs.apiyi.com/llms-full.txt"},{"label":"model-registry.json","href":"https://docs.apiyi.com/model-registry.json"},{"label":"AI 개발자 키트(중국어)","href":"/developer-kit"},{"label":"AI Developer Kit (EN)","href":"/en/developer-kit"}]},{"header":"사용자 후기 / Wall of Love","items":[{"label":"사용자 후기(중국어)","href":"/wall-of-love"},{"label":"Wall of Love (영문)","href":"/en/wall-of-love"}]}]},"navbar":{"links":[{"href":"https://api.apiyi.com","label":"홈"},{"href":"https://imagen.apiyi.com","label":"AI 이미지 생성"},{"href":"https://icover.ai","label":"AI 동영상 생성"}],"primary":{"type":"button","label":"콘솔","href":"https://api.apiyi.com/account/profile"}},"href":"ko"},{"language":"ru","banner":{"content":"Эта страница переведена с помощью ИИ. При расхождениях ориентируйтесь на [английскую версию](/en).","dismissible":true},"footer":{"socials":{"website":"https://api.apiyi.com"},"links":[{"header":"AI-интеграция","items":[{"label":"skill.md","href":"https://docs.apiyi.com/skill.md"},{"label":"llms.txt","href":"https://docs.apiyi.com/llms.txt"},{"label":"llms-full.txt","href":"https://docs.apiyi.com/llms-full.txt"},{"label":"model-registry.json","href":"https://docs.apiyi.com/model-registry.json"},{"label":"Набор AI-разработчика (кит.)","href":"/developer-kit"},{"label":"AI Developer Kit (EN)","href":"/en/developer-kit"}]},{"header":"Отзывы пользователей / Wall of Love","items":[{"label":"Отзывы пользователей (на китайском)","href":"/wall-of-love"},{"label":"Wall of Love (EN)","href":"/en/wall-of-love"}]}]},"navbar":{"links":[{"href":"https://api.apiyi.com","label":"Главная"},{"href":"https://imagen.apiyi.com","label":"Генерация изображений"},{"href":"https://icover.ai","label":"Генерация видео"}],"primary":{"type":"button","label":"Консоль","href":"https://api.apiyi.com/account/profile"}},"href":"ru"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"apiyillc","hasAudioNarration":false,"actualSubdomain":"apiyillc","customDomains":["docs.apiyi.com"],"gitSource":{"type":"github","owner":"pdmaker","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6add97229e1712172edccbf5","collectionId":"2342a635-4ad9-4a7e-a518-07278f9e55d3","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6add97229e1712172edccbf5"},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{},"buildId":"6add97229e1712172edccbf5","clientVersion":"0.0.3965","searchFilterCounts":[{"language":"zh","tag":"首页","count":213},{"language":"en","tag":"Home","count":213},{"language":"ja","tag":"ホーム","count":213},{"language":"ko","tag":"홈","count":213},{"language":"ru","tag":"Главная","count":213},{"language":"zh-Hant","tag":"首頁","count":213},{"language":"zh","tag":"图片 API(官转)","count":80},{"language":"en","tag":"Image API (Official)","count":80},{"language":"ja","tag":"画像API(公式)","count":80},{"language":"ko","tag":"이미지 API (공식)","count":80},{"language":"ru","tag":"Image API (официальный)","count":80},{"language":"zh-Hant","tag":"圖片 API(官轉)","count":80},{"language":"zh","tag":"公告","count":75},{"language":"en","tag":"Announcements","count":75},{"language":"zh","tag":"AI风向标","count":72},{"language":"en","tag":"AI Radar","count":72},{"language":"zh","tag":"常见问题","count":63},{"language":"en","tag":"FAQ","count":63},{"language":"ja","tag":"FAQ","count":63},{"language":"ko","tag":"FAQ","count":63},{"language":"ru","tag":"FAQ","count":63},{"language":"zh-Hant","tag":"常見問題","count":63},{"language":"zh","tag":"使用场景","count":49},{"language":"en","tag":"Use Cases","count":49},{"language":"ja","tag":"活用例","count":49},{"language":"ko","tag":"활용 사례","count":49},{"language":"ru","tag":"Сценарии использования","count":49},{"language":"zh-Hant","tag":"使用場景","count":49},{"language":"zh","tag":"基础 API","count":47},{"language":"en","tag":"Basic API","count":47},{"language":"ja","tag":"基本API","count":47},{"language":"ko","tag":"기본 API","count":47},{"language":"ru","tag":"Базовый API","count":47},{"language":"zh-Hant","tag":"基礎 API","count":47},{"language":"zh","tag":"视频 API(官转)","count":38},{"language":"en","tag":"Video API (Official)","count":38},{"language":"ja","tag":"動画API(公式)","count":38},{"language":"ko","tag":"동영상 API (공식)","count":38},{"language":"ru","tag":"Video API (официальный)","count":38},{"language":"zh-Hant","tag":"影片 API(官轉)","count":38},{"language":"zh","tag":"模型价格","count":35},{"language":"en","tag":"Model Pricing","count":35},{"language":"ja","tag":"モデル料金","count":35},{"language":"ko","tag":"모델 요금","count":35},{"language":"ru","tag":"Цены на модели","count":35},{"language":"zh-Hant","tag":"模型價格","count":35},{"language":"zh","tag":"文本生成","count":27},{"language":"en","tag":"Text Generation","count":27},{"language":"ja","tag":"テキスト生成","count":27},{"language":"ko","tag":"텍스트 생성","count":27},{"language":"ru","tag":"Генерация текста","count":27},{"language":"zh-Hant","tag":"文本生成","count":27},{"language":"ja","tag":"課金とセキュリティ","count":17},{"language":"ko","tag":"결제 및 보안","count":17},{"language":"ru","tag":"Оплата и безопасность","count":17},{"language":"zh-Hant","tag":"充值與安全","count":17},{"language":"ja","tag":"NanoBananaベストプラクティス","count":15},{"language":"ko","tag":"NanoBanana 모범 사례","count":15},{"language":"ru","tag":"Лучшие практики NanoBanana","count":15},{"language":"zh-Hant","tag":"NanoBanana最佳實踐","count":15}]},"assistantConfig":{},"hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"models/models.css","content":".mp-layout{display:flex;gap:2.5rem;max-width:1400px;margin:0 auto;padding:2.5rem 1.5rem 4rem;font-size:15px;line-height:1.7;color:rgb(var(--gray-500, 113 115 119))}html.dark .mp-layout{color:rgb(var(--gray-400, 159 161 165))}.mp-rail{display:none}@media (min-width:1024px){.mp-rail{display:block;width:13rem;flex-shrink:0}}.mp-rail-nav{position:sticky;top:9.25rem;font-size:.875rem}.mp-rail-head{font-weight:600;margin:0 0 .375rem;color:rgb(var(--gray-900, 23 25 29))}html.dark .mp-rail-head{color:rgb(var(--gray-200, 223 225 229))}.mp-rail-link{display:block;padding:.22rem 0;color:rgb(var(--gray-500, 113 115 119));text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mp-content a,.mp-content code.mp-ep-rec,.mp-rail-link:hover{color:rgb(var(--primary, 37 99 235))}html.dark .mp-rail-link{color:rgb(var(--gray-400, 159 161 165))}html.dark .mp-content a,html.dark .mp-content code.mp-ep-rec,html.dark .mp-rail-link:hover{color:rgb(var(--primary-light, 59 130 246))}.mp-rail-vendors{max-height:45vh;overflow-y:auto}.mp-mt{margin-top:1rem}.mp-content{min-width:0;flex:1}.mp-content h2,.mp-title{color:rgb(var(--gray-900, 23 25 29))}.mp-title{font-size:2rem;font-weight:700;letter-spacing:-.02em;margin:0 0 .5rem}html.dark .mp-content strong,html.dark .mp-title{color:#fff}.mp-desc{color:rgb(var(--gray-500, 113 115 119));margin:0 0 1.5rem}html.dark .mp-content th,html.dark .mp-desc{color:rgb(var(--gray-400, 159 161 165))}.mp-content h2{font-size:1.375rem;font-weight:600;margin:2.75rem 0 1rem;padding-bottom:.45rem;border-bottom:1px solid rgb(var(--gray-200, 223 225 229)/.7);scroll-margin-top:12rem}@media (min-width:1024px){.mp-content h2{scroll-margin-top:16.5rem}}html.dark .mp-content h2{border-color:rgb(255 255 255/.1);color:#fff}.mp-content p,.mp-content ul{margin:.75rem 0}.mp-content ul{padding-left:1.4rem}.mp-content li{margin:.4rem 0}.mp-content strong{color:rgb(var(--gray-900, 23 25 29))}.mp-content a{text-decoration:none}.mp-content a:hover{text-decoration:underline}.mp-content code{font-size:.85em;background:rgb(var(--gray-100, 239 241 245)/.8);border:1px solid rgb(var(--gray-200, 223 225 229)/.7);padding:.1em .35em;border-radius:.375rem}html.dark .mp-content code{background:rgb(255 255 255/.06);border-color:rgb(255 255 255/.1)}.mp-content code.mp-ep-rec{background:rgb(var(--primary, 37 99 235)/.08);border-color:rgb(var(--primary, 37 99 235)/.45);font-weight:600}html.dark .mp-content code.mp-ep-rec{background:rgb(var(--primary-light, 59 130 246)/.14);border-color:rgb(var(--primary-light, 59 130 246)/.5)}.mp-content table{display:block;max-width:100%;overflow-x:auto;border-collapse:collapse;font-size:.875rem;margin:1rem 0 1.5rem}.mp-content td,.mp-content th{padding:.55rem 1.25rem .55rem 0;white-space:nowrap}.mp-content th{text-align:left;font-weight:500;color:rgb(var(--gray-500, 113 115 119));border-bottom:1px solid rgb(var(--gray-200, 223 225 229)/.7)}.mp-content td{border-bottom:1px solid rgb(var(--gray-200, 223 225 229)/.45)}html.dark .mp-content th{border-color:rgb(255 255 255/.1)}html.dark .mp-content td{border-color:rgb(255 255 255/.07)}.mp-search{display:contents}.mp-search-bar{position:sticky;top:5rem;z-index:20;margin:0 0 1.75rem;background:rgb(var(--background-light, 255 255 255));padding:.75rem 0 .85rem;box-shadow:0 10px 14px -10px rgb(var(--gray-950, 11 13 17)/.28)}@media (min-width:1024px){.mp-search-bar{top:9.25rem}}html.dark .mp-search-bar{background:rgb(var(--background-dark, 10 11 16));box-shadow:0 8px 12px -10px rgb(0 0 0/.7)}.mp-search-label{margin:0 0 .5rem;padding-left:.6rem;border-left:3px solid rgb(var(--primary, 37 99 235));font-size:.9rem;font-weight:600;line-height:1.4;color:rgb(var(--primary, 37 99 235))}html.dark .mp-search-label{border-left-color:rgb(var(--primary-light, 59 130 246));color:rgb(var(--primary-light, 59 130 246))}.mp-search-input{width:100%;box-sizing:border-box;border:1px solid rgb(var(--gray-400, 159 161 165)/.3);border-radius:.75rem;padding:.7rem 1rem .7rem 2.65rem;font-size:.9rem;background-color:rgb(var(--background-light, 255 255 255));background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23717377' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E\");background-repeat:no-repeat;background-position:.9rem center;color:rgb(var(--gray-900, 23 25 29));outline:0;transition:border-color .15s ease,background-color .15s ease,box-shadow .15s ease}.mp-search-input::placeholder{color:rgb(var(--gray-500, 113 115 119))}.mp-search-input:hover{border-color:rgb(var(--gray-600, 81 83 87)/.3)}.mp-search-input:focus{border-color:rgb(var(--primary, 37 99 235));box-shadow:0 0 0 3px rgb(var(--primary, 37 99 235)/.16)}html.dark .mp-search-input{background-color:rgb(var(--background-dark, 10 11 16));background-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239fa1a5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E\");border-color:rgb(var(--gray-600, 81 83 87)/.3);color:rgb(var(--gray-100, 239 241 245))}html.dark .mp-search-input::placeholder{color:rgb(255 255 255/.5)}html.dark .mp-search-input:hover{border-color:rgb(var(--gray-500, 113 115 119)/.35)}html.dark .mp-search-input:focus{border-color:rgb(var(--primary-light, 59 130 246));box-shadow:0 0 0 3px rgb(var(--primary-light, 59 130 246)/.22)}.mp-search-empty,.mp-search-meta{color:rgb(var(--gray-500, 113 115 119))}.mp-search-meta{font-size:.75rem;margin:.75rem 0 .25rem}.mp-search-empty{font-size:.875rem;margin-top:.75rem}html.dark .mp-search-empty,html.dark .mp-search-meta{color:rgb(var(--gray-400, 159 161 165))}.mp-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.8125rem}@media (min-width:1024px){.mp-jump{display:none}}"},{"filePath":"styles/agent-prompt.css","content":"div.prompt{border:1.5px solid rgb(var(--primary, 37 99 235)/.35);background:rgb(var(--primary, 37 99 235)/.035);padding:1.25rem 1.25rem 1rem;row-gap:.75rem}html.dark div.prompt{border-color:rgb(var(--primary-light, 59 130 246)/.4);background:rgb(var(--primary-light, 59 130 246)/.06)}div.prompt [data-component-part=prompt-content-wrapper]{width:100%}div.prompt [data-component-part=prompt-actions-wrapper]{width:100%;justify-content:flex-end}div.prompt [data-component-part=prompt-description]{flex:1;font-size:14px;line-height:1.65}div.prompt [data-component-part=prompt-description]>div>*{margin:0}div.prompt [data-component-part=prompt-description]>div>*+*{margin-top:.6rem}div.prompt [data-component-part=prompt-description] strong{font-size:15px;font-weight:650;color:rgb(var(--gray-900, 23 25 29))}html.dark div.prompt [data-component-part=prompt-description] strong{color:#fff}div.prompt [data-component-part=prompt-description]>div>*+p{color:rgb(var(--gray-600, 80 82 86))}html.dark div.prompt [data-component-part=prompt-description]>div>*+p{color:rgb(var(--gray-400, 159 161 165))}div.prompt [data-component-part=prompt-description] code{font-size:.85em;background:rgb(var(--gray-100, 239 241 245)/.9);border:1px solid rgb(var(--gray-200, 223 225 229)/.7);padding:.05em .35em;border-radius:.375rem}html.dark div.prompt [data-component-part=prompt-description] code{background:rgb(255 255 255/.06);border-color:rgb(255 255 255/.1)}div.prompt [data-component-part=prompt-description] blockquote{margin:0;padding:.75rem .9rem;font-style:normal;border:1px dashed rgb(var(--gray-300, 191 193 197));border-radius:.6rem;background:rgb(var(--background-light, 255 255 255));font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12.5px;line-height:1.6;color:rgb(var(--gray-600, 80 82 86));overflow-wrap:anywhere;-webkit-mask-image:linear-gradient(to bottom,#000 70%,transparent 100%);mask-image:linear-gradient(to bottom,#000 70%,transparent 100%)}div.prompt [data-component-part=prompt-description] blockquote ol,div.prompt [data-component-part=prompt-description] blockquote p{margin:0}div.prompt [data-component-part=prompt-description] blockquote li{padding:0}div.prompt [data-component-part=prompt-description] blockquote>*+*{margin-top:.5rem}div.prompt [data-component-part=prompt-description] blockquote code{background:0 0;border:0;padding:0;font-size:1em}div.prompt [data-component-part=prompt-description] blockquote a{color:inherit;text-decoration:none;pointer-events:none}html.dark div.prompt [data-component-part=prompt-description] blockquote{border-color:rgb(255 255 255/.15);background:rgb(var(--background-dark, 13 13 13));color:rgb(var(--gray-400, 159 161 165))}div.prompt [data-component-part=prompt-action-copy-button]{padding:.6rem 1.25rem;font-size:14px;line-height:20px;font-weight:600;border-radius:.65rem;gap:.45rem;box-shadow:0 1px 2px rgb(0 0 0/.08),0 4px 12px rgb(var(--primary, 37 99 235)/.25)}div.prompt [data-component-part=prompt-action-copy-button]::before{content:\"\";width:16px;height:16px;flex-shrink:0;background:currentColor;-webkit-mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='14' x='8' y='8' rx='2' ry='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E\") center/contain no-repeat;mask:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='14' x='8' y='8' rx='2' ry='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E\") center/contain no-repeat}div.prompt [data-component-part=prompt-action-copy-button] svg{width:12px;height:12px}@media (max-width:640px){div.prompt [data-component-part=prompt-actions-wrapper]>*{flex:1}}"}],"page":{"pagePath":"ru/api-capabilities/veo-3-1-official/text-to-video","slug":"/ru/api-capabilities/veo-3-1-official/text-to-video","pageMetadata":{"title":"Официальный API VEO 3.1 для преобразования текста в видео","sidebarTitle":"Текст в видео","description":"Справочник по официальному API VEO 3.1 для преобразования текста в видео и интерактивный Playground — тело JSON-запроса, трёхэтапный асинхронный поток, гибкая длительность 4 / 6 / 8 секунд, тарификация по каждому запросу.","openapi":"api-reference/veo-3-1-official-text-to-video-openapi-en.yaml POST /v1/videos","icon":"wand-sparkles","href":"/ru/api-capabilities/veo-3-1-official/text-to-video"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Справочник по официальному API VEO 3.1 для преобразования текста в видео и интерактивный Playground — тело JSON-запроса, трёхэтапный асинхронный поток, гибкая длительность 4 / 6 / 8 секунд, тарификация по каждому запросу.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Info,Table,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Info,{children:_jsxs(_components.p,{children:[`Интерактивный Playground справа поддерживает отладку в реальном времени. Укажите свой ключ API в `,_jsx(_components.strong,{children:`Authorization`}),` (формат `,_jsx(_components.code,{children:`Bearer sk-xxx`}),`), введите prompt, выберите модель / секунды / metadata.resolution, затем отправьте. `,_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`Default`}),` группа работает — отдельный переключатель группы не нужен`]}),`.`]})}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Область применения`}),`: Эта страница охватывает «генерацию видео только по тексту» — без тела `,_jsx(_components.code,{children:`input_reference`}),`, `,_jsx(_components.code,{children:`application/json`}),`. Для генерации по референсному изображению используйте `,_jsx(_components.a,{href:`/ru/api-capabilities/veo-3-1-official/image-to-video`,children:`эндпоинт Image-to-Video`}),` (тот же эндпоинт + загрузка `,_jsx(_components.code,{children:`input_reference`}),`).`]})}),`\n`,_jsxs(Warning,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`⚠️ Три наиболее распространенные ошибки`})}),_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[`Поле длины называется `,_jsx(_components.code,{children:`seconds`}),` (а не `,_jsx(_components.code,{children:`duration`}),`) и должно быть строкой`]}),` `,_jsx(_components.code,{children:`\"4\"`}),` / `,_jsx(_components.code,{children:`\"6\"`}),` / `,_jsx(_components.code,{children:`\"8\"`}),`. Если назвать его `,_jsx(_components.code,{children:`duration`}),`, это будет молча проигнорировано → length откатится к значению по умолчанию 4 сек. (ловушка «отправили 8s, получили 4s»); передача числа завершается `,_jsx(_components.code,{children:`parse_request_failed: cannot unmarshal number into Go struct field ... duration of type string`})]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[`Не передавайте `,_jsx(_components.code,{children:`generateAudio`})]}),` — upstream возвращает `,_jsx(_components.code,{children:`INVALID_ARGUMENT`}),`. Описывайте аудиосценарий (ambient, dialogue, BGM) в prompt вместо этого`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[`При 1080p / 4k `,_jsx(_components.code,{children:`seconds`}),` должно быть `,_jsx(_components.code,{children:`\"8\"`})]}),` — `,_jsx(_components.code,{children:`\"4\"`}),` / `,_jsx(_components.code,{children:`\"6\"`}),` будут отклонены upstream`]}),`\n`]})]}),`\n`,_jsxs(Warning,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Трехшаговый асинхронный процесс — на этой странице описан только шаг 1 (отправка)`})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Шаг 1 (эта страница)`}),`: `,_jsx(_components.code,{children:`POST /v1/videos`}),` → возвращает `,_jsx(_components.code,{children:`task_id`}),` + `,_jsx(_components.code,{children:`status: \"queued\"`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Шаг 2`}),`: `,_jsx(_components.code,{children:`GET /v1/videos/{task_id}`}),` опрашивайте до `,_jsx(_components.code,{children:`status: \"completed\"`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Шаг 3`}),`: `,_jsx(_components.code,{children:`GET /v1/videos/{task_id}/content`}),` для скачивания MP4`]}),`\n`]}),_jsxs(_components.p,{children:[`POST submit сам по себе выполняется менее чем за секунду и `,_jsx(_components.strong,{children:`не ждет`}),` генерацию. Полный процесс показан в примере Python ниже.`]})]}),`\n`,_jsx(Heading,{level:`2`,id:`примеры-кода`,children:`Примеры кода`}),`\n`,_jsx(Heading,{level:`3`,id:`python-openai-sdk-·-low-level-client-post`,children:`Python (OpenAI SDK · low-level client.post)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`59`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`59`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`/*`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`SDK`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` has no videos.create method; `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`v1`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`videos `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`is`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` a custom path, use low`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`-`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`level client.post() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` openai `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`client `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` OpenAI(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"sk-your-api-key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` base_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.apiyi.com/v1\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Step 1: submit`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`resp `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"/videos\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` body`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"veo-3.1-fast-generate-preview\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"prompt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"A coastal lighthouse at dusk, slow push-in, waves lapping the rocks, distant seabirds, cinematic lighting, steady camera\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"seconds\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"8\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# string, not number`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"size\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"1280x720\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"metadata\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"resolution\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"720p\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"aspectRatio\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"16:9\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"seed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`20260521`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"negativePrompt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"blurry, watermark, distorted, low quality\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` cast_to`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`dict`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`task_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` resp.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"task_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`or`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` resp[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Task ID: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`task_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`, status: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`resp[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'status'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Step 2: poll (up to 3 minutes for 720p/1080p)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`deadline `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time.time() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`+`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 180`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`while`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time.time() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` deadline:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` s `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` client.get(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"/videos/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`task_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`cast_to`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`dict`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Status: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`s[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'status'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`, progress: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`s.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'progress'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`%\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` s[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"completed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` s[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"failed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` raise`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` RuntimeError`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Generation failed: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`s`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time.sleep(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Step 3: download (retry to handle CDN sync delay right after completed)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` urllib.request, urllib.error`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`time.sleep(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` i `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`in`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` range`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` try`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` req `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` urllib.request.Request(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://api.apiyi.com/v1/videos/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`task_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Authorization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer sk-your-api-key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` with`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` urllib.request.urlopen(req, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`timeout`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`180`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` r, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`open`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"output.mp4\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"wb\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` f:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` while`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` chunk `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` r.read(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c\u003c`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 16`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` f.write(chunk)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` except`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` urllib.error.HTTPError `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` e:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # 400 = status just flipped to completed (window up to ~20 s): keep waiting; 502 etc.: one more try at most`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` i `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 7`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` or`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (e.code `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 400`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` and`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` i `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` raise`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time.sleep(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Saved: output.mp4\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`python-requests`,children:`Python (requests)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`56`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`56`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"sk-your-api-key\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`BASE_URL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.apiyi.com/v1\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`HEADERS`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Authorization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Step 1: submit (JSON body)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`resp `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`BASE_URL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/videos\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`**`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`HEADERS`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"veo-3.1-fast-generate-preview\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"prompt\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"A coastal lighthouse at dusk, slow push-in, steady camera, ocean ambience and distant seabirds\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"seconds\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"8\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# must be a string`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"size\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"1280x720\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"metadata\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"resolution\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"720p\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"aspectRatio\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"16:9\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` timeout`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`30`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # POST is just an enqueue; 30 sec is enough`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).json()`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`task_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` resp.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"task_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`or`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` resp[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Task ID: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`task_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`, status: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`resp[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'status'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Step 2: poll (3 min for 720p/1080p, 10 min for 4K)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`deadline `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time.time() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`+`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 180`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`while`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time.time() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` deadline:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` s `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.get(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`BASE_URL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/videos/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`task_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`HEADERS`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`).json()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Status: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`s[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'status'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`, progress: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`s.get(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'progress'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`%\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` s[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"completed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` s[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`] `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"failed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` raise`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` RuntimeError`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Generation failed: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`s`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time.sleep(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Step 3: download with retry`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`time.sleep(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` i `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`in`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` range`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` try`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` with`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.get(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`BASE_URL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/videos/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`task_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/content\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`HEADERS`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`stream`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`True`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`timeout`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`180`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` r:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` r.raise_for_status()`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` with`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` open`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"output.mp4\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"wb\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` f:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` chunk `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` r.iter_content(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`chunk_size`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8192`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` f.write(chunk)`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` except`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.HTTPError `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` e:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` # 400 = status just flipped to completed (window up to ~20 s): keep waiting; 502 etc.: one more try at most`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` i `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`==`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 7`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` or`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (e.response.status_code `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 400`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` and`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` i `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`):`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` raise`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` time.sleep(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Saved: output.mp4\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`curl`,children:`cURL`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`32`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`32`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`/*`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Just`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` want`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` to`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` check/download`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` with`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` an`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` existing`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` task_id?`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` See`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` the`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Already have a task_id?\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` section`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` below`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` *`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`/*`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Step`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 1:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` submit`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (the `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`length`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` field`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` is`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` seconds,`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` the`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` string`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"8\",`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` not`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` number`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 8,`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` and`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` not`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` duration`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`/}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`RESP`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -sS`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.apiyi.com/v1/videos\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer sk-your-api-key\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"model\": \"veo-3.1-fast-generate-preview\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"prompt\": \"A coastal lighthouse at dusk, slow push-in, ocean ambience, cinematic lighting\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"seconds\": \"8\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"size\": \"1280x720\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"metadata\": {\"resolution\": \"720p\", \"aspectRatio\": \"16:9\"}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`TASK_ID`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$RESP`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` python3`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'import sys,json;print((lambda d: d.get(\"task_id\") or d[\"id\"])(json.load(sys.stdin)))'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"task_id=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$TASK_ID`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`/*`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Step`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 2:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` poll`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` every`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 8`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` sec`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` *`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`while`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` :`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`do`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` S`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -sS`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer sk-your-api-key\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.apiyi.com/v1/videos/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$TASK_ID`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` ST`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$S`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` python3`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -c`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'import sys,json;print(json.load(sys.stdin)[\"status\"])'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"status=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$ST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [ `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$ST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"completed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ] \u0026\u0026 `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`break`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [ `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$ST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"failed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ] \u0026\u0026 { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`echo`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$S`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`exit`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; }`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:` sleep`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 8`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`done`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`/*`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` Step`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 3:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` download`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (--retry `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`covers`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` occasional`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 400`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` right`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` after`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` status=completed`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`/}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`sleep`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 4`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -fsSL`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --retry`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 7`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --retry-delay`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 4`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --retry-all-errors`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer sk-your-api-key\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.apiyi.com/v1/videos/`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$TASK_ID`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/content\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -o`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` output.mp4`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`ls`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -lh`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` output.mp4`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`node-js-native-fetch`,children:`Node.js (native fetch)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`55`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`55`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` fs`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'node:fs'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` API_KEY`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'sk-your-api-key'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` BASE_URL`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://api.apiyi.com/v1'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Step 1: submit`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` submitResp`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`BASE_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"/videos`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'POST'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'application/json'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `Bearer \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` model:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'veo-3.1-fast-generate-preview'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` prompt:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'A golden retriever running on a sandy beach, slow motion, golden hour, cinematic quality'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` seconds:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '8'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// must be string`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` size:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '1280x720'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` metadata:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`resolution:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '720p'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`aspectRatio:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '16:9'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` submitData`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` submitResp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` task_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` submitData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`task_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ||`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` submitData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`Task ID: \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`task_id`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Step 2: poll`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`let`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` status`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'queued'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`while`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'completed'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` status`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !==`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'failed'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Promise`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`r`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` =>`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` setTimeout`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`r`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`8000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`));`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` s`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`BASE_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/videos/`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`task_id`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Authorization'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `Bearer \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })).`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` status`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` s`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`Status: \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`, progress: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`s`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`progress`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ??`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"%`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'failed'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`throw`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Generation failed'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Step 3: download (retry 400 every 4 s, up to about 30 s)`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Promise`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`r`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` =>`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` setTimeout`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`r`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`));`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`let`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` buffer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`let`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` i`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`i`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 8`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`i`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`++`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` try`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` resp`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`BASE_URL`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/videos/`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`task_id`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"/content`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Authorization'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `Bearer \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`resp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ok`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`throw`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Object`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`assign`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`new`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`HTTP \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`resp`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` resp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` buffer`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Buffer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` resp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`arrayBuffer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`());`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`catch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`e`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`i`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ===`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 7`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ||`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`e`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`status`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !==`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 400`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` i`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` >=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`throw`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` e`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// 400: keep waiting; 502 etc.: one more try at most`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` new`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Promise`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`r`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` =>`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` setTimeout`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`r`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`4000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`));`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`fs`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`writeFileSync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'output.mp4'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`buffer`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Saved: output.mp4'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`browser-javascript`,children:`Browser JavaScript`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`20`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`20`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`/* Demo only; route through a backend proxy in production to avoid Key leakage; large video downloads are also unsuitable for direct browser handling */`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` submitResp`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'https://api.apiyi.com/v1/videos'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'POST'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'application/json'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Bearer sk-your-api-key'`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` model:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'veo-3.1-fast-generate-preview'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` prompt:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Watercolor northern lights over snowy mountains, gentle motion'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` seconds:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '4'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` size:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '720x1280'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` metadata:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`resolution:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '720p'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`aspectRatio:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '9:16'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` })`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` submitData`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` submitResp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` task_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` submitData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`task_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ||`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` submitData`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Task ID:'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`task_id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`/* After polling completes, route the /content endpoint through your backend proxy for download */`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`уже-есть-task_id-две-готовые-curl-команды`,children:`Уже есть task_id? Две готовые cURL-команды`}),`\n`,_jsxs(_components.p,{children:[`Если у вас уже есть `,_jsx(_components.code,{children:`task_id`}),` (полученный при отправке задачи или отображаемый в логах вашей консоли), просто замените два плейсхолдера ниже и выполните:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`sk-your-api-key`}),` → ваш ключ APIYI`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`task_xxxxxxxxxxxxxxxx`}),` → ваш ID задачи`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`1-проверьте-статус-задачи`,children:`1. Проверьте статус задачи`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.apiyi.com/v1/videos/task_xxxxxxxxxxxxxxxx\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer sk-your-api-key\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Когда в JSON-ответе отображается `,_jsx(_components.code,{children:`status: \"completed\"`}),`, вы можете скачать результат; если отображается `,_jsx(_components.code,{children:`in_progress`}),`, подождите несколько секунд и проверьте снова.`]}),`\n`,_jsx(Heading,{level:`3`,id:`2-скачайте-видео-сохраняется-как-output-mp4`,children:`2. Скачайте видео (сохраняется как output.mp4)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -fL`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --retry`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 7`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --retry-delay`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 4`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --retry-all-errors`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.apiyi.com/v1/videos/task_xxxxxxxxxxxxxxxx/content\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer sk-your-api-key\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -o`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` output.mp4`})]}),`\n`]})})}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`Для эндпоинта `,_jsx(_components.code,{children:`/content`}),` требуется заголовок `,_jsx(_components.code,{children:`Authorization`}),` — прямое открытие URL в адресной строке браузера вернет 401. `,_jsx(_components.code,{children:`-f --retry 7 --retry-delay 4 --retry-all-errors`}),` обрабатывает ошибку 400 сразу после переключения `,_jsx(_components.code,{children:`status`}),` на `,_jsx(_components.code,{children:`completed`}),` (примерно до 20 секунд). Без `,_jsx(_components.code,{children:`-f`}),` curl посчитает 400 успешным ответом и запишет JSON с ошибкой в `,_jsx(_components.code,{children:`output.mp4`}),`; без `,_jsx(_components.code,{children:`--retry-all-errors`}),` параметр `,_jsx(_components.code,{children:`--retry`}),` вообще не будет повторять попытку при 400 (требуется curl 7.71+).`]})}),`\n`,_jsx(Heading,{level:`2`,id:`справка-по-параметрам`,children:`Справка по параметрам`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Параметр`}),_jsx(_components.th,{children:`Тип`}),_jsx(_components.th,{children:`Обязательно`}),_jsx(_components.th,{children:`Значение по умолчанию`}),_jsx(_components.th,{children:`Описание`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`model`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Да`}),_jsx(_components.td,{children:`—`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`veo-3.1-fast-generate-preview`}),` ($0.3/req) или `,_jsx(_components.code,{children:`veo-3.1-generate-preview`}),` ($1.2/req)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`prompt`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Да`}),_jsx(_components.td,{children:`—`}),_jsxs(_components.td,{children:[`Описание видео; опишите сцену, действие, камеру, освещение, `,_jsx(_components.strong,{children:`намерение аудио`}),` (не передавайте `,_jsx(_components.code,{children:`generateAudio`}),`)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`seconds`})}),_jsx(_components.td,{children:_jsx(_components.strong,{children:`string`})}),_jsx(_components.td,{children:`Нет`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`\"8\"`})}),_jsxs(_components.td,{children:[`Длительность видео, `,_jsx(_components.strong,{children:`строковое перечисление`}),`: `,_jsx(_components.code,{children:`\"4\"`}),` / `,_jsx(_components.code,{children:`\"6\"`}),` / `,_jsx(_components.code,{children:`\"8\"`}),`. `,_jsxs(_components.strong,{children:[`Поле — `,_jsx(_components.code,{children:`seconds`}),`, а не `,_jsx(_components.code,{children:`duration`})]}),` (если указать `,_jsx(_components.code,{children:`duration`}),`, это будет тихо проигнорировано и значение вернется к 4 сек). `,_jsxs(_components.strong,{children:[`1080p/4k должны быть `,_jsx(_components.code,{children:`\"8\"`})]})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`size`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Нет`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`1280x720`})}),_jsxs(_components.td,{children:[`Пиксели вывода, например `,_jsx(_components.code,{children:`1280x720`}),` / `,_jsx(_components.code,{children:`1920x1080`}),` / `,_jsx(_components.code,{children:`3840x2160`}),`; более низкий приоритет, чем у `,_jsx(_components.code,{children:`metadata.resolution`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`metadata.resolution`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Нет`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`720p`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`720p`}),` / `,_jsx(_components.code,{children:`1080p`}),` / `,_jsx(_components.code,{children:`4k`}),`; более высокий приоритет, чем у `,_jsx(_components.code,{children:`size`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`metadata.aspectRatio`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Нет`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`16:9`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`16:9`}),` (альбомная ориентация) или `,_jsx(_components.code,{children:`9:16`}),` (портретная ориентация)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`metadata.seed`})}),_jsx(_components.td,{children:`int`}),_jsx(_components.td,{children:`Нет`}),_jsx(_components.td,{children:`—`}),_jsxs(_components.td,{children:[`Случайный seed. Фиксированный seed группирует результаты по стилю (но `,_jsx(_components.strong,{children:`невозможно побайтно воспроизвести`}),`)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`metadata.negativePrompt`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:`Нет`}),_jsx(_components.td,{children:`—`}),_jsxs(_components.td,{children:[`Негативный prompt; рекомендуется `,_jsx(_components.code,{children:`\"blurry, watermark, distorted, low quality\"`})]})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsxs(_components.strong,{children:[`Не передавайте поле `,_jsx(_components.code,{children:`generateAudio`})]}),`! Veo 3.1 изначально поддерживает аудио; передача этого параметра возвращает `,_jsx(_components.code,{children:`INVALID_ARGUMENT`}),`. Чтобы управлять аудио, `,_jsx(_components.strong,{children:`впишите намерение в prompt`}),`: `,_jsx(_components.code,{children:`\"waves, distant seabirds, low wind sounds\"`}),`.`]})}),`\n`,_jsxs(Tip,{children:[_jsx(_components.p,{children:`Приоритет параметров:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Длительность: `,_jsx(_components.code,{children:`metadata.durationSeconds > seconds > 8`}),` (отправляйте `,_jsx(_components.code,{children:`seconds`}),`; `,_jsx(_components.code,{children:`duration`}),` не распознается)`]}),`\n`,_jsxs(_components.li,{children:[`Разрешение: `,_jsx(_components.code,{children:`metadata.resolution > size > 720p`})]}),`\n`,_jsxs(_components.li,{children:[`Соотношение сторон: явное `,_jsx(_components.code,{children:`metadata.aspectRatio`}),` > определяемое по размеру > `,_jsx(_components.code,{children:`16:9`})]}),`\n`]})]}),`\n`,_jsx(Heading,{level:`2`,id:`формат-ответа`,children:`Формат ответа`}),`\n`,_jsx(Heading,{level:`3`,id:`шаг-1-—-сразу-после-отправки`,children:`Шаг 1 — сразу после отправки`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`9`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"task_xxxxxxxxxxxxxxxx\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"task_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"task_xxxxxxxxxxxxxxxx\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"object\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"video\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"veo-3.1-fast-generate-preview\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"queued\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"progress\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"created_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1775025000`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`шаг-2-—-ответ-при-опросе-в-процессе`,children:`Шаг 2 — ответ при опросе (в процессе)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`8`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`8`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"task_xxxxxxxxxxxxxxxx\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"object\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"video\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"veo-3.1-fast-generate-preview\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"in_progress\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"progress\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`50`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"created_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1775025000`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`3`,id:`шаг-2-—-ответ-при-опросе-завершено`,children:`Шаг 2 — ответ при опросе (завершено)`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`11`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`11`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"task_xxxxxxxxxxxxxxxx\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"object\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"video\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"model\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"veo-3.1-fast-generate-preview\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"completed\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"progress\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`100`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"created_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1775025000`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"completed_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1775025090`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"expires_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`1775111490`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"video_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://…/task_xxxxxxxxxxxxxxxx_0.mp4\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(Warning,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`⚠️ Подводные камни полей ответа`})}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[`Берите ID задачи из `,_jsx(_components.code,{children:`id`})]}),`: ответ на отправку также может содержать `,_jsx(_components.code,{children:`task_id`}),` (то же значение), но ответы при опросе содержат только `,_jsx(_components.code,{children:`id`}),`; безопасный шаблон — `,_jsx(_components.code,{children:`resp.get(\"task_id\") or resp[\"id\"]`}),` (в примерах выше это уже учтено)`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[`Используйте скачивание через `,_jsx(_components.code,{children:`/content`}),` как надежный источник данных`]}),`: `,_jsx(_components.code,{children:`GET /v1/videos/{task_id}/content`}),` возвращает бинарный поток MP4 (требуется заголовок авторизации) и работает для каждой задачи. Завершенный ответ `,_jsx(_components.strong,{children:`может`}),` также содержать `,_jsx(_components.code,{children:`video_url`}),` (прямая ссылка, без авторизации) и `,_jsx(_components.code,{children:`expires_at`}),` (примерно через 24 часа); это `,_jsx(_components.strong,{children:`не гарантируется для каждой задачи`}),` и подходит только для временного предварительного просмотра. Фронтенд не может обращаться к `,_jsx(_components.code,{children:`/content`}),` напрямую — `,_jsx(_components.strong,{children:`скачивайте на стороне сервера и повторно размещайте в собственном OSS / CDN`})]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`progress`}),` имеет низкую детализацию — `,_jsx(_components.strong,{children:`переключается только между несколькими фиксированными шагами`}),`, не используйте его для индикаторов выполнения в процентах`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`status: \"failed\"`}),` обычно содержит `,_jsx(_components.code,{children:`error.message`}),` с указанием причины (проверка контента, ошибки в параметрах или невозможность получить сгенерированный файл). `,_jsx(_components.strong,{children:`Неудачные задачи не тарифицируются, а списанные средства возвращаются автоматически`}),`; скорректируйте prompt и повторите попытку`]}),`\n`,_jsxs(_components.li,{children:[_jsxs(_components.strong,{children:[_jsx(_components.code,{children:`/content`}),` иногда возвращает 400`]}),` сразу после того, как `,_jsx(_components.code,{children:`status`}),` меняется на `,_jsx(_components.code,{children:`completed`}),`; повторите попытку через 4 секунды (это уже заложено во всех примерах кода выше)`]}),`\n`]})]}),`\n`,_jsx(Info,{children:_jsxs(_components.p,{children:[`Этот эндпоинт представляет собой точку входа для асинхронных задач. `,_jsxs(_components.strong,{children:[`Тарификация происходит, когда задача достигает `,_jsx(_components.code,{children:`completed`}),`, с оплатой за запрос в зависимости от названия модели`]}),` (быстрая $0.3 / стандартная $1.2, см. `,_jsx(_components.a,{href:`/ru/api-capabilities/veo-3-1-official/overview#pricing`,children:`Тарифы`}),`). Сами отправка POST-запроса, опрос и скачивание `,_jsx(_components.strong,{children:`не тарифицируются`}),`; неудачные задачи также `,_jsx(_components.strong,{children:`не тарифицируются`}),`.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Официальный API VEO 3.1 для преобразования текста в видео","sidebarTitle":"Текст в видео","description":"Справочник по официальному API VEO 3.1 для преобразования текста в видео и интерактивный Playground — тело JSON-запроса, трёхэтапный асинхронный поток, гибкая длительность 4 / 6 / 8 секунд, тарификация по каждому запросу.","openapi":"api-reference/veo-3-1-official-text-to-video-openapi-en.yaml POST /v1/videos","icon":"wand-sparkles","href":"/ru/api-capabilities/veo-3-1-official/text-to-video"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Примеры кода","slug":"примеры-кода","depth":2,"children":[{"title":"Python (OpenAI SDK · low-level client.post)","slug":"python-openai-sdk-·-low-level-client-post","depth":3,"children":[]},{"title":"Python (requests)","slug":"python-requests","depth":3,"children":[]},{"title":"cURL","slug":"curl","depth":3,"children":[]},{"title":"Node.js (native fetch)","slug":"node-js-native-fetch","depth":3,"children":[]},{"title":"Browser JavaScript","slug":"browser-javascript","depth":3,"children":[]}]},{"title":"Уже есть task_id? Две готовые cURL-команды","slug":"уже-есть-task_id-две-готовые-curl-команды","depth":2,"children":[{"title":"1. Проверьте статус задачи","slug":"1-проверьте-статус-задачи","depth":3,"children":[]},{"title":"2. Скачайте видео (сохраняется как output.mp4)","slug":"2-скачайте-видео-сохраняется-как-output-mp4","depth":3,"children":[]}]},{"title":"Справка по параметрам","slug":"справка-по-параметрам","depth":2,"children":[]},{"title":"Формат ответа","slug":"формат-ответа","depth":2,"children":[{"title":"Шаг 1 — сразу после отправки","slug":"шаг-1-—-сразу-после-отправки","depth":3,"children":[]},{"title":"Шаг 2 — ответ при опросе (в процессе)","slug":"шаг-2-—-ответ-при-опросе-в-процессе","depth":3,"children":[]},{"title":"Шаг 2 — ответ при опросе (завершено)","slug":"шаг-2-—-ответ-при-опросе-завершено","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"generateVeo31OfficialTextToVideo","summary":"Text-to-video: submit a generation task from text prompt","description":"Справочник по официальному API VEO 3.1 для преобразования текста в видео и интерактивный Playground — тело JSON-запроса, трёхэтапный асинхронный поток, гибкая длительность 4 / 6 / 8 секунд, тарификация по каждому запросу.","tags":["Video Generation"],"security":["73852084-f4ff-4862-a139-853df6b6b491"],"requestBody":"b608b574-2df1-4b7b-845d-602acf074230","responses":{"200":"a0fb4650-7fc8-41fa-bc4d-66f8fc426ba6","400":"6fb24953-bac6-44ff-b662-46aca89c2b0c","401":"fb59b210-60da-4262-8f55-21e7fa18081e","429":"7309b850-3539-4aa6-a775-613eba93e3b3","500":"3c3ea924-6256-4062-8802-655f6bed6439"},"method":"post","type":"path","servers":["3482598a-a969-42ce-bcdb-67377d0ea9cc"],"path":"/v1/videos","baseUrlOptions":["https://api.apiyi.com"],"title":"Text-to-video: submit a generation task from text prompt","codeSamples":[],"requiredOnlyExamples":true,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","prompt"],"properties":{"model":{"type":"string","description":"Model ID (per-request billing, duration / resolution do not affect price):\n- `veo-3.1-fast-generate-preview` — \\$0.3/request, top pick for iteration / batch generation\n- `veo-3.1-generate-preview` — \\$1.2/request, for final delivery / 4K scenarios\n","enum":["veo-3.1-fast-generate-preview","veo-3.1-generate-preview"],"default":"veo-3.1-fast-generate-preview","isRequired":true,"uniqueKey":"model","typeLabel":"enum\u003cstring>"},"prompt":{"type":"string","description":"Video generation prompt; describe in detail: scene + subject + action + camera + lighting + style.\n\n**Audio intent also goes in the prompt** (e.g. \"waves, distant seabirds, low wind sounds\"). **Do not pass `generateAudio`** — upstream rejects with `INVALID_ARGUMENT`.\n","example":"A coastal lighthouse at dusk, slow push-in, waves lapping the rocks, distant seabirds, cinematic lighting, steady camera","isRequired":true,"uniqueKey":"prompt","typeLabel":"string"},"seconds":{"type":"string","description":"Video length. **The field name is `seconds` (not `duration`)**, a **string enum** (not number):\n- `\"4\"` — 4 sec, 720p only\n- `\"6\"` — 6 sec, 720p only\n- `\"8\"` — 8 sec (default), **required at 1080p / 4k**\n\nSending `duration` instead is silently ignored → length falls back to the default 4 sec (720p returns no error but only outputs 4 sec; 1080p/4k errors with `... but got 4`). Passing a number (`8`) returns `parse_request_failed: cannot unmarshal number into Go struct field ... duration of type string`.\n","enum":["4","6","8"],"default":"8","uniqueKey":"seconds","typeLabel":"enum\u003cstring>"},"size":{"type":"string","description":"Output pixel dimensions; lower precedence than `metadata.resolution`:\n- `1280x720` / `720x1280` — 720p (default)\n- `1920x1080` / `1080x1920` — 1080p (seconds must be `\"8\"`)\n- `3840x2160` / `2160x3840` — 4k (seconds must be `\"8\"`, 4–6× slower render)\n","enum":["1280x720","720x1280","1920x1080","1080x1920","3840x2160","2160x3840"],"default":"1280x720","uniqueKey":"size","typeLabel":"enum\u003cstring>"},"metadata":{"type":"object","description":"Wrapper for fine-grained generation parameters. **Higher precedence than the top-level `size` etc.**:\n- Duration resolution order: `metadata.durationSeconds > seconds > 8` (send `seconds`; `duration` is not recognized)\n- Resolution resolution order: `metadata.resolution > size > 720p`\n","properties":{"resolution":{"type":"string","description":"Resolution tier (higher precedence than `size`)","enum":["720p","1080p","4k"],"default":"720p","uniqueKey":"metadata.resolution","typeLabel":"enum\u003cstring>"},"aspectRatio":{"type":"string","description":"Aspect ratio: `16:9` landscape (default) or `9:16` portrait","enum":["16:9","9:16"],"default":"16:9","uniqueKey":"metadata.aspectRatio","typeLabel":"enum\u003cstring>"},"seed":{"type":"integer","description":"Random seed. Fixed seed clusters outputs in style (intra-group file size spread ~6%, inter-group ~36%), **but does not byte-reproduce**.\n","example":20260521,"uniqueKey":"metadata.seed","typeLabel":"integer"},"negativePrompt":{"type":"string","description":"Negative prompt; recommended `\"blurry, watermark, distorted, low quality\"`","example":"blurry, watermark, distorted, low quality","uniqueKey":"metadata.negativePrompt","typeLabel":"string"},"durationSeconds":{"type":"integer","description":"Equivalent to top-level `seconds` with highest precedence (generally prefer `seconds` for consistency)","uniqueKey":"metadata.durationSeconds","typeLabel":"integer"}},"uniqueKey":"metadata","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"model":"veo-3.1-fast-generate-preview","prompt":"A coastal lighthouse at dusk, slow push-in, waves lapping the rocks, distant seabirds, cinematic lighting, steady camera","seconds":"8","size":"1280x720","metadata":{"resolution":"720p","aspectRatio":"16:9","seed":20260521,"negativePrompt":"blurry, watermark, distorted, low quality"}},"examples":{"Example":{"title":"Example","value":{"model":"veo-3.1-fast-generate-preview","prompt":"A coastal lighthouse at dusk, slow push-in, waves lapping the rocks, distant seabirds, cinematic lighting, steady camera","seconds":"8","size":"1280x720","metadata":{"resolution":"720p","aspectRatio":"16:9","seed":20260521,"negativePrompt":"blurry, watermark, distorted, low quality"}}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"a0fb4650-7fc8-41fa-bc4d-66f8fc426ba6":{"description":"Task submitted; returns task_id and queued status","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Task ID (matches `task_id`; downstream should standardize on `task_id`)","example":"task_xxxxxxxxxxxxxxxx","uniqueKey":"id","typeLabel":"string"},"task_id":{"type":"string","description":"Task ID for subsequent polling and download","example":"task_xxxxxxxxxxxxxxxx","uniqueKey":"task_id","typeLabel":"string"},"object":{"type":"string","description":"Object type, fixed to `video`","example":"video","uniqueKey":"object","typeLabel":"string"},"model":{"type":"string","description":"Model ID used for this task","example":"veo-3.1-fast-generate-preview","uniqueKey":"model","typeLabel":"string"},"status":{"type":"string","description":"Task status:\n- `queued` — submitted, awaiting processing\n- `in_progress` — generating\n- `completed` — done, downloadable (`/v1/videos/{task_id}/content`)\n- `failed` — failed (**not billed**), retry possible\n","enum":["queued","in_progress","completed","failed"],"example":"queued","uniqueKey":"status","typeLabel":"enum\u003cstring>"},"progress":{"type":"integer","description":"Generation progress (coarse-grained, **jumps only between 0 / 50 / 100**, do not use for percentage bars)","example":0,"uniqueKey":"progress","typeLabel":"integer"},"created_at":{"type":"integer","description":"Task creation Unix timestamp (seconds)","example":1775025000,"uniqueKey":"created_at","typeLabel":"integer"},"completed_at":{"type":"integer","description":"Task completion Unix timestamp (seconds); only present for completed status","example":1775025090,"uniqueKey":"completed_at","typeLabel":"integer"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"id":"task_xxxxxxxxxxxxxxxx","task_id":"task_xxxxxxxxxxxxxxxx","object":"video","model":"veo-3.1-fast-generate-preview","status":"queued","progress":0,"created_at":1775025000,"completed_at":1775025090}}},"exampleType":"generated"}},"exampleType":"generated"},"6fb24953-bac6-44ff-b662-46aca89c2b0c":{"description":"Invalid parameter (seconds as number; seconds not in 4/6/8; field misnamed as duration; non-8-sec at 1080p/4k; prompt missing; etc.)","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"fb59b210-60da-4262-8f55-21e7fa18081e":{"description":"Unauthorized - invalid API Key","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"7309b850-3539-4aa6-a775-613eba93e3b3":{"description":"Rate limit or insufficient balance","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"3c3ea924-6256-4062-8802-655f6bed6439":{"description":"Upstream gateway error; retry 1–2 times (failed tasks not billed)","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}}},"security":{"73852084-f4ff-4862-a139-853df6b6b491":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API Key from APIYI console (Default group + Pay-per-request or Pay-as-you-go Priority Token; pure Pay-as-you-go not supported)","scopes":[]}}},"servers":{"3482598a-a969-42ce-bcdb-67377d0ea9cc":{"url":"https://api.apiyi.com","description":"Primary endpoint"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"API Key from APIYI console (Default group + Pay-per-request or Pay-as-you-go Priority Token; pure Pay-as-you-go not supported)","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"API Key from APIYI console (Default group + Pay-per-request or Pay-as-you-go Priority Token; pure Pay-as-you-go not supported)","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"api-reference/veo-3-1-official-text-to-video-openapi-en.yaml"},"subdomain":"apiyillc","siteName":"API易文档中心","title":"Официальный API VEO 3.1 для преобразования текста в видео - API易文档中心","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"zh":{"href":"/api-capabilities/veo-3-1-official/text-to-video","matchLevel":1},"en":{"href":"/en/api-capabilities/veo-3-1-official/text-to-video","matchLevel":1},"zh-Hant":{"href":"/zh-Hant/api-capabilities/veo-3-1-official/text-to-video","matchLevel":1},"ja":{"href":"/ja/api-capabilities/veo-3-1-official/text-to-video","matchLevel":1},"ko":{"href":"/ko/api-capabilities/veo-3-1-official/text-to-video","matchLevel":1},"ru":{"href":"/ru/api-capabilities/veo-3-1-official/text-to-video","matchLevel":0}}},"lastModified":"2026-10-07T05:53:53.253Z","originalFileLocation":"ru/api-capabilities/veo-3-1-official/text-to-video.mdx","locale":"ru"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Справочник по официальному API VEO 3.1 для преобразования текста в видео и интерактивный Playground — тело JSON-запроса, трёхэтапный асинхронный поток, гибкая длительность 4 / 6 / 8 секунд, тарификация по каждому запросу.\">\u003cmeta data-mint-head name=\"application-name\" content=\"API易文档中心\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/apiyillc/sQlsuRwD6o27XLvg/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/apiyillc/sQlsuRwD6o27XLvg/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/apiyillc/sQlsuRwD6o27XLvg/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/apiyillc/sQlsuRwD6o27XLvg/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/apiyillc/sQlsuRwD6o27XLvg/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/apiyillc/sQlsuRwD6o27XLvg/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/apiyillc/sQlsuRwD6o27XLvg/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/apiyillc/sQlsuRwD6o27XLvg/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/apiyillc/sQlsuRwD6o27XLvg/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Официальный API VEO 3.1 для преобразования текста в видео - API易文档中心\">\u003cmeta data-mint-head property=\"og:description\" content=\"Справочник по официальному API VEO 3.1 для преобразования текста в видео и интерактивный Playground — тело JSON-запроса, трёхэтапный асинхронный поток, гибкая длительность 4 / 6 / 8 секунд, тарификация по каждому запросу.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"API易文档中心\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.apiyi.com/ru/api-capabilities/veo-3-1-official/text-to-video\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://apiyillc.mintlify.app/_mintlify/api/og/v2?division=VEO+3.1+%28Google%29\u0026amp;title=%D0%9E%D1%84%D0%B8%D1%86%D0%B8%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B9+API+VEO+3.1+%D0%B4%D0%BB%D1%8F+%D0%BF%D1%80%D0%B5%D0%BE%D0%B1%D1%80%D0%B0%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F+%D1%82%D0%B5%D0%BA%D1%81%D1%82%D0%B0+%D0%B2+%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE\u0026amp;description=%D0%A1%D0%BF%D1%80%D0%B0%D0%B2%D0%BE%D1%87%D0%BD%D0%B8%D0%BA+%D0%BF%D0%BE+%D0%BE%D1%84%D0%B8%D1%86%D0%B8%D0%B0%D0%BB%D1%8C%D0%BD%D0%BE%D0%BC%D1%83+API+VEO+3.1+%D0%B4%D0%BB%D1%8F+%D0%BF%D1%80%D0%B5%D0%BE%D0%B1%D1%80%D0%B0%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F+%D1%82%D0%B5%D0%BA%D1%81%D1%82%D0%B0+%D0%B2+%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE+%D0%B8+%D0%B8%D0%BD%D1%82%D0%B5%D1%80%D0%B0%D0%BA%D1%82%D0%B8%D0%B2%D0%BD%D1%8B%D0%B9+Playground+%E2%80%94+%D1%82%D0%B5%D0%BB%D0%BE+JSON-%D0%B7%D0%B0%D0%BF%D1%80%D0%BE%D1%81%D0%B0%2C+%D1%82%D1%80%D1%91%D1%85%D1%8D%D1%82%D0%B0%D0%BF%D0%BD%D1%8B%D0%B9+%D0%B0%D1%81%D0%B8%D0%BD%D1%85%D1%80%D0%BE%D0%BD%D0%BD%D1%8B%D0%B9+%D0%BF%D0%BE%D1%82%D0%BE%D0%BA%2C+%D0%B3%D0%B8%D0%B1%D0%BA%D0%B0%D1%8F+%D0%B4\u0026amp;theme=421dcf1ed22dd4b5d53fa3cb\u0026amp;signature=547cef4a31b49af30667c1c91b1bbaac9f12ed9337f4d08181952301aefbc0d5\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Официальный API VEO 3.1 для преобразования текста в видео - API易文档中心\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Справочник по официальному API VEO 3.1 для преобразования текста в видео и интерактивный Playground — тело JSON-запроса, трёхэтапный асинхронный поток, гибкая длительность 4 / 6 / 8 секунд, тарификация по каждому запросу.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://apiyillc.mintlify.app/_mintlify/api/og/v2?division=VEO+3.1+%28Google%29\u0026amp;title=%D0%9E%D1%84%D0%B8%D1%86%D0%B8%D0%B0%D0%BB%D1%8C%D0%BD%D1%8B%D0%B9+API+VEO+3.1+%D0%B4%D0%BB%D1%8F+%D0%BF%D1%80%D0%B5%D0%BE%D0%B1%D1%80%D0%B0%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F+%D1%82%D0%B5%D0%BA%D1%81%D1%82%D0%B0+%D0%B2+%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE\u0026amp;description=%D0%A1%D0%BF%D1%80%D0%B0%D0%B2%D0%BE%D1%87%D0%BD%D0%B8%D0%BA+%D0%BF%D0%BE+%D0%BE%D1%84%D0%B8%D1%86%D0%B8%D0%B0%D0%BB%D1%8C%D0%BD%D0%BE%D0%BC%D1%83+API+VEO+3.1+%D0%B4%D0%BB%D1%8F+%D0%BF%D1%80%D0%B5%D0%BE%D0%B1%D1%80%D0%B0%D0%B7%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F+%D1%82%D0%B5%D0%BA%D1%81%D1%82%D0%B0+%D0%B2+%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE+%D0%B8+%D0%B8%D0%BD%D1%82%D0%B5%D1%80%D0%B0%D0%BA%D1%82%D0%B8%D0%B2%D0%BD%D1%8B%D0%B9+Playground+%E2%80%94+%D1%82%D0%B5%D0%BB%D0%BE+JSON-%D0%B7%D0%B0%D0%BF%D1%80%D0%BE%D1%81%D0%B0%2C+%D1%82%D1%80%D1%91%D1%85%D1%8D%D1%82%D0%B0%D0%BF%D0%BD%D1%8B%D0%B9+%D0%B0%D1%81%D0%B8%D0%BD%D1%85%D1%80%D0%BE%D0%BD%D0%BD%D1%8B%D0%B9+%D0%BF%D0%BE%D1%82%D0%BE%D0%BA%2C+%D0%B3%D0%B8%D0%B1%D0%BA%D0%B0%D1%8F+%D0%B4\u0026amp;theme=421dcf1ed22dd4b5d53fa3cb\u0026amp;signature=547cef4a31b49af30667c1c91b1bbaac9f12ed9337f4d08181952301aefbc0d5\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/apiyillc/sQlsuRwD6o27XLvg/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"API易文档中心\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2563eb\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.apiyi.com/ru/api-capabilities/veo-3-1-official/text-to-video\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/ru/api-capabilities/veo-3-1-official/text-to-video.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ru\" href=\"https://docs.apiyi.com/ru/api-capabilities/veo-3-1-official/text-to-video\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh\" href=\"https://docs.apiyi.com/api-capabilities/veo-3-1-official/text-to-video\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.apiyi.com/en/api-capabilities/veo-3-1-official/text-to-video\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh-Hant\" href=\"https://docs.apiyi.com/zh-Hant/api-capabilities/veo-3-1-official/text-to-video\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ja\" href=\"https://docs.apiyi.com/ja/api-capabilities/veo-3-1-official/text-to-video\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ko\" href=\"https://docs.apiyi.com/ko/api-capabilities/veo-3-1-official/text-to-video\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.apiyi.com/api-capabilities/veo-3-1-official/text-to-video\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.apiyi.com/#organization\",\"name\":\"API易文档中心\",\"url\":\"https://docs.apiyi.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/apiyillc/LjCT1O0GrSur6F2v/logo/light.svg?fit=max\u0026auto=format\u0026n=LjCT1O0GrSur6F2v\u0026q=85\u0026s=4119ef17a74cc54be127f34578d8b5fa\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.apiyi.com#website\",\"name\":\"API易文档中心\",\"url\":\"https://docs.apiyi.com\",\"publisher\":{\"@id\":\"https://docs.apiyi.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.apiyi.com/ru/api-capabilities/veo-3-1-official/text-to-video#webpage\",\"url\":\"https://docs.apiyi.com/ru/api-capabilities/veo-3-1-official/text-to-video\",\"name\":\"Официальный API VEO 3.1 для преобразования текста в видео\",\"description\":\"Справочник по официальному API VEO 3.1 для преобразования текста в видео и интерактивный Playground — тело JSON-запроса, трёхэтапный асинхронный поток, гибкая длительность 4 / 6 / 8 секунд, тарификация по каждому запросу.\",\"dateModified\":\"2026-10-07T05:53:53.253Z\",\"isPartOf\":{\"@id\":\"https://docs.apiyi.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.apiyi.com/ru/api-capabilities/veo-3-1-official/text-to-video#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.apiyi.com/ru/api-capabilities/veo-3-1-official/text-to-video#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Video API (официальный)\",\"item\":\"https://docs.apiyi.com/ru/api-capabilities/seedance2/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"VEO 3.1 (Google)\",\"item\":\"https://docs.apiyi.com/ru/api-capabilities/veo-3-1-official/overview\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Официальный API VEO 3.1 для преобразования текста в видео\",\"item\":\"https://docs.apiyi.com/ru/api-capabilities/veo-3-1-official/text-to-video\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.apiyi.com/ru/api-capabilities/veo-3-1-official/text-to-video#apireference\",\"headline\":\"Официальный API VEO 3.1 для преобразования текста в видео\",\"name\":\"Официальный API VEO 3.1 для преобразования текста в видео\",\"description\":\"Справочник по официальному API VEO 3.1 для преобразования текста в видео и интерактивный Playground — тело JSON-запроса, трёхэтапный асинхронный поток, гибкая длительность 4 / 6 / 8 секунд, тарификация по каждому запросу.\",\"url\":\"https://docs.apiyi.com/ru/api-capabilities/veo-3-1-official/text-to-video\",\"mainEntityOfPage\":{\"@id\":\"https://docs.apiyi.com/ru/api-capabilities/veo-3-1-official/text-to-video#webpage\"},\"dateModified\":\"2026-10-07T05:53:53.253Z\",\"publisher\":{\"@id\":\"https://docs.apiyi.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.apiyi.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"API易文档中心\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"API易文档中心","nav":{"global":{"anchors":[]},"languages":[{"language":"zh","pages":[{"title":"zh","href":"/api-capabilities/veo-3-1-official/text-to-video"}]},{"language":"en","navbar":{"links":[{"href":"https://api.apiyi.com","label":"Home"},{"href":"https://imagen.apiyi.com","label":"AI Image"},{"href":"https://icover.ai","label":"AI Video"}],"primary":{"type":"button","label":"Console","href":"https://api.apiyi.com/account/profile"}},"pages":[{"title":"en","href":"/en/api-capabilities/veo-3-1-official/text-to-video"}]},{"language":"zh-Hant","banner":{"content":"本頁由程式自動轉換為繁體中文,用詞以台灣正體為準;如有歧義請以[簡體中文版](/)為準。","dismissible":true},"footer":{"socials":{"website":"https://api.apiyi.com"},"links":[{"header":"AI 整合","items":[{"label":"skill.md","href":"https://docs.apiyi.com/skill.md"},{"label":"llms.txt","href":"https://docs.apiyi.com/llms.txt"},{"label":"llms-full.txt","href":"https://docs.apiyi.com/llms-full.txt"},{"label":"model-registry.json","href":"https://docs.apiyi.com/model-registry.json"},{"label":"AI 開發者套件(中文)","href":"/developer-kit"},{"label":"AI Developer Kit (EN)","href":"/en/developer-kit"}]},{"header":"使用者口碑 / Wall of Love","items":[{"label":"使用者口碑(中文)","href":"/wall-of-love"},{"label":"Wall of Love (EN)","href":"/en/wall-of-love"}]}]},"navbar":{"links":[{"href":"https://api.apiyi.com","label":"首頁"},{"href":"https://imagen.apiyi.com","label":"AI出圖"},{"href":"https://icover.ai","label":"AI影片"}],"primary":{"type":"button","label":"控制台","href":"https://api.apiyi.com/account/profile"}},"pages":[{"title":"zh-Hant","href":"/zh-Hant/api-capabilities/veo-3-1-official/text-to-video"}]},{"language":"ja","banner":{"content":"このページは AI により翻訳されています。内容に相違がある場合は[English 版](/en)を正としてください。","dismissible":true},"footer":{"socials":{"website":"https://api.apiyi.com"},"links":[{"header":"AI統合","items":[{"label":"skill.md","href":"https://docs.apiyi.com/skill.md"},{"label":"llms.txt","href":"https://docs.apiyi.com/llms.txt"},{"label":"llms-full.txt","href":"https://docs.apiyi.com/llms-full.txt"},{"label":"model-registry.json","href":"https://docs.apiyi.com/model-registry.json"},{"label":"AI開発者キット(中国語)","href":"/developer-kit"},{"label":"AI Developer Kit (EN)","href":"/en/developer-kit"}]},{"header":"ユーザーの声 / Wall of Love","items":[{"label":"ユーザーの声(中国語)","href":"/wall-of-love"},{"label":"Wall of Love(英語)","href":"/en/wall-of-love"}]}]},"navbar":{"links":[{"href":"https://api.apiyi.com","label":"ホーム"},{"href":"https://imagen.apiyi.com","label":"AI画像生成"},{"href":"https://icover.ai","label":"AI動画生成"}],"primary":{"type":"button","label":"コンソール","href":"https://api.apiyi.com/account/profile"}},"pages":[{"title":"ja","href":"/ja/api-capabilities/veo-3-1-official/text-to-video"}]},{"language":"ko","banner":{"content":"이 페이지는 AI로 번역되었습니다. 내용이 다를 경우 [English 버전](/en)을 기준으로 하십시오.","dismissible":true},"footer":{"socials":{"website":"https://api.apiyi.com"},"links":[{"header":"AI 통합","items":[{"label":"skill.md","href":"https://docs.apiyi.com/skill.md"},{"label":"llms.txt","href":"https://docs.apiyi.com/llms.txt"},{"label":"llms-full.txt","href":"https://docs.apiyi.com/llms-full.txt"},{"label":"model-registry.json","href":"https://docs.apiyi.com/model-registry.json"},{"label":"AI 개발자 키트(중국어)","href":"/developer-kit"},{"label":"AI Developer Kit (EN)","href":"/en/developer-kit"}]},{"header":"사용자 후기 / Wall of Love","items":[{"label":"사용자 후기(중국어)","href":"/wall-of-love"},{"label":"Wall of Love (영문)","href":"/en/wall-of-love"}]}]},"navbar":{"links":[{"href":"https://api.apiyi.com","label":"홈"},{"href":"https://imagen.apiyi.com","label":"AI 이미지 생성"},{"href":"https://icover.ai","label":"AI 동영상 생성"}],"primary":{"type":"button","label":"콘솔","href":"https://api.apiyi.com/account/profile"}},"pages":[{"title":"ko","href":"/ko/api-capabilities/veo-3-1-official/text-to-video"}]},{"language":"ru","banner":{"content":"Эта страница переведена с помощью ИИ. При расхождениях ориентируйтесь на [английскую версию](/en).","dismissible":true},"footer":{"socials":{"website":"https://api.apiyi.com"},"links":[{"header":"AI-интеграция","items":[{"label":"skill.md","href":"https://docs.apiyi.com/skill.md"},{"label":"llms.txt","href":"https://docs.apiyi.com/llms.txt"},{"label":"llms-full.txt","href":"https://docs.apiyi.com/llms-full.txt"},{"label":"model-registry.json","href":"https://docs.apiyi.com/model-registry.json"},{"label":"Набор AI-разработчика (кит.)","href":"/developer-kit"},{"label":"AI Developer Kit (EN)","href":"/en/developer-kit"}]},{"header":"Отзывы пользователей / Wall of Love","items":[{"label":"Отзывы пользователей (на китайском)","href":"/wall-of-love"},{"label":"Wall of Love (EN)","href":"/en/wall-of-love"}]}]},"navbar":{"links":[{"href":"https://api.apiyi.com","label":"Главная"},{"href":"https://imagen.apiyi.com","label":"Генерация изображений"},{"href":"https://icover.ai","label":"Генерация видео"}],"primary":{"type":"button","label":"Консоль","href":"https://api.apiyi.com/account/profile"}},"tabs":[{"tab":"Главная","icon":"house","groups":[{"group":"Основы","pages":[{"title":"APIYI - Хаб API моделей ИИ","sidebarTitle":"Введение","icon":"house","href":"/ru"},{"title":"Быстрый старт","icon":"rocket","href":"/ru/getting-started"},{"group":"Набор инструментов разработчика ИИ","icon":"terminal","pages":[{"title":"Набор инструментов для разработчиков ИИ","sidebarTitle":"Набор инструментов для разработчиков ИИ","icon":"bot","href":"/ru/developer-kit"},{"title":"Почему терминал сообщает, что команда apiyi не найдена?","icon":"terminal","href":"/ru/faq/apiyi-cli-command-not-found"}]},{"group":"Руководство по API","icon":"book","pages":[{"title":"Руководство по API","sidebarTitle":"Обзор руководства","icon":"book","href":"/ru/api-manual"},{"title":"Захват деталей ошибок API","sidebarTitle":"Захват ошибок","icon":"clipboard-list","href":"/ru/api-manual/error-reporting"},{"group":"Подключение API: частые вопросы","icon":"circle-question-mark","expanded":false,"pages":[{"title":"Поддерживает ли APIYI API файлов?","icon":"file-up","href":"/ru/faq/files-api-not-supported"},{"title":"Как настроить Base URL? Различия между /v1, корневым доменом и /v1beta","icon":"link","href":"/ru/faq/base-url-config"},{"title":"Как устранить ошибки API модели?","icon":"alert-triangle","href":"/ru/faq/model-error-troubleshooting"},{"title":"Каковы лимиты параллельных запросов API?","icon":"gauge","href":"/ru/faq/api-concurrency"}]}]},{"title":"Тарифы","icon":"badge-dollar-sign","href":"/ru/pricing"}]},{"group":"Базовый API","icon":"box","pages":[{"group":"Информация о моделях","icon":"cpu","pages":[{"title":"Популярные модели","icon":"database","href":"/ru/api-capabilities/model-info"},{"group":"Модели: частые вопросы","icon":"circle-question-mark","expanded":false,"pages":[{"title":"Как выбрать подходящую модель ИИ?","icon":"compass","href":"/ru/faq/model-selection-guide"},{"title":"Почему официальные веб-приложения и API дают разные результаты?","icon":"layers","href":"/ru/faq/webapp-vs-api-difference"},{"title":"Почему модели ИИ не знают свою собственную версию?","icon":"circle-question-mark","href":"/ru/faq/model-version-identity"}]}]},{"title":"Модели генерации изображений и видео","icon":"palette","href":"/ru/api-capabilities/image-video-models"},{"group":"Вызовы OpenAI API","icon":"sparkles","pages":[{"title":"Руководство по нативному OpenAI Responses API","sidebarTitle":"Нативные вызовы","icon":"zap","href":"/ru/api-capabilities/openai/native"},{"title":"Режим совместимости OpenAI Chat Completions","sidebarTitle":"Совместимый режим","icon":"plug","href":"/ru/api-capabilities/openai/compatible"},{"title":"Выбор эндпоинта: миграция GPT-5.4+ на Responses","sidebarTitle":"Эндпоинт и миграция","icon":"route","href":"/ru/api-capabilities/openai/responses-migration"},{"title":"Режим совместимости OpenAI: обработка ответов","sidebarTitle":"Обработка ответов","icon":"braces","href":"/ru/api-capabilities/openai/response-handling"},{"title":"OpenAI Compatible Mode: Вывод модели рассуждений","sidebarTitle":"Вывод модели рассуждений","icon":"brain","href":"/ru/api-capabilities/openai/reasoning-models"},{"title":"Руководство по тарификации Prompt Caching OpenAI","sidebarTitle":"Тарификация кэша","icon":"database","href":"/ru/api-capabilities/openai/prompt-caching"},{"title":"Руководство по Function Calling OpenAI","sidebarTitle":"Function Calling","icon":"wrench","href":"/ru/api-capabilities/openai/function-calling"},{"title":"Руководство по веб-поиску в OpenAI API","sidebarTitle":"Веб-поиск","icon":"globe","href":"/ru/api-capabilities/openai/web-search"},{"group":"OpenAI: частые вопросы","icon":"circle-question-mark","pages":[{"title":"Поддерживает ли APIYI быстрый / сверхбыстрый режим OpenAI?","icon":"gauge","href":"/ru/faq/openai-service-tier-fast-mode"},{"title":"Чем отличаются запросы с потоковой передачей и без неё при фильтрации контента?","sidebarTitle":"Потоковая передача и фильтрация контента","icon":"shield-half","href":"/ru/faq/streaming-content-filter"},{"title":"Как выглядит отказ модели OpenAI?","icon":"message-square-x","href":"/ru/faq/openai-content-safety-refusal"}]}]},{"group":"Официальный Claude","icon":"sparkles","pages":[{"title":"Основы вызовов API Claude","sidebarTitle":"Основы API Claude","icon":"sparkles","href":"/ru/api-capabilities/claude"},{"title":"Нативный формат Claude: потоковая передача и ответы без потоковой передачи","sidebarTitle":"Потоковая передача и ответы","icon":"braces","href":"/ru/api-capabilities/claude-response-handling"},{"title":"Руководство Claude по кэшированию промптов","sidebarTitle":"Кэширование промптов","icon":"database","href":"/ru/api-capabilities/claude-prompt-caching"},{"title":"Руководство по Effort и Thinking для Claude","sidebarTitle":"Effort и Thinking","icon":"gauge","href":"/ru/api-capabilities/claude-effort-thinking"},{"title":"Руководство по веб-поиску Claude API","sidebarTitle":"Веб-поиск Claude","icon":"globe","href":"/ru/api-capabilities/claude-web-search"},{"group":"Claude: частые вопросы","icon":"circle-question-mark","pages":[{"title":"Почему Claude утверждает, что он Qwen или DeepSeek?","icon":"venetian-mask","href":"/ru/faq/claude-identity-confusion"},{"title":"Как исправить ошибку недействительной подписи thinking в Claude?","icon":"file-signature","href":"/ru/faq/claude-thinking-signature-invalid"},{"title":"Почему при отказе Claude возвращается пустое содержимое?","icon":"message-square-x","href":"/ru/faq/claude-content-safety-refusal"}]}]},{"group":"Нативные вызовы Gemini","icon":"sparkles","pages":[{"title":"Руководство по нативному формату Gemini","sidebarTitle":"Нативные вызовы","icon":"zap","href":"/ru/api-capabilities/gemini/native"},{"title":"Interactions API против generateContent","sidebarTitle":"Сравнение Interactions API","icon":"git-compare","href":"/ru/api-capabilities/gemini/interactions-api"},{"title":"Нативный формат Gemini: потоковые и непотоковые ответы","sidebarTitle":"Потоковая передача и ответы","icon":"braces","href":"/ru/api-capabilities/gemini/response-handling"},{"title":"Мультимодальный ввод и выполнение кода в Gemini","sidebarTitle":"Мультимодальность и выполнение кода","icon":"images","href":"/ru/api-capabilities/gemini/multimodal"},{"title":"Руководство по тарификации неявного кэширования Gemini","sidebarTitle":"Тарификация кэша","icon":"database","href":"/ru/api-capabilities/gemini/prompt-caching"},{"title":"Руководство по вызову функций Gemini","sidebarTitle":"Вызов функций","icon":"wrench","href":"/ru/api-capabilities/gemini/function-calling"},{"title":"Руководство по веб-поиску для Gemini API","sidebarTitle":"Веб-поиск","icon":"globe","href":"/ru/api-capabilities/gemini/web-search"},{"title":"Как исправить ошибки 400 (Thought Signature) в Gemini при вызовах инструментов?","icon":"file-signature","href":"/ru/faq/gemini-thought-signature-missing"}]},{"group":"Вызовы API Grok","icon":"sparkles","pages":[{"title":"Руководство по серии моделей Grok","sidebarTitle":"Обзор Grok","icon":"rocket","href":"/ru/api-capabilities/grok/overview"},{"title":"Руководство по Grok Chat и рассуждению","sidebarTitle":"Чат и рассуждение","icon":"message-square","href":"/ru/api-capabilities/grok/chat"},{"title":"Руководство по Web Search и X Search в Grok","sidebarTitle":"Web и X Search","icon":"globe","href":"/ru/api-capabilities/grok/web-search"},{"title":"Выполнение кода и руководство по Remote MCP для Grok","sidebarTitle":"Выполнение кода и MCP","icon":"terminal","href":"/ru/api-capabilities/grok/code-execution-mcp"},{"title":"Руководство по модели Grok Multi-Agent","sidebarTitle":"Мультиагентная модель","icon":"users","href":"/ru/api-capabilities/grok/multi-agent"},{"title":"Руководство по тарификации кэширования Grok","sidebarTitle":"Тарификация кэша","icon":"database","href":"/ru/api-capabilities/grok/prompt-caching"}]},{"group":"Лучшие практики текстового API","icon":"book-check","pages":[{"title":"Практики работы с длинными ответами","sidebarTitle":"Длинные ответы","icon":"book-check","href":"/ru/api-capabilities/long-form-output-practices"},{"title":"Руководство по многотуровому диалогу","sidebarTitle":"Многотуровый диалог","icon":"messages-square","href":"/ru/api-capabilities/multi-turn-conversation"},{"group":"Текст: частые вопросы","icon":"circle-question-mark","expanded":false,"pages":[{"title":"В чём разница между вызовами с потоковой передачей и без потоковой передачи?","sidebarTitle":"Потоковая передача vs без потоковой передачи","icon":"audio-lines","href":"/ru/faq/streaming-vs-non-streaming"},{"title":"Что такое max_tokens? Что произойдет, если не задавать?","icon":"sliders-horizontal","href":"/ru/faq/max-tokens"},{"title":"Есть ли у API память, как у ChatGPT?","icon":"brain","href":"/ru/faq/api-memory"}]}]},{"title":"API запроса баланса","icon":"wallet","href":"/ru/api-capabilities/balance-query"},{"title":"API запроса журналов","icon":"file-text","href":"/ru/api-capabilities/log-query"},{"title":"Управление token API","icon":"key","href":"/ru/api-capabilities/token-management"},{"title":"Устаревшие модели","icon":"triangle-alert","href":"/ru/api-capabilities/deprecated-models"}]},{"group":"Image API (официальный)","icon":"image","pages":[{"group":"Основы Image API","icon":"book-check","pages":[{"title":"Основы API изображений и лучшие практики","sidebarTitle":"Обязательно к прочтению и лучшие практики","icon":"book-check","href":"/ru/api-capabilities/image-api-best-practices"},{"title":"Устранение обрывов соединения с API изображений","sidebarTitle":"Обрывы соединения","icon":"unplug","href":"/ru/api-capabilities/image-connection-drops"},{"title":"Запросы на изображение, которые зависают после получения данных","sidebarTitle":"Запросы, зависающие в конце","icon":"hourglass","href":"/ru/api-capabilities/image-tail-stall"},{"title":"Сжатие изображений и выходное разрешение","sidebarTitle":"Сжатие и разрешение","icon":"scaling","href":"/ru/api-capabilities/image-compression-resolution"},{"title":"Как получать удовлетворительные изображения","sidebarTitle":"Получение удовлетворительных изображений","icon":"target","href":"/ru/api-capabilities/image-generation-success-tips"},{"title":"Устранение отклонений по соображениям безопасности: найдите триггерное слово методом абляции","sidebarTitle":"Отклонения по соображениям безопасности","icon":"shield-alert","href":"/ru/api-capabilities/image-safety-troubleshooting"},{"title":"Длинные prompt и двухэтапная генерация: откуда берется лимит в 32K","sidebarTitle":"Длинные prompt","icon":"text-quote","href":"/ru/api-capabilities/image-long-prompt"},{"title":"Продвинутая генерация изображений: рабочий процесс и реализм","sidebarTitle":"Продвинутый рабочий процесс","icon":"workflow","href":"/ru/api-capabilities/image-advanced-workflow"},{"title":"Навык Image Prompt Doctor","sidebarTitle":"Навык Prompt Doctor","icon":"stethoscope","href":"/ru/api-capabilities/image-prompt-doctor"},{"group":"Изображения: частые вопросы","icon":"circle-question-mark","pages":[{"title":"Есть ли conversational API, который выводит и текст, и сгенерированные изображения?","sidebarTitle":"Текст + изображение в одном API","icon":"images","href":"/ru/faq/text-and-image-in-one-api"},{"title":"Запрос на генерацию изображения зависает без результата, но в журнале указана ошибка записи?","icon":"hourglass","href":"/ru/faq/image-direct-large-response-stall"},{"title":"Запросы на генерацию изображений обрываются примерно через 90 секунд при работе через прокси?","icon":"unplug","href":"/ru/faq/proxy-idle-timeout-disconnect"},{"title":"Почему сгенерированное изображение сильно отличается от референса?","icon":"image","href":"/ru/faq/image-result-differs-from-reference"},{"title":"Как исправить ошибку несоответствия содержимого изображения MIME-типу?","icon":"image","href":"/ru/faq/image-mime-type-mismatch-with-query"},{"title":"Есть ли асинхронный API для генерации изображений? Можно ли запрашивать результаты по ID задачи?","icon":"image","href":"/ru/faq/image-async-api"}]}]},{"group":"Генерация изображений GPT-Image-2.5 / 2","icon":"sparkles","pages":[{"title":"GPT-Image-2.5 / 2 Генерация/редактирование изображений","sidebarTitle":"GPT-Image-2.5 / 2 Обзор","icon":"sparkles","href":"/ru/api-capabilities/gpt-image-2/overview"},{"title":"Справочник API преобразования текста в изображение","openapi":"api-reference/gpt-image-2-generate-openapi-en.yaml POST /v1/images/generations","icon":"wand-sparkles","href":"/ru/api-capabilities/gpt-image-2/text-to-image"},{"title":"Справочник API редактирования изображений","openapi":"api-reference/gpt-image-2-edit-openapi-en.yaml POST /v1/images/edits","icon":"image","href":"/ru/api-capabilities/gpt-image-2/image-edit"},{"title":"GPT-Image-2.5 / 2 Серия навыка агента","icon":"blocks","href":"/ru/api-capabilities/gpt-image-2/skills"},{"title":"Руководство по масковому inpainting","sidebarTitle":"Масковый inpainting","icon":"brush","href":"/ru/api-capabilities/gpt-image-2/mask-editing"},{"title":"Устаревшие версии GPT-Image","sidebarTitle":"Устаревшие версии GPT-Image","icon":"rotate-ccw-clock","href":"/ru/api-capabilities/gpt-image-2/historical-versions"},{"group":"GPT-Image: частые вопросы","icon":"circle-question-mark","pages":[{"title":"Как генерировать изображения с прозрачным фоном (PNG без фона)?","icon":"layers","href":"/ru/faq/image-transparent-background"},{"title":"Почему у GPT Image так много output tokens?","icon":"calculator","href":"/ru/faq/gpt-image-output-token-calculation"},{"title":"Интеграция Codex для GPT-Image завершается ошибкой из-за неверного API-ключа","sidebarTitle":"Ключ изображения отклонён OpenAI","icon":"key-round","href":"/ru/faq/gpt-image-incorrect-api-key-openai"}]}]},{"title":"GPT-image-2.5 / 2: официальные модели против reverse-версий","sidebarTitle":"GPT-image-2.5 / 2: официальные против reverse-версий","icon":"scale","href":"/ru/api-capabilities/gpt-image-2/vs-gpt-image-2-all"},{"group":"Генерация изображений GPT-Image-2.5-All","icon":"sparkles","pages":[{"title":"GPT-Image-2.5-All: генерация/редактирование изображений","sidebarTitle":"Обзор GPT-Image-2.5-All","icon":"sparkles","href":"/ru/api-capabilities/gpt-image-2-all/overview"},{"title":"Справочник по API генерации изображений по тексту","openapi":"api-reference/gpt-image-2-all-generate-openapi-en.yaml POST /v1/images/generations","icon":"wand-sparkles","href":"/ru/api-capabilities/gpt-image-2-all/text-to-image"},{"title":"Справочник по API редактирования изображений","openapi":"api-reference/gpt-image-2-all-edit-openapi-en.yaml POST /v1/images/edits","icon":"image","href":"/ru/api-capabilities/gpt-image-2-all/image-edit"},{"title":"Навык агента GPT-Image-2.5-All","icon":"blocks","href":"/ru/api-capabilities/gpt-image-2-all/skills"}]},{"group":"Генерация изображений GPT-Image-2.5-VIP","icon":"expand","pages":[{"title":"GPT-Image-2.5-VIP: генерация/редактирование изображений","sidebarTitle":"Обзор GPT-Image-2.5-VIP","icon":"expand","href":"/ru/api-capabilities/gpt-image-2-vip/overview"},{"title":"Справочник API Text-to-Image","openapi":"api-reference/gpt-image-2-vip-generate-openapi-en.yaml POST /v1/images/generations","icon":"wand-sparkles","href":"/ru/api-capabilities/gpt-image-2-vip/text-to-image"},{"title":"Справочник API редактирования изображений","openapi":"api-reference/gpt-image-2-vip-edit-openapi-en.yaml POST /v1/images/edits","icon":"image","href":"/ru/api-capabilities/gpt-image-2-vip/image-edit"},{"title":"Навык агента GPT-Image-2.5-VIP","icon":"blocks","href":"/ru/api-capabilities/gpt-image-2-vip/skills"}]},{"title":"Тарифы серии Nano Banana","icon":"tag","href":"/ru/api-capabilities/nano-banana-pricing"},{"group":"Лучшие практики NanoBanana","icon":"lightbulb","pages":[{"title":"Руководство разработчика по серии Nano Banana","icon":"compass","href":"/ru/api-capabilities/nano-banana-dev-guide"},{"title":"Пояснение полей Usage и вывода","sidebarTitle":"Пояснение полей Usage и вывода","icon":"receipt-text","href":"/ru/api-capabilities/nano-banana-usage-metadata"},{"title":"Руководство по обработке ошибок API генерации изображений Gemini","icon":"triangle-alert","href":"/ru/api-capabilities/gemini-image-error-handling"},{"title":"Руководство по тестированию слияния нескольких изображений","sidebarTitle":"Тестирование слияния нескольких изображений","icon":"layers","href":"/ru/api-capabilities/multi-image-fusion-testing"},{"title":"План возмещения кредитов за неудачную генерацию Nano Banana Pro","icon":"shield-check","href":"/ru/api-capabilities/nano-banana-pro-guarantee"},{"title":"Группа Nano Banana OSS","icon":"link","href":"/ru/api-capabilities/nano-banana-oss-group"},{"group":"NB: частые вопросы","icon":"circle-question-mark","pages":[{"title":"Запускаются ли модели Google в AI Studio или Vertex?","icon":"split","href":"/ru/faq/google-upstream-aistudio-vertex"},{"title":"При редактировании изображений возвращается Unable to Process Input Image?","icon":"image-off","href":"/ru/faq/gemini-empty-inlinedata"},{"title":"Почему Gemini Image возвращает IMAGE_OTHER?","sidebarTitle":"IMAGE_OTHER","icon":"image-minus","href":"/ru/faq/gemini-image-other"},{"title":"Почему Gemini Image возвращает blockReason: OTHER?","sidebarTitle":"blockReason: OTHER","icon":"shield-alert","href":"/ru/faq/gemini-image-input-blocked"},{"title":"Основные причины сбоев генерации изображений Nano Banana","icon":"image-off","href":"/ru/faq/nano-banana-image-failure"},{"title":"Почему API Gemini для генерации изображений возвращает NO_IMAGE?","icon":"image-off","href":"/ru/faq/gemini-no-image"},{"title":"Почему мое изображение становится красноватым после редактирования в Nano Banana Pro?","icon":"image","href":"/ru/faq/banana-pro-edit-red-cast"},{"title":"Как исправить искажения при смене одежды с Nano Banana Pro?","icon":"shirt","href":"/ru/faq/nano-banana-pro-print-distortion"},{"title":"Почему на изображении с белым фоном появляются чёрные пятна, грязные разводы или размытые цветные блоки?","icon":"triangle-alert","href":"/ru/faq/white-background-image-artifacts"}]}]},{"group":"Генерация изображений Nano Banana 2.1","icon":"banana","pages":[{"title":"Nano Banana 2.1: генерация и редактирование изображений","icon":"banana","href":"/ru/api-capabilities/gemini-nano-banana-2.1/overview"},{"title":"Справочник по API Text-to-Image","openapi":"api-reference/gemini-nano-banana-2.1-generate-openapi-en.yaml POST /v1beta/models/gemini-nano-banana-2.1:generateContent","icon":"wand-sparkles","href":"/ru/api-capabilities/gemini-nano-banana-2.1/text-to-image"},{"title":"Справочник по API редактирования изображений","openapi":"api-reference/gemini-nano-banana-2.1-edit-openapi-en.yaml POST /v1beta/models/gemini-nano-banana-2.1:generateContent","icon":"image","href":"/ru/api-capabilities/gemini-nano-banana-2.1/image-edit"},{"title":"Agent Skill для Nano Banana 2.1","icon":"blocks","href":"/ru/api-capabilities/gemini-nano-banana-2.1/skills"}]},{"group":"Генерация изображений Nano Banana Pro","icon":"banana","pages":[{"title":"Генерация изображений Nano Banana Pro","icon":"banana","href":"/ru/api-capabilities/nano-banana-image/overview"},{"title":"Справочник API для генерации изображений по тексту","openapi":"api-reference/nano-banana-pro-generate-openapi-en.yaml POST /v1beta/models/gemini-3-pro-image:generateContent","icon":"wand-sparkles","href":"/ru/api-capabilities/nano-banana-image/text-to-image"},{"title":"Справочник API редактирования изображений","openapi":"api-reference/nano-banana-pro-edit-openapi-en.yaml POST /v1beta/models/gemini-3-pro-image:generateContent","icon":"image","href":"/ru/api-capabilities/nano-banana-image/image-edit"},{"title":"Навык агента Nano Banana Pro","icon":"blocks","href":"/ru/api-capabilities/nano-banana-image/skills"}]},{"group":"Генерация изображений Nano Banana 2","icon":"banana","pages":[{"title":"Nano Banana 2: генерация и редактирование изображений","icon":"banana","href":"/ru/api-capabilities/nano-banana-2-image/overview"},{"title":"Справочник API для преобразования текста в изображение","openapi":"api-reference/nano-banana-2-generate-openapi-en.yaml POST /v1beta/models/gemini-3.1-flash-image:generateContent","icon":"wand-sparkles","href":"/ru/api-capabilities/nano-banana-2-image/text-to-image"},{"title":"Справочник API редактирования изображений","openapi":"api-reference/nano-banana-2-edit-openapi-en.yaml POST /v1beta/models/gemini-3.1-flash-image:generateContent","icon":"image","href":"/ru/api-capabilities/nano-banana-2-image/image-edit"},{"title":"Навык агента Nano Banana 2","icon":"blocks","href":"/ru/api-capabilities/nano-banana-2-image/skills"}]},{"group":"Генерация изображений Nano Banana Lite","icon":"banana","pages":[{"title":"Nano Banana Lite Генерация/редактирование изображений","icon":"banana","href":"/ru/api-capabilities/nano-banana-lite-image/overview"},{"title":"Справочник API Text-to-Image","openapi":"api-reference/nano-banana-lite-generate-openapi-en.yaml POST /v1beta/models/gemini-3.1-flash-lite-image:generateContent","icon":"wand-sparkles","href":"/ru/api-capabilities/nano-banana-lite-image/text-to-image"},{"title":"Справочник API для редактирования изображений","openapi":"api-reference/nano-banana-lite-edit-openapi-en.yaml POST /v1beta/models/gemini-3.1-flash-lite-image:generateContent","icon":"image","href":"/ru/api-capabilities/nano-banana-lite-image/image-edit"},{"title":"Навык Agent Skill для Nano Banana Lite","icon":"blocks","href":"/ru/api-capabilities/nano-banana-lite-image/skills"}]},{"group":"Генерация и редактирование изображений FLUX","icon":"sparkles","pages":[{"title":"Генерация и редактирование изображений FLUX","sidebarTitle":"Обзор FLUX","icon":"sparkles","href":"/ru/api-capabilities/flux/overview"},{"title":"Справочник API для преобразования текста в изображение","openapi":"api-reference/flux-generate-openapi-en.yaml POST /v1/images/generations","icon":"wand-sparkles","href":"/ru/api-capabilities/flux/text-to-image"},{"title":"Справочник API по редактированию изображений","openapi":"api-reference/flux-edit-openapi-en.yaml POST /v1/images/generations","icon":"image","href":"/ru/api-capabilities/flux/image-edit"},{"title":"Исторические версии FLUX","sidebarTitle":"Исторические версии","icon":"rotate-ccw-clock","href":"/ru/api-capabilities/flux/historical-versions"}]},{"group":"Серия Seedream 5.0","icon":"sparkles","pages":[{"title":"Генерация и редактирование изображений Seedream","sidebarTitle":"Обзор Seedream","icon":"sparkles","href":"/ru/api-capabilities/seedream-image/overview"},{"title":"Справочник API Text-to-Image","openapi":"api-reference/seedream-image-generate-openapi-en.yaml POST /v1/images/generations","icon":"wand-sparkles","href":"/ru/api-capabilities/seedream-image/text-to-image"},{"title":"Справочник API для редактирования изображений","openapi":"api-reference/seedream-image-edit-openapi-en.yaml POST /v1/images/generations","icon":"image","href":"/ru/api-capabilities/seedream-image/image-edit"},{"title":"Предыдущие версии Seedream","sidebarTitle":"Предыдущие версии","icon":"rotate-ccw-clock","href":"/ru/api-capabilities/seedream-image/historical-versions"}]},{"group":"Grok Imagine: официальная генерация изображений","icon":"sparkles","pages":[{"title":"Официальная генерация изображений Grok Imagine","sidebarTitle":"Официальный обзор Grok Imagine","icon":"sparkles","href":"/ru/api-capabilities/grok-imagine-image-official/overview"},{"title":"Справочник по официальному API генерации изображений по тексту Grok Imagine","sidebarTitle":"Генерация изображений по тексту","openapi":"api-reference/grok-imagine-image-official-generate-openapi-en.yaml POST /v1/images/generations","icon":"wand-sparkles","href":"/ru/api-capabilities/grok-imagine-image-official/text-to-image"}]},{"group":"Grok Imagine (reverse): генерация и редактирование изображений","icon":"sparkles","pages":[{"title":"Grok Imagine Reverse: генерация и редактирование изображений","sidebarTitle":"Обзор Grok Imagine Reverse","icon":"sparkles","href":"/ru/api-capabilities/grok-imagine-image/overview"},{"title":"Справочник API генерации изображений по тексту","openapi":"api-reference/grok-imagine-image-generate-openapi-en.yaml POST /v1/images/generations","icon":"wand-sparkles","href":"/ru/api-capabilities/grok-imagine-image/text-to-image"},{"title":"Справочник API для редактирования изображений","openapi":"api-reference/grok-imagine-image-edit-openapi-en.yaml POST /v1/images/edits","icon":"image","href":"/ru/api-capabilities/grok-imagine-image/image-edit"}]},{"group":"Генерация и редактирование изображений MAI-Image 2.6","icon":"sparkles","pages":[{"title":"MAI-Image 2.6: генерация и редактирование изображений","sidebarTitle":"Обзор MAI-Image 2.6","icon":"sparkles","href":"/ru/api-capabilities/mai-image/overview"},{"title":"Справочник по Text-to-Image API","openapi":"api-reference/mai-image-generate-openapi-en.yaml POST /v1/images/generations","icon":"wand-sparkles","href":"/ru/api-capabilities/mai-image/text-to-image"},{"title":"Справочник API редактирования изображений","openapi":"api-reference/mai-image-edit-openapi-en.yaml POST /v1/images/edits","icon":"image","href":"/ru/api-capabilities/mai-image/image-edit"}]},{"title":"Практика интеграции Image API: создайте собственную асинхронную очередь","sidebarTitle":"Самостоятельно размещенная асинхронная очередь","icon":"list-checks","href":"/ru/api-capabilities/image-async-queue"}]},{"group":"Video API (официальный)","icon":"video","pages":[{"group":"Seedance 2.0 / 2.5 (Volcano Engine)","icon":"film","pages":[{"title":"Генерация видео Seedance 2.0 / 2.5","sidebarTitle":"Обзор Seedance 2.0 / 2.5","icon":"film","href":"/ru/api-capabilities/seedance2/overview"},{"title":"Справочник API генерации видео Seedance 2.0 / 2.5","sidebarTitle":"Генерация видео","openapi":"api-reference/seedance2-video-openapi-en.yaml POST /seedance/api/v3/contents/generations/tasks","icon":"video","href":"/ru/api-capabilities/seedance2/video-generation"},{"title":"Навык агента для генерации видео Seedance 2.0","icon":"blocks","href":"/ru/api-capabilities/seedance2/skills"},{"title":"Библиотека ассетов Seedance 2.0 (видео с сохранением персонажа)","sidebarTitle":"Библиотека ассетов","icon":"images","href":"/ru/api-capabilities/seedance2/asset-library"},{"title":"Генерация видео с привязкой к asset в коде","sidebarTitle":"Руководство по ссылкам на asset","icon":"clapperboard","href":"/ru/api-capabilities/seedance2/asset-reference"},{"title":"Сначала ресурсы: более быстрая и надёжная передача изображений и видео","sidebarTitle":"Рабочий процесс «Сначала ресурсы»","icon":"gauge","href":"/ru/api-capabilities/seedance2/asset-first-workflow"},{"group":"SD: частые вопросы","icon":"circle-question-mark","pages":[{"title":"Seedance сообщает, что первый/последний кадр нельзя смешивать с референсными медиа","sidebarTitle":"Смешивание первого кадра с референсом","icon":"layers","href":"/ru/faq/seedance-first-frame-mixed-with-reference"},{"title":"Seedance сообщает об ошибке invalid image format, но ссылка открывается в браузере","sidebarTitle":"Ссылка на изображение открывается, но не работает","icon":"link","href":"/ru/faq/seedance-image-url-invalid-format"},{"title":"Seedance 2.5: референс-видео и редактирование видео","icon":"split","href":"/ru/faq/seedance2-reference-vs-edit"},{"title":"Можно ли отменить задачу Seedance после отправки?","icon":"video","href":"/ru/faq/seedance-video-task-cancel"},{"title":"Как узнать фактическую стоимость видео Seedance по task_id?","icon":"receipt","href":"/ru/faq/seedance-task-cost-lookup"},{"title":"Загружает ли Seedance 2.0 автоматически референсы лиц в библиотеку ассетов? Срабатывает ли при этом фильтр deepfake?","icon":"banana","href":"/ru/faq/seedance2-asset-face-reference"},{"title":"Почему Seedance 2.0 / 2.5 блокирует ассеты с лицами?","icon":"scan-face","href":"/ru/faq/seedance2-face-asset-whitelist"}]}]},{"group":"Генерация видео Wan3.0 (Alibaba Cloud)","icon":"video","pages":[{"title":"Генерация видео Wan3.0 (Alibaba Tongyi Wanxiang)","sidebarTitle":"Обзор","icon":"video","href":"/ru/api-capabilities/wan3/overview"},{"title":"Справочник API генерации видео Wan3.0","sidebarTitle":"Генерация видео","openapi":"api-reference/wan3-video-openapi-en.yaml POST /wan/api/v1/services/aigc/video-generation/video-synthesis","icon":"wand-sparkles","href":"/ru/api-capabilities/wan3/video-generation"}]},{"group":"Генерация видео Wan2.7 (Alibaba Cloud)","icon":"videotape","pages":[{"title":"Генерация видео Wan (Alibaba Cloud Tongyi Wanxiang)","sidebarTitle":"Обзор Wan","icon":"video","href":"/ru/api-capabilities/wan/overview"},{"title":"Wan2.7 Справочник API для преобразования текста в видео","sidebarTitle":"Преобразование текста в видео","openapi":"api-reference/wan-text-to-video-openapi-en.yaml POST /wan/api/v1/services/aigc/video-generation/video-synthesis","icon":"wand-sparkles","href":"/ru/api-capabilities/wan/text-to-video"},{"title":"Wan2.7 Image-to-Video API Reference","sidebarTitle":"Изображение-в-видео","openapi":"api-reference/wan-image-to-video-openapi-en.yaml POST /wan/api/v1/services/aigc/video-generation/video-synthesis","icon":"image","href":"/ru/api-capabilities/wan/image-to-video"},{"title":"Справочник API Wan2.7 для генерации видео по референсу","sidebarTitle":"Генерация видео по референсу","openapi":"api-reference/wan-reference-to-video-openapi-en.yaml POST /wan/api/v1/services/aigc/video-generation/video-synthesis","icon":"users","href":"/ru/api-capabilities/wan/reference-to-video"},{"title":"Справочник API для редактирования видео Wan2.7","sidebarTitle":"Редактирование видео","openapi":"api-reference/wan-video-edit-openapi-en.yaml POST /wan/api/v1/services/aigc/video-generation/video-synthesis","icon":"scissors","href":"/ru/api-capabilities/wan/video-edit"},{"title":"Навык Agent Skill для видео Wan2.7 и HappyHorse","icon":"blocks","href":"/ru/api-capabilities/wan/skills"},{"title":"Исторические версии Wan (Wan2.6)","sidebarTitle":"Исторические версии","icon":"rotate-ccw-clock","href":"/ru/api-capabilities/wan/historical-versions"}]},{"group":"Генерация видео HappyHorse (Alibaba Cloud)","icon":"monitor-play","pages":[{"title":"Генерация видео HappyHorse (Alibaba Cloud)","sidebarTitle":"Обзор HappyHorse","icon":"monitor-play","href":"/ru/api-capabilities/happyhorse/overview"},{"title":"HappyHorse Текст-в-видео справочник API","sidebarTitle":"Текст-в-видео","openapi":"api-reference/happyhorse-text-to-video-openapi-en.yaml POST /wan/api/v1/services/aigc/video-generation/video-synthesis","icon":"wand-sparkles","href":"/ru/api-capabilities/happyhorse/text-to-video"},{"title":"Справочник API HappyHorse по преобразованию изображения в видео","sidebarTitle":"Изображение в видео","openapi":"api-reference/happyhorse-image-to-video-openapi-en.yaml POST /wan/api/v1/services/aigc/video-generation/video-synthesis","icon":"image","href":"/ru/api-capabilities/happyhorse/image-to-video"},{"title":"Справочник API Reference-to-Video HappyHorse","sidebarTitle":"Reference-to-Video","openapi":"api-reference/happyhorse-reference-to-video-openapi-en.yaml POST /wan/api/v1/services/aigc/video-generation/video-synthesis","icon":"users","href":"/ru/api-capabilities/happyhorse/reference-to-video"},{"title":"Справочник API для редактирования видео HappyHorse","sidebarTitle":"Редактирование видео","openapi":"api-reference/happyhorse-video-edit-openapi-en.yaml POST /wan/api/v1/services/aigc/video-generation/video-synthesis","icon":"scissors","href":"/ru/api-capabilities/happyhorse/video-edit"},{"title":"Навык видео-агента HappyHorse","icon":"blocks","href":"/ru/api-capabilities/happyhorse/skills"}]},{"group":"VEO 3.1 (Google)","icon":"clapperboard","pages":[{"title":"VEO 3.1 Официальная генерация видео","sidebarTitle":"VEO 3.1 Официальный обзор","description":"Полное руководство по официальному релей-каналу Google Veo 3.1: прозрачная передача запросов в Google AI Studio, тарификация за каждый запрос по $0.3 / $1.2, гибкая длительность 4 / 6 / 8 секунд, уровни 720p / 1080p / 4k и подключение без лишних действий — не требуется переключать группу или режим тарификации.","icon":"video","href":"/ru/api-capabilities/veo-3-1-official/overview"},{"title":"Официальный API VEO 3.1 для преобразования текста в видео","sidebarTitle":"Текст в видео","openapi":"api-reference/veo-3-1-official-text-to-video-openapi-en.yaml POST /v1/videos","icon":"wand-sparkles","href":"/ru/api-capabilities/veo-3-1-official/text-to-video"},{"title":"VEO 3.1 Официальный API преобразования изображения в видео","sidebarTitle":"Изображение в видео","description":"Официальная справка по API VEO 3.1 для преобразования изображения в видео и интерактивная песочница — multipart-загрузка одного изображения input_reference для анимации статичных визуальных материалов.","openapi":"api-reference/veo-3-1-official-image-to-video-openapi-en.yaml POST /v1/videos","icon":"image","href":"/ru/api-capabilities/veo-3-1-official/image-to-video"},{"title":"Сравнение VEO 3.1 Official и Reverse Channel","sidebarTitle":"Official vs Reverse","icon":"scale","href":"/ru/api-capabilities/veo-3-1-official/vs-veo-reverse"}]},{"group":"Grok Imagine: генерация видео (xAI)","icon":"camera","pages":[{"title":"Генерация видео Grok Imagine","sidebarTitle":"Обзор Grok Imagine Video","icon":"video","href":"/ru/api-capabilities/grok-imagine-video/overview"},{"title":"Справочник по API генерации видео Grok Imagine","sidebarTitle":"Генерация видео","openapi":"api-reference/grok-imagine-video-openapi-en.yaml POST /v1/videos","icon":"wand-sparkles","href":"/ru/api-capabilities/grok-imagine-video/video-generation"}]},{"group":"MiniMax H3: генерация видео (собственное развёртывание)","icon":"film","pages":[{"title":"Генерация видео MiniMax-H3","sidebarTitle":"Обзор MiniMax-H3","icon":"video","href":"/ru/api-capabilities/minimax-h3/overview"},{"title":"Справочник API по генерации видео MiniMax-H3","sidebarTitle":"Генерация видео","openapi":"api-reference/minimax-h3-video-openapi-en.yaml POST /hailuo/v2/video_generation","icon":"video","href":"/ru/api-capabilities/minimax-h3/video-generation"}]},{"group":"Oxygen: генерация видео (AZ8)","icon":"clapperboard","pages":[{"title":"Генерация видео Oxygen","sidebarTitle":"Обзор Oxygen","icon":"video","href":"/ru/api-capabilities/oxygen/overview"},{"title":"Справочник по API генерации видео Oxygen","sidebarTitle":"Генерация видео","openapi":"api-reference/oxygen-video-openapi-en.yaml POST /videos","icon":"video","href":"/ru/api-capabilities/oxygen/video-generation"}]}]},{"group":"API мультимодального понимания","icon":"eye","pages":[{"title":"API зрительного восприятия (распознавание изображений)","icon":"eye","href":"/ru/api-capabilities/vision-understanding"},{"title":"API анализа видео","icon":"video","href":"/ru/api-capabilities/video-understanding"},{"title":"Запросы на анализ изображений завершаются по таймауту — изображение слишком большое?","icon":"image","href":"/ru/faq/vision-image-too-large"}]},{"group":"Генерация текста","icon":"file-text","pages":[{"title":"Генерация текста (Chat Completions)","icon":"message-square","href":"/ru/api-capabilities/text-generation"},{"group":"Gemini 4 Argon","icon":"sparkles","pages":[{"title":"Генерация текста Gemini 4 Argon","sidebarTitle":"Обзор Gemini 4 Argon","icon":"sparkles","href":"/ru/api-capabilities/gemini-4-argon/overview"}]},{"group":"GPT-6 Astra","icon":"sparkles","pages":[{"title":"Генерация текста GPT-6 Astra","sidebarTitle":"Обзор GPT-6 Astra","icon":"sparkles","href":"/ru/api-capabilities/gpt-6-astra/overview"}]},{"group":"DeepSeek V4 Flash Vision","icon":"eye","pages":[{"title":"DeepSeek V4 Flash Vision","sidebarTitle":"Обзор","icon":"eye","href":"/ru/api-capabilities/deepseek-v4-flash-vision/overview"},{"title":"Справочник Chat API для DeepSeek V4 Flash Vision","sidebarTitle":"Песочница чата","openapi":"api-reference/deepseek-v4-flash-vision-chat-openapi-en.yaml POST /v1/chat/completions","icon":"terminal","href":"/ru/api-capabilities/deepseek-v4-flash-vision/chat-completions"},{"title":"DeepSeek V4 Flash Vision Messages API Reference","sidebarTitle":"Песочница сообщений","openapi":"api-reference/deepseek-v4-flash-vision-messages-openapi-en.yaml POST /v1/messages","icon":"terminal","href":"/ru/api-capabilities/deepseek-v4-flash-vision/messages"}]},{"group":"DeepSeek V4 Flash","icon":"zap","pages":[{"title":"DeepSeek V4 Flash Генерация текста","sidebarTitle":"Обзор","icon":"zap","href":"/ru/api-capabilities/deepseek-v4-flash/overview"},{"title":"Справочник по Chat API DeepSeek V4 Flash","sidebarTitle":"Песочница чата","openapi":"api-reference/deepseek-v4-flash-chat-openapi-en.yaml POST /v1/chat/completions","icon":"terminal","href":"/ru/api-capabilities/deepseek-v4-flash/chat-completions"},{"title":"DeepSeek V4 Flash Responses — справочник API","sidebarTitle":"Песочница Responses","openapi":"api-reference/deepseek-v4-flash-responses-openapi-en.yaml POST /v1/responses","icon":"git-fork","href":"/ru/api-capabilities/deepseek-v4-flash/responses"}]},{"group":"DeepSeek Search \u0026 Fetch","icon":"search","pages":[{"title":"API DeepSeek Web Search и Fetch","sidebarTitle":"Обзор","icon":"search","href":"/ru/api-capabilities/deepseek-search-fetch/overview"},{"title":"Справочник по DeepSeek Web Search API","sidebarTitle":"Песочница поиска","openapi":"api-reference/deepseek-search-openapi-en.yaml POST /v1/tools/search","icon":"terminal","href":"/ru/api-capabilities/deepseek-search-fetch/search-api"},{"title":"Справочник по DeepSeek Web Fetch API","sidebarTitle":"Песочница Fetch","openapi":"api-reference/deepseek-fetch-openapi-en.yaml POST /v1/tools/fetch","icon":"terminal","href":"/ru/api-capabilities/deepseek-search-fetch/fetch-api"}]},{"group":"Seed 2.1 Turbo","icon":"zap","pages":[{"title":"Генерация текста Seed 2.1 Turbo","sidebarTitle":"Обзор","icon":"message-square","href":"/ru/api-capabilities/dola-seed-2-1-turbo/overview"},{"title":"Справочник API чата Seed 2.1 Turbo","sidebarTitle":"Песочница чата","openapi":"api-reference/dola-seed-2-1-turbo-chat-openapi-en.yaml POST /v1/chat/completions","icon":"terminal","href":"/ru/api-capabilities/dola-seed-2-1-turbo/chat-completions"},{"title":"Справочник по Responses API для Seed 2.1 Turbo","sidebarTitle":"Песочница Responses","openapi":"api-reference/dola-seed-2-1-turbo-responses-openapi-en.yaml POST /v1/responses","icon":"messages-square","href":"/ru/api-capabilities/dola-seed-2-1-turbo/responses"}]},{"group":"Серия Gemini Flash","icon":"sparkles","pages":[{"title":"Генерация текста с Gemini 3.8 Flash","sidebarTitle":"Обзор Gemini 3.8 Flash","icon":"sparkles","href":"/ru/api-capabilities/gemini-3-8-flash/overview"},{"title":"Генерация текста с Gemini 3.6 Flash","sidebarTitle":"Обзор Gemini 3.6 Flash","icon":"sparkles","href":"/ru/api-capabilities/gemini-3-6-flash/overview"},{"title":"Справочник по нативному API Gemini 3.6 Flash","sidebarTitle":"Нативная площадка 3.6","openapi":"api-reference/gemini-3-6-flash-native-openapi-en.yaml POST /v1beta/models/gemini-3.6-flash:generateContent","icon":"terminal","href":"/ru/api-capabilities/gemini-3-6-flash/generate-content"},{"title":"Справочник API чата Gemini 3.6 Flash","sidebarTitle":"Песочница чата 3.6","openapi":"api-reference/gemini-3-6-flash-chat-openapi-en.yaml POST /v1/chat/completions","icon":"terminal","href":"/ru/api-capabilities/gemini-3-6-flash/chat-completions"}]},{"group":"Gemini 3.5 Flash-Lite","icon":"feather","pages":[{"title":"Gemini 3.5 Flash-Lite Генерация текста","sidebarTitle":"Обзор","icon":"feather","href":"/ru/api-capabilities/gemini-3-5-flash-lite/overview"},{"title":"Gemini 3.5 Flash-Lite Нативная справка по API","sidebarTitle":"Нативная песочница","openapi":"api-reference/gemini-3-5-flash-lite-native-openapi-en.yaml POST /v1beta/models/gemini-3.5-flash-lite:generateContent","icon":"terminal","href":"/ru/api-capabilities/gemini-3-5-flash-lite/generate-content"},{"title":"Gemini 3.5 Flash-Lite Справочник Chat API","sidebarTitle":"Песочница Chat","openapi":"api-reference/gemini-3-5-flash-lite-chat-openapi-en.yaml POST /v1/chat/completions","icon":"terminal","href":"/ru/api-capabilities/gemini-3-5-flash-lite/chat-completions"}]},{"group":"Серия Qwen3","icon":"puzzle","pages":[{"title":"Генерация текста Qwen3.8-Max","sidebarTitle":"Обзор","icon":"puzzle","href":"/ru/api-capabilities/qwen-3-8/overview"},{"title":"Справка по Chat API Qwen3.8-Max","sidebarTitle":"Песочница Chat","openapi":"api-reference/qwen-3-8-max-chat-openapi-en.yaml POST /v1/chat/completions","icon":"terminal","href":"/ru/api-capabilities/qwen-3-8/chat-completions"},{"title":"Серия текстовых моделей Qwen3.6 (устаревшая)","sidebarTitle":"Qwen3.6 (устаревшая)","icon":"puzzle","href":"/ru/api-capabilities/qwen-3-6/overview"}]},{"group":"Kimi K3.1 Pro","icon":"moon","pages":[{"title":"Обзор Kimi K3.1 Pro","sidebarTitle":"Обзор","icon":"brain","href":"/ru/api-capabilities/kimi-k3-1/overview"}]},{"title":"Генерация текста Kimi K2.5","sidebarTitle":"Kimi K2.5","icon":"bot","href":"/ru/api-capabilities/kimi-k2-5"}]},{"group":"Audio API (официальный)","icon":"audio-lines","pages":[{"title":"Голосовой режим реального времени (WebSocket)","sidebarTitle":"Обзор голосового режима реального времени","icon":"audio-lines","href":"/ru/api-capabilities/realtime/overview"}]},{"group":"Поиск и безопасность","icon":"search","pages":[{"title":"API векторизации текста","icon":"vector-square","href":"/ru/api-capabilities/text-embedding"},{"title":"Практическая настройка embedding","sidebarTitle":"Настройка embedding","icon":"sliders-horizontal","href":"/ru/api-capabilities/embedding-best-practices"},{"group":"Реранжирование","icon":"list-ordered","pages":[{"title":"bge-reranker-v2-m3 Переранжирование текста","sidebarTitle":"Обзор","icon":"list-ordered","href":"/ru/api-capabilities/rerank/overview"},{"title":"Справочник Rerank API","sidebarTitle":"Песочница","openapi":"api-reference/bge-reranker-v2-m3-rerank-openapi-en.yaml POST /v1/rerank","icon":"terminal","href":"/ru/api-capabilities/rerank/rerank-api"},{"title":"Настройка RAG на практике","sidebarTitle":"Настройка RAG","icon":"sliders-horizontal","href":"/ru/api-capabilities/rerank/rag-best-practices"}]},{"title":"Модерация текста","icon":"shield-check","href":"/ru/api-capabilities/text-moderation"}]}]},{"tab":"Сценарии использования","icon":"layout-grid","pages":[{"title":"Сценарии использования","href":"/ru/scenarios"}]},{"tab":"FAQ","icon":"circle-question-mark","pages":[{"title":"FAQ","href":"/ru/faq"}]},{"tab":"Акции","icon":"gift","pages":[{"title":"Акции","href":"/ru/faq/recharge-promotions"}]},{"tab":"Цены на модели","icon":"circle-dollar-sign","pages":[{"title":"Цены на модели","href":"/ru/models"}]}]}]},"title":"Официальный API VEO 3.1 для преобразования текста в видео - API易文档中心","buildId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","deploymentId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","dynamics":["10e4515597","c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["BannerMarkdown-cfwQA_n9.js","dist-2LoAhjKH.js","lib--scc4DXi.js","lib-B8HbPgcC.js","clsx-DZLdJUrt.js","html-void-elements-mCSPHezU.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","OpenApiReferenceProvider-Bbp7I60D.js","utils-C3RIvJha.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DqD-vLt8.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-B31Loprg.js","snippetPresets-DKpk-b8t.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-Cj65AhOR.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BXtn5gcC.js","shallow-RY2b03Cp.js","getApiPlaygroundDisplay-B0jeiPk3.js","CodeSnippet-CYgBjjwn.js","CodeSnippets-DOngDrYB.js","Page-n7I5XbKb.js","getPastedJson-DRQbJx-T.js","icon-CQiQCicY.js","MethodPill-BKTLdNtu.js","DuplicateIcon-B9jpAdat.js","createIcon-DCddRrXv.js","DynamicMarkdown-a8hUKrw6.js","SectionHeading-eECVV2eH.js","axios-vUo_bRtp.js","Markdown--GF7ZIpf.js","AssistantPageLink-Zwc0ZncM.js"]}