Hubris Chat Completions API
The Chat Completions API from Hubris — 1 operation(s) for chat completions.
The Chat Completions API from Hubris — 1 operation(s) for chat completions.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/hubris-pw:hubris-pw-chat-completions-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Hubris Chat API
version: 1.0.0
description: 'OpenAI-совместимый API российского LLM-агрегатора. Все цены в рублях.
Версии и вывод из эксплуатации (deprecation policy): несовместимые изменения — только в новой версии префикса (`/v2`); об отключении эндпоинта или поля предупреждаем не меньше чем за 90 дней заголовками `Deprecation` (RFC 9745) и `Sunset` (RFC 8594), записью в журнале изменений и письмом. Подробно: https://hubris.pw/docs/api/versioning'
servers:
- url: https://api.hubris.pw
description: Production
tags:
- name: Chat Completions
paths:
/v1/chat/completions:
post:
operationId: createChatCompletion
tags:
- Chat Completions
summary: Создать chat completion
description: 'OpenAI-совместимый chat completions endpoint.
При `stream: true` возвращает Server-Sent Events стрим из chunk-ов в формате `chat.completion.chunk`.
Подробности SSE-формата — на странице Streaming.
Hubris автоматически добавляет `stream_options: { include_usage: true }` ко всем stream-запросам, поэтому usage приходит в последнем chunk-е перед `[DONE]`.'
security:
- bearerAuth: []
- oauth2:
- chat:write
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ChatCompletionRequest'
responses:
'200':
description: 'Успешный ответ. При `stream: false` — `chat.completion`. При `stream: true` — `text/event-stream` с chunk-ами `chat.completion.chunk`.'
content:
application/json:
schema:
$ref: '#/components/schemas/ChatCompletionResponse'
text/event-stream:
schema:
type: string
description: SSE-stream chunk-ов. См. /docs/api/streaming.
'400':
description: Невалидное тело запроса
content:
application/json:
schema:
$ref: '#/components/schemas/ChatCompletionErrorResponse'
'401':
description: Невалидный API-ключ
content:
application/json:
schema:
$ref: '#/components/schemas/ChatCompletionErrorResponse'
'402':
description: Недостаточно средств на балансе
content:
application/json:
schema:
$ref: '#/components/schemas/ChatCompletionErrorResponse'
'404':
description: Модель не найдена
content:
application/json:
schema:
$ref: '#/components/schemas/ChatCompletionErrorResponse'
'429':
description: Превышен дневной лимит ключа
content:
application/json:
schema:
$ref: '#/components/schemas/ChatCompletionErrorResponse'
'502':
description: Ошибка провайдера
content:
application/json:
schema:
$ref: '#/components/schemas/ChatCompletionErrorResponse'
'503':
description: Курс ЦБ РФ временно недоступен
content:
application/json:
schema:
$ref: '#/components/schemas/ChatCompletionErrorResponse'
'504':
description: Провайдер не ответил вовремя
content:
application/json:
schema:
$ref: '#/components/schemas/ChatCompletionErrorResponse'
components:
schemas:
ImageUrlContentPart:
type: object
properties:
type:
type: string
enum:
- image_url
image_url:
type: object
properties:
url:
type: string
description: URL изображения или data:image/<mime>;base64,...
detail:
type: string
enum:
- auto
- low
- high
required:
- url
cache_control:
$ref: '#/components/schemas/CacheControl'
required:
- type
- image_url
FinishReason:
type: string
nullable: true
enum:
- stop
- length
- tool_calls
- content_filter
- function_call
FunctionToolDefinition:
type: object
properties:
type:
type: string
enum:
- function
function:
type: object
properties:
name:
type: string
description:
type: string
parameters:
type: object
additionalProperties:
nullable: true
default:
type: object
properties: {}
description: JSON Schema объект с описанием параметров функции. Без него — функция без аргументов.
strict:
type: boolean
nullable: true
required:
- name
cache_control:
type: object
nullable: true
properties:
type:
type: string
enum:
- ephemeral
ttl:
type: string
enum:
- 5m
- 1h
required:
- type
description: Маркер кеша на весь элемент — для клиентов, которые ставят его сюда. Основное место — `cache_control` на content-блоке.
required:
- type
- function
ToolChoice:
anyOf:
- type: string
enum:
- none
- auto
- required
- type: object
properties:
type:
type: string
enum:
- function
function:
type: object
properties:
name:
type: string
required:
- name
required:
- type
- function
ChatCompletionResponse:
type: object
properties:
id:
type: string
example: chatcmpl-abc123
object:
type: string
enum:
- chat.completion
created:
type: integer
description: Unix-timestamp в секундах.
model:
type: string
choices:
type: array
items:
$ref: '#/components/schemas/Choice'
minItems: 1
usage:
$ref: '#/components/schemas/Usage'
system_fingerprint:
type: string
required:
- id
- object
- created
- model
- choices
- usage
ChatCompletionRequest:
type: object
properties:
model:
type: string
minLength: 1
example: anthropic/claude-haiku-4.5
models:
type: array
items:
type: string
minLength: 1
minItems: 1
maxItems: 10
description: Список fallback-моделей. Если основная (`model`) недоступна — попробует следующие по порядку. Биллинг по фактически использованной (см. `model` в ответе).
example:
- anthropic/claude-sonnet-4.6
- openai/gpt-4o-mini
messages:
type: array
items:
$ref: '#/components/schemas/Message'
minItems: 1
tools:
type: array
items:
$ref: '#/components/schemas/ToolDefinition'
tool_choice:
$ref: '#/components/schemas/ToolChoice'
parallel_tool_calls:
type: boolean
response_format:
$ref: '#/components/schemas/ResponseFormat'
temperature:
type: number
minimum: 0
maximum: 2
top_p:
type: number
minimum: 0
maximum: 1
n:
type: integer
minimum: 1
stop:
anyOf:
- type: string
- type: array
items:
type: string
max_tokens:
type: integer
minimum: 0
exclusiveMinimum: true
max_completion_tokens:
type: integer
minimum: 0
exclusiveMinimum: true
frequency_penalty:
type: number
minimum: -2
maximum: 2
presence_penalty:
type: number
minimum: -2
maximum: 2
logit_bias:
type: object
additionalProperties:
type: number
seed:
type: integer
logprobs:
type: boolean
top_logprobs:
type: integer
minimum: 0
maximum: 20
modalities:
type: array
items:
type: string
enum:
- text
- image
- audio
description: 'Какие модальности должна вернуть модель. По умолчанию `["text"]`. Для генерации изображений: `["image","text"]` (модели типа gemini-flash-image) либо `["image"]` (модели типа flux/sdxl). Для голосового ответа: `["text","audio"]` вместе с полем `audio` и обязательным `stream: true`. Поддерживается только моделями, у которых соответствующая модальность есть в `output_modalities`.'
example:
- image
- text
audio:
type: object
properties:
voice:
type: string
description: Голос озвучки, например `alloy`.
example: alloy
format:
type: string
description: 'Формат аудио ответа: `wav`, `mp3`, `pcm16` и т.п.'
example: wav
required:
- voice
- format
description: 'Настройки голосового ответа. Требует `modalities: ["text","audio"]` и `stream: true`.'
image_config:
type: object
additionalProperties:
nullable: true
description: 'Параметры image-gen моделей: aspect_ratio (`1:1`, `16:9`, `9:16` и т.д.), image_size (`0.5K`, `1K`, `2K`, `4K`), а также model-specific поля. Конкретный набор зависит от модели — см. карточку модели в каталоге.'
example:
aspect_ratio: '16:9'
image_size: 2K
stream:
type: boolean
stream_options:
$ref: '#/components/schemas/StreamOptions'
user:
type: string
reasoning_effort:
type: string
enum:
- none
- minimal
- low
- medium
- high
- xhigh
- max
required:
- model
- messages
ErrorCode:
type: string
enum:
- invalid_request
- invalid_api_key
- insufficient_balance
- daily_limit_exceeded
- workspace_limit_exceeded
- model_not_found
- exchange_rate_unavailable
- upstream_error
- upstream_timeout
- context_length_exceeded
- content_policy_violation
- input_image_rejected
- not_found
- internal_error
- too_many_active_jobs
- video_not_ready
- index_out_of_range
- byok_disabled
- byok_egress_unavailable
- byok_not_configured
- byok_insufficient_credits
- byok_not_supported_for_videos
ToolCallInput:
allOf:
- $ref: '#/components/schemas/ToolCall'
- type: object
properties:
cache_control:
type: object
nullable: true
properties:
type:
type: string
enum:
- ephemeral
ttl:
type: string
enum:
- 5m
- 1h
required:
- type
description: Маркер кеша на весь элемент — для клиентов, которые ставят его сюда. Основное место — `cache_control` на content-блоке.
TextContentPart:
type: object
properties:
type:
type: string
enum:
- text
text:
type: string
cache_control:
$ref: '#/components/schemas/CacheControl'
required:
- type
- text
Usage:
type: object
properties:
prompt_tokens:
type: integer
minimum: 0
completion_tokens:
type: integer
minimum: 0
total_tokens:
type: integer
minimum: 0
completion_tokens_details:
type: object
properties:
reasoning_tokens:
type: integer
minimum: 0
prompt_tokens_details:
type: object
properties:
cached_tokens:
type: integer
minimum: 0
required:
- prompt_tokens
- completion_tokens
- total_tokens
AssistantMessage:
type: object
properties:
role:
type: string
enum:
- assistant
content:
anyOf:
- type: string
- type: array
items:
$ref: '#/components/schemas/TextContentPart'
- nullable: true
tool_calls:
type: array
items:
$ref: '#/components/schemas/ToolCall'
name:
type: string
refusal:
type: string
nullable: true
images:
type: array
items:
$ref: '#/components/schemas/GeneratedImage'
audio:
$ref: '#/components/schemas/AudioOutput'
required:
- role
ChatCompletionErrorResponse:
type: object
properties:
error:
$ref: '#/components/schemas/ErrorObject'
required:
- error
ToolCall:
type: object
properties:
id:
type: string
type:
type: string
enum:
- function
function:
type: object
properties:
name:
type: string
arguments:
type: string
description: JSON-строка с аргументами функции.
required:
- name
- arguments
required:
- id
- type
- function
ContentPart:
oneOf:
- $ref: '#/components/schemas/TextContentPart'
- $ref: '#/components/schemas/ImageUrlContentPart'
- $ref: '#/components/schemas/InputAudioContentPart'
- $ref: '#/components/schemas/VideoUrlContentPart'
discriminator:
propertyName: type
mapping:
text: '#/components/schemas/TextContentPart'
image_url: '#/components/schemas/ImageUrlContentPart'
input_audio: '#/components/schemas/InputAudioContentPart'
video_url: '#/components/schemas/VideoUrlContentPart'
ToolDefinition:
anyOf:
- $ref: '#/components/schemas/FunctionToolDefinition'
- $ref: '#/components/schemas/ServerToolDefinition'
Choice:
type: object
properties:
index:
type: integer
minimum: 0
message:
$ref: '#/components/schemas/AssistantMessage'
finish_reason:
$ref: '#/components/schemas/FinishReason'
logprobs:
nullable: true
required:
- index
- message
- finish_reason
AudioOutput:
type: object
properties:
id:
type: string
data:
type: string
description: Аудио ответа в base64 (формат — из запроса `audio.format`).
transcript:
type: string
description: Текстовая расшифровка сказанного.
expires_at:
type: number
VideoUrlContentPart:
type: object
properties:
type:
type: string
enum:
- video_url
video_url:
type: object
properties:
url:
type: string
minLength: 1
description: Ссылка на публичный ролик YouTube или `data:video/<mime>;base64,...`.
example: https://www.youtube.com/watch?v=dQw4w9WgXcQ
processing:
type: string
enum:
- agentic
- static
description: 'Режим обработки видео у Gemini: `agentic` — модель сама перемещается по ролику (дешевле на длинных видео), `static` — просмотр целиком с фиксированной частотой кадров.'
required:
- url
required:
- type
- video_url
InputAudioContentPart:
type: object
properties:
type:
type: string
enum:
- input_audio
input_audio:
type: object
properties:
data:
type: string
minLength: 1
description: Аудио в base64 БЕЗ префикса `data:` — только сами данные.
format:
type: string
enum:
- wav
- mp3
- aiff
- aac
- ogg
- flac
- m4a
- pcm16
- pcm24
description: Формат присланного аудио.
example: wav
required:
- data
- format
cache_control:
$ref: '#/components/schemas/CacheControl'
required:
- type
- input_audio
ToolMessage:
type: object
properties:
role:
type: string
enum:
- tool
content:
anyOf:
- type: string
- type: array
items:
$ref: '#/components/schemas/TextContentPart'
tool_call_id:
type: string
cache_control:
type: object
nullable: true
properties:
type:
type: string
enum:
- ephemeral
ttl:
type: string
enum:
- 5m
- 1h
required:
- type
description: Маркер кеша на весь элемент — для клиентов, которые ставят его сюда. Основное место — `cache_control` на content-блоке.
required:
- role
- content
- tool_call_id
SystemMessage:
type: object
properties:
role:
type: string
enum:
- system
content:
anyOf:
- type: string
- type: array
items:
$ref: '#/components/schemas/ContentPart'
name:
type: string
cache_control:
type: object
nullable: true
properties:
type:
type: string
enum:
- ephemeral
ttl:
type: string
enum:
- 5m
- 1h
required:
- type
description: Маркер кеша на весь элемент — для клиентов, которые ставят его сюда. Основное место — `cache_control` на content-блоке.
required:
- role
- content
GeneratedImage:
type: object
properties:
type:
type: string
enum:
- image_url
image_url:
type: object
properties:
url:
type: string
description: Base64 data URL вида `data:image/png;base64,...`
example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...
required:
- url
required:
- type
- image_url
UserMessage:
type: object
properties:
role:
type: string
enum:
- user
content:
anyOf:
- type: string
- type: array
items:
$ref: '#/components/schemas/ContentPart'
name:
type: string
cache_control:
type: object
nullable: true
properties:
type:
type: string
enum:
- ephemeral
ttl:
type: string
enum:
- 5m
- 1h
required:
- type
description: Маркер кеша на весь элемент — для клиентов, которые ставят его сюда. Основное место — `cache_control` на content-блоке.
required:
- role
- content
AssistantMessageInput:
allOf:
- $ref: '#/components/schemas/AssistantMessage'
- type: object
properties:
tool_calls:
type: array
items:
$ref: '#/components/schemas/ToolCallInput'
cache_control:
type: object
nullable: true
properties:
type:
type: string
enum:
- ephemeral
ttl:
type: string
enum:
- 5m
- 1h
required:
- type
description: Маркер кеша на весь элемент — для клиентов, которые ставят его сюда. Основное место — `cache_control` на content-блоке.
ErrorObject:
type: object
properties:
message:
type: string
type:
type: string
code:
$ref: '#/components/schemas/ErrorCode'
param:
type: string
nullable: true
required:
- message
- type
- code
ServerToolDefinition:
type: object
properties:
type:
type: string
minLength: 1
required:
- type
Message:
oneOf:
- $ref: '#/components/schemas/SystemMessage'
- $ref: '#/components/schemas/UserMessage'
- $ref: '#/components/schemas/AssistantMessageInput'
- $ref: '#/components/schemas/ToolMessage'
discriminator:
propertyName: role
mapping:
system: '#/components/schemas/SystemMessage'
user: '#/components/schemas/UserMessage'
assistant: '#/components/schemas/AssistantMessageInput'
tool: '#/components/schemas/ToolMessage'
StreamOptions:
type: object
properties:
include_usage:
type: boolean
description: Hubris автоматически выставляет true для всех stream-запросов. Указывать необязательно.
CacheControl:
type: object
properties:
type:
type: string
enum:
- ephemeral
ttl:
type: string
enum:
- 5m
- 1h
required:
- type
ResponseFormat:
oneOf:
- type: object
properties:
type:
type: string
enum:
- text
required:
- type
- type: object
properties:
type:
type: string
enum:
- json_object
required:
- type
- type: object
properties:
type:
type: string
enum:
- json_schema
json_schema:
type: object
properties:
name:
type: string
description:
type: string
schema:
type: object
additionalProperties:
nullable: true
strict:
type: boolean
required:
- name
- schema
required:
- type
- json_schema
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: sk-gw-...
description: API-ключ в формате `sk-gw-` + 32 hex. Создаётся в дашборде на /keys. Обычный ключ даёт все права, ключ только для чтения не может тратить баланс.
oauth2:
type: oauth2
description: 'OAuth-токен приложения с ограниченными правами. Регистрация клиента — `POST /oauth/clients` (RFC 7591), PKCE S256 обязателен. Метаданные: `/.well-known/oauth-authorization-server`, `/.well-known/oauth-protected-resource`.'
flows:
authorizationCode:
authorizationUrl: https://api.hubris.pw/oauth/authorize
tokenUrl: https://api.hubris.pw/oauth/token
refreshUrl: https://api.hubris.pw/oauth/token
scopes:
chat:write: 'Запросы к моделям от имени пользователя (списывают баланс): чат, Responses, Messages, эмбеддинги, реранкеры, модели решений, изображения, распознавание и озвучка речи, расшифровка видео; коннекторы Битрикс24.'
models:read: Видеть цепочки резервных моделей пользователя в `GET /v1/models`.
balance:read: Видеть остаток баланса пользователя.
videos:write: Создавать видео от имени пользователя (`POST /v1/videos`, резервирует и списывает баланс).
videos:read: Узнавать статус и скачивать видео пользователя (`GET /v1/videos/{id}`, `GET /v1/videos/{id}/content`).
offline_access: Выдать refresh-токен, чтобы подключение жило 90 дней без повторного входа.