{"openapi":"3.1.0","info":{"title":"Svitok API","version":"1.0.0","description":"Публичное REST-API расшифровки аудио и видео: отправка файла, статус/результат (поллинг или вебхук), экспорт. Данные хранятся в России."},"servers":[{"url":"https://svitok.io"}],"security":[{"bearerAuth":[]}],"paths":{"/api/v1/transcriptions":{"post":{"summary":"Отправить файл на расшифровку","operationId":"createTranscription","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"Аудио- или видеофайл."},"diarization":{"type":"boolean","default":true,"description":"Разделять по спикерам (по умолчанию да)."},"webhook_url":{"type":"string","format":"uri","description":"Публичный URL для callback по завершении (необязательно)."}}}}}},"responses":{"202":{"description":"Задача принята в очередь.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Accepted"}}}},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/Error"},"415":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"},"503":{"$ref":"#/components/responses/Error"}}},"get":{"summary":"Список задач аккаунта","operationId":"listTranscriptions","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"Непрозрачный next_cursor из предыдущего ответа."}],"responses":{"200":{"description":"Страница списка задач.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscriptionList"}}}},"401":{"$ref":"#/components/responses/Error"}}}},"/api/v1/transcriptions/{id}":{"get":{"summary":"Статус и результат задачи","operationId":"getTranscription","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Статус/результат задачи.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transcription"}}}},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}},"/api/v1/transcriptions/{id}/export":{"get":{"summary":"Скачать результат в файл","operationId":"exportTranscription","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"format","in":"query","required":true,"schema":{"type":"string","enum":["srt","txt","docx","xlsx"]}}],"responses":{"200":{"description":"Файл расшифровки.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API-ключ: Authorization: Bearer sk_live_…"}},"responses":{"Error":{"description":"Ошибка.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Accepted":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued"]},"duration_sec":{"type":"integer"},"cost_kopecks":{"type":"integer"}}},"Segment":{"type":"object","properties":{"start":{"type":"number"},"end":{"type":"number"},"text":{"type":"string"}}},"Speaker":{"type":"object","properties":{"start":{"type":"number"},"end":{"type":"number"},"speaker":{"type":"string","description":"Метка «Спикер N» без привязки к личности."},"text":{"type":"string"}}},"Transcription":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["queued","running","done","failed"]},"duration_sec":{"type":["integer","null"]},"language":{"type":["string","null"]},"text":{"type":"string"},"segments":{"type":"array","items":{"$ref":"#/components/schemas/Segment"}},"speakers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Speaker"}},"error":{"type":"string","description":"Человекочитаемая причина (только при status=failed)."}}},"TranscriptionList":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"duration_sec":{"type":["integer","null"]}}}},"next_cursor":{"type":["string","null"]}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}