ZvenoAI
API Reference

Chat Completions

POST
/v1/chat/completions

Создает chat completion запрос к LLM-модели. Совместим с OpenAI Chat Completions API — можно использовать любой OpenAI SDK, указав base_url: "https://api.zveno.ai/v1".

Поддерживает:

  • Обычный и streaming (stream: true) режимы
  • Function calling / tool use
  • Vision (изображения в сообщениях)
  • Structured output (JSON schema, grammar)
  • Reasoning (extended thinking)
  • Мульти-модельный fallback (models: [...])
  • Настройки выбора провайдера (provider)

Модель указывается в формате vendor/model (например, openai/gpt-4o, anthropic/claude-sonnet-4-20250514).

Аутентификация: Authorization: Bearer <api-key>.

Authorization

BearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "http://localhost:8080/v1/chat/completions" \  -H "Content-Type: application/json" \  -d '{}'
{
  "choices": [
    {
      "finish_reason": "string",
      "native_finish_reason": "string",
      "index": 0,
      "logprobs": {
        "content": [
          {
            "bytes": [
              0
            ],
            "logprob": 0.1,
            "token": "string"
          }
        ],
        "refusal": [
          {
            "bytes": [
              0
            ],
            "logprob": 0.1,
            "token": "string"
          }
        ]
      },
      "message": {
        "annotations": [
          null
        ],
        "content": [
          {
            "image_url": {
              "detail": "string",
              "url": "string"
            },
            "input_audio": {
              "data": "string",
              "format": "string"
            },
            "text": "string",
            "type": "string"
          }
        ],
        "name": "string",
        "reasoning": "string",
        "reasoning_content": "string",
        "reasoning_details": [
          {
            "data": "string",
            "format": "string",
            "id": "string",
            "index": 0,
            "signature": "string",
            "summary": "string",
            "text": "string",
            "type": "string"
          }
        ],
        "refusal": "string",
        "role": "string",
        "tool_call_id": "string",
        "tool_calls": [
          {
            "function": {
              "arguments": "string",
              "name": "string",
              "thought_signature": "string"
            },
            "id": "string",
            "index": 0,
            "type": "string"
          }
        ],
        "images": [
          {
            "detail": "string",
            "url": "string"
          }
        ]
      }
    }
  ],
  "created": 0,
  "id": "string",
  "model": "string",
  "object": "string",
  "system_fingerprint": "string",
  "usage": {
    "completion_tokens": 0,
    "prompt_tokens": 0,
    "total_tokens": 0
  }
}
{
  "error": {
    "code": 0,
    "message": "string",
    "metadata": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": 0,
    "message": "string",
    "metadata": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": 0,
    "message": "string",
    "metadata": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": 0,
    "message": "string",
    "metadata": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": 0,
    "message": "string",
    "metadata": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": 0,
    "message": "string",
    "metadata": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": 0,
    "message": "string",
    "metadata": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": 0,
    "message": "string",
    "metadata": {
      "property1": null,
      "property2": null
    }
  }
}