{"openapi":"3.1.0","info":{"title":"QVORA API","version":"2.0.0","description":"Один ключ и один баланс в рублях для текстовых моделей (OpenAI Chat Completions, OpenAI Responses, Anthropic Messages), эмбеддингов и медиа-генераций (изображения, видео, музыка, озвучка, транскрибация). Base URL для OpenAI SDK: `https://qvora.ru/api/v1`. Для Anthropic SDK / Claude Code: `ANTHROPIC_BASE_URL=https://qvora.ru/api`. Легаси-префикс `/ext/*` эквивалентен `/v1/*` и сохраняется для существующих интеграций.","contact":{"email":"support@qvora.ru","url":"https://qvora.ru/docs/api"}},"servers":[{"url":"https://qvora.ru/api/v1"}],"security":[{"bearer":[]},{"apiKey":[]}],"tags":[{"name":"Chat","description":"OpenAI Chat Completions"},{"name":"Responses","description":"OpenAI Responses API (Codex CLI, агентные SDK)"},{"name":"Messages","description":"Anthropic Messages API (Claude Code, anthropic-SDK)"},{"name":"Embeddings"},{"name":"Models"},{"name":"Media","description":"Асинхронные медиа-задачи: изображения, видео, музыка, озвучка, апскейл"},{"name":"Audio"},{"name":"Account","description":"Баланс и расходы"},{"name":"Admin","description":"Управление ключами, группами, сотрудниками (скоуп admin)"}],"x-scopes":["chat","embeddings","media","admin","usage"],"x-rate-limit-headers":["x-request-id"],"paths":{"/chat/completions":{"post":{"tags":["Chat"],"summary":"Chat Completions (stream и non-stream, tools, vision, json_schema, reasoning_effort)","description":"Совместимо с openai-SDK. Поддержаны: messages (system/developer/user/assistant/tool), tools/tool_choice/parallel_tool_calls, response_format text|json_object|json_schema, temperature/top_p/max_tokens|max_completion_tokens/stop/seed/presence_penalty/frequency_penalty, reasoning_effort, stream + stream_options.include_usage, `user`. Неподдержанный параметр → 400 unsupported_parameter с `param`. Заголовок `Idempotency-Key` (только non-stream) даёт повтор без второго списания в течение 24 ч.","x-required-scope":"chat","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionRequest"}}}},"responses":{"200":{"description":"chat.completion либо SSE `chat.completion.chunk` (при stream=true)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletion"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/responses":{"post":{"tags":["Responses"],"summary":"Responses API (input items, function tools, SSE-события)","description":"Совместимо с Codex CLI и openai-SDK `responses.create`. previous_response_id/background/conversation не поддержаны (400). Хостовые инструменты (web_search и т.п.) игнорируются с заголовком `x-qvora-dropped-tools`. reasoning-items входа с encrypted_content выбрасываются.","x-required-scope":"chat","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponsesRequest"}}}},"responses":{"200":{"description":"Объект response либо SSE-события response.created → … → response.completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/messages":{"post":{"tags":["Messages"],"summary":"Anthropic Messages API (system/image/tool_use/tool_result, SSE Anthropic)","description":"Совместимо с anthropic-SDK и Claude Code. Ошибки — в конверте Anthropic `{type:\"error\", error:{type,message}}`. Серверные инструменты Anthropic (web_search_*, bash_*, computer_*) игнорируются с `x-qvora-dropped-tools`. thinking-блоки не возвращаются (без подписи их нельзя вернуть в следующем ходе). `usage.input_tokens` не включает cache_read_input_tokens.","x-required-scope":"chat","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicMessageRequest"}}}},"responses":{"200":{"description":"message либо SSE message_start → content_block_* → message_delta → message_stop","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicMessage"}},"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"401":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"402":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}},"429":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicError"}}}}}}},"/messages/count_tokens":{"post":{"tags":["Messages"],"summary":"Оценка числа входных токенов (бесплатно, приблизительно)","x-required-scope":"chat","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnthropicMessageRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"input_tokens":{"type":"integer"}}}}}}}}},"/embeddings":{"post":{"tags":["Embeddings"],"summary":"Эмбеддинги (batch input, dimensions)","x-required-scope":"embeddings","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingResponse"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/models":{"get":{"tags":["Models"],"summary":"Текстовые и embedding-модели, доступные ключу, с ценами ₽/1k токенов, capabilities и псевдонимами","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelList"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/models/{id}":{"get":{"tags":["Models"],"summary":"Одна модель (принимает псевдонимы)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"id или псевдоним модели"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Model"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/balance":{"get":{"tags":["Account"],"summary":"Баланс организации, кредитный лимит, открытые резервы, лимит ключа","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Balance"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/usage":{"get":{"tags":["Account"],"summary":"Сводка расходов по срезам (день, модель, ключ, группа, сотрудник, протокол, end_user)","x-required-scope":"usage | admin","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string"},"description":"YYYY-MM-DD (МСК)"},{"name":"to","in":"query","required":false,"schema":{"type":"string"},"description":"YYYY-MM-DD включительно"},{"name":"group_by","in":"query","required":false,"schema":{"type":"string","enum":["day","model","key","group","member","api","end_user"]},"description":"day|model|key|group|member|api|end_user"},{"name":"key_id","in":"query","required":false,"schema":{"type":"string"},"description":"фильтр"},{"name":"model","in":"query","required":false,"schema":{"type":"string"},"description":"фильтр"},{"name":"api","in":"query","required":false,"schema":{"type":"string"},"description":"chat|responses|messages|embeddings|audio|media"},{"name":"end_user","in":"query","required":false,"schema":{"type":"string"},"description":"значение поля user запроса"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageSummary"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/usage/requests":{"get":{"tags":["Account"],"summary":"Детализация по запросам (токены, стоимость, ключ, сотрудник, end_user)","x-required-scope":"usage | admin","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string"},"description":""},{"name":"to","in":"query","required":false,"schema":{"type":"string"},"description":""},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"},"description":"1..1000"},{"name":"before","in":"query","required":false,"schema":{"type":"string"},"description":"unix-время курсора"},{"name":"key_id","in":"query","required":false,"schema":{"type":"string"},"description":""},{"name":"model","in":"query","required":false,"schema":{"type":"string"},"description":""},{"name":"api","in":"query","required":false,"schema":{"type":"string"},"description":""},{"name":"end_user","in":"query","required":false,"schema":{"type":"string"},"description":""}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageRequestList"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/media/models":{"get":{"tags":["Media"],"summary":"Каталог медиа-моделей со схемами параметров, входов и правилами цены (строится из каталога продукта)","x-required-scope":"media","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaModelList"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/media/models/{id}":{"get":{"tags":["Media"],"summary":"Одна медиа-модель","x-required-scope":"media","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"id модели"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaModel"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/media/tasks":{"post":{"tags":["Media"],"summary":"Создать медиа-задачу (асинхронно, 202)","description":"model + operation (generate|edit|animate|upscale|remove_background; по умолчанию выводится из inputs) + prompt + params по схеме модели + inputs с ролями (image, first_frame, last_frame, video, reference_images, reference_videos, reference_audio, source_task). Входы — https-URL публичного адреса или data:-URI (≤200 МБ). idempotency_key: повтор возвращает ту же задачу (200 + Idempotent-Replayed), другое тело — 409. webhook_url: https, события media.task.succeeded|failed|cancelled с подписью X-Qvora-Signature. wait (0–60 с): дождаться результата, не теряя асинхронности.","x-required-scope":"media","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaTaskRequest"}}}},"responses":{"200":{"description":"Повтор по idempotency_key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaTask"}}}},"202":{"description":"Задача принята","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaTask"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Media"],"summary":"Список задач организации","x-required-scope":"media","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer"},"description":"1..100"},{"name":"after","in":"query","required":false,"schema":{"type":"string"},"description":"id задачи-курсора"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/MediaTask"}},"has_more":{"type":"boolean"}}}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/media/tasks/{id}":{"get":{"tags":["Media"],"summary":"Статус и результаты задачи (URL результатов подписаны, действуют 1 ч — expires_at)","x-required-scope":"media","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"task_…"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaTask"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/media/tasks/{id}/cancel":{"post":{"tags":["Media"],"summary":"Отменить задачу, пока она в очереди (деньги возвращаются); взятую в работу отменить нельзя — 409","x-required-scope":"media","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"task_…"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaTask"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/media/tasks/{id}/webhooks":{"get":{"tags":["Media"],"summary":"Журнал доставок вебхуков задачи","x-required-scope":"media","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"task_…"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}}}}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/audio/transcriptions":{"post":{"tags":["Audio"],"summary":"Транскрибация (OpenAI multipart `file` или JSON {url}); синхронно, дедлайн до 10 минут","description":"model: whisper-1 | whisper-large-v3; response_format: json | verbose_json | text; language. Цена — за минуту аудио, списание по факту длительности. Заголовок ответа x-qvora-cost-rub.","x-required-scope":"media","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transcription"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"deadline_exceeded — файл не уложился в дедлайн","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/keys":{"get":{"tags":["Admin"],"summary":"Список ключей","x-required-scope":"admin","parameters":[{"name":"include_revoked","in":"query","required":false,"schema":{"type":"string"},"description":"true — включая отозванные"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}}}}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Admin"],"summary":"Создать ключ (полный ключ и webhook_secret возвращаются один раз)","description":"Скоупы нового ключа не могут быть шире скоупов ключа-актора (403 scope_escalation).","x-required-scope":"admin","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyPatch"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreated"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/keys/{id}":{"get":{"tags":["Admin"],"summary":"Ключ","x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":""}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Admin"],"summary":"Изменить ключ (применяется следующим запросом: кэша авторизации нет)","x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":""}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyPatch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Admin"],"summary":"Отозвать ключ (мгновенно; журнал сохраняется)","x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":""}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/keys/{id}/rotate":{"post":{"tags":["Admin"],"summary":"Ротация: новый ключ с теми же настройками, старый истекает через grace_hours (по умолчанию 24)","x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":""}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"grace_hours":{"type":"number","minimum":0,"maximum":168}}}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreated"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/keys/{id}/webhook-secret":{"post":{"tags":["Admin"],"summary":"Новый секрет подписи вебхуков (показывается один раз, старый перестаёт действовать)","x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":""}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"webhook_secret":{"type":"string"}}}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/groups":{"get":{"tags":["Admin"],"summary":"Группы ключей","x-required-scope":"admin","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/KeyGroup"}}}}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Admin"],"summary":"Создать группу с месячным лимитом","x-required-scope":"admin","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyGroupPatch"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyGroup"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/groups/{id}":{"patch":{"tags":["Admin"],"summary":"Изменить группу","x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":""}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyGroupPatch"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyGroup"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Admin"],"summary":"Удалить группу (ключи остаются без группы)","x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":""}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"deleted":{"type":"boolean"}}}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/members":{"get":{"tags":["Admin"],"summary":"Сотрудники организации с лимитами и расходом месяца","x-required-scope":"admin","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Member"}}}}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/members/{userId}":{"patch":{"tags":["Admin"],"summary":"Лимит / блокировка / отдел сотрудника (владельца ограничить нельзя)","x-required-scope":"admin","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"},"description":""}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"monthly_limit_rub":{"type":["number","null"]},"disabled":{"type":"boolean"},"dept":{"type":["string","null"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/audit":{"get":{"tags":["Admin"],"summary":"Аудит действий администратора и жизненного цикла ключей","x-required-scope":"admin","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer"},"description":"1..200"},{"name":"before","in":"query","required":false,"schema":{"type":"string"},"description":"unix-время курсора"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AuditEvent"}}}}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/webhooks/deliveries":{"get":{"tags":["Admin"],"summary":"Журнал доставок вебхуков","x-required-scope":"admin","parameters":[{"name":"task","in":"query","required":false,"schema":{"type":"string"},"description":"task_…"},{"name":"status","in":"query","required":false,"schema":{"type":"string"},"description":"pending|delivered|failed"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"},"description":""}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}}}}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/admin/webhooks/deliveries/{id}/retry":{"post":{"tags":["Admin"],"summary":"Повторить доставку вручную (новая доставка с новым id)","x-required-scope":"admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"whd_…"}],"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"400":{"description":"Некорректный запрос: `code` и `param` указывают, что исправить","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Нет или неверный API-ключ (`invalid_api_key`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Недостаточно средств: `required_amount_rub`, `available_amount_rub`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsufficientBalanceError"}}}},"403":{"description":"Скоуп ключа / IP / доступ (`insufficient_scope`, `ip_not_allowed`, …)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Модель или объект не найден (`model_not_found`, `task_not_found`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Конфликт идемпотентности или состояния (`idempotency_key_reused`, `task_not_cancellable`, `request_expired`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Лимиты: `rate_limit_exceeded`, `tpm_limit_exceeded`, `concurrency_limit_exceeded`, `monthly_limit_exceeded`, `daily_limit_exceeded`, `group_limit_exceeded`, `member_limit_exceeded`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Модель временно недоступна (`model_unavailable`)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Authorization: Bearer shds-…"},"apiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Альтернатива Bearer (anthropic-SDK, curl, вебхуки панелей)"}},"schemas":{"Error":{"type":"object","description":"Конверт ошибки (OpenAI-стиль). trace_id = заголовок x-request-id — присылайте в поддержку.","properties":{"error":{"type":"object","required":["message","type","code","param","trace_id"],"properties":{"message":{"type":"string"},"type":{"type":"string","enum":["invalid_request_error","authentication_error","insufficient_quota","rate_limit_error","api_error"]},"code":{"type":"string","description":"Стабильный машиночитаемый код, см. /docs/api#errors"},"param":{"type":["string","null"]},"trace_id":{"type":"string"}}}}},"InsufficientBalanceError":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"error":{"type":"object","properties":{"required_amount_rub":{"type":"number"},"available_amount_rub":{"type":"number"},"currency":{"const":"RUB"}}}}}]},"AnthropicError":{"type":"object","properties":{"type":{"const":"error"},"error":{"type":"object","properties":{"type":{"type":"string","enum":["invalid_request_error","authentication_error","billing_error","permission_error","not_found_error","request_too_large","rate_limit_error","api_error","overloaded_error"]},"message":{"type":"string"},"code":{"type":"string"}}},"request_id":{"type":"string"}}},"Qvora":{"type":"object","description":"Наши поля сверх спеки: за что списано","properties":{"served_model":{"type":"string"},"cost_rub":{"type":"number"},"cache_saved_rub":{"type":"number"},"request_ref":{"type":"string","description":"id записи расхода для /usage/requests"}}},"ChatCompletionRequest":{"type":"object","required":["messages"],"properties":{"model":{"type":"string","description":"id из /models или псевдоним (gpt-5.5, claude-sonnet-5, …)"},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","developer","user","assistant","tool"]},"content":{"oneOf":[{"type":"string"},{"type":"array"},{"type":"null"}]},"tool_calls":{"type":"array"},"tool_call_id":{"type":"string"},"name":{"type":"string"}}}},"tools":{"type":"array","items":{"type":"object","properties":{"type":{"const":"function"},"function":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"parameters":{"type":"object"},"strict":{"type":"boolean"}}}}}},"tool_choice":{"oneOf":[{"type":"string","enum":["auto","none","required"]},{"type":"object"}]},"parallel_tool_calls":{"type":"boolean"},"response_format":{"type":"object","properties":{"type":{"type":"string","enum":["text","json_object","json_schema"]},"json_schema":{"type":"object"}}},"temperature":{"type":"number","minimum":0,"maximum":2},"top_p":{"type":"number"},"max_tokens":{"type":"integer"},"max_completion_tokens":{"type":"integer"},"stop":{"oneOf":[{"type":"string"},{"type":"array"}]},"seed":{"type":"integer"},"presence_penalty":{"type":"number"},"frequency_penalty":{"type":"number"},"reasoning_effort":{"type":"string","enum":["low","medium","high"]},"stream":{"type":"boolean"},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}}},"user":{"type":"string","description":"Идентификатор конечного пользователя — попадает в /usage (end_user)"}}},"ChatCompletion":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"chat.completion"},"model":{"type":"string"},"choices":{"type":"array"},"usage":{"$ref":"#/components/schemas/Usage"},"qvora":{"$ref":"#/components/schemas/Qvora"}}},"Usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"completion_tokens":{"type":"integer"},"total_tokens":{"type":"integer"},"prompt_tokens_details":{"type":"object","properties":{"cached_tokens":{"type":"integer"}}},"completion_tokens_details":{"type":"object","properties":{"reasoning_tokens":{"type":"integer"}}}}},"ResponsesRequest":{"type":"object","required":["input"],"properties":{"model":{"type":"string"},"input":{"oneOf":[{"type":"string"},{"type":"array"}]},"instructions":{"type":"string"},"tools":{"type":"array"},"tool_choice":{},"parallel_tool_calls":{"type":"boolean"},"text":{"type":"object"},"reasoning":{"type":"object","properties":{"effort":{"type":"string"}}},"max_output_tokens":{"type":"integer"},"temperature":{"type":"number"},"top_p":{"type":"number"},"stream":{"type":"boolean"},"store":{"type":"boolean","description":"принимается, всегда false"},"user":{"type":"string"}}},"Response":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"response"},"status":{"type":"string","enum":["completed","incomplete","failed","in_progress"]},"output":{"type":"array"},"usage":{"type":"object"},"qvora":{"$ref":"#/components/schemas/Qvora"}}},"AnthropicMessageRequest":{"type":"object","required":["model","max_tokens","messages"],"properties":{"model":{"type":"string"},"max_tokens":{"type":"integer"},"system":{"oneOf":[{"type":"string"},{"type":"array"}]},"messages":{"type":"array"},"tools":{"type":"array"},"tool_choice":{"type":"object"},"thinking":{"type":"object"},"stop_sequences":{"type":"array"},"temperature":{"type":"number"},"top_p":{"type":"number"},"stream":{"type":"boolean"},"metadata":{"type":"object"}}},"AnthropicMessage":{"type":"object","properties":{"id":{"type":"string"},"type":{"const":"message"},"role":{"const":"assistant"},"model":{"type":"string"},"content":{"type":"array"},"stop_reason":{"type":"string","enum":["end_turn","max_tokens","stop_sequence","tool_use","refusal"]},"usage":{"type":"object","properties":{"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"},"cache_read_input_tokens":{"type":"integer"},"cache_creation_input_tokens":{"type":"integer"}}}}},"EmbeddingRequest":{"type":"object","required":["input"],"properties":{"model":{"type":"string","default":"text-embedding-3-small"},"input":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"dimensions":{"type":"integer"},"encoding_format":{"const":"float"},"user":{"type":"string"}}},"EmbeddingResponse":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"type":"object","properties":{"object":{"const":"embedding"},"index":{"type":"integer"},"embedding":{"type":"array","items":{"type":"number"}}}}},"model":{"type":"string"},"usage":{"type":"object"},"qvora":{"$ref":"#/components/schemas/Qvora"}}},"Model":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"model"},"owned_by":{"const":"qvora"},"qvora":{"type":"object","properties":{"title":{"type":"string"},"type":{"type":"string","enum":["text","embedding"]},"aliases":{"type":"array","items":{"type":"string"}},"context_tokens":{"type":["integer","null"]},"max_output_tokens":{"type":["integer","null"]},"capabilities":{"type":"object","properties":{"vision":{"type":"boolean"},"reasoning":{"type":"boolean"},"tools":{"type":"boolean"},"json_mode":{"type":"boolean"},"json_schema":{"type":"boolean"},"streaming":{"type":"boolean"},"protocols":{"type":"array","items":{"type":"string"}}}},"price_rub_per_1k":{"type":"object","properties":{"input":{"type":"number"},"cached_input":{"type":"number"},"cache_write":{"type":"number"},"output":{"type":"number"}}},"deprecated":{"type":"boolean"}}}}},"ModelList":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Model"}},"qvora":{"type":"object","properties":{"price_book":{"type":"string"}}}}},"Balance":{"type":"object","properties":{"object":{"const":"balance"},"balance_rub":{"type":"number"},"credit_limit_rub":{"type":"number"},"available_rub":{"type":"number"},"reserved_rub":{"type":"number","description":"Открытые резервы запросов в полёте"},"key":{"type":"object","properties":{"monthly_limit_rub":{"type":"number"},"spent_month_rub":{"type":"number"},"month":{"type":["string","null"]},"scopes":{"type":"array","items":{"type":"string"}}}}}},"UsageSummary":{"type":"object","properties":{"object":{"const":"usage.summary"},"from":{"type":"string"},"to":{"type":"string"},"group_by":{"type":"string"},"currency":{"const":"RUB"},"total":{"type":"object"},"data":{"type":"array","items":{"type":"object","properties":{"cost_rub":{"type":"number"},"requests":{"type":"integer"},"failed":{"type":"integer"},"tokens":{"type":"object"}}}}}},"UsageRequestList":{"type":"object","properties":{"object":{"const":"list"},"has_more":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string"},"created_at":{"type":"integer"},"api":{"type":"string"},"model":{"type":"string"},"status":{"type":"string"},"key_id":{"type":"string"},"group_id":{"type":["string","null"]},"member_user_id":{"type":["string","null"]},"end_user":{"type":["string","null"]},"tokens":{"type":["object","null"]},"cost_rub":{"type":"number"}}}}}},"MediaModel":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"model"},"type":{"type":"string","enum":["image","video","music","speech"]},"title":{"type":"string"},"provider_family":{"type":"string"},"operations":{"type":"array","items":{"type":"string","enum":["generate","edit","animate","upscale","remove_background"]}},"schemas":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/MediaOperationSchema"}},"deprecated":{"type":"boolean"}}},"MediaOperationSchema":{"type":"object","properties":{"operation":{"type":"string"},"prompt":{"type":"object","properties":{"required":{"type":"boolean"},"max_length":{"type":"integer"}}},"params":{"type":"object","description":"JSON Schema объекта params"},"inputs":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string"},"required":{"type":"boolean"},"min":{"type":"integer"},"max":{"type":"integer"},"accepts":{"type":"array","items":{"type":"string"}},"description":{"type":"string"}}}},"price":{"type":"object","properties":{"kind":{"type":"string","enum":["fixed","per_option","per_text_length","quote"]}}},"output":{"type":"object"},"async":{"const":true}}},"MediaModelList":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/MediaModel"}},"qvora":{"type":"object","properties":{"price_book":{"type":"string"},"result_url_ttl_sec":{"type":"integer"}}}}},"MediaTaskRequest":{"type":"object","required":["model"],"properties":{"model":{"type":"string"},"operation":{"type":"string","enum":["generate","edit","animate","upscale","remove_background"]},"prompt":{"type":"string"},"params":{"type":"object"},"inputs":{"type":"object","additionalProperties":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"idempotency_key":{"type":"string","maxLength":255},"webhook_url":{"type":"string","format":"uri"},"wait":{"type":"number","minimum":0,"maximum":60},"user":{"type":"string"}}},"MediaTask":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"media.task"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled"]},"model":{"type":"string"},"served_model":{"type":"string"},"operation":{"type":"string"},"created_at":{"type":"integer"},"finished_at":{"type":["integer","null"]},"progress":{"type":"object","properties":{"done":{"type":"integer"},"total":{"type":"integer"}}},"request":{"type":"object"},"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"url":{"type":"string"},"preview_url":{"type":["string","null"]},"thumbnail_url":{"type":["string","null"]},"expires_at":{"type":"integer"}}}},"error":{"type":["object","null"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},"cost":{"type":"object","properties":{"charged_rub":{"type":"number"},"refunded_rub":{"type":"number"},"currency":{"const":"RUB"}}},"webhook_url":{"type":["string","null"]},"idempotency_key":{"type":["string","null"]}}},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"webhook.delivery"},"event":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed"]},"attempts":{"type":"integer"},"last_status":{"type":["integer","null"]},"last_error":{"type":["string","null"]},"next_attempt_at":{"type":["integer","null"]},"delivered_at":{"type":["integer","null"]},"created_at":{"type":"integer"}}},"Transcription":{"type":"object","properties":{"text":{"type":"string"},"language":{"type":"string"},"duration":{"type":"number"},"segments":{"type":"array"},"qvora":{"$ref":"#/components/schemas/Qvora"}}},"ApiKeyPatch":{"type":"object","properties":{"name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["chat","embeddings","media","admin","usage"]}},"monthly_limit_rub":{"type":["number","null"]},"daily_limit_rub":{"type":["number","null"]},"rpm":{"type":["integer","null"]},"tpm":{"type":["integer","null"]},"concurrency":{"type":["integer","null"]},"ip_allowlist":{"type":["array","string","null"],"items":{"type":"string"}},"allowed_models":{"type":["array","null"],"items":{"type":"string"}},"expires_at":{"type":["string","null"],"format":"date-time"},"group_id":{"type":["string","null"]},"member_user_id":{"type":["string","null"]},"enabled":{"type":"boolean"}}},"ApiKey":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"api_key"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"revoked_at":{"type":["integer","null"]},"expires_at":{"type":["integer","null"]},"limits":{"type":"object","properties":{"monthly_limit_rub":{"type":"number"},"spent_month_rub":{"type":"number"},"daily_limit_rub":{"type":"number"},"spent_day_rub":{"type":"number"},"rpm":{"type":"integer"},"tpm":{"type":"integer"},"concurrency":{"type":"integer"}}},"ip_allowlist":{"type":"array","items":{"type":"string"}},"allowed_models":{"type":"array","items":{"type":"string"}},"group_id":{"type":["string","null"]},"member_user_id":{"type":["string","null"]},"webhook_secret_set":{"type":"boolean"},"calls_month":{"type":"integer"},"last_used_at":{"type":["integer","null"]},"created_at":{"type":"integer"}}},"ApiKeyCreated":{"allOf":[{"$ref":"#/components/schemas/ApiKey"},{"type":"object","properties":{"key":{"type":"string","description":"Полный ключ — показывается один раз"},"webhook_secret":{"type":"string","description":"Секрет подписи вебхуков — показывается один раз"}}}]},"KeyGroupPatch":{"type":"object","properties":{"name":{"type":"string"},"monthly_limit_rub":{"type":["number","null"]}}},"KeyGroup":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"key_group"},"name":{"type":"string"},"monthly_limit_rub":{"type":"number"},"spent_month_rub":{"type":"number"},"keys":{"type":"integer"},"created_at":{"type":"integer"}}},"Member":{"type":"object","properties":{"user_id":{"type":"string"},"object":{"const":"member"},"email":{"type":["string","null"]},"name":{"type":["string","null"]},"role":{"type":"string"},"dept":{"type":["string","null"]},"monthly_limit_rub":{"type":"number"},"spent_month_rub":{"type":"number"},"disabled":{"type":"boolean"}}},"AuditEvent":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"audit_event"},"action":{"type":"string"},"target":{"type":["string","null"]},"actor":{"type":["object","null"]},"diff":{},"ip":{"type":["string","null"]},"created_at":{"type":"integer"}}}}}}