Документация Botech AI Gateway
Единый OpenAI-совместимый API для GPT, Gemini, Claude и Grok. Меняете base_url и ключ — и сразу получаете доступ ко всем моделям. Без VPN, без зарубежных карт, с биллингом в рублях.
Содержание
1. Быстрый старт
- Зарегистрируйтесь и войдите в кабинет.
- Пополните баланс в разделе Биллинг.
- Создайте API-ключ в разделе Ключи API. Ключ показывается ровно один раз.
- Отправьте первый запрос на
https://proxy.botech.pro/v1/chat/completions.
Учёт расходов в реальном времени, отдельные лимиты на ключ, история запросов в кабинете.
2. Аутентификация
Все запросы идут на https://proxy.botech.pro/v1 и требуют заголовок Authorization: Bearer bt_... с вашим токеном.
Authorization: Bearer bt_xxxxxxxx_yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
Content-Type: application/json
Не публикуйте ключ в репозиториях и фронтенде. При компрометации сразу отозвите его в кабинете.
3. Список endpoint
/v1 — служебный индекс с описанием API/v1/models — все доступные модели/v1/models/{model} — описание конкретной модели/v1/chat/completions — чат-комплишены (основной endpoint)/v1/responses — Responses API в формате OpenAI/v1/text/generations — простой текст по промпту/v1/images/generations — генерация изображений/v1/models/{model}/chat/completions — то же, но модель в URL вместо тела/v1/me — профиль текущего токена/v1/balance — баланс и расходы/v1/usage — снимок использования за период4. Чат-комплишены
Совместимы со схемой OpenAI Chat Completions. Достаточно подменить base_url и ключ.
Запрос
POST https://proxy.botech.pro/v1/chat/completions
Authorization: Bearer bt_YOUR_TOKEN
Content-Type: application/json
{
"model": "gpt-4o-mini",
"messages": [
{"role": "system", "content": "Ты вежливый ассистент."},
{"role": "user", "content": "Привет!"}
],
"temperature": 0.7,
"max_tokens": 256
}
Ответ
{
"id": "chatcmpl-...",
"object": "chat.completion",
"created": 1777300000,
"model": "gpt-4o-mini",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "Привет! Чем помочь?"},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 18,
"completion_tokens": 7,
"total_tokens": 25
}
}
Поля messages, temperature, top_p, max_tokens, stop, tools, tool_choice, response_format поддерживаются провайдерами в их форматах. Параметр stream в текущей версии шлюза отключен — см. раздел «Лимиты и стриминг».
5. Python (официальный OpenAI SDK)
pip install openai
from openai import OpenAI
client = OpenAI(
base_url="https://proxy.botech.pro/v1",
api_key="bt_YOUR_TOKEN",
)
resp = client.chat.completions.create(
model="gpt-4o-mini",
messages=[
{"role": "system", "content": "Отвечай кратко."},
{"role": "user", "content": "Скажи 'pong'"},
],
max_tokens=20,
)
print(resp.choices[0].message.content)
print(resp.usage)
6. Node.js / TypeScript (OpenAI SDK)
npm install openai
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://proxy.botech.pro/v1",
apiKey: "bt_YOUR_TOKEN",
});
const resp = await client.chat.completions.create({
model: "gpt-4o-mini",
messages: [
{ role: "system", content: "Ты ассистент." },
{ role: "user", content: "Привет!" },
],
max_tokens: 50,
});
console.log(resp.choices[0].message.content);
7. Чистый HTTP (curl / requests / fetch)
curl
curl https://proxy.botech.pro/v1/chat/completions \
-H "Authorization: Bearer bt_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o-mini",
"messages": [{"role":"user","content":"Привет"}]
}'
Python requests
import requests
r = requests.post(
"https://proxy.botech.pro/v1/chat/completions",
headers={"Authorization": "Bearer bt_YOUR_TOKEN"},
json={
"model": "gpt-4o-mini",
"messages": [{"role": "user", "content": "Привет"}],
},
timeout=60,
)
r.raise_for_status()
print(r.json()["choices"][0]["message"]["content"])
JavaScript fetch
const r = await fetch("https://proxy.botech.pro/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": "Bearer bt_YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "gpt-4o-mini",
messages: [{ role: "user", content: "Привет" }],
}),
});
const data = await r.json();
console.log(data.choices[0].message.content);
8. Responses API
Зеркалит формат OpenAI Responses. Удобно для агентских сценариев и потокового вывода tool-calls.
POST https://proxy.botech.pro/v1/responses
{
"model": "gpt-4o-mini",
"input": "Сгенерируй краткий план выходного дня в Москве"
}
9. Генерация изображений
POST https://proxy.botech.pro/v1/images/generations
{
"model": "gpt-image-1",
"prompt": "Минималистичный логотип проекта о космосе",
"size": "1024x1024",
"n": 1
}
Возвращает массив data[].b64_json или data[].url в зависимости от модели.
10. Text completions
POST https://proxy.botech.pro/v1/text/generations
{
"model": "gpt-4o-mini",
"prompt": "Однострочный заголовок для статьи о Kubernetes:",
"max_tokens": 64
}
Если у модели нет нативной поддержки completions, шлюз автоматически оборачивает запрос в чат-схему.
11. Маршрутизация моделей
Имя модели в поле model однозначно определяет провайдера и тарифную сетку. Маршрутизация прозрачна для клиента: один и тот же ключ работает со всеми провайдерами.
gpt-*,o1-*,o3-*,chatgpt-*,gpt-image-*— OpenAIgemini-*— Googleclaude-*— Anthropicgrok-*— xAI
Полный список см. в разделе «Все доступные модели» ниже или через GET /v1/models.
12. Биллинг и аккаунт
GET /v1/me
{
"user": {"id": "...", "login": "you@example.com", "status": "ACTIVE", ...},
"token": {"id": "...", "prefix": "12345678", "status": "ACTIVE", ...},
"usage": {"requestsTotal": 42, "spendTotalUsd": 1.23, "spendMonthUsd": 0.45}
}
GET /v1/balance
{
"account_balance_usd": 10.0,
"account_balance_rub": 950.0,
"spend_total_usd": 1.23,
"remaining_balance_usd": 8.77,
"monthly_limit_usd": 50.0,
"spend_month_usd": 0.45,
"remaining_month_usd": 49.55
}
GET /v1/usage
Снимок: количество запросов и расход за всё время / за текущий месяц.
13. Все доступные модели
Показываются только включенные модели. Актуальный список — через GET /v1/models.
| Модель | Endpoint |
|---|---|
babbage-002 |
/v1/chat/completions |
chatgpt-image-latest |
/v1/images/generations |
dall-e-2 |
/v1/chat/completions |
dall-e-3 |
/v1/chat/completions |
davinci-002 |
/v1/chat/completions |
deep-research-max-preview-04-2026 |
/v1/chat/completions |
deep-research-preview-04-2026 |
/v1/chat/completions |
deep-research-pro-preview-12-2025 |
/v1/chat/completions |
gemini-2.0-flash |
/v1/chat/completions |
gemini-2.0-flash-001 |
/v1/chat/completions |
gemini-2.0-flash-lite |
/v1/chat/completions |
gemini-2.0-flash-lite-001 |
/v1/chat/completions |
gemini-2.5-computer-use-preview-10-2025 |
/v1/chat/completions |
gemini-2.5-flash |
/v1/chat/completions |
gemini-2.5-flash-image |
/v1/images/generations |
gemini-2.5-flash-lite |
/v1/chat/completions |
gemini-2.5-flash-preview-tts |
/v1/chat/completions |
gemini-2.5-pro |
/v1/chat/completions |
gemini-2.5-pro-preview-tts |
/v1/chat/completions |
gemini-3-flash-preview |
/v1/chat/completions |
gemini-3-pro-image-preview |
/v1/images/generations |
gemini-3-pro-preview |
/v1/chat/completions |
gemini-3.1-flash-image-preview |
/v1/images/generations |
gemini-3.1-flash-lite-preview |
/v1/chat/completions |
gemini-3.1-flash-tts-preview |
/v1/chat/completions |
gemini-3.1-pro-preview |
/v1/chat/completions |
gemini-3.1-pro-preview-customtools |
/v1/chat/completions |
gemini-flash-latest |
/v1/chat/completions |
gemini-flash-lite-latest |
/v1/chat/completions |
gemini-pro-latest |
/v1/chat/completions |
gemini-robotics-er-1.5-preview |
/v1/chat/completions |
gemini-robotics-er-1.6-preview |
/v1/chat/completions |
gemma-3-12b-it |
/v1/chat/completions |
gemma-3-1b-it |
/v1/chat/completions |
gemma-3-27b-it |
/v1/chat/completions |
gemma-3-4b-it |
/v1/chat/completions |
gemma-3n-e2b-it |
/v1/chat/completions |
gemma-3n-e4b-it |
/v1/chat/completions |
gemma-4-26b-a4b-it |
/v1/chat/completions |
gemma-4-31b-it |
/v1/chat/completions |
gpt-3.5-turbo |
/v1/chat/completions |
gpt-3.5-turbo-0125 |
/v1/chat/completions |
gpt-3.5-turbo-1106 |
/v1/chat/completions |
gpt-3.5-turbo-16k |
/v1/chat/completions |
gpt-3.5-turbo-instruct |
/v1/chat/completions |
gpt-3.5-turbo-instruct-0914 |
/v1/chat/completions |
gpt-4 |
/v1/chat/completions |
gpt-4-0613 |
/v1/chat/completions |
gpt-4-turbo |
/v1/chat/completions |
gpt-4-turbo-2024-04-09 |
/v1/chat/completions |
gpt-4.1 |
/v1/chat/completions |
gpt-4.1-2025-04-14 |
/v1/chat/completions |
gpt-4.1-mini |
/v1/chat/completions |
gpt-4.1-mini-2025-04-14 |
/v1/chat/completions |
gpt-4.1-nano |
/v1/chat/completions |
gpt-4.1-nano-2025-04-14 |
/v1/chat/completions |
gpt-4o |
/v1/chat/completions |
gpt-4o-2024-05-13 |
/v1/chat/completions |
gpt-4o-2024-08-06 |
/v1/chat/completions |
gpt-4o-2024-11-20 |
/v1/chat/completions |
gpt-4o-audio-preview |
/v1/chat/completions |
gpt-4o-audio-preview-2024-12-17 |
/v1/chat/completions |
gpt-4o-audio-preview-2025-06-03 |
/v1/chat/completions |
gpt-4o-mini |
/v1/chat/completions |
gpt-4o-mini-2024-07-18 |
/v1/chat/completions |
gpt-4o-mini-audio-preview |
/v1/chat/completions |
gpt-4o-mini-audio-preview-2024-12-17 |
/v1/chat/completions |
gpt-4o-mini-realtime-preview |
/v1/chat/completions |
gpt-4o-mini-realtime-preview-2024-12-17 |
/v1/chat/completions |
gpt-4o-mini-search-preview |
/v1/chat/completions |
gpt-4o-mini-search-preview-2025-03-11 |
/v1/chat/completions |
gpt-4o-mini-transcribe |
/v1/chat/completions |
gpt-4o-mini-transcribe-2025-03-20 |
/v1/chat/completions |
gpt-4o-mini-transcribe-2025-12-15 |
/v1/chat/completions |
gpt-4o-mini-tts |
/v1/chat/completions |
gpt-4o-mini-tts-2025-03-20 |
/v1/chat/completions |
gpt-4o-mini-tts-2025-12-15 |
/v1/chat/completions |
gpt-4o-realtime-preview |
/v1/chat/completions |
gpt-4o-realtime-preview-2024-12-17 |
/v1/chat/completions |
gpt-4o-realtime-preview-2025-06-03 |
/v1/chat/completions |
gpt-4o-search-preview |
/v1/chat/completions |
gpt-4o-search-preview-2025-03-11 |
/v1/chat/completions |
gpt-4o-transcribe |
/v1/chat/completions |
gpt-4o-transcribe-diarize |
/v1/chat/completions |
gpt-5 |
/v1/responses |
gpt-5-2025-08-07 |
/v1/responses |
gpt-5-chat-latest |
/v1/responses |
gpt-5-codex |
/v1/responses |
gpt-5-mini |
/v1/responses |
gpt-5-mini-2025-08-07 |
/v1/responses |
gpt-5-nano |
/v1/responses |
gpt-5-nano-2025-08-07 |
/v1/responses |
gpt-5-pro |
/v1/responses |
gpt-5-pro-2025-10-06 |
/v1/responses |
gpt-5-search-api |
/v1/responses |
gpt-5-search-api-2025-10-14 |
/v1/responses |
gpt-5.1 |
/v1/responses |
gpt-5.1-2025-11-13 |
/v1/responses |
gpt-5.1-chat-latest |
/v1/responses |
gpt-5.1-codex |
/v1/responses |
gpt-5.1-codex-max |
/v1/responses |
gpt-5.1-codex-mini |
/v1/responses |
gpt-5.2 |
/v1/responses |
gpt-5.2-2025-12-11 |
/v1/responses |
gpt-5.2-chat-latest |
/v1/responses |
gpt-5.2-codex |
/v1/responses |
gpt-5.2-pro |
/v1/responses |
gpt-5.2-pro-2025-12-11 |
/v1/responses |
gpt-5.3-chat-latest |
/v1/responses |
gpt-5.3-codex |
/v1/responses |
gpt-5.4 |
/v1/responses |
gpt-5.4-2026-03-05 |
/v1/responses |
gpt-5.4-mini |
/v1/responses |
gpt-5.4-mini-2026-03-17 |
/v1/responses |
gpt-5.4-nano |
/v1/responses |
gpt-5.4-nano-2026-03-17 |
/v1/responses |
gpt-5.4-pro |
/v1/responses |
gpt-5.4-pro-2026-03-05 |
/v1/responses |
gpt-5.5 |
/v1/responses |
gpt-5.5-2026-04-23 |
/v1/responses |
gpt-5.5-pro |
/v1/responses |
gpt-5.5-pro-2026-04-23 |
/v1/responses |
gpt-audio |
/v1/chat/completions |
gpt-audio-1.5 |
/v1/chat/completions |
gpt-audio-2025-08-28 |
/v1/chat/completions |
gpt-audio-mini |
/v1/chat/completions |
gpt-audio-mini-2025-10-06 |
/v1/chat/completions |
gpt-audio-mini-2025-12-15 |
/v1/chat/completions |
gpt-image-1 |
/v1/images/generations |
gpt-image-1-mini |
/v1/images/generations |
gpt-image-1.5 |
/v1/images/generations |
gpt-image-2 |
/v1/images/generations |
gpt-image-2-2026-04-21 |
/v1/images/generations |
gpt-realtime |
/v1/chat/completions |
gpt-realtime-1.5 |
/v1/chat/completions |
gpt-realtime-2025-08-28 |
/v1/chat/completions |
gpt-realtime-mini |
/v1/chat/completions |
gpt-realtime-mini-2025-10-06 |
/v1/chat/completions |
gpt-realtime-mini-2025-12-15 |
/v1/chat/completions |
grok-3 |
/v1/chat/completions |
grok-3-mini |
/v1/chat/completions |
grok-4-0709 |
/v1/chat/completions |
grok-4-1-fast-non-reasoning |
/v1/chat/completions |
grok-4-1-fast-reasoning |
/v1/chat/completions |
grok-4-fast-non-reasoning |
/v1/chat/completions |
grok-4-fast-reasoning |
/v1/chat/completions |
grok-4.20-0309-non-reasoning |
/v1/chat/completions |
grok-4.20-0309-reasoning |
/v1/chat/completions |
grok-4.20-multi-agent-0309 |
/v1/chat/completions |
grok-code-fast-1 |
/v1/chat/completions |
grok-imagine-image |
/v1/images/generations |
grok-imagine-image-pro |
/v1/images/generations |
grok-imagine-video |
/v1/chat/completions |
lyria-3-clip-preview |
/v1/chat/completions |
lyria-3-pro-preview |
/v1/chat/completions |
nano-banana-pro-preview |
/v1/chat/completions |
o1 |
/v1/chat/completions |
o1-2024-12-17 |
/v1/chat/completions |
o1-pro |
/v1/chat/completions |
o1-pro-2025-03-19 |
/v1/chat/completions |
o3 |
/v1/chat/completions |
o3-2025-04-16 |
/v1/chat/completions |
o3-mini |
/v1/chat/completions |
o3-mini-2025-01-31 |
/v1/chat/completions |
o4-mini |
/v1/chat/completions |
o4-mini-2025-04-16 |
/v1/chat/completions |
omni-moderation-2024-09-26 |
/v1/chat/completions |
omni-moderation-latest |
/v1/chat/completions |
sora-2 |
/v1/chat/completions |
sora-2-pro |
/v1/chat/completions |
text-embedding-3-large |
/v1/chat/completions |
text-embedding-3-small |
/v1/chat/completions |
text-embedding-ada-002 |
/v1/chat/completions |
tts-1 |
/v1/chat/completions |
tts-1-1106 |
/v1/chat/completions |
tts-1-hd |
/v1/chat/completions |
tts-1-hd-1106 |
/v1/chat/completions |
whisper-1 |
/v1/chat/completions |
14. Ошибки и коды
Шлюз возвращает JSON с полем message и HTTP-кодом:
{"statusCode": 401, "error": "Unauthorized", "message": "invalid token"}
400— некорректное тело запроса (например, отсутствуетmodelилиmessages).401— отсутствует или невалидный токен.403— недостаточно баланса, превышен месячный лимит, либо модель запрещена для ключа.404— указанная модель не найдена среди включенных.429— слишком много запросов (rate-limit от провайдера).503— апстрим-провайдер недоступен или таймаут (8000 ms). Шлюз пробует один резервный кандидат и возвращает 503, если все попытки неуспешны.
15. Лимиты и стриминг
- Стриминг (
"stream": true) в текущей версии не поддерживается — шлюз отвечает обычным JSON. - Лимиты по балансу аккаунта и по бюджету каждого ключа задаются в кабинете.
- Каждый запрос фиксируется в истории; стоимость списывается с баланса клиента в момент ответа.
- Курс конвертации USD→RUB настраивается администратором; в API выводятся обе валюты для удобства.