API для PythonAPI for Python
Для своих скриптов, ботов и парсеров. Ключ хранится в переменной окружения — не в коде и не в Git. Вставь ключ в поле ниже — команды и сниппет соберутся под тебя.For your own scripts, bots and parsers. The key lives in an environment variable — not in code and not in Git. Paste your key below and the commands will be built for you.
Ключ не отправляется с этой страницы: команды собираются локально в браузере. Без галочки выше ключ исчезнет после закрытия страницы. Ключ — как пароль: не показывай его на скриншотах, не отправляй в чаты и не добавляй в 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 для PythonAPI for Python
Ключ из поля выше автоматически подставляется в команды и конфиги.Your key from the field above is inserted into the commands and configs automatically.
Установи библиотеку
Официальный OpenAI SDK — он подходит для нашего API.
В терминале: pip install openai (если pip не найден — python -m pip install openai).
Ключ — в переменную окружения
Так ключ не попадёт в код и в Git.
Windows. PowerShell, вставь команду целиком:
macOS / Linux. Terminal, вставь блок целиком:
После команды обязательно перезапусти терминал (и редактор, если запускаешь код из него) — переменная действует только в новых окнах.
Запусти первый запрос
Сниппет читает ключ из переменной — в коде его нет.
Стриминг ответа: stream=True. Картинки (vision): файл передаётся в content. Все модели — в таблице, маршруты — в документации.
Install the library
The official OpenAI SDK — it works with our API.
In the terminal: pip install openai (if pip is not found — python -m pip install openai).
Put the key into an environment variable
This way the key never lands in code or Git.
Windows. PowerShell — paste the whole command:
macOS / Linux. Terminal — paste the whole block:
After the command, be sure to restart the terminal (and the editor, if you run code from it) — the variable only works in new windows.
Run the first request
The snippet reads the key from the variable — it's not in the code.
Response streaming: stream=True. Images (vision): the file goes into content. All models — in the table, routes — in the documentation.
Частые ошибки
KeyError: 'AIDOSTUP_API_KEY'
401 — ключ не принят
404 Not Found
pip не найден
KeyError: 'AIDOSTUP_API_KEY'
401 — the key is not accepted
404 Not Found
pip is not found
Ограничения и совместимость
Сниппет рассчитан на официальный OpenAI SDK версии 1.x и новее; base_url указывается с /v1 на конце.
Если хранишь ключ в .env-файле — обязательно добавь .env в .gitignore: ключ не должен попадать в репозиторий.
Не вставляй ключ в код, который отправляешь кому-то или публикуешь.
The snippet targets the official OpenAI SDK version 1.x and newer; base_url is set with a trailing /v1.
If you keep the key in a .env file — be sure to add .env to .gitignore: the key must not land in the repository.
Never paste the key into code that you send to someone or publish.
Вопросы и ответы
Можно ли вписать ключ прямо в код?
Как включить стриминг ответа?
Работает ли асинхронный клиент?
Какую модель взять для теста?
Can I put the key right into the code?
How do I enable response streaming?
Does the async client work?
Which model should I take for a test?
Дальше:Next: Полный гайд и генератор конфигурацийFull guide and config generator Таблица моделейModel table Документация APIAPI documentation Баланс и логиBalance and logs
Инструкции для других программ:Guides for other tools:
Codex Claude Code Cursor Cline ZCode Терминал / cURLTerminal / cURL JavaScript JetBrains Antigravity Claude Code в РоссииClaude Code in Russia