API ключ для Claude Code: подключение за 5 минутAPI key for Claude Code: set up in 5 minutes
Claude Code — ИИ-помощник, который живёт в терминале. Настраивается один раз — файлом настроек или двумя переменными окружения, — дальше работает через наш API.Claude Code is an AI assistant that lives in the terminal. You set it up once — with a settings file or two environment variables — and it works through our API.
Ключ не отправляется с этой страницы: команды собираются локально в браузере. Без галочки выше ключ исчезнет после закрытия страницы. Ключ — как пароль: не показывай его на скриншотах, не отправляй в чаты и не добавляй в Git. Нет ключа — зарегистрируйся: личный ключ выпустится сам. Кнопки скачивания готовых файлов (settings.json, codex-setup.bat) — на странице «Подключение» — генератор конфигураций.Your key never leaves this page: commands are assembled locally in your browser. Without the checkbox above, the key disappears when you close the page. Treat the key like a password: never show it in screenshots, chats, or Git. No key yet? Register — a personal key is issued automatically. Download buttons for ready-made files are on the full connection page.
Как подключить
API ключ для Claude CodeAPI key for Claude Code
Ключ из поля выше автоматически подставляется в команды и конфиги.Your key from the field above is inserted into the commands and configs automatically.
Установи Claude Code
Уже стоит — переходи к способу А или Б.
- Поставь Node.js (версия 18 или новее).
- В терминале выполни: npm install -g @anthropic-ai/claude-code
Способ А — файл настроек (без терминала)
Итог тот же, что у способа Б, но систему не трогаем.
- Открой папку: нажми Win+R, вставь %USERPROFILE%\.claude, Enter. Папки нет — создай.
- Открой папку: в Finder нажми Cmd+Shift+G, вставь ~/.claude, Enter. Папки нет — создай.
- Создай в ней файл settings.json (обычным Блокнотом/текстовым редактором) и вставь текст ниже — ключ уже подставлен из поля выше:
Кнопку «Скачать settings.json» с готовым файлом ищи на странице «Подключение».
Способ Б — переменные окружения
Выбери систему и вставь блок целиком.
Windows. Открой PowerShell (Пуск → набери powershell), вставь обе команды, Enter:
macOS / Linux. Открой Terminal, вставь блок целиком, Enter — он пропишет настройки сразу в ~/.zshrc и ~/.bashrc:
Перезапусти и запусти Claude Code
Настройки действуют только в новых окнах терминала.
- Полностью закрой все окна терминала, открой новое.
- Запусти claude — всё, можно работать.
- Модель выбирается как обычно: /model claude-sonnet-5. Доступны claude-opus-5, claude-fable-5, claude-sonnet-5, claude-haiku-4-5 и другие — полный список.
Почему это работает из России без VPN и что делать при блокировках — подробно разобрано в гайде «Claude Code в России».
Install Claude Code
Already installed? Skip to method A or B.
- Install Node.js (version 18 or newer).
- In the terminal, run: npm install -g @anthropic-ai/claude-code
Method A — a settings file (no terminal)
Same result as method B, but the system stays untouched.
- Open the folder: press Win+R, paste %USERPROFILE%\.claude, Enter. No such folder? Create it.
- Open the folder: in Finder press Cmd+Shift+G, paste ~/.claude, Enter. No such folder? Create it.
- Create a file named settings.json in it (any text editor) and paste the text below — your key is already inserted from the field above:
A ready-made “Download settings.json” button lives on the full connection page.
Method B — environment variables
Pick your system and paste the whole block.
Windows. Open PowerShell (Start → type powershell), paste both commands, Enter:
macOS / Linux. Open Terminal, paste the whole block, Enter — it writes the settings into both ~/.zshrc and ~/.bashrc:
Restart and launch Claude Code
The settings only apply in new terminal windows.
- Close all terminal windows completely and open a new one.
- Run claude — that's it, you can work.
- The model is picked as usual: /model claude-sonnet-5. Available: claude-opus-5, claude-fable-5, claude-sonnet-5, claude-haiku-4-5 and more — full list.
Why this works from Russia without a VPN and what to do about blocks — covered in detail in the guide “Claude Code in Russia”.
Частые ошибки
Claude Code требует войти в аккаунт Anthropic
401 — ключ не принят
Переменные окружения не действуют
Медленно отвечает или ошибка сети
Claude Code asks to sign in to an Anthropic account
401 — the key is not accepted
The environment variables have no effect
Slow responses or network errors
Ограничения и совместимость
Claude Code обращается по Anthropic-формату: сервер принимает /v1/messages и подсчёт токенов. В настройках адрес указывается БЕЗ /v1 на конце — Claude Code сам добавляет нужный путь (проверено на практике: клиенты подключаются именно так).
Названия переменных важны до буквы: ANTHROPIC_BASE_URL и ANTHROPIC_AUTH_TOKEN.
Claude Code периодически обновляется, и поведение входа в аккаунт меняется между версиями. Если что-то не сходится — сверься с официальной документацией Anthropic.
Часть функций (веб-поиск, некоторые серверные инструменты Anthropic) выполняется на стороне Anthropic и может быть недоступна через сторонний API — это ограничение Claude Code, не сервера.
Claude Code speaks the Anthropic format: the server accepts /v1/messages and token counting. In the settings the address goes WITHOUT a trailing /v1 — Claude Code adds the right path itself (verified in practice: clients connect exactly this way).
Variable names matter down to the letter: ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN.
Claude Code updates regularly, and account sign-in behavior changes between versions. If something doesn't match up — check the official Anthropic documentation.
Some features (web search, certain Anthropic server-side tools) run on Anthropic's side and may be unavailable through a third-party API — a Claude Code limitation, not the server's.
Вопросы и ответы
Где должен лежать settings.json?
Какую модель выбрать для Claude Code?
Работает ли Claude Code из России?
Чем способ А отличается от способа Б?
Where should settings.json live?
Which model should I pick for Claude Code?
Does Claude Code work from Russia?
How is method A different from method B?
Дальше:Next: Полный гайд и генератор конфигурацийFull guide and config generator Таблица моделейModel table Документация APIAPI documentation Баланс и логиBalance and logs
Инструкции для других программ:Guides for other tools:
Codex Cursor Cline ZCode Терминал / cURLTerminal / cURL Python JavaScript JetBrains Antigravity Claude Code в РоссииClaude Code in Russia