Chat
Создать chat completion
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].
post/v1/chat/completions
Request
- Base URL: https://api.hubris.pw
- URL: https://api.hubris.pw/v1/chat/completions
- Auth: one of:
- HTTP bearer
- OAuth 2 (authorization code, authorization URL https://api.hubris.pw/oauth/authorize, token URL https://api.hubris.pw/oauth/token, scopes: chat:write)
Request body
Example request
{
"model": "anthropic/claude-haiku-4.5",
"models": [
"anthropic/claude-sonnet-4.6",
"openai/gpt-4o-mini"
],
"messages": [
{
"content": [
{
"input_audio": {
"format": "wav"
}
}
]
}
],
"modalities": [
"image",
"text"
],
"audio": {
"voice": "alloy",
"format": "wav"
},
"image_config": {
"aspect_ratio": "16:9",
"image_size": "2K"
}
}Response
Успешный ответ. При stream: false — chat.completion. При stream: true — text/event-stream с chunk-ами chat.completion.chunk.
Example response
{
"id": "chatcmpl-abc123",
"choices": [
{
"message": {
"images": [
{
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
}
}
]
}
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.