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.

Base URL
API KeyAPI Key

Ключ не отправляется с этой страницы: команды собираются локально в браузере. Без галочки выше ключ исчезнет после закрытия страницы. Ключ — как пароль: не показывай его на скриншотах, не отправляй в чаты и не добавляй в 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.

Как подключить

Какая у тебя система?Your operating system?

API ключ для Claude CodeAPI key for Claude Code

Ключ из поля выше автоматически подставляется в команды и конфиги.Your key from the field above is inserted into the commands and configs automatically.

1

Установи Claude Code

Уже стоит — переходи к способу А или Б.

  1. Поставь Node.js (версия 18 или новее).
  2. В терминале выполни: npm install -g @anthropic-ai/claude-code
2

Способ А — файл настроек (без терминала)

Итог тот же, что у способа Б, но систему не трогаем.

  1. Открой папку: нажми Win+R, вставь %USERPROFILE%\.claude, Enter. Папки нет — создай.
  2. Открой папку: в Finder нажми Cmd+Shift+G, вставь ~/.claude, Enter. Папки нет — создай.
  3. Создай в ней файл settings.json (обычным Блокнотом/текстовым редактором) и вставь текст ниже — ключ уже подставлен из поля выше:

Кнопку «Скачать settings.json» с готовым файлом ищи на странице «Подключение».

3

Способ Б — переменные окружения

Выбери систему и вставь блок целиком.

Windows. Открой PowerShell (Пуск → набери powershell), вставь обе команды, Enter:

macOS / Linux. Открой Terminal, вставь блок целиком, Enter — он пропишет настройки сразу в ~/.zshrc и ~/.bashrc:

4

Перезапусти и запусти Claude Code

Настройки действуют только в новых окнах терминала.

  1. Полностью закрой все окна терминала, открой новое.
  2. Запусти claude — всё, можно работать.
  3. Модель выбирается как обычно: /model claude-sonnet-5. Доступны claude-opus-5, claude-fable-5, claude-sonnet-5, claude-haiku-4-5 и другие — полный список.

Почему это работает из России без VPN и что делать при блокировках — подробно разобрано в гайде «Claude Code в России».

1

Install Claude Code

Already installed? Skip to method A or B.

  1. Install Node.js (version 18 or newer).
  2. In the terminal, run: npm install -g @anthropic-ai/claude-code
2

Method A — a settings file (no terminal)

Same result as method B, but the system stays untouched.

  1. Open the folder: press Win+R, paste %USERPROFILE%\.claude, Enter. No such folder? Create it.
  2. Open the folder: in Finder press Cmd+Shift+G, paste ~/.claude, Enter. No such folder? Create it.
  3. 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.

3

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:

4

Restart and launch Claude Code

The settings only apply in new terminal windows.

  1. Close all terminal windows completely and open a new one.
  2. Run claude — that's it, you can work.
  3. 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
Переменные окружения должны быть заданы до первого запуска. Если он уже спросил логин — выполни в нём /logout, полностью перезапусти терминал и запусти claude снова.
401 — ключ не принят
Проверь: ANTHROPIC_AUTH_TOKEN скопирован целиком и без пробелов; файл называется именно settings.json и лежит именно в папке ~/.claude; JSON не сломан (кавычки и запятые на местах).
Переменные окружения не действуют
На Windows команда setx действует только на новые окна терминала — полностью закрой все окна и открой заново. На macOS/Linux проверь, что блок попал в ~/.zshrc (терминал macOS по умолчанию использует именно его).
Медленно отвечает или ошибка сети
Выключи VPN — сервер находится в России, и соединение напрямую быстрее и стабильнее. Остаток токенов и последние списания видны на странице баланса.
Claude Code asks to sign in to an Anthropic account
The environment variables must be set before the first launch. If it already asked for a login — run /logout inside it, fully restart the terminal and run claude again.
401 — the key is not accepted
Check: ANTHROPIC_AUTH_TOKEN is copied in full, with no spaces; the file is named exactly settings.json and sits exactly in the ~/.claude folder; the JSON is valid (quotes and commas in place).
The environment variables have no effect
On Windows, setx only affects new terminal windows — close all of them and reopen. On macOS/Linux, check that the block landed in ~/.zshrc (the macOS terminal uses it by default).
Slow responses or network errors
Turn your VPN off — the server is in Russia, and a direct connection is faster and more stable. Remaining tokens and recent charges are on the balance page.

Ограничения и совместимость

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?
Windows: %USERPROFILE%\.claude\settings.json, macOS и Linux: ~/.claude/settings.json. Папки .claude может не быть — создай её.
Какую модель выбрать для Claude Code?
Оптимум по цене и качеству — claude-sonnet-5. Максимум качества для сложных задач — claude-opus-5. Дешёвая и быстрая — claude-haiku-4-5.
Работает ли Claude Code из России?
Да: запросы идут через сервер в России, VPN не нужен, оплата в рублях. Подробный гайд с нюансами — «Claude Code в России».
Чем способ А отличается от способа Б?
Итог одинаковый. Способ А пишет настройки в один файл и не трогает систему — его проще отменить (удалить файл). Способ Б прописывает переменные для всех терминалов сразу — удобно, если работаешь в нескольких.
Where should settings.json live?
Windows: %USERPROFILE%\.claude\settings.json; macOS and Linux: ~/.claude/settings.json. The .claude folder may not exist — create it.
Which model should I pick for Claude Code?
Best price/quality balance — claude-sonnet-5. Maximum quality for hard tasks — claude-opus-5. Cheap and fast — claude-haiku-4-5.
Does Claude Code work from Russia?
Yes: requests go through a server in Russia, no VPN needed, payment in rubles. A detailed guide — “Claude Code in Russia”.
How is method A different from method B?
The result is the same. Method A writes the settings into one file and doesn't touch the system — easy to undo (delete the file). Method B sets the variables for every terminal at once — handy if you work in several.