{"openapi":"3.1.0","info":{"title":"Tegas API","version":"1.0"},"paths":{"/v1/keys":{"get":{"tags":["Keys"],"summary":"List API keys (cabinet session)","operationId":"list_keys_v1_keys_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Keys V1 Keys Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"CabinetSession":[]}]},"post":{"tags":["Keys"],"summary":"Create API key (shown once)","operationId":"create_key_v1_keys_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"CabinetSession":[]}]}},"/v1/keys/{key_id}":{"delete":{"tags":["Keys"],"summary":"Revoke API key","operationId":"revoke_key_v1_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"CabinetSession":[]}]}},"/v1/me":{"get":{"tags":["Account"],"summary":"Account, plan and token balance","operationId":"me_v1_me_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Me V1 Me Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/prices":{"get":{"tags":["Account"],"summary":"Tokens per second by quality (wan 3.0)","operationId":"prices_v1_prices_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Prices V1 Prices Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/voices":{"get":{"tags":["Account"],"summary":"Available voices for a language","operationId":"voices_v1_voices_get","parameters":[{"name":"language","in":"query","required":false,"schema":{"type":"string","pattern":"^(ru|en|es|fr|de)$","default":"ru","title":"Language"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Voices V1 Voices Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/scenarios":{"post":{"tags":["Tessa"],"summary":"Write a scenario from an idea (no questions)","operationId":"create_scenario_v1_scenarios_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/scenarios/{scenario_id}/heroes":{"post":{"tags":["Heroes"],"summary":"Hero sheet brief","operationId":"hero_brief_v1_scenarios__scenario_id__heroes_post","parameters":[{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","title":"Scenario Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeroBriefIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeroBriefOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/scenarios/{scenario_id}/heroes/draw":{"post":{"tags":["Heroes"],"summary":"Draw hero sheets","operationId":"hero_draw_v1_scenarios__scenario_id__heroes_draw_post","parameters":[{"name":"scenario_id","in":"path","required":true,"schema":{"type":"string","title":"Scenario Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeroDrawIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeroDrawOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/conversations":{"post":{"tags":["Tessa"],"summary":"Start a dialog with Tessa","operationId":"create_conversation_v1_conversations_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Conversation V1 Conversations Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/conversations/{cid}/messages":{"post":{"tags":["Tessa"],"summary":"Send a message to Tessa","operationId":"send_message_v1_conversations__cid__messages_post","parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","title":"Cid"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/conversations/{cid}":{"get":{"tags":["Tessa"],"summary":"Conversation history","operationId":"get_conversation_v1_conversations__cid__get","parameters":[{"name":"cid","in":"path","required":true,"schema":{"type":"string","title":"Cid"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/references":{"post":{"tags":["References"],"summary":"Upload a reference image (jpeg/png/webp/heic)","operationId":"upload_reference_v1_references_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_reference_v1_references_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferenceUploaded"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/music":{"post":{"tags":["Music"],"summary":"Upload your own music track (mp3/wav/m4a)","description":"Загрузка своего трека до 25 МБ. Возвращённый `url` подставляется в `music.url` запроса `POST /v1/videos/{id}/edits` — при старте ролика своя музыка недоступна.","operationId":"upload_music_v1_music_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_music_v1_music_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MusicUploaded"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/videos":{"post":{"tags":["Videos"],"summary":"Start a video from a scenario","operationId":"start_video_v1_videos_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Idempotency-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoCreate"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Videos"],"summary":"List my videos","operationId":"list_videos_v1_videos_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoList"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/videos/{video_id}":{"get":{"tags":["Videos"],"summary":"Video status","operationId":"video_status_v1_videos__video_id__get","parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"string","title":"Video Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/videos/{video_id}/edits":{"post":{"tags":["Videos"],"summary":"Edit a finished video (free, rebuilds it)","description":"Applies scene, voice, subtitle, music and volume changes in one call and rebuilds the video; no tokens are charged. Changing voice.id, voice.gender or voice.language re-voices every scene that has voice-over text. watermark must be the only field changed in the call, because the renderer rebuilds it through a separate endpoint; combining it with any other change answers 422 validation_error. Poll GET /v1/videos/{video_id} until the status is completed; a video that is already being rebuilt answers 409 video_busy.","operationId":"edit_video_v1_videos__video_id__edits_post","parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"string","title":"Video Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoEditIn"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoEditOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AppleAuthBody":{"properties":{"authorization_code":{"type":"string","minLength":1,"title":"Authorization Code"}},"type":"object","required":["authorization_code"],"title":"AppleAuthBody"},"AssistantMessage":{"properties":{"role":{"type":"string","title":"Role","description":"user или assistant"},"text":{"type":"string","title":"Text"}},"type":"object","required":["role","text"],"title":"AssistantMessage","description":"Одно сообщение переписки в том виде, в каком его рисует приложение."},"AssistantReply":{"properties":{"text":{"type":"string","title":"Text","description":"Текст для человека, уже без служебных меток"},"scenario_ready":{"type":"boolean","title":"Scenario Ready","description":"Сценарий дописан, можно запускать генерацию","default":false},"settings":{"additionalProperties":true,"type":"object","title":"Settings","description":"Настройки ролика, которые ассистент выбрал сам: язык озвучки, формат и прочее"}},"type":"object","required":["text"],"title":"AssistantReply","description":"Ответ ассистента в том виде, в каком его показывает приложение."},"Assumptions":{"properties":{"category":{"type":"string","title":"Category"},"inferred":{"additionalProperties":{"type":"string"},"type":"object","title":"Inferred"}},"type":"object","required":["category"],"title":"Assumptions"},"Body_upload_music_v1_music_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"label":{"type":"string","maxLength":120,"title":"Label","default":""}},"type":"object","required":["file"],"title":"Body_upload_music_v1_music_post"},"Body_upload_reference_v1_references_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"label":{"type":"string","maxLength":120,"title":"Label","default":""}},"type":"object","required":["file"],"title":"Body_upload_reference_v1_references_post"},"ChatMessage":{"properties":{"role":{"type":"string","title":"Role"},"content":{"type":"string","title":"Content"}},"type":"object","required":["role","content"],"title":"ChatMessage"},"ChatRequest":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/ChatMessage"},"type":"array","title":"Messages"},"mode":{"type":"string","title":"Mode","default":"video"},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"references":{"items":{"type":"string"},"type":"array","title":"References"},"one_shot":{"type":"boolean","title":"One Shot","default":false}},"type":"object","required":["messages"],"title":"ChatRequest"},"ChatResponse":{"properties":{"reply":{"type":"string","title":"Reply"},"complete":{"type":"boolean","title":"Complete"},"category":{"type":"string","title":"Category"},"valid":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Valid"},"validation_errors":{"items":{"type":"string"},"type":"array","title":"Validation Errors"},"repaired":{"type":"boolean","title":"Repaired","default":false}},"type":"object","required":["reply","complete","category"],"title":"ChatResponse"},"ConversationCreate":{"properties":{"language":{"type":"string","enum":["ru","en","es","fr","de"],"title":"Language","default":"ru"},"duration_sec":{"type":"integer","maximum":60.0,"minimum":5.0,"title":"Duration Sec","default":20},"aspect":{"type":"string","enum":["9:16","16:9","1:1"],"title":"Aspect","default":"9:16"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"references":{"items":{"$ref":"#/components/schemas/ReferenceIn"},"type":"array","maxItems":10,"title":"References"}},"type":"object","title":"ConversationCreate"},"ConversationOut":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"messages":{"items":{"$ref":"#/components/schemas/MessageHistoryItem"},"type":"array","title":"Messages"},"complete":{"type":"boolean","title":"Complete"}},"type":"object","required":["conversation_id","messages","complete"],"title":"ConversationOut"},"DeviceRequest":{"properties":{"device_token":{"type":"string","pattern":"^Expo(nent)?PushToken\\[[A-Za-z0-9_-]+\\]$","title":"Device Token"}},"type":"object","required":["device_token"],"title":"DeviceRequest"},"EditVolumesIn":{"properties":{"voice":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Voice"},"music":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Music"},"master":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Master"}},"type":"object","title":"EditVolumesIn","description":"Громкости в процентах: озвучка, музыка и общая."},"EmailRequestBody":{"properties":{"email":{"type":"string","pattern":"^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$","title":"Email"},"lang":{"type":"string","pattern":"^(ru|en)$","title":"Lang","default":"ru"}},"type":"object","required":["email"],"title":"EmailRequestBody"},"EmailVerifyBody":{"properties":{"code":{"type":"string","minLength":1,"title":"Code"}},"type":"object","required":["code"],"title":"EmailVerifyBody"},"EpisodeOut":{"properties":{"index":{"type":"integer","title":"Index"},"duration_sec":{"type":"integer","title":"Duration Sec"},"voiceover":{"type":"string","title":"Voiceover"},"visual":{"type":"string","title":"Visual"}},"type":"object","required":["index","duration_sec","voiceover","visual"],"title":"EpisodeOut"},"GoogleAuthBody":{"properties":{"code":{"type":"string","minLength":1,"title":"Code"}},"type":"object","required":["code"],"title":"GoogleAuthBody"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HeroBriefIn":{"properties":{"style":{"anyOf":[{"type":"string","enum":["photorealistic","3d_cartoon","2d_animation","anime"]},{"type":"null"}],"title":"Style"}},"type":"object","title":"HeroBriefIn"},"HeroBriefItem":{"properties":{"index":{"type":"integer","title":"Index"},"kind":{"type":"string","enum":["character","object"],"title":"Kind"},"name":{"type":"string","title":"Name"},"prompt":{"type":"string","title":"Prompt"}},"type":"object","required":["index","kind","name","prompt"],"title":"HeroBriefItem"},"HeroBriefOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/HeroBriefItem"},"type":"array","title":"Items"},"price_each_tokens":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price Each Tokens"}},"type":"object","required":["items"],"title":"HeroBriefOut"},"HeroBriefRequest":{"properties":{"scenario_text":{"type":"string","title":"Scenario Text"},"style":{"type":"string","title":"Style","default":""}},"type":"object","required":["scenario_text"],"title":"HeroBriefRequest"},"HeroBriefResponse":{"properties":{"found":{"type":"boolean","title":"Found"},"name":{"type":"string","title":"Name","default":""},"image_prompt":{"type":"string","title":"Image Prompt","default":""},"items":{"items":{"$ref":"#/components/schemas/ReferenceBriefItem"},"type":"array","title":"Items"}},"type":"object","required":["found"],"title":"HeroBriefResponse"},"HeroDrawIn":{"properties":{"items":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"items":{"$ref":"#/components/schemas/HeroItemIn"},"type":"array"}],"maxLength":3,"minLength":1,"title":"Items"}},"type":"object","required":["items"],"title":"HeroDrawIn"},"HeroDrawOut":{"properties":{"items":{"items":{"$ref":"#/components/schemas/HeroDrawnItem"},"type":"array","title":"Items"},"price_tokens":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price Tokens"}},"type":"object","required":["items"],"title":"HeroDrawOut"},"HeroDrawnItem":{"properties":{"reference_id":{"type":"string","title":"Reference Id"},"kind":{"type":"string","enum":["character","object"],"title":"Kind"},"name":{"type":"string","title":"Name"},"url":{"type":"string","title":"Url"}},"type":"object","required":["reference_id","kind","name","url"],"title":"HeroDrawnItem"},"HeroItemIn":{"properties":{"kind":{"type":"string","enum":["character","object"],"title":"Kind"},"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"prompt":{"type":"string","maxLength":2000,"minLength":20,"title":"Prompt"}},"type":"object","required":["kind","name","prompt"],"title":"HeroItemIn"},"KeyCreate":{"properties":{"name":{"type":"string","maxLength":60,"minLength":1,"title":"Name"}},"type":"object","required":["name"],"title":"KeyCreate"},"KeyCreated":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"prefix":{"type":"string","title":"Prefix"},"created_at":{"type":"string","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"},"key":{"type":"string","title":"Key"}},"type":"object","required":["id","name","prefix","created_at","last_used_at","key"],"title":"KeyCreated"},"MapReference":{"properties":{"url":{"type":"string","title":"Url"},"label":{"type":"string","title":"Label","default":""},"description":{"type":"string","title":"Description","default":""}},"type":"object","required":["url"],"title":"MapReference"},"MapRequest":{"properties":{"scenario_text":{"type":"string","title":"Scenario Text"},"engine_mode":{"type":"string","title":"Engine Mode","default":"default"},"references":{"items":{"$ref":"#/components/schemas/MapReference"},"type":"array","title":"References"}},"type":"object","required":["scenario_text"],"title":"MapRequest"},"MapResponse":{"properties":{"engine_json":{"additionalProperties":true,"type":"object","title":"Engine Json"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"}},"type":"object","required":["engine_json"],"title":"MapResponse"},"MessageHistoryItem":{"properties":{"role":{"type":"string","title":"Role"},"text":{"type":"string","title":"Text"},"scenario_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scenario Id"}},"type":"object","required":["role","text"],"title":"MessageHistoryItem"},"MessageIn":{"properties":{"text":{"type":"string","maxLength":4000,"minLength":1,"title":"Text"}},"type":"object","required":["text"],"title":"MessageIn"},"MessageOut":{"properties":{"reply":{"type":"string","title":"Reply"},"complete":{"type":"boolean","title":"Complete"},"scenario":{"anyOf":[{"$ref":"#/components/schemas/ScenarioOut"},{"type":"null"}]}},"type":"object","required":["reply","complete"],"title":"MessageOut"},"MobileConversation":{"properties":{"id":{"type":"string","title":"Id"}},"type":"object","required":["id"],"title":"MobileConversation","description":"Только идентификатор: остальное из ответа OpenAI приложению не нужно."},"MobileMessageList":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/AssistantMessage"},"type":"array","title":"Messages"}},"type":"object","required":["messages"],"title":"MobileMessageList"},"MobileProfile":{"properties":{"id":{"type":"integer","title":"Id"},"uid":{"type":"string","title":"Uid"},"email":{"type":"string","title":"Email"},"username":{"type":"string","title":"Username"},"tokens":{"type":"integer","title":"Tokens"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"is_agent":{"type":"boolean","title":"Is Agent","default":false}},"type":"object","required":["id","uid","email","username","tokens"],"title":"MobileProfile","description":"Профиль и баланс — всё, что нужно главному экрану."},"MobileScenario":{"properties":{"text":{"type":"string","title":"Text"},"settings":{"additionalProperties":true,"type":"object","title":"Settings"},"price":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price","description":"Стоимость в токенах"},"affordable":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Affordable","description":"Хватает ли токенов на балансе"}},"type":"object","required":["text","settings"],"title":"MobileScenario","description":"Готовый сценарий вместе с ценой — до того, как списывать токены."},"MobileSession":{"properties":{"token":{"type":"string","title":"Token"},"profile":{"$ref":"#/components/schemas/MobileProfile"}},"type":"object","required":["token","profile"],"title":"MobileSession","description":"Результат входа.\n\nТокен и профиль отдаются одним ответом: иначе приложение сразу после входа\nделало бы второй запрос, а на мобильной сети это заметная задержка."},"MobileVideo":{"properties":{"id":{"type":"string","title":"Id"},"status":{"$ref":"#/components/schemas/MobileVideoStatus"},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Reason"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"video_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Video Url"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Duration Seconds"}},"type":"object","required":["id","status"],"title":"MobileVideo","description":"Ролик в списке своих видео."},"MobileVideoList":{"properties":{"total":{"type":"integer","title":"Total"},"videos":{"items":{"$ref":"#/components/schemas/MobileVideo"},"type":"array","title":"Videos"}},"type":"object","required":["total","videos"],"title":"MobileVideoList"},"MobileVideoStatus":{"type":"string","enum":["queued","processing","completed","failed"],"title":"MobileVideoStatus","description":"Статусы, известные приложению.\n\nРендерер знает девять состояний и может не вернуть статус вовсе. Приложению\nстолько не нужно: ему важно, ждать дальше, показывать результат или сообщать\nоб ошибке. Промежуточные стадии сворачиваются в PROCESSING."},"MobileVideoTask":{"properties":{"id":{"type":"string","title":"Id"},"status":{"$ref":"#/components/schemas/MobileVideoStatus"}},"type":"object","required":["id","status"],"title":"MobileVideoTask"},"MusicEditIn":{"properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Url","description":"Track from POST /v1/music (https, public host)"}},"type":"object","title":"MusicEditIn"},"MusicUploaded":{"properties":{"music_id":{"type":"string","title":"Music Id"},"url":{"type":"string","title":"Url"},"label":{"type":"string","title":"Label","default":""},"expires_at":{"type":"string","title":"Expires At"}},"type":"object","required":["music_id","url","expires_at"],"title":"MusicUploaded"},"ReferenceBriefItem":{"properties":{"kind":{"type":"string","title":"Kind","default":"character"},"name":{"type":"string","title":"Name","default":""},"image_prompt":{"type":"string","title":"Image Prompt","default":""}},"type":"object","title":"ReferenceBriefItem"},"ReferenceIn":{"properties":{"url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Url"},"label":{"type":"string","maxLength":120,"title":"Label","default":""},"reference_id":{"anyOf":[{"type":"string","pattern":"^ref_[0-9a-f]{20}$"},{"type":"null"}],"title":"Reference Id"}},"type":"object","title":"ReferenceIn","description":"Референс либо по ссылке (url + label), либо загруженный ранее файлом (reference_id)."},"ReferenceOut":{"properties":{"url":{"type":"string","title":"Url"},"label":{"type":"string","title":"Label","default":""},"description":{"type":"string","title":"Description","default":""}},"type":"object","required":["url"],"title":"ReferenceOut"},"ReferenceUploaded":{"properties":{"reference_id":{"type":"string","title":"Reference Id"},"url":{"type":"string","title":"Url"},"label":{"type":"string","title":"Label","default":""},"description":{"type":"string","title":"Description","default":""},"expires_at":{"type":"string","title":"Expires At"}},"type":"object","required":["reference_id","url","expires_at"],"title":"ReferenceUploaded"},"RenderFinished":{"properties":{"task_id":{"type":"string","title":"Task Id"},"user_id":{"type":"integer","title":"User Id"},"status":{"type":"string","title":"Status"}},"type":"object","required":["task_id","user_id","status"],"title":"RenderFinished"},"ScenarioCreate":{"properties":{"idea":{"type":"string","maxLength":4000,"minLength":3,"title":"Idea"},"language":{"type":"string","enum":["ru","en","es","fr","de"],"title":"Language","default":"ru"},"duration_sec":{"type":"integer","maximum":60.0,"minimum":5.0,"title":"Duration Sec","default":20},"aspect":{"type":"string","enum":["9:16","16:9","1:1"],"title":"Aspect","default":"9:16"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"references":{"items":{"$ref":"#/components/schemas/ReferenceIn"},"type":"array","maxItems":10,"title":"References"}},"type":"object","required":["idea"],"title":"ScenarioCreate"},"ScenarioOut":{"properties":{"scenario_id":{"type":"string","title":"Scenario Id"},"text":{"type":"string","title":"Text"},"category":{"type":"string","title":"Category"},"language":{"type":"string","title":"Language"},"duration_sec":{"type":"integer","title":"Duration Sec"},"requested_duration_sec":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Requested Duration Sec"},"episodes":{"items":{"$ref":"#/components/schemas/EpisodeOut"},"type":"array","title":"Episodes"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"},"references":{"items":{"$ref":"#/components/schemas/ReferenceOut"},"type":"array","title":"References"},"expires_at":{"type":"string","title":"Expires At"}},"type":"object","required":["scenario_id","text","category","language","duration_sec","episodes","expires_at"],"title":"ScenarioOut"},"ScenarioRequest":{"properties":{"idea":{"type":"string","title":"Idea"},"mode":{"type":"string","title":"Mode","default":"video"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Id"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"video_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Video Format"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"voice":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice"},"audience":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Audience"},"tone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tone"},"key_points":{"items":{"type":"string"},"type":"array","title":"Key Points"},"cta":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cta"},"music":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Music"},"subtitles":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Subtitles"}},"type":"object","required":["idea"],"title":"ScenarioRequest"},"ScenarioResult":{"properties":{"scenario":{"type":"string","title":"Scenario"},"assumptions":{"$ref":"#/components/schemas/Assumptions"},"valid":{"type":"boolean","title":"Valid"},"validation_errors":{"items":{"type":"string"},"type":"array","title":"Validation Errors"}},"type":"object","required":["scenario","assumptions","valid"],"title":"ScenarioResult"},"SceneEditIn":{"properties":{"index":{"type":"integer","minimum":0.0,"title":"Index"},"voiceover_text":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Voiceover Text"},"subtitles_text":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Subtitles Text"},"video_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Video Url"}},"type":"object","required":["index"],"title":"SceneEditIn","description":"Правка одной сцены готового ролика: текст озвучки, текст субтитров, своё видео."},"SendMessageRequest":{"properties":{"text":{"type":"string","maxLength":4000,"minLength":1,"title":"Text"}},"type":"object","required":["text"],"title":"SendMessageRequest"},"StartVideoRequest":{"properties":{"conversation_id":{"type":"string","title":"Conversation Id"},"video_format":{"type":"string","enum":["9:16","16:9","1:1"],"title":"Video Format","default":"9:16"},"video_quality":{"type":"string","enum":["720p","1080p"],"title":"Video Quality","default":"720p"},"subtitles_enabled":{"type":"boolean","title":"Subtitles Enabled","default":true}},"type":"object","required":["conversation_id"],"title":"StartVideoRequest"},"SubtitleAppearanceIn":{"properties":{"alignment":{"anyOf":[{"type":"string","enum":["left","center","right"]},{"type":"null"}],"title":"Alignment"},"font_size":{"anyOf":[{"type":"string","enum":["small","medium","large","maximum"]},{"type":"null"}],"title":"Font Size"},"font_family":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Font Family"},"text_color":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},{"type":"null"}],"title":"Text Color","description":"HEX colour, e.g. #FFCC00"},"color_saturation":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Color Saturation"}},"type":"object","title":"SubtitleAppearanceIn","description":"Вид субтитров: выравнивание, размер, шрифт, цвет. Пустые поля рендеру не отправляются."},"SubtitlesEditIn":{"properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"style":{"anyOf":[{"type":"string","enum":["tiktok","phrases","contrast"]},{"type":"null"}],"title":"Style"},"appearance":{"anyOf":[{"$ref":"#/components/schemas/SubtitleAppearanceIn"},{"type":"null"}]}},"type":"object","title":"SubtitlesEditIn"},"SubtitlesIn":{"properties":{"enabled":{"type":"boolean","title":"Enabled","default":true},"style":{"type":"string","enum":["tiktok","phrases","contrast"],"title":"Style","default":"phrases"},"appearance":{"anyOf":[{"$ref":"#/components/schemas/SubtitleAppearanceIn"},{"type":"null"}]}},"type":"object","title":"SubtitlesIn"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VideoCreate":{"properties":{"scenario_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scenario Id"},"scenario_text":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}],"title":"Scenario Text"},"quality":{"type":"string","enum":["480p","720p","1080p"],"title":"Quality","default":"720p"},"aspect":{"anyOf":[{"type":"string","enum":["9:16","16:9","1:1"]},{"type":"null"}],"title":"Aspect"},"voice":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Voice","description":"Voice id from GET /v1/voices; default is the natural voice"},"voice_gender":{"type":"string","enum":["female","male"],"title":"Voice Gender","default":"female"},"music":{"type":"boolean","title":"Music","description":"Turn on the built-in background music. A custom track is only available through POST /v1/videos/{video_id}/edits after the video is built","default":true},"subtitles":{"$ref":"#/components/schemas/SubtitlesIn"},"volumes":{"anyOf":[{"$ref":"#/components/schemas/VolumesIn"},{"type":"null"}]},"references":{"items":{"$ref":"#/components/schemas/ReferenceIn"},"type":"array","maxItems":10,"title":"References"},"webhook_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Webhook Url","description":"https URL on a public host; POSTed when the video completes or fails"},"webhook_secret":{"anyOf":[{"type":"string","maxLength":128,"minLength":16},{"type":"null"}],"title":"Webhook Secret","description":"HMAC-SHA256 key for X-Tegas-Signature; requires webhook_url"},"watermark":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Watermark","description":"The Tegas watermark on the finished video; omit to keep the account default"}},"type":"object","title":"VideoCreate"},"VideoEditIn":{"properties":{"scenes":{"anyOf":[{"items":{"$ref":"#/components/schemas/SceneEditIn"},"type":"array","maxItems":20},{"type":"null"}],"title":"Scenes"},"voice":{"anyOf":[{"$ref":"#/components/schemas/VoiceEditIn"},{"type":"null"}]},"subtitles":{"anyOf":[{"$ref":"#/components/schemas/SubtitlesEditIn"},{"type":"null"}]},"music":{"anyOf":[{"$ref":"#/components/schemas/MusicEditIn"},{"type":"null"}]},"volumes":{"anyOf":[{"$ref":"#/components/schemas/EditVolumesIn"},{"type":"null"}]},"webhook_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Webhook Url","description":"https URL on a public host; POSTed when the rebuild finishes"},"webhook_secret":{"anyOf":[{"type":"string","maxLength":128,"minLength":16},{"type":"null"}],"title":"Webhook Secret","description":"HMAC-SHA256 key for X-Tegas-Signature; requires webhook_url"},"watermark":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Watermark","description":"The Tegas watermark on the finished video; must be the only change in the edit, the renderer rebuilds it separately"}},"type":"object","title":"VideoEditIn","description":"Правки готового ролика. Все поля необязательны, но хотя бы одно изменение обязано быть."},"VideoEditOut":{"properties":{"video_id":{"type":"string","title":"Video Id"},"status":{"type":"string","const":"processing","title":"Status","default":"processing"},"edits_accepted":{"items":{"type":"string"},"type":"array","title":"Edits Accepted"}},"type":"object","required":["video_id"],"title":"VideoEditOut"},"VideoList":{"properties":{"items":{"items":{"$ref":"#/components/schemas/VideoOut"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"next_offset":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Offset"}},"type":"object","required":["items","total","next_offset"],"title":"VideoList"},"VideoOut":{"properties":{"video_id":{"type":"string","title":"Video Id"},"status":{"type":"string","enum":["queued","processing","completed","failed"],"title":"Status"},"progress":{"type":"integer","title":"Progress","default":0},"duration_sec":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Sec"},"file_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Url"},"error":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Error"},"price_tokens":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price Tokens"},"quality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quality"},"scenario_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Scenario Id"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Completed At"},"webhook":{"anyOf":[{"$ref":"#/components/schemas/WebhookState"},{"type":"null"}]}},"type":"object","required":["video_id","status"],"title":"VideoOut"},"VoiceEditIn":{"properties":{"id":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Id","description":"Voice id from GET /v1/voices; changing the voice, gender or language re-voices every scene that has voice-over text"},"gender":{"anyOf":[{"type":"string","enum":["female","male"]},{"type":"null"}],"title":"Gender"},"language":{"anyOf":[{"type":"string","enum":["ru","en","es","fr","de"]},{"type":"null"}],"title":"Language"}},"type":"object","title":"VoiceEditIn","description":"Переозвучка: голос, пол, язык. Сцены без своего voiceover_text озвучиваются прежним текстом."},"VolumesIn":{"properties":{"voice":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Voice"},"music":{"anyOf":[{"type":"integer","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Music"}},"type":"object","title":"VolumesIn","description":"Громкости в процентах: озвучка и музыка."},"WebhookState":{"properties":{"state":{"type":"string","enum":["pending","delivering","done","failed"],"title":"State"},"attempts":{"type":"integer","title":"Attempts","default":0},"last_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Status"}},"type":"object","required":["state"],"title":"WebhookState"}},"securitySchemes":{"ApiKey":{"type":"http","scheme":"bearer","bearerFormat":"tg_live_..."},"CabinetSession":{"type":"http","scheme":"bearer","description":"Cabinet session JWT — only for /v1/keys"}}},"tags":[{"name":"Account","description":"Balance, plan, prices, voices"},{"name":"Tessa","description":"Scenario writing: one-shot and dialog"},{"name":"Videos","description":"Start a video, poll status, list"},{"name":"Keys","description":"API keys (cabinet session only)"}],"servers":[{"url":"https://api.tegas.ai"},{"url":"https://api.tegasai.ru"}],"security":[{"ApiKey":[]}]}