Chat Completions
OpenAI-compatible endpoint для чат-моделей. Совместим с OpenAI Python / JS SDK через смену base_url. Под капотом — thin proxy на Gemini Flash class и GPT-5.4-mini.
https://zowy.ai/api/v1/chat/completions
Authorization: Bearer YOUR_API_KEY · См. AuthenticationПараметры запроса
| Поле | Тип | Описание |
|---|---|---|
| model | string | Required. zowy-1 | zowy-1-pro | zowy-2 |
| messages | array | Required. Сообщения в формате OpenAI: {role, content} с ролями system | user | assistant | tool |
| stream | boolean | Если true — SSE streaming. По умолчанию false |
| temperature | number | 0–2. По умолчанию 1 |
| top_p | number | 0–1. Nucleus sampling |
| max_tokens | integer | Максимум токенов в ответе |
| tools | array | Function calling по OpenAI-формату. Пробрасывается в upstream |
| tool_choice | string|object | auto | none | required | object |
| response_format | object | {"type":"json_object"} или JSON schema |
| logprobs | boolean | Возвращать ли log-probabilities. Пробрасывается |
| seed | integer | Для воспроизводимости (если поддерживается upstream) |
| user | string | Произвольный идентификатор end-user для трейсинга |
Пример — все 3 языка
curl -X POST "https://zowy.ai/api/v1/chat/completions" \
-H "Authorization: Bearer $ZOWY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "zowy-1",
"messages": [{"role": "user", "content": "Привет!"}]
}'from openai import OpenAI
client = OpenAI(api_key="...", base_url="https://zowy.ai/api/v1")
r = client.chat.completions.create(
model="zowy-1",
messages=[{"role": "user", "content": "Привет!"}],
)
print(r.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.ZOWY_API_KEY,
baseURL: "https://zowy.ai/api/v1",
});
const r = await client.chat.completions.create({
model: "zowy-1",
messages: [{ role: "user", content: "Привет!" }],
});
console.log(r.choices[0].message.content);Streaming (SSE)
curl -N -X POST "https://zowy.ai/api/v1/chat/completions" \
-H "Authorization: Bearer $ZOWY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "zowy-1",
"messages": [{"role": "user", "content": "Расскажи историю"}],
"stream": true
}'
Ответ — поток data: {...} событий, заканчивается data: [DONE].
Function calling (tools)
Совместимо с OpenAI tools API. Реальное поведение зависит от выбранной модели.
{
"model": "zowy-1-pro",
"messages": [{"role": "user", "content": "Сколько времени в Ташкенте?"}],
"tools": [{
"type": "function",
"function": {
"name": "get_current_time",
"description": "Возвращает текущее время для города",
"parameters": {
"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"]
}
}
}],
"tool_choice": "auto"
}
Vision (multimodal input)
Поддерживается через messages[].content массив с image_url элементами (формат OpenAI).
{
"model": "zowy-2",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "Что на этой картинке?"},
{"type": "image_url", "image_url": {"url": "https://example.com/img.jpg"}}
]
}]
}
Формат ответа
{
"id": "chatcmpl-...",
"object": "chat.completion",
"created": 1714291200,
"model": "zowy-1",
"choices": [{
"index": 0,
"message": {"role": "assistant", "content": "..."},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 64,
"total_tokens": 76
}
}
Identity-guard system prompt
Zowy автоматически инжектит небольшой system prompt в начало messages, чтобы модель идентифицировала себя как Zowy AI и не раскрывала имена upstream-моделей. Это нельзя отключить через API.
Биллинг и токены
Каждый запрос списывает total_tokens с активного пакета AI Chat (Pro 2M или Business 10M). Если активного пакета нет — 402 Payment Required. См. /pricing.
Rate limits: 60 запросов/минуту, 1000/час per-ключ. См. Rate limits.