API ключ для Codex: App, CLI и VS CodeAPI key for Codex: App, CLI and VS Code
У Codex есть отдельное приложение, версия для терминала и расширение VS Code. Выбери свой вариант — на полной странице подключения команда собирается под приложение, систему и твой ключ.Codex comes as a desktop app, a terminal tool and a VS Code extension. Choose your version — the full connection page builds the command for your app, operating system and key.
Ключ не отправляется с этой страницы: команды собираются локально в браузере. Без галочки выше ключ исчезнет после закрытия страницы. Ключ — как пароль: не показывай его на скриншотах, не отправляй в чаты и не добавляй в Git. Нет ключа — зарегистрируйся: личный ключ выпустится сам. Готовые файлы и команды для выбранной программы и системы — на странице «Подключение» — генератор конфигураций.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 ключ для CodexAPI key for Codex
Ключ из поля выше автоматически подставляется в команды и конфиги.Your key from the field above is inserted into the commands and configs automatically.
Если до этого ты входил в Codex со своим личным аккаунтом ChatGPT (Plus/Pro) — сначала выйди из него: в приложении открой настройки и нажми Sign out, в терминале выполни codex logout. Иначе настройка перекроет личный вход: автоматический способ сохраняет старую копию файлов в папке backups, при ручной настройке сделай копию auth.json сам.
Выбери свой Codex
Открой нужную вкладку на странице подключения.
Codex App — отдельное настольное приложение.
Codex CLI — работа через команды в терминале.
Codex в VS Code — официальное расширение внутри редактора.
Вставь ключ и выбери систему
Windows, macOS или Linux — переключатель на полной странице.
Скопируй ключ ниже и вставь в поле вверху выбранной страницы подключения. Если ты включил «Запомнить ключ только на этом устройстве», он подставится там автоматически. Без этой галочки переход на другую страницу ключ не переносит.
sk-ВАШ_КЛЮЧПодстановка ключа в команды и файлы происходит в браузере. После запуска команды или Codex ключ используется для подключения к AiDostup API — не публикуй команды и файлы с ним.
Выполни одну команду и перезапусти
Используй блок «Автоматически — одна команда» для своего приложения.
- Сохрани работу. Перед настройкой App или расширения полностью закрой Codex App или VS Code, как указано в выбранной вкладке.
- Открой PowerShell на Windows (Пуск → набери PowerShell) или «Терминал» на macOS/Linux.
- Скопируй готовую команду кнопкой на полной странице, вставь целиком и нажми Enter. Дождись завершения; если появилась ошибка, не считай настройку законченной.
- Полностью перезапусти выбранное приложение. Для CLI закрой прежний сеанс и открой новое окно терминала.
Не подменяй команду для App или VS Code командой для CLI: варианты учитывают настройку приложения и перенос существующих чатов. Автоматический способ предпочтительнее ручной замены файлов.
Если хочешь настроить вручную
Сначала сохрани отдельную резервную копию папки .codex. Затем открой блок «Вручную» в выбранной вкладке: там готовятся config.toml, auth.json и .env.
Папка в Windows — %USERPROFILE%\.codex, в macOS/Linux — ~/.codex (домашняя папка пользователя, не папка проекта). Положи туда три файла с исходными именами, без добавления .txt, затем полностью перезапусти Codex.
Команда записи .env в ручном блоке только задаёт ключ в этом файле. Она не заменяет config.toml и auth.json и не выполняет перенос чатов. Ручная замена файлов — не полный аналог автоматического способа.
If you previously signed into Codex with your personal ChatGPT (Plus/Pro) account — sign out first: open settings in the app and click Sign out, or run codex logout in the terminal. Otherwise the setup replaces the personal login: the automatic method keeps the old copy in the backups folder; if you set up manually, back up auth.json yourself.
Choose your Codex
Open the matching tab on the connection page.
Codex App — the standalone desktop application.
Codex CLI — commands in a terminal.
Codex in VS Code — the official extension inside the editor.
Paste your key and choose your system
Windows, macOS or Linux — use the selector on the full page.
Copy your key below and paste it into the field at the top of the chosen connection page. If you enabled “Remember this key on this device only”, it will appear there automatically. Without that checkbox, navigating to another page does not carry the key over.
sk-ВАШ_КЛЮЧKeys are inserted into commands and files locally in your browser. Once you run a command or Codex, the key is used to connect to AiDostup API — never publish commands or files containing it.
Run one command and restart
Use “Automatic — one command” for your application.
- Save your work. Before configuring the App or extension, fully close Codex App or VS Code as instructed in the selected tab.
- Open PowerShell on Windows (Start → type PowerShell) or Terminal on macOS/Linux.
- Copy the generated command using the button on the full page, paste it in one piece and press Enter. Wait for completion; an error means setup is not complete.
- Fully restart the selected application. For CLI, close the previous session and open a new terminal window.
Do not replace the App or VS Code command with the CLI command: the variants account for application setup and migration of existing chats. Automatic setup is recommended over replacing files manually.
If you prefer manual setup
First keep a separate backup of your .codex folder. Then open “Manual setup” in the selected tab: it provides config.toml, auth.json and .env.
The folder is %USERPROFILE%\.codex on Windows or ~/.codex on macOS/Linux (your home folder, not the project folder). Put all three files there with their original names, without adding .txt, then fully restart Codex.
The command that writes .env in the manual section only sets the key in that file. It does not replace config.toml or auth.json, and does not migrate chats. Replacing files manually is not a complete equivalent of automatic setup.
Частые ошибки
После обновления Codex соединение часто рвётся — постоянные переподключения
Команда закончилась ошибкой или настройки не применились
Ошибка 401 или упоминание api.openai.com
Записал .env, но Codex всё ещё не подключается
After a Codex update the connection keeps dropping — frequent reconnects
The command failed or the settings did not apply
Error 401 or a reference to api.openai.com
I wrote .env but Codex still cannot connect
Ограничения и совместимость
Команды зависят от приложения и ОС: не переноси команду из соседней вкладки, даже если часть файлов общая.
В готовом конфиге Codex используется специальный адрес подключения. Не заменяй его общим Base URL из карточки выше и не смешивай со старыми примерами настройки.
Удаление интеграции не означает гарантированный возврат всех файлов и чатов в прежнее состояние. Перед заменой файлов сохраняй свою резервную копию; ограничения удаления описаны на полной странице.
Commands depend on the application and OS: do not take a command from a different tab even if some files are shared.
The ready-made Codex config uses a dedicated connection address. Do not replace it with the general Base URL from the card above or mix it with older setup examples.
Removing the integration does not guarantee that every file and chat returns to its previous state. Keep your own backup before replacing files; removal limitations are on the full page.
Вопросы и ответы
Где лежат config.toml, auth.json и .env?
У App, CLI и VS Code одна команда?
Куда отправляется ключ из поля на странице?
Как отменить подключение?
Where do config.toml, auth.json and .env belong?
Do App, CLI and VS Code use the same command?
Where is the key from the page sent?
How do I undo the connection?
Дальше:Next: Полный гайд и генератор конфигурацийFull guide and config generator Таблица моделейModel table Документация APIAPI documentation Баланс и логиBalance and logs
Инструкции для других программ:Guides for other tools:
Claude Code Cline ZCode Терминал / cURLTerminal / cURL Python JavaScript JetBrains Antigravity Claude Code в РоссииClaude Code in Russia