{"openapi":"3.0.0","info":{"title":"Bothub API","version":"2.0.0"},"servers":[{"url":"/api/v2"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"anthropicApiKey":{"type":"apiKey","in":"header","name":"x-api-key"}},"rules":{"adminExternalService":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,63}$"},"description":{"type":"string","nullable":true},"enabled":{"type":"boolean"},"providerType":{"type":"string","enum":["ECO","PRO"],"description":"Provider routing for all requests of the service / Маршрутизация провайдеров для всех запросов сервиса"},"config":{"type":"object","properties":{"returnUrl":{"type":"string"},"defaultLocale":{"type":"string"}}}}},"adminExternalServiceIp":{"type":"object","properties":{"name":{"type":"string"},"ip":{"type":"string","description":"IPv4/IPv6 address or CIDR range / Адрес IPv4/IPv6 или CIDR-диапазон"}}},"adminServicePlan":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"capsLimit":{"type":"string","description":"CAPS granted per period (integer) / CAPS на период (целое)"},"periodUnit":{"type":"string","enum":["DAY","MONTH","YEAR"]},"periodCount":{"type":"integer"},"enabled":{"type":"boolean"},"sort":{"type":"integer"}}},"adminServicePlanPrice":{"type":"object","required":["price"],"properties":{"price":{"type":"number"}}},"adminServicePlanModels":{"type":"object","required":["modelIds"],"properties":{"modelIds":{"type":"array","items":{"type":"string"}}}},"adminServiceSubscription":{"type":"object","properties":{"planId":{"type":"string","nullable":true},"balance":{"type":"string"},"capsLimit":{"type":"string"},"expiresAt":{"type":"string","format":"date-time","nullable":true}}},"adminListUsers":{"type":"object","properties":{"page":{"type":"number"},"search":{"type":"string"}}},"adminUpdateUser":{"type":"object","required":["planId","tokens"],"properties":{"planId":{"type":"string"},"tokens":{"type":"number"}}},"adminPlanModelAction":{"type":"object","required":["modelId"],"properties":{"modelId":{"type":"string"}}},"adminUpdatePlan":{"type":"object","properties":{"price":{"type":"integer"},"tokens":{"type":"integer"}}},"adminCreateReferralTemplate":{"type":"object","required":["name","locale","currency","minWithdrawAmount","encouragementPercentage"],"properties":{"name":{"type":"string"},"locale":{"type":"string"},"currency":{"type":"string"},"planId":{"type":"string"},"tokens":{"type":"number"},"minWithdrawAmount":{"type":"number"},"encouragementPercentage":{"type":"number"},"capsEncouragementPercentage":{"type":"number"},"isPrivate":{"type":"boolean"}}},"adminListReferralTemplate":{"type":"object","properties":{"page":{"type":"number"},"search":{"type":"string"},"locale":{"type":"string"}}},"adminDateRange":{"type":"object","required":["dateFrom","dateTo"],"properties":{"dateFrom":{"type":"string","format":"date-time"},"dateTo":{"type":"string","format":"date-time"}}},"adminProductUsage":{"allOf":[{"$ref":"#/components/rules/adminDateRange"},{"type":"object","required":["product"],"properties":{"product":{"type":"string","description":"Product code, validated against domain/entity/statistics validProducts"}}}]},"adminModelEnableDisable":{"type":"object","required":["modelId"],"properties":{"modelId":{"type":"string"},"platform":{"type":"string","enum":["API","WEB","TELEGRAM"]}}},"adminUpdateReferralTemplate":{"type":"object","properties":{"includeApi":{"type":"boolean"}}},"adminToolSetStatus":{"type":"object","required":["toolSetName"],"properties":{"toolSetName":{"type":"string"}}},"supportedLocale":{"type":"string","enum":["ru","kz","en","es","fr","pt"]},"generateSubject":{"type":"object","properties":{"modelId":{"type":"string"},"generationMode":{"type":"string"}},"required":["modelId","generationMode"]},"generatePlan":{"properties":{"generationMode":{"type":"string"},"subject":{"type":"string"},"creativity":{"type":"number"},"modelId":{"type":"string"}},"required":["generationMode","subject","creativity","modelId"]},"generatePlanHints":{"properties":{"generationMode":{"type":"string"},"subject":{"type":"string"},"plan":{"type":"string"},"creativity":{"type":"number"},"modelId":{"type":"string"}},"required":["generationMode","subject","plan","creativity","modelId"]},"addChapterToPlan":{"properties":{"generationMode":{"type":"string"},"subject":{"type":"string"},"plan":{"type":"string"},"locale":{"type":"string"},"creativity":{"type":"number"},"modelId":{"type":"string"},"chapter":{"type":"string"}},"required":["generationMode","subject","plan","locale","creativity","modelId","chapter"]},"generateArticle":{"properties":{"spentCaps":{"type":"number"},"generationMode":{"type":"string"},"subject":{"type":"string"},"plan":{"type":"string"},"creativity":{"type":"number"},"style":{"type":"string"},"customStyle":{"type":"string"},"modelId":{"type":"string"},"language":{"type":"string"},"linkStyle":{"type":"string"},"symbolsCount":{"type":"number"},"keywords":{"type":"string"},"sourceLink":{"type":"string"}},"required":["spentCaps","generationMode","subject","plan","creativity","style","customStyle","modelId","language","linkStyle","symbolsCount","keywords","sourceLink"]},"generateChapter":{"properties":{"articleId":{"type":"string"},"modelId":{"type":"string"},"creativity":{"type":"number"},"chapterPrompt":{"type":"string"},"language":{"type":"string"}},"required":["articleId","modelId","creativity","chapterPrompt","language"]},"updateArticle":{"properties":{"content":{"type":"string"}},"required":["content"]},"listSEOArticles":{"type":"object","properties":{"search":{"type":"string"},"page":{"type":"number"},"quantity":{"type":"number"},"slug":{"type":"string"},"categorySlug":{"type":"string"},"topicSlug":{"type":"string"}}},"deleteManyArticles":{"type":"object","properties":{"articleSlugs":{"type":"array","items":{"type":"string"}}},"required":["articleSlugs"]},"getOAuthConsentURL":{"required":["provider","redirectUri"],"properties":{"provider":{"in":"query","type":"string"},"redirectUri":{"in":"query","type":"string"}}},"oauthAuthorize":{"required":["provider","code","redirectUri"],"properties":{"provider":{"type":"string"},"code":{"type":"string"},"deviceId":{"type":"string"},"codeVerifier":{"type":"string"},"redirectUri":{"type":"string"},"yandexMetricClientId":{"type":"string","nullable":true},"yandexMetricYclid":{"type":"string","nullable":true}}},"emailAuth":{"required":["email","password","altcha"],"properties":{"email":{"type":"string"},"password":{"type":"string"},"altcha":{"type":"string"},"yandexMetricClientId":{"type":"string","nullable":true},"yandexMetricYclid":{"type":"string","nullable":true}}},"signUp":{"required":["email","password","altcha"],"properties":{"email":{"type":"string"},"password":{"type":"string"},"altcha":{"type":"string"},"receiveEmails":{"type":"boolean"},"companyName":{"type":"string"},"inn":{"type":"string","description":"10 digits for a company, 12 for a sole proprietor / 10 цифр для ЮЛ, 12 для ИП"},"kpp":{"type":"string"},"legalAdress":{"type":"string"},"needInvoice":{"type":"boolean"},"yandexMetricClientId":{"type":"string","nullable":true},"yandexMetricYclid":{"type":"string","nullable":true}}},"loginAuth":{"required":["login","password","altcha"],"properties":{"login":{"type":"string"},"password":{"type":"string"},"altcha":{"type":"string"},"yandexMetricClientId":{"type":"string","nullable":true},"yandexMetricYclid":{"type":"string","nullable":true}}},"signUpWithLogin":{"allOf":[{"$ref":"#/components/rules/loginAuth"},{"type":"object","required":["inviteToken"],"properties":{"inviteToken":{"type":"string"}}}]},"sendResetLink":{"required":["email"],"properties":{"email":{"type":"string"}}},"resetPassword":{"required":["password","token"],"properties":{"password":{"type":"string"},"token":{"type":"string"}}},"resetPasswordForEmployee":{"required":["password","employeeId"],"properties":{"password":{"type":"string"},"employeeId":{"type":"string"}}},"telegramAuthorize":{"required":["name"],"properties":{"name":{"type":"string"},"tgId":{"type":"string"},"yandexMetricClientId":{"type":"string","nullable":true},"yandexMetricYclid":{"type":"string","nullable":true}}},"maxAuthorize":{"required":["name"],"properties":{"maxId":{"type":"string"},"name":{"type":"string"},"id":{"type":"string"},"invitedBy":{"type":"string"},"yandexMetricClientId":{"type":"string","nullable":true},"yandexMetricYclid":{"type":"string","nullable":true}}},"logout":{"required":["refreshToken"],"properties":{"refreshToken":{"type":"string"}}},"connectTelegram":{"required":["telegramConnectionToken"],"properties":{"telegramConnectionToken":{"type":"string"}}},"connectMax":{"required":["maxConnectionToken"],"properties":{"maxConnectionToken":{"type":"string"}}},"unlinkTelegram":{"required":["telegramUnlinkToken"],"properties":{"telegramUnlinkToken":{"type":"string"}}},"verifyEmail":{"required":["userId","verificationCode"],"properties":{"userId":{"type":"string"},"verificationCode":{"type":"string"}}},"toggleReceiveEmails":{"required":["receiveEmails"],"properties":{"receiveEmails":{"type":"boolean"}}},"changePassword":{"allOf":[{"$ref":"#/components/rules/authorization"},{"type":"object","properties":{"oldPassword":{"type":"string"},"newPassword":{"type":"string"}}}]},"updateYandexMetric":{"required":[],"properties":{"yandexMetricClientId":{"type":"string","nullable":true},"yandexMetricYclid":{"type":"string","nullable":true}}},"createChat":{"required":null,"properties":{"modelId":{"type":"string"},"groupId":{"type":"string"},"name":{"type":"string"},"highlight":{"type":"string"},"platform":{"type":"string","enum":["WEB","TELEGRAM","MAX"]},"temporary":{"type":"boolean"},"assistantId":{"type":"string"}}},"updateChat":{"required":null,"properties":{"name":{"type":"string"},"highlight":{"type":"string"},"draft":{"type":"string","nullable":true},"modelId":{"type":"string"},"modelFunctionId":{"type":"string"},"initial":{"type":"boolean"},"groupId":{"type":"string"}}},"deleteManyChat":{"required":["ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}}}},"deleteAllExcept":{"required":["idsToKeep"],"properties":{"idsToKeep":{"type":"array","items":{"type":"string"}},"groupIdsToKeep":{"type":"array","items":{"type":"string"}}}},"getChatSettings":{"properties":{"all":{"type":"integer"},"elements":{"type":"integer"},"platform":{"type":"string","enum":["WEB","MAIN","TELEGRAM","MAX"]}}},"getChatGenerationCost":{"properties":{"platform":{"type":"string","enum":["WEB","MAIN","DASHBOARD","TELEGRAM","MAX"]}}},"updateChatSettings":{"oneOf":[{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}}}}},{"type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}]},"branchChat":{"required":["messageId"],"properties":{"messageId":{"type":"string"},"onlyInContext":{"type":"boolean","default":true}}},"createInvite":{"required":[],"properties":{"expiresAt":{"type":"string","format":"date-time","nullable":true,"default":null,"example":"2025-12-31T23:59:59.000Z"},"reusable":{"type":"boolean","default":false}}},"checkInvite":{"required":["inviteToken"],"properties":{"inviteToken":{"in":"path","type":"string"}}},"deleteInvite":{"required":["enterpriseId","inviteId"],"properties":{"enterpriseId":{"in":"path","type":"string"},"inviteId":{"in":"path","type":"string"}}},"joinEnterprise":{"required":["inviteToken"],"properties":{"inviteToken":{"type":"string"}}},"createExchangeRate":{"type":"object","properties":{"startDate":{"type":"string","format":"date"},"capsPerRub":{"type":"number"},"capsPerUsd":{"type":"number"}},"required":["startDate","capsPerRub","capsPerUsd"]},"updateExchangeRate":{"type":"object","properties":{"startDate":{"type":"string","format":"date"},"capsPerRub":{"type":"number"},"capsPerUsd":{"type":"number"}}},"externalServiceCheckOrCreate":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","description":"Required when the user does not exist yet / Обязателен, если пользователя ещё нет"},"locale":{"type":"string"}}},"externalServiceConfirm":{"type":"object","required":["email","code"],"properties":{"email":{"type":"string","format":"email"},"code":{"type":"string","pattern":"^\\d{6}$"},"password":{"type":"string","description":"Password given at sign-up; without it an unconfirmed account loses its password / Пароль, заданный при регистрации; без него у неподтверждённой учётки пароль стирается"}}},"externalServiceBuy":{"type":"object","required":["planId","currency"],"properties":{"planId":{"type":"string","format":"uuid"},"currency":{"type":"string","enum":["RUB","USD","EUR"]},"provider":{"type":"string","enum":["TINKOFF","CRYPTO","STRIPE"],"description":"RUB defaults to TINKOFF, other currencies to CRYPTO / RUB по умолчанию TINKOFF, остальные валюты — CRYPTO"}}},"externalServiceRefund":{"type":"object","required":["amount","key"],"properties":{"amount":{"type":"string","pattern":"^[1-9]\\d{0,17}$","description":"CAPS to return / Сколько CAPS вернуть"},"key":{"type":"string","maxLength":100,"description":"Idempotency key, a repeated key returns the first result / Ключ идемпотентности, повтор возвращает первый результат"},"reason":{"type":"string","maxLength":200}}},"create":{"required":["version","updates"],"properties":{"amount":{"type":"number"},"message":{"type":"string"},"recipientName":{"type":"string"},"version":{"type":"string"},"updates":{"type":"array","items":{"type":"string"}}}},"activate":{"required":["code"],"properties":{"code":{"type":"string"}}},"createGroup":{"required":["name"],"properties":{"name":{"type":"string"},"highlight":{"type":"string"}}},"updateGroup":{"required":["name","highlight"],"properties":{"name":{"type":"string"},"highlight":{"type":"string","description":"group card color"}}},"sendMessage":{"required":["chatId"],"properties":{"chatId":{"type":"string"},"message":{"type":"string"},"modelId":{"type":"string"},"sourceUserMessageId":{"type":"string"},"tgBotMessageId":{"type":"string"},"platform":{"type":"string","enum":["MAIN","DASHBOARD","TELEGRAM","MAX","BOTHUB_API"]}}},"chatPromptQueue":{"required":["prompts","prompts.*.message","prompts.*.includeContext","prompts.*.modelId"],"properties":{"chatId":{"type":"string"},"prompts":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"},"includeContext":{"type":"boolean"},"modelId":{"type":"string"}}}}}},"outputFilePromptQueue":{"required":["prompts","prompts.*.message","prompts.*.includeContext","prompts.*.modelId"],"properties":{"chatId":{"type":"string"},"markup":{"type":"string","enum":["md","html","docx"]},"outputOneFile":{"type":"boolean"},"prompts":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string"},"includeContext":{"type":"boolean"},"modelId":{"type":"string"}}}}}},"downloadPromptQueueResult":{"required":["path"],"properties":{"path":{"type":"string"}}},"regenerateMessage":{"required":["id"],"properties":{"id":{"type":"string"},"userMessageId":{"type":"string"},"platform":{"type":"string","enum":["MAIN","DASHBOARD","TELEGRAM","MAX","BOTHUB_API"]}}},"upsertMessageFeedback":{"required":["messageId","type"],"properties":{"messageId":{"type":"string"},"type":{"type":"string","enum":["LIKE","DISLIKE"]},"reasons":{"type":"array","items":{"type":"string"}},"comment":{"type":"string"}}},"buyPlan":{"required":[],"properties":{"quantity":{"type":"integer","minimum":1,"maximum":99},"inn":{"type":"string","pattern":"^\\d{10}$|^\\d{12}$"},"kpp":{"type":"string","pattern":"^\\d{9}$"},"companyName":{"type":"string"},"needInvoice":{"type":"boolean"}}},"createPreset":{"required":["name","description","systemPrompt","access"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"modelId":{"type":"string"},"systemPrompt":{"type":"string"},"access":{"type":"string","enum":["PUBLIC","PRIVATE"]},"categoriesIds":{"type":"array","items":"string","example":[]}}},"updatePreset":{"required":null,"properties":{"name":{"type":"string"},"description":{"type":"string"},"modelId":{"type":"string"},"systemPrompt":{"type":"string"},"attachmentsIds":{"type":"array","items":"string","example":[]},"access":{"type":"string","enum":["PUBLIC","PRIVATE"]},"categoriesIds":{"type":"array","items":"string","example":[]}}},"createPresetCategory":{"required":["code","name"],"properties":{"code":{"type":"string"},"locale":{"type":"string"},"name":{"type":"string"}}},"updatePresetCategory":{"required":null,"properties":{"code":{"type":"string"},"locale":{"type":"string"},"name":{"type":"string"}}},"changePresetAssistant":{"required":["assistantId"],"properties":{"assistantId":{"type":"string","format":"uuid"}}},"createReferral":{"required":["templateId"],"properties":{"templateId":{"type":"string"}}},"withdrawReferral":{"required":["details"],"properties":{"details":{"type":"object"}}},"updateReleaseNote":{"properties":{"version":{"type":"string"},"updates":{"type":"array","items":{"type":"string"}}},"anyOf":[{"required":["version"]},{"required":["updates"]}]},"createSEOArticleCategory":{"type":"object","properties":{"name":{"type":"object","properties":{"ru":{"type":"string"},"en":{"type":"string"},"es":{"type":"string"},"fr":{"type":"string"},"pt":{"type":"string"}}}},"required":["name"]},"listSEOArticleCategory":{"type":"object","properties":{"page":{"type":"number"},"quantity":{"type":"number"}}},"updateSEOArticleCategory":{"type":"object","properties":{"name":{"type":"object","properties":{"ru":{"type":"string"},"en":{"type":"string"},"es":{"type":"string"},"fr":{"type":"string"},"pt":{"type":"string"}}}}},"createSEOArticleExpertJobHistory":{"type":"object","properties":{"post":{"type":"string"},"fromDate":{"type":"string","format":"date"},"toDate":{"type":"string","format":"date"},"company":{"type":"string"},"city":{"type":"string"},"duties":{"type":"array","items":{"type":"string"}},"achievements":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"seoExpertId":{"type":"string"}},"required":["post","fromDate","company","city","duties","achievements","description","seoExpertId"]},"updateSEOArticleExpertJobHistory":{"type":"object","properties":{"post":{"type":"string"},"fromDate":{"type":"string","format":"date"},"toDate":{"type":"string","format":"date"},"company":{"type":"string"},"city":{"type":"string"},"duties":{"type":"array","items":{"type":"string"}},"achievements":{"type":"array","items":{"type":"string"}},"description":{"type":"string"},"seoExpertId":{"type":"string"}}},"createSEOArticleExpert":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"telegram":{"type":"string"},"bio":{"type":"string"},"city":{"type":"string"},"country":{"type":"string"},"education":{"type":"object","properties":{"university":{"type":"string"},"level":{"type":"string"},"form":{"type":"string"},"graduationYear":{"type":"string"},"faculty":{"type":"string"},"specialty":{"type":"string"}}},"qualification":{"type":"string"}},"required":["name","bio","city","country","qualification"]},"updateSEOArticleExpert":{"type":"object","properties":{"name":{"type":"string"},"bio":{"type":"string"},"city":{"type":"string"},"country":{"type":"string"},"education":{"type":"object","properties":{"university":{"type":"string"},"level":{"type":"string"},"form":{"type":"string"},"graduationYear":{"type":"string"},"faculty":{"type":"string"},"specialty":{"type":"string"}}},"qualification":{"type":"string"}}},"createSEOArticleProofreading":{"type":"object","properties":{"expertId":{"type":"string"},"articleId":{"type":"string"}},"required":["expertId","articleId"]},"createManySEOArticleProofreading":{"type":"object","properties":{"articleSlugs":{"type":"array","items":{"type":"string"}},"expertId":{"type":"string"}},"required":["articleSlugs","expertId"]},"updateSEOArticleProofreading":{"type":"object","required":[],"properties":{"properties":null,"expertId":{"type":"string"},"articleId":{"type":"string"}}},"createSEOArticleTopic":{"type":"object","properties":{"name":{"type":"object","properties":{"ru":{"type":"string"},"en":{"type":"string"},"es":{"type":"string"},"fr":{"type":"string"},"pt":{"type":"string"}}},"articleId":{"type":"string"},"categoryId":{"type":"string"}},"required":["name","articleId","categoryId"]},"updateSEOArticleTopic":{"type":"object","properties":{"name":{"type":"object","properties":{"ru":{"type":"string"},"en":{"type":"string"},"es":{"type":"string"},"fr":{"type":"string"},"pt":{"type":"string"}}},"articleId":{"type":"string"},"categoryId":{"type":"string"}}},"createShortcut":{"required":["name","text","autosend"],"properties":{"name":{"type":"string"},"text":{"type":"string"},"autosend":{"type":"boolean"}}},"updateShortcut":{"required":["name","text","autosend"],"properties":{"name":{"type":"string"},"text":{"type":"string"},"autosend":{"type":"boolean"}}},"twoFactorVerifyLogin":{"required":["twoFactorToken","code"],"properties":{"twoFactorToken":{"type":"string"},"code":{"type":"string","description":"6-digit TOTP/email code or backup code (xxxx-xxxx)"}}},"twoFactorResendLoginCode":{"required":["twoFactorToken"],"properties":{"twoFactorToken":{"type":"string"}}},"twoFactorCode":{"required":["code"],"properties":{"code":{"type":"string"}}},"lavaWebhook":{"required":[],"properties":{"invoiceId":{"type":"string","description":"Lava invoice id / Идентификатор счёта Lava"},"id":{"type":"string","description":"Fallback invoice id field / Запасное поле идентификатора счёта"},"orderId":{"type":"string"},"status":{"type":"string"},"amount":{"type":"number"}}},"plategaWebhook":{"required":["id"],"properties":{"id":{"type":"string","description":"Platega transaction id / Идентификатор транзакции Platega"},"status":{"type":"string","enum":["CONFIRMED","CANCELED","CHARGEBACKED"]},"amount":{"type":"number"},"currency":{"type":"string"},"paymentMethod":{"type":"integer"},"payload":{"type":"string"}}}},"schemas":{"AvailabilityFirstChunk":{"type":"object","description":"Time to the first streamed chunk of any kind over successful generations","properties":{"medianMs":{"type":"integer","nullable":true},"p90Ms":{"type":"integer","nullable":true},"samples":{"type":"integer"}}},"FavoriteModels":{"type":"object","properties":{"modelIds":{"type":"array","description":"Favorite model IDs in the order they were added / ID избранных моделей в порядке добавления","items":{"type":"string"}}}}},"entities":{"Article":{"required":["id","slug","userId","modelId","generationMode","subject","plan","creativity","style","customStyle","language","symbolsCount","sourceLink","content","spentCaps","chatId","createdAt"],"properties":{"id":{"type":"string"},"slug":{"type":"string"},"userId":{"type":"string"},"user":{"$ref":"#/components/entities/User"},"modelId":{"type":"string"},"model":{"$ref":"#/components/entities/Model"},"generationMode":{"type":"string"},"subject":{"type":"string"},"plan":{"type":"string"},"creativity":{"type":"number"},"style":{"type":"string"},"customStyle":{"type":"string"},"linkStyle":{"type":"string"},"language":{"type":"string"},"symbolsCount":{"type":"number"},"keywords":{"type":"string"},"sourceContent":{"type":"string"},"sourceLink":{"type":"string"},"content":{"type":"string"},"spentCaps":{"type":"string"},"chatId":{"type":"string"},"chat":{"$ref":"#/components/entities/Chat"},"createdAt":{"type":"string","format":"date"},"publishedAt":{"type":"string","format":"date"},"topics":{"$ref":"#/components/entities/SEOArticleTopic"},"proofreadings":{"$ref":"#/components/entities/SEOArticleProofreading"}}},"Assistant":{"required":["id","code","name","description","locale","createdAt"],"properties":{"id":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"color":{"type":"string"},"icon":{"type":"string"},"description":{"type":"string"},"position":{"type":"integer"},"createdAt":{"type":"string","format":"date"}}},"AuthProvider":{"required":["id","userId","provider"],"properties":{"id":{"type":"string"},"userId":{"type":"string"},"externalId":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"provider":{"type":"string","enum":["LOGIN_PASSWORD","APPLE"]}}},"BatchRequest":{"type":"object","required":["id","user_id","status","provider_id","batch_id","input_file_id","updated_at","finished_at","created_at"],"properties":{"id":{"type":"string"},"userId":{"type":"string"},"status":{"type":"string"},"providerId":{"type":"string"},"path":{"type":"string"},"batchId":{"type":"string"},"inputFileId":{"type":"string"},"outputFileId":{"type":"string"},"updatedAt":{"type":"string","format":"date"},"createdAt":{"type":"string","format":"date"},"finishedAt":{"type":"string","format":"date"}}},"Chat":{"required":["id","name","createdAt","totalCaps"],"properties":{"id":{"type":"string"},"groupId":{"type":"string"},"userId":{"type":"string"},"name":{"type":"string"},"totalCaps":{"type":"number"},"highlight":{"type":"string"},"temporary":{"type":"boolean"},"modelId":{"type":"string"},"createdAt":{"type":"string","format":"date"},"queueId":{"type":"string"},"branchFromChatId":{"type":"string"},"branchFromMessageId":{"type":"string"}}},"ClonedVoice":{"type":"object","required":["id","voice_id","model_id","provider_id","user_id","created_at"],"properties":{"id":{"type":"string"},"voiceId":{"type":"string"},"modelId":{"type":"string"},"providerId":{"type":"string"},"userId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"expiredAt":{"type":"string","format":"date-time","nullable":true},"name":{"type":"string","nullable":true},"lastUsedAt":{"type":"string","format":"date-time","nullable":true},"evictedAt":{"type":"string","format":"date-time","nullable":true}}},"CsatSurveyResponseAdmin":{"properties":{"id":{"type":"string"},"userId":{"type":"string"},"userEmail":{"type":"string","nullable":true},"userTgId":{"type":"string","nullable":true},"period":{"type":"string","example":"2026-09"},"rating":{"type":"integer","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"comment":{"type":"string","nullable":true},"question":{"type":"string","nullable":true},"answer":{"type":"string","nullable":true},"contactAllowed":{"type":"boolean"},"contact":{"type":"string","nullable":true},"rewardAmount":{"type":"integer","nullable":true},"dismissedAt":{"type":"string","format":"date-time","nullable":true},"submittedAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"}}},"EnterpriseInvite":{"required":["id","token","enterpriseId","allowedAuthProviders","createdAt"],"properties":{"id":{"type":"string"},"token":{"type":"string"},"enterpriseId":{"type":"string"},"employeeId":{"type":"string","nullable":true},"allowedAuthProviders":{"type":"array","items":{"type":"string","enum":["EMAIL_PASSWORD","LOGIN_PASSWORD","OAUTH"]}},"expiresAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"employee":{"type":"object","nullable":true}}},"ExchangeRate":{"required":["id","startDate","rub","usd","createdAt"],"properties":{"id":{"type":"string"},"startDate":{"type":"string","format":"date-time"},"rub":{"type":"number"},"usd":{"type":"number"},"createdAt":{"type":"string","format":"date-time"}}},"File":{"required":["id","size","isEncrypted","createdAt"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"path":{"type":"string"},"size":{"type":"string"},"isEncrypted":{"type":"string"},"createdAt":{"type":"string","format":"date"},"deletedAt":{"type":"string","format":"date"}}},"GiftCertificate":{"required":["id","code","fromUserId","gifterEmail","amount","createdAt"],"properties":{"id":{"type":"string"},"code":{"type":"string"},"fromUserId":{"type":"string"},"gifterEmail":{"type":"string"},"amount":{"type":"string"},"message":{"type":"string"},"recipientName":{"type":"string"},"createdAt":{"type":"string","format":"date"}}},"Group":{"required":["id","name","userId","createdAt"],"properties":{"id":{"type":"string"},"userId":{"type":"string"},"name":{"type":"string"},"highlight":{"type":"string"},"createdAt":{"type":"string","format":"date"}}},"Job":{"required":["id","name","status"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"}}},"MessageButton":{"required":["id","type","action","disabled","createdAt"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"action":{"type":"string"},"disabled":{"type":"boolean"},"createdAt":{"type":"string","format":"date"}}},"MessageFeedback":{"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["LIKE","DISLIKE"]},"userId":{"type":"string"},"messageId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"MessageImage":{"required":["id","messageId","width","height","previewHeight","previewWidth","previewId","originalId","isNsfw","createdAt","status"],"properties":{"id":{"type":"string"},"messageId":{"type":"string"},"width":{"type":"number"},"height":{"type":"number"},"previewHeight":{"type":"number"},"previewWidth":{"type":"number"},"previewId":{"type":"string"},"originalId":{"type":"string"},"isNsfw":{"type":"boolean"},"createdAt":{"type":"string","format":"date"},"status":{"type":"string","enum":["PENDING","DONE"]}}},"Message":{"required":["id","name","createdAt","type"],"properties":{"id":{"type":"string"},"role":{"type":"string","enum":["assistant","user","action"]},"type":{"type":"string","enum":["TEXT","IMAGE","ACTION"]},"status":{"type":"string","enum":["PENDING","DONE"]},"tokens":{"type":"number"},"actionType":{"type":"string","enum":["CONTEXT_CLEARED"]},"userId":{"type":"string"},"chatId":{"type":"string"},"additionalContent":{"type":"string"},"githubContext":{"type":"object"},"tgBotMessageId":{"type":"string"},"disabled":{"type":"boolean"},"edited":{"type":"boolean"},"content":{"type":"string"},"requestId":{"type":"string"},"transactionId":{"type":"string"},"images":{"$ref":"#/components/entities/MessageImage"},"modelId":{"type":"string"},"responseTimeMs":{"type":"number"},"feedbacks":{"type":"array","items":{"$ref":"#/components/entities/MessageFeedback"}},"createdAt":{"type":"string","format":"date"}}},"ModelDescription":{"required":["id","locale"],"properties":{"id":{"type":"string"},"locale":{"type":"string"},"name":{"oneOf":[{"type":null},{"type":"string"}]},"descriptionDashboard":{"oneOf":[{"type":null},{"type":"string"}]},"descriptionMain":{"oneOf":[{"type":null},{"type":"string"}]},"descriptionFooter":{"oneOf":[{"type":null},{"type":"string"}]},"keywords":{"oneOf":[{"type":null},{"type":"string"}]},"meta":{"oneOf":[{"type":null},{"type":"object","properties":{"title":{"oneOf":[{"type":null},{"type":"string"}]},"description":{"oneOf":[{"type":null},{"type":"string"}]}}}]},"faq":{"oneOf":[{"type":null},{"type":"array","items":{"type":"object","properties":{"question":{"type":"string"},"answer":{"type":"string"}}}}]}}},"ModelFunction":{"required":["id","isDefault","order","usedCount","createdAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"label":{"oneOf":[{"type":null},{"type":"string"}]},"features":{"oneOf":[{"type":null},{"type":"object"}]},"isDefault":{"type":"boolean"},"order":{"type":"number"},"modelId":{"oneOf":[{"type":null},{"type":"string"}]},"usedCount":{"type":"number"},"createdAt":{"type":"string","format":"date"}}},"Model":{"required":["id","ownedBy","createdAt","order","usedCount","popularityScore"],"properties":{"id":{"type":"string"},"label":{"oneOf":[{"type":null},{"type":"string"}]},"ownedBy":{"type":"string"},"order":{"type":"number"},"usedCount":{"type":"number"},"popularityScore":{"type":"number"},"createdAt":{"type":"string","format":"date"},"trackAvailability":{"type":"boolean"}}},"MusicGeneration":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":"string","nullable":true,"description":"The external_id sent when the job was created"},"object":{"type":"string","example":"music.generation"},"model":{"type":"string","example":"suno-v6"},"status":{"type":"string","enum":["in_progress","completed","failed"]},"createdAt":{"type":"integer","description":"Unix time, seconds"},"completedAt":{"type":"integer","nullable":true},"data":{"type":"array","description":"Tracks, filled when status is completed (Suno returns two per generation)","items":{"type":"object","properties":{"id":{"type":"string"},"audioUrl":{"type":"string","description":"MP3 file, kept for 30 days after the generation"},"imageUrl":{"type":"string","nullable":true},"title":{"type":"string"},"tags":{"type":"string","description":"Style the track was generated with"},"lyrics":{"type":"string","nullable":true},"duration":{"type":"integer","description":"Seconds"}}}},"usage":{"type":"object","nullable":true,"properties":{"caps":{"type":"number"}}},"error":{"type":"object","nullable":true,"properties":{"code":{"type":"string","enum":["MUSIC_MODERATION","MUSIC_ARTIST_NAME","MUSIC_PROVIDER_ERROR"]},"message":{"type":"string"}}}}},"Plan":{"required":["id","type","price","currency","tokens"],"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["GUEST","FREE","BASIC","PREMIUM","DELUXE","ELITE"]},"price":{"type":"number"},"currency":{"type":"string","enum":["RUB","EUR","USD"]},"tokens":{"type":"number"}}},"PresetAttachment":{"required":["id","presetId","isNsfw","fileId","createdAt"],"properties":{"id":{"type":"string"},"presetId":{"type":"string"},"isNsfw":{"type":"boolean"},"fileId":{"type":"string"},"createdAt":{"type":"string","format":"date"}}},"PresetCategory":{"required":["id","code","name","createdAt"],"properties":{"id":{"type":"string"},"code":{"type":"string"},"name":{"type":"string"},"createdAt":{"type":"string","format":"date"}}},"Preset":{"required":["id","name","description","createdAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"modelId":{"type":"string"},"systemPrompt":{"type":"string"},"access":{"type":"string","enum":["PUBLIC","PRIVATE","CARD"]},"usageCount":{"type":"number"},"authorId":{"type":"string"},"localeId":{"type":"string"},"assistantId":{"type":"string"},"createdAt":{"type":"string","format":"date"}}},"ReferralTemplate":{"properties":{"id":{"type":"string"},"name":{"type":"string"},"locale":{"type":"string"},"minWithdrawAmount":{"type":"number"},"encouragementPercentage":{"type":"number"},"currency":{"type":"string"},"planId":{"type":"string"},"tokens":{"type":"number"},"private":{"type":"boolean"},"includeApi":{"type":"boolean"},"plan":{"$ref":"#/components/entities/Plan"}}},"Referral":{"required":["id","ownerId"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"ownerId":{"type":"string"},"templateId":{"type":"string"},"balance":{"type":"number"},"code":{"type":"string"}}},"RefreshToken":{"required":["id","token","ip","updatedAt"],"properties":{"id":{"type":"string"},"token":{"type":"string"},"ip":{"type":"string"},"userAgent":{"type":"string"},"userId":{"type":"string"},"updatedAt":{"type":"string","format":"date"}}},"Report":{"properties":{"id":{"type":"string"},"userId":{"type":"string"},"description":{"type":"string"},"reasons":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["NEW","IN_PROGRESS","RESOLVED","REJECTED"]},"settingsSnapshot":{"type":"object"},"messageSnapshot":{"type":"object"},"modelId":{"type":"string"},"resolution":{"type":"string"},"reviewedBy":{"type":"string"},"reviewedAt":{"type":"string","format":"date-time"},"revokedAt":{"type":"string","format":"date-time","nullable":true},"chatId":{"type":"string"},"chat":{"$ref":"#/components/entities/Chat"},"messageId":{"type":"string"},"message":{"$ref":"#/components/entities/Message"},"feedbackId":{"type":"string","nullable":true},"files":{"type":"array","items":{"$ref":"#/components/entities/File"}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"SEOArticleCategory":{"required":["id","name","slug"],"properties":{"id":{"type":"string"},"name":{"type":"object","properties":{"ru":{"type":"string"},"en":{"type":"string"},"es":{"type":"string"},"fr":{"type":"string"},"pt":{"type":"string"}}},"slug":{"type":"string"},"topics":{"$ref":"#/components/entities/SEOArticleTopic"}}},"SEOArticleExpertJobHistory":{"required":["id","post","fromDate","company","city","duties","achievements","description","seoExpertId"],"properties":{"id":{"type":"string"},"post":{"type":"string"},"fromDate":{"type":"string","format":"date"},"toDate":{"type":"string","format":"date"},"company":{"type":"string"},"city":{"type":"string"},"duties":{"type":"string"},"achievements":{"type":"string"},"description":{"type":"string"},"seoExpertId":{"type":"string"},"expert":{"$ref":"#/components/entities/SEOArticleExpert"}}},"SEOArticleExpert":{"required":["id","name","slug","email","telegram","bio","city","country","education","qualification","createdAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"email":{"type":"string"},"telegram":{"type":"string"},"bio":{"type":"string"},"city":{"type":"string"},"country":{"type":"string"},"education":{"type":"object","properties":{"university":{"type":"string"},"level":{"type":"string"},"form":{"type":"string"},"graduationYear":{"type":"string"},"faculty":{"type":"string"},"specialty":{"type":"string"}}},"qualification":{"type":"string"},"createdAt":{"type":"string","format":"date"},"experience":{"$ref":"#/components/entities/SEOArticleExpertJobHistory"},"proofreadings":{"$ref":"#/components/entities/SEOArticleProofreading"}}},"SEOArticleProofreading":{"required":["id","expertId","articleId","createdAt"],"properties":{"id":{"type":"string"},"expertId":{"type":"string"},"expert":{"$ref":"#/components/entities/SEOArticleExpert"},"articleId":{"type":"string"},"article":{"$ref":"#/components/entities/Article"},"createdAt":{"type":"string","format":"date"}}},"SEOArticleTopic":{"required":["id","name","slug","articleId","categoryId"],"properties":{"id":{"type":"string"},"name":{"type":"object","properties":{"ru":{"type":"string"},"en":{"type":"string"},"es":{"type":"string"},"fr":{"type":"string"},"pt":{"type":"string"}}},"articleId":{"type":"string"},"article":{"$ref":"#/components/entities/Article"},"categoryId":{"type":"string"},"category":{"$ref":"#/components/entities/SEOArticleCategory"}}},"Shortcut":{"properties":{"id":{"type":"string"},"name":{"type":"string"},"text":{"type":"string"},"autosend":{"type":"boolean"},"position":{"type":"string"},"userId":{"type":"string"},"createdAt":{"type":"string"}}},"Subscription":{"required":["id","planId","userId","enterpriseId","balance","paymentPlan","creditLimit","softLimit","systemLimit","createdAt"],"properties":{"id":{"type":"string"},"planId":{"type":"string"},"userId":{"type":"string"},"enterpriseId":{"type":"string"},"balance":{"type":"number"},"paymentPlan":{"type":"string"},"creditLimit":{"type":"number"},"softLimit":{"type":"number"},"systemLimit":{"type":"number"},"createdAt":{"type":"string","format":"date"}}},"Transaction":{"required":["id","provider","amount","currency","status","type","createdAt"],"properties":{"id":{"type":"string"},"provider":{"type":"string","enum":["YOOMONEY","CRYPTO","BOTHUB"]},"currency":{"type":"string","enum":["RUB","USD","EUR","BOTHUB_TOKEN"]},"meta":{"type":"object"},"amount":{"type":"number"},"status":{"type":"string","enum":["FAILED","SUCCEDED","PENDING"]},"type":{"type":"string","enum":["SUBSCRIPTION","WRITE_OFF","REPLINSH","WITHDRAW"]},"planId":{"type":"string"},"userId":{"type":"string"},"referralId":{"type":"string"},"externalId":{"type":"string"},"createdAt":{"type":"string","format":"date"},"developerKeyId":{"type":"string"}}},"User":{"required":["id","role","createdAt"],"properties":{"id":{"type":"string"},"email":{"type":"string"},"tgId":{"type":"string"},"maxId":{"type":"string"},"name":{"type":"string"},"avatar":{"type":"string"},"role":{"type":"string","enum":["USER"]},"createdAt":{"type":"string","format":"date"},"emailVerified":{"type":"boolean"},"yandexMetricClientId":{"type":"string"},"useEncryption":{"type":"boolean"},"ecoProFallback":{"type":"boolean","description":"On ECO failure answer through a PRO provider at the PRO price"},"subscription":{"$ref":"#/components/entities/Subscription"},"region":{"type":"string","enum":["RU","KZ","GLOBAL"]},"authProviders":{"type":"array","items":{"$ref":"#/components/entities/AuthProvider"}}}},"VideoRequest":{"type":"object","required":["id","user_id","status","provider_id","created_at"],"properties":{"id":{"type":"string"},"userId":{"type":"string"},"status":{"type":"string"},"error":{"type":"string"},"usage":{"type":"object"},"providerId":{"type":"string"},"outputFileId":{"type":"string"},"createdAt":{"type":"string","format":"date"}}}}},"paths":{"/ai-tools/v1/chat/completions":{"post":{"summary":"Completions with AI tools / Генерация с инструментами ИИ","description":"Sends a generation request with integrated AI tool capabilities (e.g. web search). Compatible with the OpenAI Chat Completions API format. Supports both streaming and non-streaming modes.\n\nОтправляет запрос на генерацию с поддержкой встроенных инструментов ИИ (например, веб-поиск). Совместимо с форматом OpenAI Chat Completions API. Поддерживает потоковый и обычный режимы.\n","tags":["AI Tools"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string","description":"ID of the model to use"},"messages":{"type":"array","description":"A list of messages comprising the conversation","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant"]},"content":{"type":"string"}}}},"stream":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"Generation response (non-streaming). When stream is true, returns SSE text/event-stream.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"choices":{"type":"array","items":{"type":"object"}},"usage":{"type":"object","description":"Token usage statistics. Only present when stream is false (default)."}}}},"text/event-stream":{"schema":{"type":"string"}}}}}}},"/anthropic/v1/messages":{"post":{"summary":"Create a message (Anthropic Messages API) / Создать сообщение (Anthropic Messages API)","description":"Anthropic Messages API compatible endpoint. Works with any Bothub text model\n(Claude, GPT, Gemini, DeepSeek, …), not only Claude. Supports streaming via SSE\n(`message_start`, `content_block_*`, `message_delta`, `message_stop`), tools,\nimages, PDF documents and extended thinking.\n\nAuth: `Authorization: Bearer <key>` or `x-api-key: <key>` (Bothub developer key).\nPoint an Anthropic SDK or Claude Code at Bothub:\n  ANTHROPIC_BASE_URL=https://<bothub-host>/api/v2/anthropic\n  ANTHROPIC_AUTH_TOKEN=<bothub_developer_key>\n\nСовместим с Anthropic Messages API. Работает с любой текстовой моделью Bothub\n(Claude, GPT, Gemini, DeepSeek и др.), а не только с Claude. Поддерживает стриминг (SSE),\nинструменты, изображения, PDF и reasoning. Ключ передаётся в `Authorization: Bearer`\nили `x-api-key`.\n","tags":["Anthropic Compatible"],"security":[{"bearerAuth":[]},{"anthropicApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages","max_tokens"],"properties":{"model":{"type":"string","description":"Bothub model ID (e.g. claude-sonnet-4.5, gpt-5.1, gemini-2.5-pro). Claude Code IDs like claude-sonnet-4-5-20250929 are accepted","example":"claude-sonnet-4.5"},"maxTokens":{"type":"integer","description":"Maximum number of tokens to generate","example":1024},"messages":{"type":"array","description":"Conversation turns","items":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["user","assistant"]},"content":{"description":"String or content blocks (text, image, document, tool_use, tool_result, thinking)","oneOf":[{"type":"string"},{"type":"array","items":{"type":"object"}}]}}},"example":[{"role":"user","content":"Hello!"}]},"system":{"description":"System prompt, a string or text blocks","oneOf":[{"type":"string"},{"type":"array","items":{"type":"object"}}]},"stream":{"type":"boolean","default":false,"description":"If true, returns a stream of Server-Sent Events"},"temperature":{"type":"number"},"topP":{"type":"number"},"topK":{"type":"integer"},"stopSequences":{"type":"array","items":{"type":"string"}},"tools":{"type":"array","description":"Tools with name, description and input_schema","items":{"type":"object"}},"toolChoice":{"type":"object","description":"{type: auto}, {type: any}, {type: none} or {type: tool, name}"},"thinking":{"type":"object","description":"{type: enabled, budget_tokens}, {type: adaptive} or {type: disabled}"},"outputConfig":{"type":"object","properties":{"effort":{"type":"string","description":"Reasoning effort (low, medium, high, …)"}}},"metadata":{"type":"object","properties":{"userId":{"type":"string"}}}}}}}},"responses":{"200":{"description":"Message or SSE stream / Сообщение или SSE-поток","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","example":"message"},"role":{"type":"string","example":"assistant"},"model":{"type":"string"},"content":{"type":"array","description":"text, thinking and tool_use blocks","items":{"type":"object"}},"stopReason":{"type":"string","enum":["end_turn","max_tokens","stop_sequence","tool_use"]},"usage":{"type":"object","properties":{"inputTokens":{"type":"integer"},"outputTokens":{"type":"integer"},"cacheCreationInputTokens":{"type":"integer","nullable":true},"cacheReadInputTokens":{"type":"integer","nullable":true}}}}}},"text/event-stream":{"schema":{"type":"string","description":"SSE stream of Anthropic message events"}}}},"400":{"description":"Invalid request / Неверный запрос"},"401":{"description":"Missing or invalid key / Нет ключа или ключ неверный"},"404":{"description":"Model not found (MODEL_NOT_FOUND) / Модель не найдена"}}}},"/anthropic/v1/messages/countTokens":{"post":{"summary":"Count input tokens / Посчитать входные токены","description":"Takes the same body as `/anthropic/v1/messages` and returns an estimate of input tokens.\n\nПринимает то же тело, что `/anthropic/v1/messages`, и возвращает оценку числа входных токенов.\n","tags":["Anthropic Compatible"],"security":[{"bearerAuth":[]},{"anthropicApiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string"},"messages":{"type":"array","items":{"type":"object"}},"system":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"object"}}]},"tools":{"type":"array","items":{"type":"object"}}}}}}},"responses":{"200":{"description":"Token estimate / Оценка токенов","content":{"application/json":{"schema":{"type":"object","properties":{"inputTokens":{"type":"integer"}}}}}},"401":{"description":"Missing or invalid key / Нет ключа или ключ неверный"}}}},"/anthropic/v1/models":{"get":{"summary":"List text models / Список текстовых моделей","description":"Lists Bothub text models available to the key, in the Anthropic Models API format.\n\nСписок текстовых моделей Bothub, доступных по ключу, в формате Anthropic Models API.\n","tags":["Anthropic Compatible"],"security":[{"bearerAuth":[]},{"anthropicApiKey":[]}],"responses":{"200":{"description":"Model list / Список моделей","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","example":"model"},"id":{"type":"string"},"displayName":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}}},"hasMore":{"type":"boolean"},"firstId":{"type":"string","nullable":true},"lastId":{"type":"string","nullable":true}}}}}},"401":{"description":"Missing or invalid key / Нет ключа или ключ неверный"}}}},"/auth/oauth/consent-url":{"get":{"summary":"Get OAuth consent URL / Получить URL согласия OAuth","description":"Returns the OAuth provider consent URL and optional PKCE code verifier.\n\nВозвращает URL страницы согласия OAuth-провайдера и опциональный codeVerifier для PKCE.\n","tags":["Auth"],"produces":["application/json"],"parameters":[{"name":"provider","in":"query","required":true,"type":"string"},{"name":"redirectUri","in":"query","required":true,"type":"string"}],"responses":{"200":{"description":"Consent URL.","content":{"application/json":{"schema":{"properties":{"consentURL":{"type":"string"},"codeVerifier":{"type":"string"}}}}}}}}},"/auth/oauth":{"post":{"summary":"Authorize with OAuth / Авторизация через OAuth","description":"Exchanges an OAuth authorization code for user access and refresh tokens.\n\nОбменивает код авторизации OAuth на токены доступа пользователя.\n","tags":["Auth"],"produces":["application/json"],"requestBody":{"in":"body","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/oauthAuthorize"}}}},"responses":{"200":{"description":"Authorized user.","content":{"application/json":{"schema":{"properties":{"user":{"$ref":"#/components/entities/User"},"accessToken":{"type":"string"},"refreshToken":{"type":"string"}}}}}}}}},"/auth/altcha/challenge":{"get":{"summary":"Get ALTCHA challenge / Получить challenge ALTCHA","description":"Returns a proof-of-work challenge for the ALTCHA widget.\n\nВозвращает proof-of-work challenge для виджета ALTCHA.\n","tags":["Auth"],"produces":["application/json"],"responses":{"200":{"description":"ALTCHA challenge.","content":{"application/json":{"schema":{"properties":{"algorithm":{"type":"string"},"challenge":{"type":"string"},"salt":{"type":"string"},"signature":{"type":"string"},"maxnumber":{"type":"number"}}}}}}}}},"/auth/signin":{"post":{"summary":"Sign in with email / Вход по email","description":"Authenticates a user with their email and password, returning tokens.\n\nАутентифицирует пользователя по email и паролю, возвращая токены доступа.\n","tags":["Auth"],"produces":["application/json"],"requestBody":{"in":"body","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/emailAuth"}}}},"responses":{"200":{"description":"Authorized user.","content":{"application/json":{"schema":{"properties":{"user":{"$ref":"#/components/entities/User"},"accessToken":{"type":"string"},"refreshToken":{"type":"string"}}}}}}}}},"/auth/signup":{"post":{"summary":"Sign up with email / Регистрация по email","description":"Creates a new user account using email and password.\n\nСоздаёт новый аккаунт пользователя по email и паролю.\n","tags":["Auth"],"produces":["application/json"],"requestBody":{"in":"body","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/signUp"}}}},"responses":{"200":{"description":"Created user.","content":{"application/json":{"schema":{"properties":{"user":{"$ref":"#/components/entities/User"}}}}}}}}},"/auth/refresh":{"post":{"summary":"Refresh token / Обновить токен","description":"Issues a new access token and rotates the refresh token using a valid refresh token.\n\nВыдаёт новый access-токен и обновляет refresh-токен по действующему refresh-токену.\n","tags":["Auth"],"produces":["application/json"],"requestBody":{"in":"body","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/refreshToken"}}}},"responses":{"200":{"description":"Authorized user.","content":{"application/json":{"schema":{"properties":{"accessToken":{"type":"string"},"refreshToken":{"type":"string"},"user":{"$ref":"#/components/entities/User"}}}}}}}}},"/auth/telegram":{"post":{"summary":"Authorize with Telegram / Авторизация через Telegram","description":"Authenticates or registers a user via the Telegram bot.\n\nАутентифицирует или регистрирует пользователя через Telegram-бота.\n","tags":["Auth"],"produces":["application/json"],"parameters":[{"name":"botsecretkey","in":"header","required":true,"type":"string"}],"requestBody":{"in":"body","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/telegramAuthorize"}}}},"responses":{"200":{"description":"Authorized user.","content":{"application/json":{"schema":{"properties":{"user":{"$ref":"#/components/entities/User"},"accessToken":{"type":"string"}}}}}}}}},"/auth/request-reset-password":{"post":{"summary":"Request password reset / Запрос сброса пароля","description":"Sends a password reset link to the user's email address.\n\nОтправляет ссылку для сброса пароля на email пользователя.\n","tags":["Auth"],"produces":["application/json"],"requestBody":{"in":"body","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/sendResetLink"}}}},"responses":{"200":{"description":"Email sent."}}}},"/auth/reset-password":{"post":{"summary":"Reset password / Сбросить пароль","description":"Resets the user's password using a valid reset token.\n\nСбрасывает пароль пользователя по действующему токену сброса.\n","tags":["Auth"],"produces":["application/json"],"requestBody":{"in":"body","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/resetPassword"}}}},"responses":{"200":{"description":"Password reset."}}}},"/auth/telegram-connection-token":{"get":{"summary":"Generate Telegram connection token / Сгенерировать токен подключения Telegram","description":"Generates a one-time token used to link a Telegram account.\n\nГенерирует одноразовый токен для привязки Telegram-аккаунта.\n","tags":["Auth"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"telegramConnectionToken":{"type":"string"}}}}}}}}},"/auth/connect-telegram":{"post":{"summary":"Connect Telegram account / Привязать Telegram-аккаунт","description":"Links a Telegram account to the authenticated user using a connection token.\n\nПривязывает Telegram-аккаунт к авторизованному пользователю по токену подключения.\n","tags":["Auth"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"requestBody":{"in":"body","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/connectTelegram"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/User"}}}}}}},"/auth/telegram-unlink-token":{"get":{"summary":"Generate Telegram unlink token / Токен отвязки Telegram","description":"Generates a one-time token used to unlink a Telegram account.\n\nГенерирует одноразовый токен для отвязки Telegram-аккаунта.\n","tags":["Auth"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"telegramUnlinkToken":{"type":"string"}}}}}}}}},"/auth/unlink-telegram":{"post":{"summary":"Unlink Telegram account / Отвязать Telegram-аккаунт","description":"Unlinks a Telegram account from the authenticated user.\n\nОтвязывает Telegram-аккаунт от авторизованного пользователя.\n","tags":["Auth"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"requestBody":{"in":"body","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/unlinkTelegram"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/User"}}}}}}},"/auth/verify-email":{"post":{"summary":"Verify email address / Подтвердить email","description":"Verifies the user's email address using the confirmation code.\n\nПодтверждает email-адрес пользователя с помощью кода подтверждения.\n","tags":["Auth"],"produces":["application/json"],"requestBody":{"in":"body","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/verifyEmail"}}}},"responses":{"200":{"description":"Email verified."}}}},"/auth/receive-emails":{"post":{"summary":"Toggle email notifications / Включить/выключить email-уведомления","description":"Subscribes or unsubscribes the user from marketing email notifications.\n\nПодписывает или отписывает пользователя от маркетинговых email-уведомлений.\n","tags":["Auth"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"requestBody":{"in":"body","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/toggleReceiveEmails"}}}},"responses":{"200":{"description":"Updated subscription.","content":{"application/json":{"schema":{"type":"object","properties":{"subscription":{"$ref":"#/components/entities/Subscription"}}}}}}}}},"/auth/me":{"get":{"summary":"Get current user / Получить текущего пользователя","description":"Returns the profile of the currently authenticated user.\n\nВозвращает профиль текущего авторизованного пользователя.\n","tags":["Auth"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/User"}}}}}}},"/auth/encryption/enable":{"post":{"summary":"Enable encryption / Включить шифрование","description":"Enables end-to-end encryption for the user, returns new tokens.\n\nВключает шифрование для пользователя, возвращает новые токены.\n","tags":["Auth"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["password"],"properties":{"password":{"type":"string"}}}}}},"responses":{"200":{"description":"New access token and refresh token","content":{"application/json":{"schema":{"properties":{"accessToken":{"type":"string"},"refreshToken":{"type":"string"}}}}}}}}},"/auth/change-password":{"post":{"summary":"Change password / Изменить пароль","description":"Changes the user's password and returns new access and refresh tokens.\n\nИзменяет пароль пользователя и возвращает новые токены доступа.\n","tags":["Auth"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["oldPassword","newPassword"],"properties":{"oldPassword":{"type":"string"},"newPassword":{"type":"string"}}}}}},"responses":{"200":{"description":"New access token and refresh token","content":{"application/json":{"schema":{"properties":{"accessToken":{"type":"string"},"refreshToken":{"type":"string"}}}}}}}}},"/auth/update-yandex-metric":{"patch":{"summary":"Update Yandex Metric data / Обновить данные Яндекс.Метрики","description":"Stores Yandex Metric client ID and yclid for analytics attribution.\n\nСохраняет clientId и yclid Яндекс.Метрики для атрибуции в аналитике.\n","tags":["Auth"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"yandexMetricClientId":{"type":"string","nullable":true},"yandexMetricYclid":{"type":"string","nullable":true}}}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/User"}}}}}}},"/auth/logout":{"post":{"summary":"Logout / Выйти из системы","description":"Invalidates the current refresh token, logging the user out of this session.\n\nИнвалидирует текущий refresh токен, завершая сессию пользователя.\n","tags":["Auth"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"requestBody":{"in":"body","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/logout"}}}},"responses":{"200":{"description":"Successfully logged out.","content":{"application/json":{"schema":{"properties":{"message":{"type":"string"}}}}}}}}},"/auth/logout-all":{"get":{"summary":"Logout all sessions / Выйти со всех устройств","description":"Invalidates all active refresh tokens for the user across all devices.\n\nИнвалидирует все активные refresh токены пользователя на всех устройствах.\n","tags":["Auth"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"}}}}}}}}},"/chat":{"post":{"summary":"Create a new chat / Создать новый чат","description":"Creates a new chat for the authenticated user.\nPass `temporary: true` to create a chat that is hidden from history.\nPass `assistantId` to apply the assistant's preset settings immediately,\nusing the same logic as `POST /preset/{id}/chat`.\nThe client should persist `id` in sessionStorage and pass it as `chatId` on\n`/chat/initial` to resume after reload. Temporary chats are deleted on logout\nor by idle TTL.\n\nСоздаёт новый чат для авторизованного пользователя.\nПередайте `temporary: true`, чтобы создать чат, который не попадает в историю.\nПередайте `assistantId`, чтобы сразу применить настройки ассистента —\nтой же логикой, что и `POST /preset/{id}/chat`.\nКлиент сохраняет `id` в sessionStorage и передаёт его как `chatId` в\n`/chat/initial` после reload. Temporary-чаты удаляются при логауте или по TTL.\n","security":[{"bearerAuth":[]}],"tags":["Chat"],"produces":["application/json"],"requestBody":{"in":"body","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/createChat"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/Chat"}}}}}},"delete":{"summary":"Delete multiple chats / Удалить несколько чатов","description":"Deletes multiple chats by their IDs in a single request.\n\nУдаляет несколько чатов по списку ID в одном запросе.\n","security":[{"bearerAuth":[]}],"tags":["Chat"],"produces":["application/json"],"parameters":[{"name":"ids","in":"body","required":true,"type":"array","items":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/entities/Chat"}}}}}}}},"/chat/except":{"delete":{"summary":"Delete all chats except specified / Удалить все чаты, кроме указанных","description":"Deletes all chats and groups except those whose IDs are passed in idsToKeep / groupIdsToKeep.\n\nУдаляет все чаты и группы, кроме тех, чьи ID переданы в idsToKeep / groupIdsToKeep.\n","security":[{"bearerAuth":[]}],"tags":["Chat"],"produces":["application/json"],"parameters":[{"name":"idsToKeep","in":"body","required":true,"type":"array","items":{"type":"string"}},{"name":"groupIdsToKeep","in":"body","type":"array","items":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/entities/Chat"}}}}}}}},"/chat/{id}":{"get":{"summary":"Get chat by ID / Получить чат по ID","description":"Returns a single chat by its identifier.\n\nВозвращает отдельный чат по его идентификатору.\n","security":[{"bearerAuth":[]}],"tags":["Chat"],"produces":["application/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/Chat"}}}}}},"patch":{"summary":"Update chat / Обновить чат","description":"Updates the title or other properties of an existing chat.\n\nОбновляет название или другие свойства существующего чата.\n","tags":["Chat"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"requestBody":{"in":"body","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/updateChat"}}}},"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/Chat"}}}}}},"delete":{"summary":"Delete chat by ID / Удалить чат по ID","description":"Permanently deletes a single chat by its identifier.\n\nБезвозвратно удаляет чат по его идентификатору.\n","security":[{"bearerAuth":[]}],"tags":["Chat"],"produces":["application/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/Chat"}}}}}}},"/chat/list":{"get":{"summary":"List chats / Список чатов","description":"Returns a paginated list of chats. Supports filtering by group and search query.\n\nВозвращает пагинированный список чатов. Поддерживает фильтрацию по группе и поисковому запросу.\n","tags":["Chat"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"page","in":"query","type":"number"},{"name":"groupId","in":"query","type":"string"},{"name":"search","in":"query","type":"string"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"type":"array","items":{"$ref":"#/components/entities/Chat"}},"pages":{"type":"number"}}}}}}}}},"/chat/initial":{"get":{"summary":"Get user’s initial chat / Получить начальный чат пользователя","description":"Returns the default/initial chat for the authenticated user.\nFor a temporary chat, pass `chatId` from sessionStorage to resume the same\ndialog after reload. Without `chatId` a new temporary chat is created.\n\nВозвращает начальный (дефолтный) чат авторизованного пользователя.\nДля temporary-чата передайте `chatId` из sessionStorage, чтобы продолжить\nтот же диалог после reload. Без `chatId` создаётся новый temporary-чат.\n","security":[{"bearerAuth":[]}],"tags":["Chat"],"produces":["application/json"],"parameters":[{"name":"temporary","in":"query","type":"boolean","description":"Return or create a temporary chat scoped to the browser tab session"},{"name":"chatId","in":"query","type":"string","format":"uuid","description":"Temporary chat id from sessionStorage. If missing or unknown, a new temporary chat is created"},{"name":"presetId","in":"query","type":"string","format":"uuid","description":"Assistant preset id. Applies the assistant's prompt, model and attachments to the chat once (skipped if already applied)"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/Chat"}}}}}}},"/chat/{id}/clear-context":{"put":{"summary":"Clear chat context / Очистить контекст чата","description":"Clears the message history used as AI context for the specified chat.\n\nОчищает историю сообщений, используемую как контекст ИИ в указанном чате.\n","tags":["Chat"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"201":{"description":"Successful request"}}}},"/chat/{id}/restore-context":{"put":{"summary":"Restore chat context / Восстановить контекст чата","description":"Restores the message history prior to the last clear, used as AI context in the specified chat.\n\nВосстанавливает историю сообщений до последнего сброса, используемую как контекст ИИ в указанном чате.\n","tags":["Chat"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"201":{"description":"Successful request"}}}},"/chat/{id}/context/summarize":{"post":{"summary":"Summarize (compact) chat context / Сжать контекст чата","description":"Summarizes all but the last few messages, excludes them from future AI context, and keeps them visible.\n\nСуммаризирует все сообщения, кроме последних, исключает их из контекста ИИ и оставляет видимыми.\n","tags":["Chat"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"Successful request"}}}},"/chat/{id}/settings":{"get":{"summary":"Get chat settings / Настройки чата","description":"Returns settings for the specified chat. Use query params all or elements to control which settings are returned.\n\nВозвращает настройки чата. Параметры all и elements управляют набором возвращаемых настроек.\n","tags":["Chat"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"},{"name":"all","in":"query","type":"boolean"},{"name":"elements","in":"query","type":"boolean"}],"responses":{"200":{"description":"Successful request"}}},"patch":{"summary":"Update chat settings / Обновить настройки чата","description":"Updates one or more settings for the specified chat. Accepts multipart form data with a value[] array.\n\nОбновляет одну или несколько настроек указанного чата. Принимает multipart/form-data с массивом value[].\n","tags":["Chat"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/updateChatSettings"}}}},"responses":{"200":{"description":"Successful request"}}}},"/chat/{id}/generation-cost":{"get":{"summary":"Generation cost for current chat settings / Стоимость генерации по текущим настройкам","description":"Returns how many CAPS the next generation in this chat will cost with the settings it has\nright now (model, duration, resolution, audio, mode, fps, reference videos) and whether the\nbalance covers it. The price is not recalculated here: it is the same value the send flow\nreserves and writes off, including the account multiplicator and rounding. If prompt\ntranslation is needed for the model, it is billed on top of this amount.\nOnly video chats are priced: for any other modality `supported` is false and `caps` is null.\n\nВозвращает стоимость следующей генерации в этом чате при текущих настройках\n(модель, длительность, разрешение, звук, режим, fps, референсные видео) и признак того,\nхватает ли баланса. Цена не пересчитывается заново — это то же значение, которое\nрезервируется и списывается при отправке, вместе с множителем аккаунта и округлением.\nЕсли модели нужен перевод промпта, он списывается дополнительно.\nСчитается только для видео-чатов: для остальных модальностей `supported` = false,\n`caps` = null.\n","tags":["Chat"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"},{"name":"platform","in":"query","type":"string"}],"responses":{"200":{"description":"Successful request","content":{"application/json":{"schema":{"type":"object","properties":{"modality":{"type":"string","nullable":true,"enum":["VIDEO"]},"supported":{"type":"boolean"},"modelId":{"type":"string","nullable":true},"caps":{"type":"number","nullable":true},"balance":{"type":"number"},"reservedCaps":{"type":"number"},"hasEnoughBalance":{"type":"boolean"},"reason":{"type":"string","nullable":true},"reasonCode":{"type":"string","nullable":true},"settings":{"type":"object","nullable":true}}}}}}}}},"/chat/{id}/stream":{"get":{"summary":"Chat SSE event stream / SSE-поток событий чата","description":"Server-sent events stream for a chat. Returns real-time ChatEvent objects as the AI generates a response.\n\nSocket.IO (cookie auth, one connection per tab, subscribe per chat) is also available at the same path without `:id`: `/api/v2/chat/stream`.\n\nSSE-поток реального времени для чата. Возвращает объекты ChatEvent по мере генерации ответа ИИ.\n","security":[{"bearerAuth":[]}],"tags":["Chat"],"produces":["text/event-stream"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"200":{"content":{"text/event-stream":{"schema":{"$ref":"#/components/entities/ChatEvent"}}}}}}},"/chat/{id}/stop":{"post":{"summary":"Stop chat generation / Остановить генерацию в чате","description":"Stops the currently running AI generation in the specified chat.\n\nОстанавливает текущую генерацию ИИ в указанном чате.\n","security":[{"bearerAuth":[]}],"tags":["Chat"],"produces":["application/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"Successful request"}}}},"/chat/{id}/branch":{"post":{"summary":"Branch chat from a message / Создать ветку чата от сообщения","description":"Creates a new chat immediately and clones history in a background BRANCH_CHAT job.\nThe source chat is not modified. Subscribe to the new chat stream and wait for JOB_DONE.\n\nСразу создаёт новый чат и клонирует историю фоновой джобой BRANCH_CHAT.\nИсходный чат не меняется. На новом чате слушайте JOB_DONE и перезапросите сообщения.\n","tags":["Chat"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/branchChat"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"chat":{"$ref":"#/components/entities/Chat"},"job":{"$ref":"#/components/entities/Job"}}}}}}}}},"/dev/key/sign":{"post":{"summary":"Create API key / Создать API-ключ","description":"Creates a new developer API key for authenticating API requests.\n\nСоздаёт новый API-ключ разработчика для аутентификации запросов к API.\n","tags":["Developer Keys"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","description":"Optional label for the API key"},"scopes":{"type":"array","items":{"type":"string","enum":["rag"]},"description":"Optional scopes for the API key"},"providerType":{"type":"string","enum":["ECO","PRO"],"nullable":true,"description":"Provider mode for this key. Omit or null to follow the account setting.\n\nРежим провайдера для этого ключа. Не задан или null - берётся настройка аккаунта.\n"},"ecoProFallback":{"type":"boolean","default":true,"description":"For an ECO key: when ECO providers fail or do not start answering in time,\nthe request goes to a PRO provider and is billed at the PRO price.\n\nДля ECO-ключа: если ECO-провайдеры недоступны или не начали отвечать вовремя,\nзапрос уходит на PRO-провайдера и списывается по цене PRO.\n"}}}}}},"responses":{"200":{"description":"Created API key","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"key":{"type":"string","description":"The API key value"},"scopes":{"type":"array","items":{"type":"string"}},"userId":{"type":"string","format":"uuid"},"label":{"type":"string"},"providerType":{"type":"string","enum":["ECO","PRO"],"nullable":true},"ecoProFallback":{"type":"boolean"},"deleted":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}}}}}}}}},"/dev/key/list":{"get":{"summary":"List API keys / Список API-ключей","description":"Returns all developer API keys for the current user.\n\nВозвращает все API-ключи разработчика текущего пользователя.\n","tags":["Developer Keys"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"List of API keys","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"key":{"type":"string","description":"The API key value"},"scopes":{"type":"array","items":{"type":"string"}},"userId":{"type":"string","format":"uuid"},"label":{"type":"string"},"providerType":{"type":"string","enum":["ECO","PRO"],"nullable":true},"ecoProFallback":{"type":"boolean"},"deleted":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}}}}}}}}}},"/dev/key/{id}":{"patch":{"summary":"Update API key / Обновить API-ключ","description":"Updates the name, the provider mode and/or the ECO→PRO fallback of an existing developer API key. At least one field is required.\n\nОбновляет название, режим провайдера и/или переход с ECO на PRO у существующего API-ключа. Нужно передать хотя бы одно поле.\n","tags":["Developer Keys"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","description":"New name for the API key"},"providerType":{"type":"string","enum":["ECO","PRO"],"nullable":true,"description":"Provider mode for this key, null resets it to the account setting.\n\nРежим провайдера для этого ключа, null возвращает настройку аккаунта.\n"},"ecoProFallback":{"type":"boolean","default":true,"description":"For an ECO key: when ECO providers fail or do not start answering in time,\nthe request goes to a PRO provider and is billed at the PRO price.\n\nДля ECO-ключа: если ECO-провайдеры недоступны или не начали отвечать вовремя,\nзапрос уходит на PRO-провайдера и списывается по цене PRO.\n"}}}}}},"responses":{"200":{"description":"Updated API key","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"key":{"type":"string","description":"The API key value"},"scopes":{"type":"array","items":{"type":"string"}},"userId":{"type":"string","format":"uuid"},"label":{"type":"string"},"providerType":{"type":"string","enum":["ECO","PRO"],"nullable":true},"ecoProFallback":{"type":"boolean"},"deleted":{"type":"boolean"},"createdAt":{"type":"string","format":"date-time"}}}}}}}},"delete":{"summary":"Delete API key / Удалить API-ключ","description":"Deletes a single developer API key by ID.\n\nУдаляет один API-ключ разработчика по его идентификатору.\n","tags":["Developer Keys"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Key deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}}}},"/dev/key":{"delete":{"summary":"Delete multiple API keys / Удалить несколько API-ключей","description":"Deletes multiple developer API keys by their IDs.\n\nУдаляет несколько API-ключей разработчика по их идентификаторам.\n","tags":["Developer Keys"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","items":{"type":"string"},"description":"Array of API key IDs to delete"}}}}}},"responses":{"200":{"description":"Keys deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}}}}}}}},"/gift-certificate/create":{"post":{"summary":"Create gift certificate / Создать подарочный сертификат","description":"Creates a new gift certificate with the specified amount.\n\nСоздаёт новый подарочный сертификат на указанную сумму.\n","tags":["Gift Certificate"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"requestBody":{"in":"body","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/create"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"},"required":["amount"],"properties":{"amount":{"type":"string"}}}}}}}},"/gift-certificate/activate":{"post":{"summary":"Activate gift certificate / Активировать подарочный сертификат","description":"Activates a gift certificate using the provided code and applies the balance to the user account.\n\nАктивирует подарочный сертификат по коду и зачисляет баланс на аккаунт пользователя.\n","tags":["Gift Certificate"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"requestBody":{"in":"body","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/activate"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"certificate":{"type":"object","required":["amount","plan"],"properties":{"amount":{"type":"number"},"plan":{"type":"number"}}}}}}}}}}},"/message/send":{"post":{"summary":"Send message / Отправить сообщение","description":"Sends a message to a chat and returns the created message entity.\nFor speech-to-speech models (ElevenLabs Voice Changer) attach the audio to convert\nin the `audio` field; the voice sample is taken from the chat settings file,\nwithout it the audio is converted into the default ElevenLabs voice.\n\nОтправляет сообщение в чат и возвращает созданную сущность сообщения.\nДля speech-to-speech моделей (ElevenLabs Voice Changer) аудио для преобразования\nпередаётся в поле `audio`, образец голоса берётся из файла в настройках чата,\nбез него аудио преобразуется в стандартный голос ElevenLabs.\n","tags":["Message"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/sendMessage"}}}},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/Message"}}}}}}},"/message/chat-prompt-queue":{"post":{"summary":"Queue message for generation (SSE) / Поставить сообщение в очередь (SSE)","description":"Queues a message for AI generation and streams progress via SSE. Returns queueId and progress events.\n\nПомещает сообщение в очередь генерации ИИ и транслирует прогресс через SSE. Возвращает queueId и события прогресса.\n","tags":["Message"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/chatPromptQueue"}}}},"responses":{"200":{"description":"SSE‑соединение с прогрессом генерации","content":{"text/event-stream":{"schema":{"type":"string"},"example":"data: {\"queueId\":\"123e4567-e89b-12d3-a456-426614174000\"}\ndata: {\"percent\":33}\ndata: {\"percent\":100,\"done\":true}\n[DONE]\n"}}}}}},"/message/output-file-prompt-queue":{"post":{"summary":"Queue message and stream result as file (SSE) / Очередь + вывод результата в файл (SSE)","description":"Queues a message for AI generation, streams progress via SSE, and returns a ZIP file path on completion.\n\nПомещает сообщение в очередь, транслирует прогресс через SSE и по завершении возвращает путь к ZIP-файлу.\n","tags":["Message"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/outputFilePromptQueue"}}}},"responses":{"200":{"description":"SSE‑соединение с прогрессом генерации и ссылкой на ZIP","content":{"text/event-stream":{"schema":{"type":"string"},"example":"data: {\"queueId\":\"123e4567-e89b-12d3-a456-426614174000\"}\ndata: {\"percent\":33}\ndata: {\"percent\":100,\"done\":true,\"zipFilePath\":\"/tmp/responses_abc123.zip\"}\n[DONE]\n"}}}}}},"/message/prompt-queue/{id}/stream":{"get":{"summary":"Stream prompt queue progress / SSE-поток прогресса очереди","description":"Server-sent events stream for a specific prompt queue job, returning PromptQueueEvent objects.\n\nSSE-поток для конкретной задачи в очереди. Возвращает объекты PromptQueueEvent.\n","security":[{"bearerAuth":[]}],"tags":["Message"],"produces":["text/event-stream"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"200":{"content":{"text/event-stream":{"schema":{"$ref":"#/components/entities/PromptQueueEvent"}}}}}}},"/message/queue-cancel":{"post":{"summary":"Cancel queued message / Отменить сообщение в очереди","description":"Cancels a pending or in-progress queue job by its queueId.\n\nОтменяет ожидающуюся или выполняющуюся задачу очереди по её queueId.\n","tags":["Message"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["queueId"],"properties":{"queueId":{"type":"string"}}}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"queueId":{"type":"string","description":"ID of the cancelled queue job"}}}}}}}}},"/message/switch/next/{id}":{"post":{"summary":"Switch to next message variant / Переключиться на следующий вариант ответа","description":"Switches to the next regenerated variant of a message.\n\nПереключается на следующий перегенерированный вариант сообщения.\n","tags":["Message"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/Message"}}}}}}},"/message/switch/previous/{id}":{"post":{"summary":"Switch to previous message variant / Переключиться на предыдущий вариант ответа","description":"Switches to the previous regenerated variant of a message.\n\nПереключается на предыдущий перегенерированный вариант сообщения.\n","tags":["Message"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/Message"}}}}}}},"/message/button/{buttonId}/click":{"post":{"summary":"Click message button / Нажать кнопку в сообщении","description":"Registers a button click action on an interactive message.\n\nРегистрирует нажатие кнопки в интерактивном сообщении.\n","tags":["Message"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"buttonId","in":"path","required":true,"type":"string"}],"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/MessageButton"}}}}}}},"/message/list":{"get":{"summary":"List chat messages / Список сообщений чата","description":"Returns a paginated list of messages for a given chat, including related transaction info.\n\nВозвращает пагинированный список сообщений чата, включая связанные транзакции.\n","tags":["Message"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"chatId","in":"query","required":true,"type":"string"},{"name":"page","in":"query","type":"number"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"type":"array","items":{"allOf":[{"$ref":"#/components/entities/Message"},{"type":"object","properties":{"transaction":{"$ref":"#/components/entities/Transaction"}}}]}},"pages":{"type":"number"}}}}}}}}},"/message/list-all":{"get":{"summary":"List all chat messages / Все сообщения чата","description":"Returns all messages for a given chat without pagination.\n\nВозвращает все сообщения указанного чата без пагинации.\n","tags":["Message"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"chatId","in":"query","required":true,"type":"string"}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"$ref":"#/components/entities/Message"},{"type":"object"}]}}}}}}}},"/message/{id}":{"get":{"summary":"Get message by ID / Получить сообщение по ID","description":"Returns a single message by its identifier.\n\nВозвращает отдельное сообщение по его идентификатору.\n","tags":["Message"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/Message"}}}}}},"patch":{"summary":"Update message / Обновить сообщение","description":"Updates selected message fields and returns updated message entity.\n\nОбновляет выбранные поля сообщения и возвращает обновленную сущность сообщения.\n","tags":["Message"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"requestBody":{"required":false,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"content":{"type":"string"},"files":{"type":"array","items":{"type":"string","format":"binary"}},"audio":{"type":"array","items":{"type":"string","format":"binary"}},"video":{"type":"array","items":{"type":"string","format":"binary"}},"keepAttachmentIds":{"type":"array","items":{"type":"string"}},"keepAudioFileIds":{"type":"array","items":{"type":"string"}},"keepVideoFileIds":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/Message"}}}}}}},"/message/feedback":{"post":{"tags":["Message"],"summary":"Rate model answer / Оценить ответ модели","description":"Creates or updates the current user's like/dislike for an assistant message.\n\nСоздаёт или обновляет лайк/дизлайк текущего пользователя на ответ модели.\n","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/upsertMessageFeedback"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/MessageFeedback"}}}}}},"delete":{"tags":["Message"],"summary":"Remove answer rating / Убрать оценку ответа","description":"Removes the current user's like/dislike from a message.\n\nУдаляет лайк/дизлайк текущего пользователя с сообщения.\n","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["messageId"],"properties":{"messageId":{"type":"string"}}}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/MessageFeedback"}}}}}}},"/message/report":{"delete":{"tags":["Message"],"summary":"Delete message report / Удалить репорт на сообщение","description":"Deletes a NEW report by its id.\n\nУдаляет репорт в статусе NEW по его id.\n","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["reportId"],"properties":{"reportId":{"type":"string","description":"Report ID to delete."}}}}}},"responses":{"200":{"description":"Deleted successfully","content":{"application/json":{"schema":{"$ref":"#/components/entities/Report"}}}}}}},"/message/report/list":{"post":{"tags":["Message"],"summary":"List chat reports / Список репортов чата","description":"Returns a list of all reports associated with the specified chat.\n\nВозвращает список всех репортов, связанных с указанным чатом.\n","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["chatId"],"properties":{"chatId":{"type":"string","description":"The ID of the chat for which to retrieve reports."}}}}}},"responses":{"200":{"description":"Successful response. Returns a list of reports.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/entities/Report"}}}}}}}},"/message/report/create":{"post":{"tags":["Message"],"summary":"Create message report / Создать репорт на сообщение","description":"Creates a new report for a specific message in a chat.\n\nСоздаёт новый репорт на конкретное сообщение в чате.\n","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["messageId"],"properties":{"messageId":{"type":"string","description":"The ID of the message being reported."},"description":{"type":"string","description":"User complaint text."},"fileIds":{"type":"array","items":{"type":"string"},"description":"IDs of previously uploaded image files attached to the report."}}}}}},"responses":{"200":{"description":"Successfully created the report. Returns the report entity with its id.","content":{"application/json":{"schema":{"$ref":"#/components/entities/Report"}}}}}}},"/message/{id}/stop":{"post":{"summary":"Stop background job / Остановить фоновую задачу","description":"Stops a running background job by its identifier.\n\nОстанавливает выполняющуюся фоновую задачу по её идентификатору.\n","security":[{"bearerAuth":[]}],"tags":["Message"],"produces":["application/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/Message"}}}}}}},"/message/{id}/speech":{"post":{"summary":"Speech up message / Озвучить сообщение","description":"Returns the message read aloud as an audio file. The first call synthesizes\nthe speech and charges caps, subsequent calls reuse the stored audio for free\nuntil the message text changes.\n\nВозвращает озвученное сообщение аудиофайлом. Первый вызов синтезирует речь\nи списывает капсы, последующие переиспользуют сохранённое аудио бесплатно,\nпока текст сообщения не изменился.\n","security":[{"bearerAuth":[]}],"tags":["Message"],"produces":["audio/mpeg"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"200":{"description":"Audio file with the spoken message.","content":{"audio/mpeg":{"schema":{"type":"string","format":"binary"}}}}}}},"/model/list":{"get":{"summary":"List models / Список моделей","description":"Returns available models. Can be filtered by parentId. Supports unauthenticated access.\n\nВозвращает доступные модели. Можно фильтровать по parentId. Доступен без аутентификации.\n","tags":["Model"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"parentId","in":"query","type":"number"},{"name":"locale","in":"query","type":"string"},{"name":"keywords","in":"query","type":"boolean","description":"Pass `true` to include SEO keywords in descriptions / Передайте `true`, чтобы получить SEO-ключевые слова"}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/entities/Model"}}}}}}}},"/model/list/compact":{"get":{"summary":"List models (compact) / Список моделей (компактный формат)","description":"Returns a compact list of models with key display fields: id, label, descriptions, icon, features, functions, order, usage stats, and children.\n\nВозвращает компактный список моделей с основными полями для отображения: id, label, descriptions, icon, features, functions, order, статистика и children.\n","tags":["Model"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"locale","in":"query","type":"string"},{"name":"keywords","in":"query","type":"boolean","description":"Pass `true` to include SEO keywords in descriptions / Передайте `true`, чтобы получить SEO-ключевые слова"},{"name":"fields","in":"query","type":"string","enum":["picker"],"description":"`picker` returns a lightweight catalog for the model picker: id, label, icon, features, disabled, disabledWeb, isAllowed, allowedPlanType, isDefault, popularityScore, pricing, discount, isDiscounted, one description (requested locale, else ru) with locale, name and descriptionDashboard; children also have createdAt. Without the parameter the response is unchanged.\n\n`picker` отдаёт облегчённый каталог для выбора модели: id, label, icon, features, disabled, disabledWeb, isAllowed, allowedPlanType, isDefault, popularityScore, pricing, discount, isDiscounted и одно описание (на запрошенной локали, иначе ru) с полями locale, name и descriptionDashboard; у детей ещё createdAt. Без параметра ответ прежний.\n"}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"type":"object"},{"properties":{"id":{"type":"string"},"label":{"type":"string"},"descriptions":{"type":"array","items":{"$ref":"#/components/entities/ModelDescription"}},"icon":{"type":"string"},"features":{"type":"array","items":{"type":"string"}},"functions":{"type":"array","items":{"$ref":"#/components/entities/ModelFunction"}},"order":{"type":"number"},"usedCount":{"type":"number"},"popularityScore":{"type":"number"},"disabled":{"type":"boolean"},"disabledWeb":{"type":"boolean"},"disabledApi":{"type":"boolean"},"isAllowed":{"type":"boolean"},"allowedPlanType":{"type":"string"},"isDefault":{"type":"boolean","description":"Default text model of the plan / Дефолтная текстовая модель тарифа"},"defaultFor":{"type":"string","nullable":true,"enum":["TEXT","IMAGE","VIDEO","MUSIC","SPEECH","STT","IVC","EMBEDDING","RERANKER"],"description":"Modality the model is the plan default for / Модальность, в которой модель дефолтная в тарифе"},"pricing":{"type":"object","nullable":true},"discount":{"type":"number"},"isDiscounted":{"type":"boolean"},"children":{"type":"array","items":{"type":"object"}}}}]}}}}}}}},"/openai/v1/chat/completions":{"post":{"summary":"Create chat completion / Создать чат-ответ модели","description":"Creates a model response for the given chat conversation.\nCompatible with the OpenAI Chat Completions API.\nSupports both synchronous and streaming responses via SSE.\n\nВозвращает ответ по переданному диалогу. Совместим с OpenAI Chat Completions API.\nПоддерживает синхронные и потоковые ответы через SSE.\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string","description":"ID of the model to use (e.g. gpt-4o, claude-sonnet-4, gemini-2.5-pro)"},"messages":{"type":"array","description":"A list of messages comprising the conversation","items":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant","tool"]},"content":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"object"}}]}}}},"stream":{"type":"boolean","default":false,"description":"If true, returns a stream of Server-Sent Events"},"temperature":{"type":"number","description":"Sampling temperature (0-2)"},"maxTokens":{"type":"integer","description":"Maximum number of tokens to generate"},"tools":{"type":"array","description":"A list of tools the model may call","items":{"type":"object"}},"toolChoice":{"description":"Controls which tool is called by the model"},"responseFormat":{"type":"object","description":"Format of the model response (e.g. json_object)"}}}}}},"responses":{"200":{"description":"Chat completion response or SSE stream","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","example":"chat.completion"},"choices":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"message":{"type":"object","properties":{"role":{"type":"string"},"content":{"type":"string"}}},"finishReason":{"type":"string"}}}},"usage":{"type":"object","properties":{"promptTokens":{"type":"integer"},"completionTokens":{"type":"integer"},"totalTokens":{"type":"integer"}}}}}},"text/event-stream":{"schema":{"type":"string","description":"SSE stream of chat completion chunks"}}}}}}},"/openai/v1/responses":{"post":{"summary":"Create a model response / Создать ответ через Responses API","description":"Creates a model response using the Responses API format.\nSupports both synchronous and streaming responses via SSE.\n\nСоздаёт ответ в формате Responses API.\nПоддерживает синхронные и потоковые ответы через SSE.\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model"],"properties":{"model":{"type":"string","description":"ID of the model to use"},"input":{"oneOf":[{"type":"string","description":"Simple text input"},{"type":"array","description":"Structured message input","items":{"type":"object"}}]},"stream":{"type":"boolean","default":false,"description":"If true, returns a stream of Server-Sent Events"},"temperature":{"type":"number"},"maxOutputTokens":{"type":"integer"},"instructions":{"type":"string","description":"System instructions for the model"},"tools":{"type":"array","items":{"type":"object"}},"text":{"type":"object","description":"Text response format configuration"}}}}}},"responses":{"200":{"description":"Model response or SSE stream","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"output":{"type":"array","items":{"type":"object"}},"usage":{"type":"object"}}}},"text/event-stream":{"schema":{"type":"string","description":"SSE stream of response events"}}}}}}},"/openai/v1/images/generations":{"post":{"summary":"Create image / Создать изображение","description":"Creates an image based on a prompt. Compatible with the OpenAI Images API format.\nWorks across all served providers (routing by model). Model-specific parameters are\naccepted as-is and passed to the provider; the exhaustive list per model is available\nvia GET /openai/v1/images/models.\n\nСоздаёт изображение на основе промпта в формате, совместимом с OpenAI Images API.\nРаботает для всех обслуживаемых провайдеров (маршрутизация по модели). Параметры,\nспецифичные для модели, принимаются как есть; полный список параметров каждой модели —\nчерез GET /openai/v1/images/models.\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"schema":{"type":"string"},"description":"Best-effort idempotency key (max 64 chars, [A-Za-z0-9_-]). It scopes the\npre-generation balance reservation so concurrent or retried requests with the\nsame key share a single hold. Note: responses are NOT stored — a retry after a\ncompleted generation will generate and bill again. For once-only semantics do\nnot retry a request that may already have succeeded.\n"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","prompt"],"properties":{"model":{"type":"string","description":"ID of the model to use","default":"gpt-image-1"},"prompt":{"type":"string","description":"Text prompt describing the desired image","default":"flower"},"n":{"type":"integer","description":"Number of images to generate","default":1},"responseFormat":{"type":"string","enum":["url","b64_json"],"description":"Return images as stored URLs or base64. Defaults to b64_json.","default":"b64_json"},"inputImages":{"type":"array","description":"BotHub extension (not part of the OpenAI /generations spec): input image\nURLs or data: URIs for image-to-image. Only accepted by models with\nsupports_image_input=true (see GET /images/models); other models reject it\nwith 400 IMAGE_EDIT_NOT_SUPPORTED (no charge). For OpenAI-SDK compatibility\nuse POST /images/edits (multipart). Billed by the provider — input image\ntokens for gpt-image/gemini, megapixels for replicate.\n\nInpainting/fill models (supports_mask=true in GET /images/models) require\nTWO images: input_images[0] is the source image, input_images[1] is the mask\n(white marks the area to change, black stays intact). Sending only one image\nto such a model returns 400 IMAGE_MASK_REQUIRED (no charge).\n","items":{"type":"string"}},"size":{"type":"string","description":"Image size","default":"1024x1024"},"quality":{"type":"string","description":"Omit it and the provider picks its own default: gpt-image models fall back\nto `auto`, which renders at `high` and costs about 15x of `low`.\nPass `low`, `medium` or `high` explicitly to control the price.\n"},"background":{"type":"string","default":"transparent"},"moderation":{"type":"string","default":"auto"},"outputCompression":{"type":"integer","description":"Compression level for jpeg/webp output","default":100},"outputFormat":{"type":"string","default":"png"},"user":{"type":"string","description":"Unique user identifier"},"bothub":{"type":"object","properties":{"includeUsage":{"type":"boolean","description":"Include information about spent caps into usage property of response object"}}}}}}}},"responses":{"200":{"description":"Image generation result","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"integer"},"background":{"type":"string"},"outputFormat":{"type":"string"},"quality":{"type":"string"},"size":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"b64Json":{"type":"string"},"url":{"type":"string"}}}},"usage":{"type":"object","properties":{"inputTokens":{"type":"integer"},"inputTokensDetails":{"type":"object","properties":{"imageTokens":{"type":"integer"},"textTokens":{"type":"integer"}}},"outputTokens":{"type":"integer"},"outputTokensDetails":{"type":"object","properties":{"imageTokens":{"type":"integer"},"textTokens":{"type":"integer"}}},"totalTokens":{"type":"integer"},"bothub":{"type":"object","description":"Return information about spent caps only when bothub.include_usage is set to true in the request","properties":null,"caps":{"type":"number","format":"float","description":"Amount of spent caps"}}}}}}}}}}}},"/openai/v1/images/edits":{"post":{"summary":"Edit image (image-to-image) / Редактировать изображение","description":"OpenAI-compatible multipart image-to-image. Uploaded image files are forwarded to the\nmodel as reference input (equivalent to input_images on /images/generations). Works\nacross gpt-image (Azure edit), gemini, replicate and openrouter models.\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"header","name":"Idempotency-Key","required":false,"schema":{"type":"string"},"description":"Best-effort idempotency key; scopes balance reservation and replays a stored response within 24h."}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["image","model","prompt"],"properties":{"image":{"type":"string","format":"binary","description":"Input image(s) to edit. Repeat the field for multiple images."},"model":{"type":"string","default":"gpt-image-1"},"prompt":{"type":"string"},"n":{"type":"integer","default":1},"size":{"type":"string","default":"1024x1024"},"quality":{"type":"string","description":"Omit it and the provider picks its own default: gpt-image models fall back\nto `auto`, which renders at `high` and costs about 15x of `low`.\nPass `low`, `medium` or `high` explicitly to control the price.\n"},"responseFormat":{"type":"string","enum":["url","b64_json"]},"resolution":{"type":"string","enum":["1K","2K","4K"],"description":"BotHub extension for gemini/openrouter image models: output resolution\n(generationConfig.imageConfig.imageSize). 2K/4K are supported by\nnano-banana-pro / nano-banana-2 class models; classic nano-banana renders 1K.\n"},"aspectRatio":{"type":"string","enum":["1:1","2:3","3:2","3:4","4:3","4:5","5:4","16:9","9:16","21:9"],"description":"BotHub extension for gemini/openrouter image models."},"bothub":{"type":"object","properties":{"includeUsage":{"type":"boolean","description":"Include information about spent caps into usage property of response object"}}}}}}}},"responses":{"200":{"description":"Image edit result (same shape as /images/generations)"}}}},"/openai/v1/images/models":{"get":{"summary":"List image generation models / Список моделей генерации изображений","description":"Returns image-generation models served by the unified images endpoint,\nwith their available request parameters and price.\n\nВозвращает модели генерации изображений, обслуживаемые единым методом,\nс доступными параметрами запроса и ценой. Цена самоописательна через unit:\nper_image — плоская цена в caps (поле caps); token — потокенные ставки (поле rates).\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"List of available image models","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"providerId":{"type":"string","nullable":true},"supportsImageInput":{"type":"boolean","description":"Whether the model accepts input_images (image-to-image). Models with false reject input_images with 400 IMAGE_EDIT_NOT_SUPPORTED."},"requiresImageInput":{"type":"boolean","description":"Whether the model REQUIRES an input image (edit/control models like flux-kontext-*, flux-depth-*, qwen-image-edit-*). Calling without input_images fails at the provider."},"imageInputField":{"type":"string","nullable":true,"description":"The provider's native image field the first input image maps to (e.g. image, input_image, control_image, redux_image, image_prompt). Informational."},"supportsMask":{"type":"boolean","description":"Inpainting/fill models. When true, send two images — input_images[0] as the source image and input_images[1] as the mask; a single image returns 400 IMAGE_MASK_REQUIRED."},"params":{"type":"array","description":"Available request parameters with allowed values","items":{"type":"object"}},"price":{"type":"object","properties":{"unit":{"type":"string","enum":["per_image","per_megapixel","per_run","token"]},"caps":{"type":"number","nullable":true,"description":"Reference price in caps (for per_image/per_megapixel/per_run; per_megapixel/per_run computed at a default resolution)"},"unitPrice":{"type":"number","nullable":true,"description":"Price per unit in caps (per image / per megapixel / per run)"},"rates":{"type":"object","nullable":true,"description":"Per-token rates in caps (for token unit)"}}}}}}}}}}}}}},"/openai/v1/videos/generations":{"post":{"summary":"Create video / Создать видео","description":"Creates a video based on a prompt. Compatible with the OpenAI Videos API format.\n\nСоздаёт видео на основе промпта в формате, в будущем появится поддержка параметров доступных для каждой конкретной модели.\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","prompt"],"properties":{"model":{"type":"string","description":"ID of the model to use"},"imageUrl":{"type":"string","description":"image URL"},"prompt":{"type":"string","description":"Text prompt describing the desired video"},"notify":{"type":"boolean","description":"Notify the email associated with the account about the completion of generation"},"settings":{"type":"object","required":["duration_seconds"],"properties":{"durationSeconds":{"type":"number","description":"duration in seconds 4|5|6|7|8|9|10|12"}}}}}}}},"responses":{"200":{"description":"Video request","content":{"application/json":{"schema":{"$ref":"#/components/entities/VideoRequest"}}}}}}},"/openai/v1/videos/models":{"get":{"summary":"List video-capable models / Список моделей для видео запросов","description":"Returns the models that can be used in video requests, across all supported providers.\n\nВозвращает модели, которые можно использовать в видео запросах, по всем поддерживаемым провайдерам.\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"List of video-capable models","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","example":"list"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","example":"model"},"created":{"type":"integer"},"ownedBy":{"type":"string"}}}}}}}}}}}},"/openai/v1/videos/{videoId}":{"get":{"summary":"Check video request / Проверить видео запрос","description":"Returns video request status by batch request ID.\n\nВозвращает статус видео запроса по ид.\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"videoId","required":true,"schema":{"type":"string"},"description":"Video ID"}],"responses":{"200":{"description":"Video request","content":{"application/json":{"schema":{"$ref":"#/components/entities/VideoRequest"}}}}}}},"/openai/v1/music/generations":{"post":{"summary":"Create music / Создать музыку","description":"Starts a Suno music generation and returns a job; poll GET /openai/v1/music/{musicId} until\nstatus is completed or failed (usually 1-3 minutes). One generation returns two tracks and\nis billed once, when it completes.\n\nPass either `prompt` (a description, Suno writes the lyrics) or your own `lyrics` with\n`style`, `title` and the other fine-tuning fields. `prompt` cannot be combined with them.\nAn instrumental track with your own settings needs `style` or `negative_tags`.\n\nЗапускает генерацию музыки в Suno и возвращает задачу; опрашивайте\nGET /openai/v1/music/{musicId}, пока статус не станет completed или failed (обычно 1-3 минуты).\nОдна генерация даёт два трека и списывается один раз, по завершении.\n\nПередайте либо `prompt` (описание, текст Suno напишет сам), либо свой текст в `lyrics` вместе\nсо `style`, `title` и остальными параметрами. `prompt` с ними не сочетается.\nДля инструментала со своими настройками нужен `style` или `negative_tags`.\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model"],"properties":{"model":{"type":"string","description":"See GET /openai/v1/music/models","example":"suno-v6"},"externalId":{"type":"string","maxLength":128,"description":"Your own ID for the job, unique within the account. A repeated request with the\nsame external_id does not start a new generation and returns the existing job;\nonly a failed job is started again.\n\nВаш ID задачи, уникальный в пределах аккаунта. Повторный запрос с тем же\nexternal_id не запускает новую генерацию, а возвращает уже созданную задачу;\nзаново запускается только задача со статусом failed.\n","example":"order-12345"},"prompt":{"type":"string","maxLength":3000,"description":"Description of the song; Suno writes the lyrics"},"lyrics":{"type":"string","maxLength":5000,"description":"Words to sing, sections marked like [Verse], [Chorus]"},"style":{"type":"string","maxLength":1000,"description":"Genre, mood, tempo, instruments, vocals"},"title":{"type":"string","maxLength":80,"description":"Defaults to the first line of the lyrics"},"instrumental":{"type":"boolean","default":false},"negativeTags":{"type":"string","maxLength":1000,"description":"Styles to avoid"},"vocalGender":{"type":"string","enum":["male","female"]},"styleWeight":{"type":"number","minimum":0,"maximum":1},"weirdnessConstraint":{"type":"number","minimum":0,"maximum":1},"audioWeight":{"type":"number","minimum":0,"maximum":1},"duration":{"type":"integer","minimum":10,"maximum":360,"description":"Target length in seconds"},"variety":{"type":"integer","minimum":0,"maximum":4}}},"example":{"model":"suno-v6","lyrics":"[Verse]\nНеоновый свет на мокром асфальте\nГород не спит, он ждёт меня\n\n[Chorus]\nНочной город, огни до рассвета","style":"synthwave, 80s retro, 110 bpm, dreamy female vocals","title":"Ночной город","vocalGender":"female","duration":180}}}},"responses":{"200":{"description":"Music generation job","content":{"application/json":{"schema":{"$ref":"#/components/entities/MusicGeneration"}}}}}}},"/openai/v1/music/models":{"get":{"summary":"List music models / Список моделей для музыки","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"List of music models","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","example":"list"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","example":"model"},"created":{"type":"integer"},"ownedBy":{"type":"string"}}}}}}}}}}}},"/openai/v1/music/{musicId}":{"get":{"summary":"Check music generation / Проверить генерацию музыки","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"musicId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Music generation job","content":{"application/json":{"schema":{"$ref":"#/components/entities/MusicGeneration"}}}}}}},"/openai/v1/audio/transcriptions":{"post":{"summary":"Create transcription / Создать транскрипцию","description":"Transcribes audio into the input language. Supports Whisper and AssemblyAI models.\n\nТранскрибирует аудио на языке оригинала. Поддерживает модели Whisper и AssemblyAI.\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"The audio file to transcribe"},"model":{"type":"string","description":"The model to use (e.g. whisper-1)","default":"whisper-1"},"language":{"type":"string","description":"The language of the audio (ISO 639-1)"},"prompt":{"type":"string","description":"Optional text to guide the model's style"},"responseFormat":{"type":"string","enum":["json","text","srt","verbose_json","vtt"],"default":"json"},"temperature":{"type":"number","description":"Sampling temperature (0-1)"},"timestampGranularities":{"type":"array","items":{"type":"string","enum":["word","segment"]}}}}}}},"responses":{"200":{"description":"Transcription result","content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"}}}}}}}}},"/openai/v1/audio/translations":{"post":{"summary":"Create translation / Перевести аудио","description":"Translates audio into English text.\n\nПереводит аудио в текст на английском языке.\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary","description":"The audio file to translate"},"model":{"type":"string","description":"The model to use"},"prompt":{"type":"string","description":"Optional text to guide the model's style"},"responseFormat":{"type":"string","enum":["json","text","srt","verbose_json","vtt"]},"temperature":{"type":"number","description":"Sampling temperature (0-1)"}}}}}},"responses":{"200":{"description":"Translation result","content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"}}}}}}}}},"/openai/v1/audio/speech":{"post":{"summary":"Create speech / Синтезировать речь","description":"Generates audio from the input text. Returns binary audio data.\nGoogle TTS models (google-tts-standard, google-tts-wavenet) accept up to 1000 characters,\na Google voice name (e.g. ru-RU-Wavenet-B) and always return MP3.\n\nГенерирует аудио из текста. Возвращает бинарные данные аудиофайла.\nМодели Google TTS (google-tts-standard, google-tts-wavenet) принимают до 1000 символов,\nимя голоса Google (например, ru-RU-Wavenet-B) и всегда возвращают MP3.\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","input","voice"],"properties":{"model":{"type":"string","description":"The TTS model to use (e.g. tts-1, tts-1-hd, google-tts-wavenet)"},"input":{"type":"string","description":"The text to generate audio for (max 4096 characters)"},"voice":{"type":"string","description":"The voice to use (alloy, echo, fable, onyx, nova, shimmer, or a Google voice name for Google TTS)"},"responseFormat":{"type":"string","description":"The audio format","enum":["mp3","opus","aac","flac","wav","pcm"],"default":"mp3"},"speed":{"type":"number","description":"Speed of the generated audio (0.25-4.0)","default":1}}}}}},"responses":{"200":{"description":"Audio binary data","headers":{"X-BotHub-Caps":{"description":"Caps usage (when bothub.include_usage is true)","schema":{"type":"string"}}},"content":{"audio/mpeg":{"schema":{"type":"string","format":"binary"}}}}}}},"/openai/v1/moderations":{"post":{"summary":"Create moderation / Проверить контент","description":"Classifies if text is potentially harmful. Compatible with OpenAI Moderations API.\n\nКлассифицирует текст на предмет потенциально вредного содержимого. Совместим с OpenAI Moderations API.\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input"],"properties":{"input":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Input text to classify"},"model":{"type":"string","description":"The moderation model to use"}}}}}},"responses":{"200":{"description":"Moderation result","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"model":{"type":"string"},"results":{"type":"array","items":{"type":"object","properties":{"flagged":{"type":"boolean"},"categories":{"type":"object"},"categoryScores":{"type":"object"}}}}}}}}}}}},"/openai/v1/embeddings":{"post":{"summary":"Create embeddings / Создать эмбеддинги","description":"Creates an embedding vector representing the input text. Compatible with OpenAI Embeddings API.\n\nСоздаёт вектор эмбеддинга для входного текста. Совместим с OpenAI Embeddings API.\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","input"],"properties":{"model":{"type":"string","description":"ID of the model to use (e.g. text-embedding-3-large)"},"input":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Input text to embed"},"encodingFormat":{"type":"string","enum":["float","base64"],"default":"float"},"dimensions":{"type":"integer","description":"Number of dimensions for the output embeddings"}}}}}},"responses":{"200":{"description":"Embedding result","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","example":"list"},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","example":"embedding"},"embedding":{"type":"array","items":{"type":"number"}},"index":{"type":"integer"}}}},"model":{"type":"string"},"usage":{"type":"object","properties":{"promptTokens":{"type":"integer"},"totalTokens":{"type":"integer"}}}}}}}}}}},"/openai/v1/models":{"get":{"summary":"List models / Список моделей","description":"Lists the currently available models.\n\nВозвращает список доступных моделей.\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"List of available models","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","example":"list"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","example":"model"},"created":{"type":"integer"},"ownedBy":{"type":"string"}}}}}}}}}}}},"/openai/v1/responses/models":{"get":{"summary":"List Responses API models / Модели для Responses API","description":"Lists models compatible with the Responses API.\n\nВозвращает список моделей, совместимых с Responses API.\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"List of available models for the Responses API","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","example":"list"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","example":"model"},"created":{"type":"integer"},"ownedBy":{"type":"string"}}}}}}}}}}}},"/openai/v1/batches":{"get":{"summary":"List batch requests / Список пакетных запросов","description":"Returns a list of batch requests for the current user.\n\nВозвращает список пакетных запросов текущего пользователя.\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"limit","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"in":"query","name":"offset","required":false,"schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"List of batches","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/entities/BatchRequest"}}}}}}},"post":{"summary":"Create batch request / Создать пакетный запрос","description":"Creates a batch request from provided file id.\n\nСоздаёт пакетный запрос по переданному ид файла.\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["input_file_id"],"properties":{"inputFileId":{"type":"string","description":"ID of the input file"},"completionWindow":{"type":"string","enum":["24h"],"description":"Optional completion window"}}}}}},"responses":{"200":{"description":"Batch created successfully","content":{"application/json":{"schema":{"$ref":"#/components/entities/BatchRequest"}}}}}}},"/openai/v1/batches/{batchId}/cancel":{"post":{"summary":"Cancel batch request / Отменить пакетный запрос","description":"Cancel a batch request by id.\n\nОтменяет пакетный запрос по ид.\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"batchId","required":true,"schema":{"type":"string"},"description":"Batch request ID"}],"responses":{"200":{"description":"Batch cancelled successfully","content":{"application/json":{"schema":{"$ref":"#/components/entities/BatchRequest"}}}}}}},"/openai/v1/batches/models":{"get":{"summary":"List batch-capable models / Список моделей для пакетных запросов","description":"Returns the models that can be used in batch requests, across all supported providers.\n\nВозвращает модели, которые можно использовать в пакетных запросах, по всем поддерживаемым провайдерам.\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"List of batch-capable models","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"type":"string","example":"list"},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","example":"model"},"created":{"type":"integer"},"ownedBy":{"type":"string"}}}}}}}}}}}},"/openai/v1/batches/{batchId}":{"get":{"summary":"Check batch request / Проверить пакетный запрос","description":"Returns batch request status by batch request ID.\n\nВозвращает статус пакетного запроса по ид пакетного запроса.\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"batchId","required":true,"schema":{"type":"string"},"description":"Batch ID"},{"in":"query","name":"include_usage","required":false,"schema":{"type":"boolean"},"description":"Include usage breakdown in response (Bothub extension)"}],"responses":{"200":{"description":"Batch info","content":{"application/json":{"schema":{"$ref":"#/components/entities/BatchRequest"}}}}}}},"/openai/v1/files/{fileId}":{"get":{"summary":"Download file / Скачать результат запроса","description":"Returns a link to download the result of request by file ID.\n\nВозвращает ссылку для скачивания результата обработки запроса по идентификатору файла.\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"path","name":"fileId","required":true,"schema":{"type":"string"},"description":"File ID"}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"string"}}}}}}},"/openai/v1/files":{"post":{"summary":"Upload file for batch request / Загрузить файл для пакетного запроса","description":"Uploads a JSONL file for batch request processing.\n\nЗагружает JSONL-файл для отправки на генерацию пакетного запроса(загружать нужно один файл за раз).\n","tags":["OpenAI Compatible"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["purpose"],"properties":{"purpose":{"type":"string","example":"batch"},"files":{"type":"array","items":{"type":"string","format":"binary"}}}}}}},"responses":{"200":{"description":"List of batches","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/entities/File"}}}}}}}},"/plan/{id}/buy":{"post":{"summary":"Buy subscription plan / Купить тарифный план","description":"Initiates a payment for the specified subscription plan. Returns a payment URL to redirect the user.\n\nИнициирует оплату указанного тарифного плана. Возвращает URL для перенаправления пользователя на страницу оплаты.\n","tags":["Plan"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/buyPlan"}}}},"responses":{"200":{"description":"Successfully initiated the payment.","content":{"application/json":{"schema":{"properties":{"url":{"type":"string","description":"Payment URL"},"paymentId":{"type":"string","description":"Internal payment identifier"}}}}}}}}},"/plan/list":{"get":{"summary":"List subscription plans / Список тарифных планов","description":"Returns all available subscription plans. Optionally includes plan models and currency conversion.\n\nВозвращает все доступные тарифные планы. Опционально включает связанные модели и конвертацию валюты.\n","tags":["Plan"],"produces":["application/json"],"parameters":[{"name":"includePlanModels","in":"query","required":false,"type":"boolean"},{"name":"currency","in":"query","required":false,"type":"string"},{"name":"includeGuest","in":"query","required":false,"type":"boolean","description":"Include the guest plan for unauthenticated users (hidden by default) / Включить гостевой тариф для неавторизованных (по умолчанию скрыт)"}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/entities/Plan"}}}}}}}},"/preset":{"post":{"summary":"Create preset / Создать пресет","description":"Creates a new AI chat preset with a name, instructions, and optional model settings.\n\nСоздаёт новый пресет чата с названием, инструкциями и настройками модели.\n","security":[{"bearerAuth":[]}],"tags":["Preset"],"produces":["application/json"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/createPreset"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/Preset"}}}}}}},"/preset/{id}":{"get":{"summary":"Get preset by id / Получить пресет по id","description":"Returns a single preset by id. With ?elements=true also returns the settings form\ndescriptors (elements) pre-filled with the preset values, for the editor.\n\nВозвращает один пресет по id. С ?elements=true дополнительно отдаёт дескрипторы формы\nнастроек (elements) с подставленными значениями пресета — для редактора.\n","tags":["Preset"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"},{"name":"elements","in":"query","required":false,"type":"boolean"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/Preset"}}}}}},"patch":{"summary":"Update preset / Обновить пресет","description":"Updates the name, instructions, or other properties of an existing preset.\n\nОбновляет название, инструкции или другие свойства существующего пресета.\n","tags":["Preset"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/rules/updatePreset"}}}},"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/Preset"}}}}}},"delete":{"summary":"Delete preset / Удалить пресет","description":"Permanently deletes a preset by its identifier.\n\nБезвозвратно удаляет пресет по его идентификатору.\n","tags":["Preset"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/Preset"}}}}}}},"/preset/list":{"get":{"summary":"List presets / Список пресетов","description":"Returns a paginated list of presets. Supports search, filtering by favorites, and locale.\n\nВозвращает пагинированный список пресетов. Поддерживает поиск, фильтрацию по избранным и локализацию.\n","tags":["Preset"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"search","in":"query","type":"string"},{"name":"page","in":"query","type":"number"},{"name":"favorite","in":"query","type":"boolean"},{"name":"quantity","in":"query","type":"number"},{"name":"locale","in":"query","type":"number"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"type":"array","items":{"$ref":"#/components/entities/Preset"}},"pages":{"type":"number"}}}}}}}}},"/preset/category/list":{"get":{"summary":"List preset categories / Список категорий пресетов","description":"Returns all preset categories, optionally filtered by locale.\n\nВозвращает все категории пресетов, опционально с фильтрацией по локализации.\n","tags":["Preset"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"locale","in":"query","required":false,"type":"string"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"type":"array","items":{"$ref":"#/components/entities/PresetCategory"}}}}}}}}},"/preset/{id}/favorite":{"post":{"summary":"Toggle preset favorite status / Изменить статус \"избранного\" для пресета","description":"Adds or removes a preset from favorites for the authenticated user based on the 'value' boolean.\n\nДобавляет или удаляет пресет из избранного для авторизованного пользователя в зависимости от значения 'value'.\n","tags":["Preset"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the preset / ID пресета","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["value"],"properties":{"value":{"type":"boolean","description":"true to add to favorites, false to remove / true чтобы добавить, false чтобы удалить","example":true}}}}}},"responses":{"200":{"description":"Success / Успешно","content":{"application/json":{"schema":{"$ref":"#/components/entities/Preset"}}}}}}},"/preset/filters":{"get":{"summary":"Get preset filters / Фильтры пресетов","description":"Returns available filter options for presets: categories and models lists.\n\nВозвращает доступные опции фильтрации для пресетов: список категорий и моделей.\n","tags":["Preset"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"locale","in":"query","required":false,"type":"string"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"categories":{"type":"array","items":{"$ref":"#/components/entities/PresetFilter"}}}}}}}}}},"/preset/{id}/chat":{"post":{"summary":"Create chat from preset / Создать чат из пресета","description":"Creates a new chat using the model from the specified preset.\n\nСоздаёт новый чат с моделью из указанного пресета.\n","tags":["Preset"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"id","in":"path","required":true,"type":"string"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/entities/Chat"}}}}}}},"/preset/{id}/assistant":{"patch":{"summary":"Move preset to another assistant category / Перенести пресет в другую категорию ассистентов","description":"Admin only. Changes only the assistant category of the preset. The category must exist and have the same locale as the preset.\n\nТолько для админа. Меняет только категорию ассистентов у пресета. Категория должна существовать и быть на том же языке, что и пресет.\n","tags":["Preset"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"ID of the preset / ID пресета","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/changePresetAssistant"}}}},"responses":{"200":{"description":"Success / Успешно","content":{"application/json":{"schema":{"$ref":"#/components/entities/Preset"}}}},"400":{"description":"ASSISTANT_LOCALE_MISMATCH — category locale differs from the preset / язык категории не совпадает с языком пресета"},"403":{"description":"Not an admin / Не админ"},"404":{"description":"PRESET_NOT_FOUND, PRESET_ASSISTANT_NOT_FOUND"}}}},"/pricing":{"get":{"summary":"Get pricing settings / Параметры ценообразования","description":"Returns current pricing configuration for the requesting user (enterprise-specific,\nenterprise-wide or default, resolved from the optional auth token): the currency\nmultiplier applied on every platform and the dashboard markup. API platforms are\nbilled with the currency multiplier only.\n\nВозвращает конфигурацию ценообразования для текущего пользователя (персональную\nдля юр.лица, общую для юр.лиц или дефолтную — определяется по опциональному\nтокену): курсовой множитель, применяемый на всех платформах, и наценку дашборда.\nНа API идёт только курсовой множитель.\n","tags":["Pricing"],"parameters":[{"in":"query","name":"platform","required":false,"schema":{"type":"string","enum":["WEB","MAIN","DASHBOARD","TELEGRAM","MAX","BOTHUB_API","API","API_COMPLETIONS","API_IMAGES","API_VIDEOS","API_EMBEDDINGS","API_MODERATIONS","API_SPEECH","API_TRANSCRIPTIONS","API_TRANSLATIONS","ENTERPRISE","EASY_WRITER","PROMPT_QUEUE","API_BATCH"]},"description":"Platform the serviceMultiplier is resolved for; API platforms exclude the markup. Default DASHBOARD."}],"produces":["application/json"],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"serviceMultiplier":{"type":"number","description":"currencyMultiplier * markup, or currencyMultiplier alone on API platforms; kept for backward compatibility"},"currencyMultiplier":{"type":"number"},"markup":{"type":"number"}}}}}}}}},"/pricing/tools":{"get":{"summary":"Get tools pricing / Стоимость инструментов","description":"Returns how the chat tools (web search, Google Scholar, legal search, URL analysis,\nimage generation, documents) are billed: fixed CAPS per call, CAPS per 1M tokens of\nprocessed page text, and the models whose own price is charged (see models.role).\nUses the same formulas as billing. Models follow the utility model settings (cached for\nup to ~1 min); coefficients follow app settings after they are reloaded. Prices are\nbase CAPS before the serviceMultiplier from GET /pricing.\n\nВозвращает, как списываются инструменты чата (веб-поиск, Google Scholar, юридический\nпоиск, анализ ссылок, генерация изображений, документы): фиксированные CAPS за вызов,\nCAPS за 1M токенов обработанного текста страниц и модели, по цене которых списывается\nих работа (см. models.role). Формулы те же, что в биллинге. Модели берутся из настроек\nслужебных моделей (кеш до ~1 мин), коэффициенты — из настроек приложения после их\nперезагрузки. Цены — базовые CAPS до serviceMultiplier из GET /pricing.\n","tags":["Pricing"],"produces":["application/json"],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"tools":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","enum":["web_search","google_scholar","legal_search","analyze_urls","generate_image","create_document"]},"fixedCosts":{"type":"array","items":{"type":"object","properties":{"unit":{"type":"string","enum":["request","search","document","add_sources","find_changes"]},"caps":{"type":"number","nullable":true,"description":"Plan-independent price"},"capsByPlan":{"type":"object","nullable":true,"description":"Price per plan type (FREE, BASIC, PREMIUM, DELUXE, ELITE)","additionalProperties":{"type":"number"}}}}},"capsPer1mContentTokens":{"type":"number","nullable":true},"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string","nullable":true},"role":{"type":"string","enum":["billed","default","video"],"description":"billed — the model price is charged on every call;\ndefault — default model, can be changed in chat settings;\nvideo — the model price is charged for video analysis\n"}}}}}}}}}}}}}}},"/pricing/models":{"get":{"summary":"Get model prices in CAPS, RUB and USD / Цены моделей в CAPS, рублях и долларах","description":"Returns the price of every model from the models catalog (child models, excluding auto\nand models disabled on the platform; only the models bound to the user's plan, like the\nAPI access check, ELITE without a token; employees with a model list see every model),\nor of one model when modelId is passed. Prices follow the catalog formulas:\nbase CAPS from model pricing times the multiplier from GET /pricing for the platform\n(the user's legal entity rates when a token is passed). RUB and USD are CAPS times\nplan.price / plan.tokens of the user's plan, ELITE without a token or on a free plan;\nlegal entity employees get RUB from the contract rate and no USD. Prices are full: the\nECO discount is returned separately in discount. On API platforms the mode comes from\nthe developer key like in billing (PRO without a key; always PRO for legal entities with\napi.eco_first or api.eco_only), elsewhere from the user.\nText and embeddings are priced per 1M tokens, image tokens per 1K tokens, speech\nsynthesis per 1K characters, transcription per minute. generationPrices hold the\nprice of one image for gpt-image (size × quality), Gemini (resolution) and dall-e\n(quality × size) models. Voice cloning and speech-to-speech have no prices. Models\nand plans are cached for up to 30 s.\n\nВозвращает цены всех моделей каталога (дочерние модели, кроме auto и выключенных на\nплатформе; только модели, привязанные к тарифу пользователя, как при проверке доступа в\nAPI, без токена — к ELITE; сотрудникам со списком моделей — все) или одной модели при\nпереданном modelId. Формулы те же, что в каталоге: базовые CAPS из pricing модели\nумножаются на множитель из GET /pricing для платформы (по токену — ставки юр.лица\nпользователя). Рубли и доллары — CAPS × plan.price / plan.tokens тарифа пользователя;\nбез токена или на бесплатном тарифе — ELITE; сотрудникам юр.лица рубли считаются по\nкурсу из договора, долларов нет. Цены полные: скидка ECO отдаётся отдельно в discount.\nНа API-платформах режим берётся из ключа разработчика, как в биллинге (без ключа —\nPRO; юр.лицам с api.eco_first или api.eco_only — всегда PRO), на остальных — из\nпользователя. Текст и эмбеддинги — за 1M\nтокенов, токены изображений — за 1K токенов, синтез речи — за 1K символов,\nтранскрибация — за минуту. generationPrices — цена одной картинки у gpt-image\n(размер × качество), Gemini (разрешение) и dall-e (качество × размер). У клонов\nголоса и speech-to-speech цен нет. Модели и тарифы кешируются до 30 с.\n","tags":["Pricing"],"parameters":[{"in":"query","name":"modelId","required":false,"schema":{"type":"string"},"description":"Return only this model; 404 MODEL_NOT_FOUND if it is not in the catalog"},{"in":"query","name":"platform","required":false,"schema":{"type":"string","enum":["WEB","MAIN","DASHBOARD","TELEGRAM","MAX","BOTHUB_API","API","API_COMPLETIONS","API_IMAGES","API_VIDEOS","API_EMBEDDINGS","API_MODERATIONS","API_SPEECH","API_TRANSCRIPTIONS","API_TRANSLATIONS","ENTERPRISE","EASY_WRITER","PROMPT_QUEUE","API_BATCH","EXTERNAL_SERVICE"]},"description":"Platform the multiplier and model visibility are resolved for. Default API_COMPLETIONS."}],"produces":["application/json"],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"platform":{"type":"string"},"multiplier":{"type":"number","description":"Applied to every CAPS price, the serviceMultiplier from GET /pricing"},"providerType":{"type":"string","enum":["ECO","PRO"]},"rates":{"type":"object","properties":{"planType":{"type":"string","enum":["BASIC","PREMIUM","DELUXE","ELITE","ENTERPRISE"]},"rubPerMillionCaps":{"type":"number"},"usdPerMillionCaps":{"type":"number","nullable":true,"description":"null for legal entity employees"}}},"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string","nullable":true},"parentId":{"type":"string","nullable":true},"features":{"type":"array","items":{"type":"string"}},"allowedPlanType":{"type":"string","nullable":true,"enum":["FREE","BASIC","PREMIUM","DELUXE","ELITE"],"description":"Cheapest plan that includes the model"},"discount":{"type":"number","description":"ECO discount multiplier, not applied to the prices; 1 for PRO and for a zero discount"},"isDiscounted":{"type":"boolean"},"prices":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["input","cache_read","cache_write","cache_write_1h","output","input_image","output_image","per_image","per_second"]},"unit":{"type":"string","enum":["per_1m_tokens","per_1k_tokens","per_1k_chars","per_minute","per_image","per_second"]},"caps":{"type":"number"},"rub":{"type":"number"},"usd":{"type":"number","nullable":true}}}},"generationPrices":{"type":"array","items":{"type":"object","properties":{"size":{"type":"string","nullable":true},"quality":{"type":"string","nullable":true},"resolution":{"type":"string","nullable":true},"caps":{"type":"number"},"rub":{"type":"number"},"usd":{"type":"number","nullable":true}}}}}}}}}}}},"400":{"description":"VALIDATION_ERROR"},"404":{"description":"MODEL_NOT_FOUND"},"500":{"description":"PRICING_PLAN_NOT_FOUND — the default ELITE plan has no RUB/USD price"}}}},"/replicate/v1/images/generations":{"post":{"deprecated":true,"summary":"Generate image via Replicate / Создать изображение через Replicate","description":"Generates an image using Replicate models (e.g. Flux, Stable Diffusion).\nThe model identifier is passed at the root of the request body; model-specific\nparameters go inside the `input` object. Common fields are documented\nbelow — each model may accept additional parameters; refer to the model's\npage on replicate.com for its full input schema.\n\nГенерирует изображение с помощью моделей Replicate (например, Flux, Stable Diffusion).\nНазвание модели передаётся в корне тела запроса; специфичные параметры модели — внутри объекта `input`.\nКаждая модель может принимать дополнительные параметры — см. страницу модели на replicate.com.\n","tags":["Replicate"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["model","input"],"properties":{"model":{"type":"string","description":"Model identifier as returned by /replicate/v1/models"},"input":{"type":"object","description":"Model-specific input parameters","properties":{"prompt":{"type":"string","description":"Text prompt describing the desired image (required by all models)"},"negativePrompt":{"type":"string","description":"What to exclude from the image (SD-family models)"},"aspectRatio":{"type":"string","description":"Output aspect ratio. Common values: 1:1, 16:9, 9:16, 4:3, 3:4, custom","default":"1:1"},"width":{"type":"integer","minimum":256,"maximum":1440,"description":"Output width in pixels, multiple of 32. Used when aspect_ratio is \"custom\" (FLUX)"},"height":{"type":"integer","minimum":256,"maximum":1440,"description":"Output height in pixels, multiple of 32. Used when aspect_ratio is \"custom\" (FLUX)"},"seed":{"type":"integer","description":"Random seed for reproducible results. Omit for random"},"outputFormat":{"type":"string","enum":["webp","jpg","png"],"default":"webp","description":"Format of the output image"},"outputQuality":{"type":"integer","minimum":0,"maximum":100,"default":80,"description":"JPEG/WebP compression quality (0-100). Not used for png"},"cfg":{"type":"number","minimum":1,"maximum":10,"description":"Classifier-free guidance scale (SD-family models)"},"steps":{"type":"integer","minimum":1,"maximum":100,"description":"Number of diffusion steps (SD-family models)"},"promptStrength":{"type":"number","minimum":0,"maximum":1,"default":0.85,"description":"Denoising strength for img2img mode. 1.0 fully ignores the input image (SD models)"},"image":{"type":"string","format":"uri","description":"Input image URL for img2img or inpainting (SD models)"},"imagePrompt":{"type":"string","format":"uri","description":"Reference image URL for Flux Redux composition conditioning"},"safetyTolerance":{"type":"integer","minimum":1,"maximum":6,"default":2,"description":"Safety filter level for FLUX Pro models. 1 = strictest, 6 = most permissive"},"promptUpsampling":{"type":"boolean","default":false,"description":"Automatically expand the prompt for more diverse results (FLUX Pro models)"}}},"bothub":{"type":"object","properties":{"includeUsage":{"type":"boolean","description":"Include caps usage in the response"},"returnBase64":{"type":"boolean","default":false,"description":"Instead of a url, it returns an image in base64 format"}}}}}}}},"responses":{"200":{"description":"Generated image (URL or base64)","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"array","items":{"type":"string"}},"base64":{"type":"array","items":{"type":"string"}},"usage":{"type":"object","properties":{"bothub":{"type":"object","properties":{"caps":{"type":"integer"}}}}}}}}}}}}},"/replicate/v1/models":{"get":{"summary":"List Replicate models / Список моделей Replicate","description":"Returns the list of available Replicate models.\n\nВозвращает список доступных моделей Replicate.\n","tags":["Replicate"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"List of available Replicate models","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}}}}}}}}},"/transaction/list":{"get":{"summary":"List transactions / Список транзакций","description":"Returns a paginated list of the current user's transactions.\n\nВозвращает постраничный список транзакций текущего пользователя.\n","tags":["Transaction"],"security":[{"bearerAuth":[]}],"produces":["application/json"],"parameters":[{"name":"page","in":"query","type":"number"},{"name":"withDeveloperKey","in":"query","type":"boolean"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"type":"array","items":{"$ref":"#/components/entities/Transaction"}},"pages":{"type":"number"}}}}}}}}},"/transaction/excel-grouped-by-developer-key-label":{"get":{"tags":["Transaction"],"security":[{"bearerAuth":[]}],"summary":"Export spending report by Developer Key / Экспорт агрегированных трат по developerKeyId","description":"Exports an Excel file with aggregated user spending grouped by Developer Key label.\n\nЭкспортирует Excel-файл с агрегированной статистикой трат пользователя, сгруппированных по метке Developer Key.\n","parameters":[{"name":"from","in":"query","description":"Start date (inclusive) in YYYY-MM-DD or ISO 8601 format. Defaults to today. / Начальная дата (включительно) в формате YYYY-MM-DD или ISO 8601. По умолчанию — текущая дата.","required":false,"schema":{"type":"string","format":"date","example":"2025-06-01"}},{"name":"to","in":"query","description":"End date (inclusive) in YYYY-MM-DD or ISO 8601 format. Defaults to today. / Конечная дата (включительно) в формате YYYY-MM-DD или ISO 8601. По умолчанию — текущая дата.","required":false,"schema":{"type":"string","format":"date","example":"2025-06-10"}}],"responses":{"200":{"description":"Excel file with aggregated spending statistics by developerKeyId. / Excel-файл с агрегированной статистикой трат пользователя по developerKeyId.","content":{"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}}}}}},"/transaction/usage-report":{"get":{"tags":["Transaction"],"security":[{"bearerAuth":[]}],"summary":"Export usage report as Excel / Экспорт агрегированных трат в формате Excel","description":"Exports an Excel file with aggregated user spending for the specified time range.\n\nЭкспортирует Excel-файл с агрегированной статистикой трат пользователя за указанный период.\n","parameters":[{"name":"from","in":"query","description":"Start timestamp (inclusive) in ISO 8601 format. / Начальный timestamp (включительно) в формате ISO 8601.","required":true,"schema":{"type":"string","format":"date","example":"2025-09-24T09:23:31.518Z"}},{"name":"to","in":"query","description":"End timestamp (inclusive) in ISO 8601 format. / Конечный timestamp (включительно) в формате ISO 8601.","required":true,"schema":{"type":"string","format":"date","example":"2025-09-25T09:23:31.518Z"}},{"name":"userId","in":"query","description":"Employee user ID to filter by. / userId вашего сотрудника.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Excel file with aggregated user spending statistics. / Excel-файл с агрегированной статистикой трат пользователя.","content":{"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}}}}}},"/auth/2fa/verify":{"post":{"summary":"Complete sign-in with a second factor / Завершить вход вторым фактором","description":"Exchanges `twoFactorToken` returned by sign-in (`twoFactorRequired: true`) and a 6-digit TOTP/email code or a backup code for auth tokens. Session type (admin panel or not) is taken from the sign-in request; the refresh cookie is set unless it was an admin panel sign-in.\n\nОбменивает `twoFactorToken` из ответа входа (`twoFactorRequired: true`) и 6-значный код из приложения/письма или резервный код на токены. Тип сессии (админка или нет) берётся из запроса входа; refresh-кука ставится, если вход был не из админки.\n","tags":["Auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/twoFactorVerifyLogin"}}}},"responses":{"200":{"description":"{ user, accessToken, refreshToken }"},"401":{"description":"TWO_FACTOR_INVALID_CODE (data.attemptsLeft) / TWO_FACTOR_CHALLENGE_EXPIRED"},"429":{"description":"TWO_FACTOR_TOO_MANY_ATTEMPTS"}}}},"/auth/2fa/resend":{"post":{"summary":"Resend sign-in email code / Отправить код входа повторно","description":"Sends a new email code for a pending sign-in. Only for the EMAIL method; limited by cooldown.\n\nОтправляет новый код на почту для незавершённого входа. Только для метода EMAIL, с ограничением по частоте.\n","tags":["Auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/twoFactorResendLoginCode"}}}},"responses":{"200":{"description":"Code sent"},"429":{"description":"TWO_FACTOR_RESEND_COOLDOWN"}}}},"/auth/2fa":{"get":{"summary":"Two-factor status / Статус двухфакторной аутентификации","description":"Returns whether 2FA is enabled, its method and the number of unused backup codes.\n\nВозвращает, включена ли 2FA, её метод и число неиспользованных резервных кодов.\n","tags":["Auth"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"{ enabled, method: TOTP|EMAIL|null, backupCodesLeft, enabledAt }"}}}},"/auth/2fa/setup/totp":{"post":{"summary":"Start authenticator app setup / Начать подключение приложения-аутентификатора","description":"Generates a TOTP secret. Show `otpauthUri` as a QR code, then confirm via /auth/2fa/setup/confirm.\n\nГенерирует TOTP-секрет. Покажите `otpauthUri` QR-кодом и подтвердите через /auth/2fa/setup/confirm.\n","tags":["Auth"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"{ secret, otpauthUri }"},"400":{"description":"TWO_FACTOR_ALREADY_ENABLED"}}}},"/auth/2fa/setup/email":{"post":{"summary":"Start email 2FA setup / Начать подключение 2FA по почте","description":"Sends a code to the verified email. Confirm via /auth/2fa/setup/confirm.\n\nОтправляет код на подтверждённую почту. Подтвердите через /auth/2fa/setup/confirm.\n","tags":["Auth"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Code sent"},"400":{"description":"TWO_FACTOR_ALREADY_ENABLED / TWO_FACTOR_EMAIL_REQUIRED"}}}},"/auth/2fa/setup/confirm":{"post":{"summary":"Confirm 2FA setup / Подтвердить подключение 2FA","description":"Enables 2FA after a valid code and returns 10 one-time backup codes. They are shown only once.\n\nВключает 2FA по верному коду и возвращает 10 одноразовых резервных кодов. Они показываются один раз.\n","tags":["Auth"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/twoFactorCode"}}}},"responses":{"200":{"description":"{ method, backupCodes: string[] }"}}}},"/auth/2fa/email-code":{"post":{"summary":"Send email code for 2FA management / Отправить код для управления 2FA","description":"For the EMAIL method: sends a code required to disable 2FA or regenerate backup codes.\n\nДля метода EMAIL: отправляет код, нужный для отключения 2FA или перевыпуска резервных кодов.\n","tags":["Auth"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Code sent"}}}},"/auth/2fa/disable":{"post":{"summary":"Disable 2FA / Отключить 2FA","description":"Disables 2FA after a valid TOTP/email code or a backup code.\n\nОтключает 2FA по верному коду из приложения/письма или резервному коду.\n","tags":["Auth"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/twoFactorCode"}}}},"responses":{"200":{"description":"Disabled"}}}},"/auth/2fa/backup-codes":{"post":{"summary":"Regenerate backup codes / Перевыпустить резервные коды","description":"Replaces all backup codes with 10 new ones after a valid code.\n\nЗаменяет все резервные коды на 10 новых по верному коду.\n","tags":["Auth"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/rules/twoFactorCode"}}}},"responses":{"200":{"description":"{ backupCodes: string[] }"}}}}},"tags":[]}