Chat

OpenAI-compatible chat completion endpoint

POST
/v2/chat/completions

Authorization

X-Signature<token>

HMAC-SHA256 подпись канонической строки. . Обязательный заголовок

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

curl -X POST "https://example.com/v2/chat/completions" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "chatcmpl-uuid",
  "object": "chat.completion",
  "created": 0,
  "model": "string",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "string",
        "content": "string"
      },
      "finish_reason": "string"
    }
  ],
  "usage": {
    "prompt_tokens": 0,
    "completion_tokens": 0,
    "total_tokens": 0
  }
}
{
  "error": "VALIDATION_ERROR",
  "message": "Данные некорректны.",
  "errors": {
    "property1": [
      "string"
    ],
    "property2": [
      "string"
    ]
  }
}
{
  "error": "VALIDATION_ERROR",
  "message": "Данные некорректны.",
  "errors": {
    "property1": [
      "string"
    ],
    "property2": [
      "string"
    ]
  }
}
{
  "error": "VALIDATION_ERROR",
  "message": "Данные некорректны.",
  "errors": {
    "property1": [
      "string"
    ],
    "property2": [
      "string"
    ]
  }
}