SDKs accept it as api_key or apiKey — see API Reference.
Security best practices
❌ Don't commit to Git
Never put sk-... in commits. Repos — especially public — get scraped by bots in minutes.
✅ Use environment variables
Store the key in .env or system env. Read it with os.getenv("OPENAI_API_KEY").
❌ Don't expose to frontend
The API key belongs only on the backend. If the browser calls RuAPI directly, anyone opening DevTools sees the key.
✅ One key per project
Don’t share a single key across projects. If one leaks, the others stay safe — only revoke the bad one.
Revoking and rotating
If a key leaks (committed to Git, posted in chat, in a screenshot):
1
Revoke immediately
In API Keys, find the bad key and turn off its switch in the Status column — or delete it via the ⋯ menu at the end of the row. All subsequent requests with it return 401 Unauthorized.
2
Create a replacement
Generate a new key with the same limits and update your application’s environment.
3
Audit logs
In Usage Logs, check for suspicious requests made with the leaked key before you revoked it.
Credit limits
When creating a key you can set “max X USD from overall balance”. Useful for:
Prod/staging split: production key with no limit, staging with $10 limit.
Delegation: give a contractor a key with a $50 cap for one feature.
Bug protection: a runaway script can’t drain everything — it hits the cap.
When the limit is reached, the key stops working automatically (even if your overall balance has more).
Credit limit: turn off Unlimited and enter an amount
Multiple keys
You can have any number of active keys at once. A typical layout:
Key
Purpose
Expiry
Limit
prod-app
Production
never
none
staging
Staging
never
$10
local-dev
Local development
30 days
$5
experiment-X
Experimental project X
7 days
$1
This gives isolation — if one key has issues, revoke and recreate it without touching the others.
Account compromise
If your RuAPI account is compromised (someone got your password):
Change your password immediately (if you still have access).
If you’ve lost access — email support@ruapi.ai from the address on file and describe what happened.
After regaining access: revoke all API keys and create new ones.
{"docsConfig":{"theme":"mint","$schema":"https://www.mintlify.com/docs.json","name":"RuAPI","colors":{"primary":"#1E40AF","light":"#3B82F6","dark":"#1E3A8A"},"logo":{"light":"https://mintcdn.com/no-d0cfaf14/1VmhF-J3miQLRTX3/logo/light.svg?fit=max\u0026auto=format\u0026n=1VmhF-J3miQLRTX3\u0026q=85\u0026s=1f94dc794b3a69a72b12786da6d4c4c7","dark":"https://mintcdn.com/no-d0cfaf14/1VmhF-J3miQLRTX3/logo/dark.svg?fit=max\u0026auto=format\u0026n=1VmhF-J3miQLRTX3\u0026q=85\u0026s=241a7e0f83696d465133dd24c440283a"},"favicon":"https://mintcdn.com/no-d0cfaf14/QzFnMRT4kSNQIgBQ/favicon.ico?fit=max\u0026auto=format\u0026n=QzFnMRT4kSNQIgBQ\u0026q=85\u0026s=01953194b79fd1b0848c6a79d971b473","navbar":{"links":[{"icon":"telegram","href":"https://t.me/ruapi_ai","label":"Telegram"},{"href":"mailto:support@ruapi.ai","label":"support@ruapi.ai"}],"primary":{"type":"button","label":"Get started","href":"https://www.ruapi.ai/?utm_source=docs\u0026utm_campaign=navbar"}},"footer":{"socials":{"telegram":"https://t.me/ruapi_ai","website":"https://www.ruapi.ai/?utm_source=docs\u0026utm_campaign=footer"}},"seo":{"metatags":{"yandex-verification":"978301833ca68565"}},"styling":{"latex":true},"navigation":{"languages":[{"language":"ru","navbar":{"links":[{"icon":"telegram","href":"https://t.me/ruapi_ai","label":"Канал в Telegram"},{"href":"mailto:support@ruapi.ai","label":"support@ruapi.ai"}],"primary":{"type":"button","label":"Начать","href":"https://www.ruapi.ai/?utm_source=docs\u0026utm_campaign=ru-navbar"}},"href":"ru/introduction"},{"language":"en","navbar":{"links":[{"icon":"telegram","href":"https://t.me/ruapi_ai","label":"Telegram channel"},{"href":"mailto:support@ruapi.ai","label":"support@ruapi.ai"}],"primary":{"type":"button","label":"Get started","href":"https://www.ruapi.ai/?utm_source=docs\u0026utm_campaign=en-navbar"}},"href":"en/introduction"},{"language":"zh","navbar":{"links":[{"icon":"telegram","href":"https://t.me/ruapi_ai","label":"Telegram 频道"},{"href":"mailto:support@ruapi.ai","label":"support@ruapi.ai"}],"primary":{"type":"button","label":"开始使用","href":"https://www.ruapi.ai/?utm_source=docs\u0026utm_campaign=zh-navbar"}},"href":"zh/introduction"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"no-d0cfaf14","hasAudioNarration":false,"actualSubdomain":"no-d0cfaf14","customDomains":["docs.ruapi.ai"],"gitSource":{"type":"github","owner":"rayray881188","repo":"ruapi-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6b011e86e6c40135846af32b","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"en","tag":"Integrations","count":20},{"language":"ru","tag":"Интеграции","count":20},{"language":"zh","tag":"工具对接","count":20},{"language":"en","tag":"Model guides","count":19},{"language":"ru","tag":"Гайды по моделям","count":19},{"language":"zh","tag":"模型指南","count":19},{"language":"en","tag":"From Russia: step by step","count":8},{"language":"ru","tag":"Из России — пошагово","count":8},{"language":"zh","tag":"在俄罗斯怎么用","count":8},{"language":"en","tag":"Guides","count":6},{"language":"en","tag":"Recipes","count":6},{"language":"ru","tag":"Руководства","count":6},{"language":"ru","tag":"Рецепты","count":6},{"language":"zh","tag":"指南","count":6},{"language":"zh","tag":"实战教程","count":6},{"language":"en","tag":"Video: Seedance","count":5},{"language":"ru","tag":"Видео: Seedance","count":5},{"language":"zh","tag":"视频:Seedance","count":5},{"language":"en","tag":"Capabilities","count":4},{"language":"en","tag":"Gemini","count":4},{"language":"ru","tag":"Возможности","count":4},{"language":"ru","tag":"Gemini","count":4},{"language":"zh","tag":"能力进阶","count":4},{"language":"zh","tag":"Gemini","count":4},{"language":"en","tag":"API Reference","count":3},{"language":"en","tag":"DeepSeek","count":3},{"language":"ru","tag":"Справочник API","count":3},{"language":"ru","tag":"DeepSeek","count":3},{"language":"zh","tag":"API 参考","count":3},{"language":"zh","tag":"DeepSeek","count":3}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"en/authentication","slug":"/en/authentication","pageMetadata":{"title":"API keys \u0026 security","description":"How to create, use, cap with a credit limit and revoke a RuAPI key — and keep it out of Git and your frontend","icon":"key","keywords":["how to create an API key","API key credit limit","sk key security","API key for LLMs"],"canonicalUrl":"https://docs.ruapi.ai/en/authentication","href":"/en/authentication"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"How to create, use, cap with a credit limit and revoke a RuAPI key — and keep it out of Git and your frontend\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,Frame,Heading,OptimizedImage,Step,Steps,Table}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Step)_missingMdxReference(`Step`,true);if(!Steps)_missingMdxReference(`Steps`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`You need an `,_jsx(_components.strong,{children:`API key`}),` to call any model through RuAPI. Keys start with `,_jsx(_components.code,{children:`sk-...`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`creating-a-key`,children:`Creating a key`}),`\n`,_jsxs(Steps,{children:[_jsx(Step,{title:`Open the API Keys section`,children:_jsxs(_components.p,{children:[`Console → `,_jsx(_components.strong,{children:`API Keys`}),`.`]})}),_jsxs(Step,{title:`Create a new key`,children:[_jsxs(_components.p,{children:[`Click `,_jsx(_components.strong,{children:`Create API key`}),`. Fill in:`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Name`}),`: for your reference, e.g. `,_jsx(_components.code,{children:`local-dev`}),`, `,_jsx(_components.code,{children:`production-bot`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Expiration time`}),`: leave it at `,_jsx(_components.strong,{children:`Never expires`}),` or set a specific date.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Credit limit (optional)`}),`: cap on how much this key can draw from your overall balance.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Allowed models (optional)`}),`: restrict the key to specific models.`]}),`\n`]}),_jsx(Frame,{caption:`New key: enter a name and keep the expiration set to Never expires`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/no-d0cfaf14/8dsQJWdEM4PQHdHy/images/console/en/token-create.webp?fit=max\u0026auto=format\u0026n=8dsQJWdEM4PQHdHy\u0026q=85\u0026s=cc1d10d004f62557bd324970b5f2be9d`,alt:`RuAPI new API key form: name and expiration time`,width:`1200`,height:`902`,style:{width:`100%`,maxWidth:`600px`,height:`auto`},\"data-og-width\":`1200`,\"data-og-height\":`902`,\"data-path\":`images/console/en/token-create.webp`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/no-d0cfaf14/8dsQJWdEM4PQHdHy/images/console/en/token-create.webp?w=280\u0026fit=max\u0026auto=format\u0026n=8dsQJWdEM4PQHdHy\u0026q=85\u0026s=259691b0f0ecb1735440b5a7deb64e2c 280w, https://mintcdn.com/no-d0cfaf14/8dsQJWdEM4PQHdHy/images/console/en/token-create.webp?w=560\u0026fit=max\u0026auto=format\u0026n=8dsQJWdEM4PQHdHy\u0026q=85\u0026s=75520a1dbe005d6a5b8f8d74fae65e81 560w, https://mintcdn.com/no-d0cfaf14/8dsQJWdEM4PQHdHy/images/console/en/token-create.webp?w=840\u0026fit=max\u0026auto=format\u0026n=8dsQJWdEM4PQHdHy\u0026q=85\u0026s=ea703100644403ed77b7a232a1905927 840w, https://mintcdn.com/no-d0cfaf14/8dsQJWdEM4PQHdHy/images/console/en/token-create.webp?w=1100\u0026fit=max\u0026auto=format\u0026n=8dsQJWdEM4PQHdHy\u0026q=85\u0026s=008db2343115babdad18e6784f14e1f5 1100w, https://mintcdn.com/no-d0cfaf14/8dsQJWdEM4PQHdHy/images/console/en/token-create.webp?w=1650\u0026fit=max\u0026auto=format\u0026n=8dsQJWdEM4PQHdHy\u0026q=85\u0026s=b6d1b1e32e0d0cc6d53643fa84cea4cf 1650w, https://mintcdn.com/no-d0cfaf14/8dsQJWdEM4PQHdHy/images/console/en/token-create.webp?w=2500\u0026fit=max\u0026auto=format\u0026n=8dsQJWdEM4PQHdHy\u0026q=85\u0026s=d4c2a609523799ff9faa6706b3d2a4ce 2500w`})})]}),_jsxs(Step,{title:`Copy the key`,children:[_jsx(_components.p,{children:`Click the copy icon next to the key, choose Copy Key and save it.`}),_jsx(Frame,{caption:`The Create API key button adds a key; the icon next to the key opens the copy menu`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/no-d0cfaf14/EdBAaGrmUKLbdQ3l/images/console/en/token-list.webp?fit=max\u0026auto=format\u0026n=EdBAaGrmUKLbdQ3l\u0026q=85\u0026s=642487ea62a7462885157b7ad575f4ba`,alt:`RuAPI API Keys page: the Create API key button and the copy key button`,width:`2208`,height:`480`,style:{height:`auto`},\"data-og-width\":`2208`,\"data-og-height\":`480`,\"data-path\":`images/console/en/token-list.webp`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/no-d0cfaf14/EdBAaGrmUKLbdQ3l/images/console/en/token-list.webp?w=280\u0026fit=max\u0026auto=format\u0026n=EdBAaGrmUKLbdQ3l\u0026q=85\u0026s=3b6ad209a4c1c6282aca8a497f2b758c 280w, https://mintcdn.com/no-d0cfaf14/EdBAaGrmUKLbdQ3l/images/console/en/token-list.webp?w=560\u0026fit=max\u0026auto=format\u0026n=EdBAaGrmUKLbdQ3l\u0026q=85\u0026s=08ba64c5313f2cda1b02209be023657f 560w, https://mintcdn.com/no-d0cfaf14/EdBAaGrmUKLbdQ3l/images/console/en/token-list.webp?w=840\u0026fit=max\u0026auto=format\u0026n=EdBAaGrmUKLbdQ3l\u0026q=85\u0026s=b001b9400471b88d69535b4f56c8d642 840w, https://mintcdn.com/no-d0cfaf14/EdBAaGrmUKLbdQ3l/images/console/en/token-list.webp?w=1100\u0026fit=max\u0026auto=format\u0026n=EdBAaGrmUKLbdQ3l\u0026q=85\u0026s=6e64c0bdbfe0029b55bc80fff5d8abba 1100w, https://mintcdn.com/no-d0cfaf14/EdBAaGrmUKLbdQ3l/images/console/en/token-list.webp?w=1650\u0026fit=max\u0026auto=format\u0026n=EdBAaGrmUKLbdQ3l\u0026q=85\u0026s=445f9c4ee373d33162912a4cfc6382e3 1650w, https://mintcdn.com/no-d0cfaf14/EdBAaGrmUKLbdQ3l/images/console/en/token-list.webp?w=2500\u0026fit=max\u0026auto=format\u0026n=EdBAaGrmUKLbdQ3l\u0026q=85\u0026s=658bfe8629a7f4052d1aaa4654076f8d 2500w`})}),_jsxs(_components.p,{children:[`You can view the key again later on the `,_jsx(_components.strong,{children:`API Keys`}),` page in the Console.`]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`using-the-key`,children:`Using the key`}),`\n`,_jsxs(_components.p,{children:[`Pass the key in the `,_jsx(_components.code,{children:`Authorization: Bearer sk-...`}),` header on every request:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://www.ruapi.ai/v1/chat/completions`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer sk-YOUR_KEY\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type: application/json\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{...}'`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`SDKs accept it as `,_jsx(_components.code,{children:`api_key`}),` or `,_jsx(_components.code,{children:`apiKey`}),` — see `,_jsx(_components.a,{href:`/en/api-reference`,children:`API Reference`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`security-best-practices`,children:`Security best practices`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`❌ Don't commit to Git`,icon:`ban`,children:_jsxs(_components.p,{children:[`Never put `,_jsx(_components.code,{children:`sk-...`}),` in commits. Repos — especially public — get scraped by bots in minutes.`]})}),_jsx(Card,{title:`✅ Use environment variables`,icon:`circle-check`,children:_jsxs(_components.p,{children:[`Store the key in `,_jsx(_components.code,{children:`.env`}),` or system env. Read it with `,_jsx(_components.code,{children:`os.getenv(\"OPENAI_API_KEY\")`}),`.`]})}),_jsx(Card,{title:`❌ Don't expose to frontend`,icon:`ban`,children:_jsx(_components.p,{children:`The API key belongs only on the backend. If the browser calls RuAPI directly, anyone opening DevTools sees the key.`})}),_jsx(Card,{title:`✅ One key per project`,icon:`circle-check`,children:_jsx(_components.p,{children:`Don’t share a single key across projects. If one leaks, the others stay safe — only revoke the bad one.`})})]}),`\n`,_jsx(Heading,{level:`2`,id:`revoking-and-rotating`,children:`Revoking and rotating`}),`\n`,_jsx(_components.p,{children:`If a key leaks (committed to Git, posted in chat, in a screenshot):`}),`\n`,_jsxs(Steps,{children:[_jsx(Step,{title:`Revoke immediately`,children:_jsxs(_components.p,{children:[`In `,_jsx(_components.strong,{children:`API Keys`}),`, find the bad key and turn off its switch in the `,_jsx(_components.strong,{children:`Status`}),` column — or delete it via the `,_jsx(_components.strong,{children:`⋯`}),` menu at the end of the row. All subsequent requests with it return `,_jsx(_components.code,{children:`401 Unauthorized`}),`.`]})}),_jsx(Step,{title:`Create a replacement`,children:_jsx(_components.p,{children:`Generate a new key with the same limits and update your application’s environment.`})}),_jsx(Step,{title:`Audit logs`,children:_jsxs(_components.p,{children:[`In `,_jsx(_components.strong,{children:`Usage Logs`}),`, check for suspicious requests made with the leaked key before you revoked it.`]})})]}),`\n`,_jsx(Heading,{level:`2`,id:`credit-limits`,children:`Credit limits`}),`\n`,_jsx(_components.p,{children:`When creating a key you can set “max X USD from overall balance”. Useful for:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Prod/staging split`}),`: production key with no limit, staging with $10 limit.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Delegation`}),`: give a contractor a key with a $50 cap for one feature.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Bug protection`}),`: a runaway script can’t drain everything — it hits the cap.`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`When the limit is reached, the key stops working automatically (even if your overall balance has more).`}),`\n`,_jsx(Frame,{caption:`Credit limit: turn off Unlimited and enter an amount`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/no-d0cfaf14/8dsQJWdEM4PQHdHy/images/console/en/token-budget.webp?fit=max\u0026auto=format\u0026n=8dsQJWdEM4PQHdHy\u0026q=85\u0026s=db3592c6b862ad890c2767ee7fc9a7af`,alt:`Credit limit block in the RuAPI API key form: amount 10 dollars, Unlimited turned off`,width:`1168`,height:`578`,style:{width:`100%`,maxWidth:`584px`,height:`auto`},\"data-og-width\":`1168`,\"data-og-height\":`578`,\"data-path\":`images/console/en/token-budget.webp`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/no-d0cfaf14/8dsQJWdEM4PQHdHy/images/console/en/token-budget.webp?w=280\u0026fit=max\u0026auto=format\u0026n=8dsQJWdEM4PQHdHy\u0026q=85\u0026s=4c4398cfaffc06e7f886e7b38c95fc86 280w, https://mintcdn.com/no-d0cfaf14/8dsQJWdEM4PQHdHy/images/console/en/token-budget.webp?w=560\u0026fit=max\u0026auto=format\u0026n=8dsQJWdEM4PQHdHy\u0026q=85\u0026s=1ec51af462673813103567cd158ca2dd 560w, https://mintcdn.com/no-d0cfaf14/8dsQJWdEM4PQHdHy/images/console/en/token-budget.webp?w=840\u0026fit=max\u0026auto=format\u0026n=8dsQJWdEM4PQHdHy\u0026q=85\u0026s=33c26e86156ae68e8c9d24d99e37290c 840w, https://mintcdn.com/no-d0cfaf14/8dsQJWdEM4PQHdHy/images/console/en/token-budget.webp?w=1100\u0026fit=max\u0026auto=format\u0026n=8dsQJWdEM4PQHdHy\u0026q=85\u0026s=303d4680a9b7090054f17f92275ce0c7 1100w, https://mintcdn.com/no-d0cfaf14/8dsQJWdEM4PQHdHy/images/console/en/token-budget.webp?w=1650\u0026fit=max\u0026auto=format\u0026n=8dsQJWdEM4PQHdHy\u0026q=85\u0026s=618f147289f60edc7760d00404a77127 1650w, https://mintcdn.com/no-d0cfaf14/8dsQJWdEM4PQHdHy/images/console/en/token-budget.webp?w=2500\u0026fit=max\u0026auto=format\u0026n=8dsQJWdEM4PQHdHy\u0026q=85\u0026s=8fce5f258f880e639ed76995eae06c15 2500w`})}),`\n`,_jsx(Heading,{level:`2`,id:`multiple-keys`,children:`Multiple keys`}),`\n`,_jsx(_components.p,{children:`You can have any number of active keys at once. A typical layout:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Key`}),_jsx(_components.th,{children:`Purpose`}),_jsx(_components.th,{children:`Expiry`}),_jsx(_components.th,{children:`Limit`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`prod-app`})}),_jsx(_components.td,{children:`Production`}),_jsx(_components.td,{children:`never`}),_jsx(_components.td,{children:`none`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`staging`})}),_jsx(_components.td,{children:`Staging`}),_jsx(_components.td,{children:`never`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$10`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`local-dev`})}),_jsx(_components.td,{children:`Local development`}),_jsx(_components.td,{children:`30 days`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$5`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`experiment-X`})}),_jsx(_components.td,{children:`Experimental project X`}),_jsx(_components.td,{children:`7 days`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`$1`})]})]})]}),`\n`,_jsx(_components.p,{children:`This gives isolation — if one key has issues, revoke and recreate it without touching the others.`}),`\n`,_jsx(Heading,{level:`2`,id:`account-compromise`,children:`Account compromise`}),`\n`,_jsx(_components.p,{children:`If your RuAPI account is compromised (someone got your password):`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Change your password immediately (if you still have access).`}),`\n`,_jsxs(_components.li,{children:[`If you’ve lost access — email `,_jsx(_components.a,{href:`mailto:support@ruapi.ai`,children:`support@ruapi.ai`}),` from the address on file and describe what happened.`]}),`\n`,_jsx(_components.li,{children:`After regaining access: revoke all API keys and create new ones.`}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"API keys \u0026 security","description":"How to create, use, cap with a credit limit and revoke a RuAPI key — and keep it out of Git and your frontend","icon":"key","keywords":["how to create an API key","API key credit limit","sk key security","API key for LLMs"],"canonicalUrl":"https://docs.ruapi.ai/en/authentication","href":"/en/authentication"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Creating a key","slug":"creating-a-key","depth":2,"children":[]},{"title":"Using the key","slug":"using-the-key","depth":2,"children":[]},{"title":"Security best practices","slug":"security-best-practices","depth":2,"children":[]},{"title":"Revoking and rotating","slug":"revoking-and-rotating","depth":2,"children":[]},{"title":"Credit limits","slug":"credit-limits","depth":2,"children":[]},{"title":"Multiple keys","slug":"multiple-keys","depth":2,"children":[]},{"title":"Account compromise","slug":"account-compromise","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/no-d0cfaf14/b2182f172390a67d/metrica.js","/_mintlify/custom/no-d0cfaf14/dfdd861a128e4705/support-fab.js"],"subdomain":"no-d0cfaf14","siteName":"RuAPI","title":"API keys \u0026 security - RuAPI","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"ru":{"href":"/ru/authentication","matchLevel":1},"en":{"href":"/en/authentication","matchLevel":0},"zh":{"href":"/zh/authentication","matchLevel":1}}},"lastModified":"2026-10-31T13:42:40.603Z","originalFileLocation":"en/authentication.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"How to create, use, cap with a credit limit and revoke a RuAPI key — and keep it out of Git and your frontend\">\u003cmeta data-mint-head name=\"application-name\" content=\"RuAPI\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/no-d0cfaf14/vv0-ZrOtX6-3EqF8/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/no-d0cfaf14/vv0-ZrOtX6-3EqF8/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/no-d0cfaf14/vv0-ZrOtX6-3EqF8/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/no-d0cfaf14/vv0-ZrOtX6-3EqF8/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/no-d0cfaf14/vv0-ZrOtX6-3EqF8/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/no-d0cfaf14/vv0-ZrOtX6-3EqF8/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/no-d0cfaf14/vv0-ZrOtX6-3EqF8/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/no-d0cfaf14/vv0-ZrOtX6-3EqF8/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/no-d0cfaf14/vv0-ZrOtX6-3EqF8/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"API keys \u0026amp; security - RuAPI\">\u003cmeta data-mint-head property=\"og:description\" content=\"How to create, use, cap with a credit limit and revoke a RuAPI key — and keep it out of Git and your frontend\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"RuAPI\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.ruapi.ai/en/authentication\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://no-d0cfaf14.mintlify.site/_mintlify/api/og/v2?division=Guides\u0026amp;title=API+keys+%26+security\u0026amp;description=How+to+create%2C+use%2C+cap+with+a+credit+limit+and+revoke+a+RuAPI+key+%E2%80%94+and+keep+it+out+of+Git+and+your+frontend\u0026amp;theme=c4de6659e60b8aa7f179d30a\u0026amp;signature=03564a55deb1a8c7cbbc05bdab88fd167cb91e68b53eeac7b5d818ba2326a7f3\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"API keys \u0026amp; security - RuAPI\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"How to create, use, cap with a credit limit and revoke a RuAPI key — and keep it out of Git and your frontend\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://no-d0cfaf14.mintlify.site/_mintlify/api/og/v2?division=Guides\u0026amp;title=API+keys+%26+security\u0026amp;description=How+to+create%2C+use%2C+cap+with+a+credit+limit+and+revoke+a+RuAPI+key+%E2%80%94+and+keep+it+out+of+Git+and+your+frontend\u0026amp;theme=c4de6659e60b8aa7f179d30a\u0026amp;signature=03564a55deb1a8c7cbbc05bdab88fd167cb91e68b53eeac7b5d818ba2326a7f3\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/no-d0cfaf14/vv0-ZrOtX6-3EqF8/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"RuAPI\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#1E40AF\">\u003cmeta data-mint-head name=\"yandex-verification\" content=\"978301833ca68565\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.ruapi.ai/en/authentication\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/en/authentication.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.ruapi.ai/en/authentication\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ru\" href=\"https://docs.ruapi.ai/ru/authentication\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh\" href=\"https://docs.ruapi.ai/zh/authentication\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.ruapi.ai/ru/authentication\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.ruapi.ai/#organization\",\"name\":\"RuAPI\",\"url\":\"https://docs.ruapi.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/no-d0cfaf14/1VmhF-J3miQLRTX3/logo/light.svg?fit=max\u0026auto=format\u0026n=1VmhF-J3miQLRTX3\u0026q=85\u0026s=1f94dc794b3a69a72b12786da6d4c4c7\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.ruapi.ai#website\",\"name\":\"RuAPI\",\"url\":\"https://docs.ruapi.ai\",\"publisher\":{\"@id\":\"https://docs.ruapi.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.ruapi.ai/en/authentication#webpage\",\"url\":\"https://docs.ruapi.ai/en/authentication\",\"name\":\"API keys \u0026 security\",\"description\":\"How to create, use, cap with a credit limit and revoke a RuAPI key — and keep it out of Git and your frontend\",\"dateModified\":\"2026-10-31T13:42:40.603Z\",\"isPartOf\":{\"@id\":\"https://docs.ruapi.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.ruapi.ai/en/authentication#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.ruapi.ai/en/authentication#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Guides\",\"item\":\"https://docs.ruapi.ai/en/models\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"API keys \u0026 security\",\"item\":\"https://docs.ruapi.ai/en/authentication\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.ruapi.ai/en/authentication#article\",\"headline\":\"API keys \u0026 security\",\"name\":\"API keys \u0026 security\",\"description\":\"How to create, use, cap with a credit limit and revoke a RuAPI key — and keep it out of Git and your frontend\",\"url\":\"https://docs.ruapi.ai/en/authentication\",\"mainEntityOfPage\":{\"@id\":\"https://docs.ruapi.ai/en/authentication#webpage\"},\"dateModified\":\"2026-10-31T13:42:40.603Z\",\"keywords\":\"how to create an API key, API key credit limit, sk key security, API key for LLMs\",\"publisher\":{\"@id\":\"https://docs.ruapi.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.ruapi.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"RuAPI\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"RuAPI\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/en/authentication.md","siteName":"RuAPI","nav":{"global":null,"languages":[{"language":"ru","navbar":{"links":[{"icon":"telegram","href":"https://t.me/ruapi_ai","label":"Канал в Telegram"},{"href":"mailto:support@ruapi.ai","label":"support@ruapi.ai"}],"primary":{"type":"button","label":"Начать","href":"https://www.ruapi.ai/?utm_source=docs\u0026utm_campaign=ru-navbar"}},"pages":[{"title":"ru","href":"/ru/authentication"}]},{"language":"en","navbar":{"links":[{"icon":"telegram","href":"https://t.me/ruapi_ai","label":"Telegram channel"},{"href":"mailto:support@ruapi.ai","label":"support@ruapi.ai"}],"primary":{"type":"button","label":"Get started","href":"https://www.ruapi.ai/?utm_source=docs\u0026utm_campaign=en-navbar"}},"groups":[{"group":"Getting Started","pages":[{"title":"RuAPI Docs","mode":"wide","href":"/en/introduction"},{"title":"Quick Start","icon":"bolt","href":"/en/quickstart"}]},{"group":"From Russia: step by step","pages":[{"title":"Claude Code in Russia: how to install and use it without a VPN","sidebarTitle":"Claude Code in Russia","icon":"terminal","href":"/en/claude-code-russia"},{"title":"Claude Code without a subscription: API key and pay-per-token from Russia","sidebarTitle":"Claude Code without a subscription","icon":"coins","href":"/en/claude-code-without-subscription"},{"title":"How to pay for the DeepSeek API from Russia","sidebarTitle":"Paying for DeepSeek API","icon":"wallet","href":"/en/pay-deepseek-api-russia"},{"title":"OpenAI (ChatGPT) API key in Russia: where to get it and how to pay","sidebarTitle":"OpenAI API key","icon":"key","href":"/en/openai-api-key-russia"},{"title":"Claude API key in Russia: where to get it and how to buy one","sidebarTitle":"Claude API key","icon":"key","href":"/en/claude-api-key-russia"},{"title":"Google AI Studio in Russia: how to use it and get a Gemini key","sidebarTitle":"Google AI Studio in Russia","icon":"google","href":"/en/google-ai-studio-russia"},{"title":"Gemini API key in Russia: where to get one and how","sidebarTitle":"Gemini API key","icon":"key","href":"/en/gemini-api-key-russia"},{"title":"Why some sell AI APIs at 5% of the official price — and what it costs you","sidebarTitle":"Why so cheap?","icon":"shield-halved","href":"/en/cheap-api-risks"}]},{"group":"Guides","pages":[{"title":"Models","icon":"layer-group","href":"/en/models"},{"title":"Model updates","icon":"clock-rotate-left","href":"/en/changelog"},{"title":"How billing works","icon":"receipt","href":"/en/pricing"},{"title":"Top-up Guide","icon":"wallet","href":"/en/topup"},{"title":"How to buy USDT with rubles","description":"No USDT yet? Three ways to buy USDT with rubles (SBP, Sberbank, T-Bank) and top up RuAPI: Crypto Bot in Telegram, Bybit P2P, and exchangers found via BestChange.","icon":"ruble-sign","href":"/en/buy-usdt"},{"title":"API keys \u0026 security","icon":"key","href":"/en/authentication"}]},{"group":"API Reference","pages":[{"title":"API Reference","description":"Two protocols supported: OpenAI-compatible and Anthropic Claude — pick what fits","icon":"code","href":"/en/api-reference"},{"title":"API error codes and fixes","icon":"triangle-exclamation","href":"/en/errors"},{"title":"OpenAI or Anthropic format: which one to use for Claude","sidebarTitle":"OpenAI vs Anthropic format","icon":"code-compare","href":"/en/openai-vs-anthropic-format"}]},{"group":"Model guides","pages":[{"group":"Claude","expanded":true,"pages":[{"title":"Claude API: tiers, versions and how to connect","sidebarTitle":"Claude API","icon":"brain","href":"/en/claude-api"},{"title":"Claude: “Request not allowed” (403) and “not allowed from unsupported countries” — what they mean and how to fix them","sidebarTitle":"Claude: Request not allowed","icon":"location-crosshairs","href":"/en/claude-request-not-allowed"}]},{"group":"OpenAI GPT","expanded":true,"pages":[{"title":"OpenAI GPT via RuAPI: the model lineup and when to use each","sidebarTitle":"GPT API","icon":"robot","href":"/en/gpt-api"},{"title":"OpenAI API: “unsupported_country_region_territory” (403) — what it means and how to fix it","sidebarTitle":"OpenAI: unsupported_country_region_territory","icon":"location-crosshairs","href":"/en/openai-unsupported-country-region-territory"}]},{"group":"Gemini","expanded":true,"pages":[{"title":"Gemini API: the model lineup, long context and multimodality","sidebarTitle":"Gemini API","icon":"sparkles","href":"/en/gemini-api"},{"title":"How to get the Gemini API in Russia: no VPN, no foreign card","sidebarTitle":"Gemini API without a VPN","icon":"earth-europe","href":"/en/gemini-api-russia"},{"title":"Gemini 4 Carbon: API release date, price and what to use now","sidebarTitle":"Gemini 4 Carbon","icon":"atom","href":"/en/gemini-4-carbon"},{"title":"Gemini API: “User location is not supported for the API use” — what it means and how to fix it","sidebarTitle":"Gemini: User location is not supported","icon":"location-crosshairs","href":"/en/gemini-user-location-not-supported"}]},{"group":"DeepSeek","expanded":true,"pages":[{"title":"DeepSeek API: the budget pick for code and reasoning","sidebarTitle":"DeepSeek API","icon":"microchip","href":"/en/deepseek-api"},{"title":"DeepSeek Flash: review and tests from Russia","sidebarTitle":"DeepSeek Flash review","icon":"bolt","href":"/en/deepseek-flash-review"},{"title":"DeepSeek API error 402 “Insufficient Balance” — what it means and how to fix it","sidebarTitle":"DeepSeek: 402 Insufficient Balance","icon":"wallet","href":"/en/deepseek-402-insufficient-balance"}]},{"title":"GLM API: Zhipu's models and how to connect","sidebarTitle":"GLM API (Zhipu)","icon":"cube","href":"/en/glm-api"},{"group":"Video: Seedance","expanded":true,"pages":[{"title":"Video generation: Seedance 2.0 / 2.5","sidebarTitle":"Video generation","icon":"clapperboard","href":"/en/video-generation"},{"title":"How to use Seedance 2.5 and 2.0 online: generate video in your browser with no subscription or VPN","sidebarTitle":"Seedance online in the browser","icon":"film","href":"/en/seedance-online"},{"title":"Seedance 2.5 and 2.0 prompts: formula, storyboards, sound and ready-made examples","sidebarTitle":"Seedance prompts","icon":"wand-magic-sparkles","href":"/en/seedance-prompts"},{"title":"Seedance: “input image may contain real person” (PrivacyInformation) — what it means and how to fix it","sidebarTitle":"Seedance: real person","icon":"user-slash","href":"/en/seedance-real-person-error"},{"title":"Seedance: PolicyViolation and SensitiveContentDetected — why a prompt, photo or finished video was rejected","sidebarTitle":"Seedance: moderation","icon":"shield-halved","href":"/en/seedance-sensitive-content-error"}]},{"group":"Images","expanded":true,"pages":[{"title":"Image generation: Gemini Image and GPT Image","sidebarTitle":"Image generation","icon":"image","href":"/en/image-generation"},{"title":"GPT Image 2.6 API in Russia without a VPN: Flare vs Sunburst, pricing, GIF and SVG","sidebarTitle":"GPT Image 2.6","icon":"image","href":"/en/gpt-image-2-6"}]}]},{"group":"Integrations","pages":[{"title":"CC Switch: point Claude Code and Codex at RuAPI","sidebarTitle":"CC Switch (multi-tool switcher)","icon":"shuffle","href":"/en/integrations/ccswitch"},{"title":"How to connect Claude Code to RuAPI","sidebarTitle":"Claude Code","icon":"terminal","href":"/en/integrations/claude-code"},{"title":"Claude Code on DeepSeek: Flash and V4 Pro","icon":"terminal","href":"/en/integrations/claude-code-deepseek"},{"title":"How to connect Codex CLI to RuAPI","sidebarTitle":"Codex CLI","icon":"code","href":"/en/integrations/codex"},{"title":"How to use OpenCode with Claude, DeepSeek and GPT via RuAPI","sidebarTitle":"OpenCode","icon":"square-terminal","href":"/en/integrations/opencode"},{"title":"How to connect OpenClaw to RuAPI","sidebarTitle":"OpenClaw","icon":"shrimp","href":"/en/integrations/openclaw"},{"title":"How to connect Hermes Agent to RuAPI","sidebarTitle":"Hermes Agent","icon":"caduceus","href":"/en/integrations/hermes"},{"title":"DeepSeek Harness (dsh) + RuAPI: DeepSeek, Claude and GPT in one agent","sidebarTitle":"DeepSeek Harness (dsh)","icon":"terminal","href":"/en/integrations/deepseek-harness"},{"title":"Cherry Studio: connect to RuAPI with an API key","sidebarTitle":"Cherry Studio","icon":"cherries","href":"/en/integrations/cherry-studio"},{"title":"How to switch from Cursor to Cline, Kilo Code, Claude Code and other agents","sidebarTitle":"Switching from Cursor","icon":"arrow-right-arrow-left","href":"/en/integrations/cursor-alternatives"},{"title":"Cursor with your own API key: connect to RuAPI","sidebarTitle":"Cursor","icon":"i-cursor","href":"/en/integrations/cursor"},{"title":"How to use Cline with Claude, DeepSeek and GPT via RuAPI","sidebarTitle":"Cline","icon":"robot","href":"/en/integrations/cline"},{"title":"Roo Code (shut down): connect Claude, DeepSeek and GPT via RuAPI","sidebarTitle":"Roo Code (shut down)","icon":"code","href":"/en/integrations/roo-code"},{"title":"How to use Kilo Code with Claude, DeepSeek and GPT via RuAPI","sidebarTitle":"Kilo Code","icon":"bolt","href":"/en/integrations/kilo-code"},{"title":"n8n: use RuAPI models in workflows (OpenAI node)","sidebarTitle":"n8n","icon":"diagram-project","href":"/en/integrations/n8n"},{"title":"LangChain with RuAPI: ChatOpenAI and base_url","sidebarTitle":"LangChain","icon":"link","href":"/en/integrations/langchain"},{"title":"JetBrains AI Assistant with your own key: Claude, DeepSeek and GPT via RuAPI","sidebarTitle":"JetBrains AI Assistant","icon":"laptop-code","href":"/en/integrations/jetbrains-ai-assistant"},{"title":"Open WebUI: connect RuAPI (OpenAI API Base URL)","sidebarTitle":"Open WebUI","icon":"browser","href":"/en/integrations/open-webui"},{"title":"LibreChat: add RuAPI as a custom endpoint","sidebarTitle":"LibreChat","icon":"comments","href":"/en/integrations/librechat"},{"title":"How to use Continue with Claude, DeepSeek and GPT via RuAPI (VS Code, JetBrains)","sidebarTitle":"Continue (discontinued)","icon":"forward","href":"/en/integrations/continue"}]},{"group":"Capabilities","pages":[{"title":"Streaming responses","icon":"wave-square","href":"/en/streaming"},{"title":"Prompt caching: pay at least 10× less for repeated context","sidebarTitle":"Prompt caching","icon":"database","href":"/en/prompt-caching"},{"title":"Function calling (tool use)","icon":"screwdriver-wrench","href":"/en/function-calling"},{"title":"Image input (vision)","icon":"image","href":"/en/vision"}]},{"group":"Recipes","pages":[{"title":"DeepSeek vs Claude: what one day of work actually costs","icon":"scale-balanced","href":"/en/deepseek-vs-claude"},{"title":"How to cut your Claude Code and Cline bill: caching, models, context","sidebarTitle":"Saving on Claude Code and Cline","icon":"piggy-bank","href":"/en/claude-code-cline-costs"},{"title":"Claude auto-caching: cache prices without setting cache_control","sidebarTitle":"Claude auto-caching","icon":"coins","href":"/en/claude-auto-cache"},{"title":"Long context in the API: what it costs and how to cut it","sidebarTitle":"Long context: how to save","icon":"scroll","href":"/en/long-context-costs"},{"title":"AI Telegram bot without code: GPT, Claude, DeepSeek","sidebarTitle":"Your own Telegram bot","icon":"telegram","href":"/en/integrations/telegram-bot"},{"title":"A Telegram bot on an LLM (Claude/GPT)","icon":"paper-plane","href":"/en/recipes/telegram-bot"}]},{"group":"Legal","pages":[{"title":"Terms of Service","icon":"scale-balanced","href":"/en/legal/terms"},{"title":"Privacy Policy","icon":"lock","href":"/en/legal/privacy"},{"title":"Refund Policy","icon":"circle-xmark","href":"/en/legal/refund"}]}]},{"language":"zh","navbar":{"links":[{"icon":"telegram","href":"https://t.me/ruapi_ai","label":"Telegram 频道"},{"href":"mailto:support@ruapi.ai","label":"support@ruapi.ai"}],"primary":{"type":"button","label":"开始使用","href":"https://www.ruapi.ai/?utm_source=docs\u0026utm_campaign=zh-navbar"}},"pages":[{"title":"zh","href":"/zh/authentication"}]}]},"basePath":"","title":"API keys \u0026 security - RuAPI","deploymentId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","buildId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-D0FT0qQs.js","DynamicMarkdown-CQM9Bhbv.js","zoom-image-lightbox-BQ4tbj_9.js","lightbox-handle-r17bVUz3.js"]}