Перейти к содержимомуKumoДокументация
Разделы
На странице
Шлюз

Справочник API

Каждая операция шлюза Kumo, сгенерированная из опубликованного описания API: адрес, способ аутентификации, содержимое запроса и то, что приходит в ответ.

Открыть как Markdown

Эта страница сгенерирована из описания API, против которого собрана эта сборка, — поэтому она говорит, на что шлюз отвечает, а не на что его когда-то описали отвечающим. Каждый член ниже — член провода. Формулировки самих операций процитированы из описания API и потому остаются английскими: перевод создал бы второе утверждение о проводе, за которым не следит ни одна проверка.

POST /v1/chat/completions

Метод
POST
Путь
/v1/chat/completions
Аутентификация
Authorization: Bearer <key>
Операция
public.chat_completions.create

OpenAI-совместимый чат: отправляете разговор, получаете одно завершение или поток чанков в ответ.

Create a chat completion.

  • Протокол: нативный OpenAI Chat Completions, а не перевод другого протокола — члены запроса, форма ответа, словарь usage и конверт ошибки принадлежат этому протоколу.
  • Стриминг: при stream: true ответ приходит как text/event-stream — события chat.completion.chunk, при stream_options.include_usage отдельный чанк с usage, затем финальный кадр [DONE]; отказ до первого события оформляется обычной JSON-ошибкой этого протокола.
  • Аутентификация: ключ Kumo передаётся заголовком Authorization: Bearer.
  • Потолок вывода: max_tokens и max_completion_tokens необязательны и взаимозаменяемы — запрос, не назвавший ни одного, отвечается под опубликованным умолчанием в 32768 токенов вывода, против которого и берётся резерв; назвать оба с разными значениями — отказ, а не правило старшинства.
{
  "max_tokens": 128,
  "messages": [
    {
      "role": "user"
    }
  ],
  "model": "<model>"
}

Запрос несёт:

членчто это
max_completion_tokensinteger, необязателен — The output ceiling, in the current spelling.
max_tokensinteger, необязателен — The output ceiling, in the spelling long-established clients send.
messagesarray of ChatMessage, обязателен — The conversation, in order.
modelstring, обязателен — The model to answer with: a canonical name or an alias the published catalog carries.
ninteger, необязателен — How many completions to answer with.
reasoning_effortstring, необязателен — Accepted and NOT CARRIED: this states how much reasoning to spend on the answer, as OpenAI-compatible clients fill it in for reasoning models, but no supplier request on this platform has a member for a reasoning budget, so the answer comes back at whatever budget the model itself defaults to.
response_formatChatResponseFormat, необязателен — A structured output requirement.
stoparray of string, необязателен — Sequences whose appearance ends the answer, at most four, as a LIST — the bare-string spelling this protocol also defines is not accepted on this surface and is refused rather than ignored.
streamboolean, необязателен — Whether to stream the answer.
stream_optionsChatStreamOptions, необязателен — Options that apply only when stream is true.
temperaturenumber, необязателен — How much randomness to use, from 0 to 2 — this protocol's own interval, and not the [0, 1] of the Anthropic Messages surface.
tool_choice"auto" or "none" or "required" or object, необязателен — What this request requires of its tool list, in either spelling this protocol defines: the bare mode word "auto", "none" or "required", or an object naming one declared tool.
toolsarray of ChatTool, необязателен — The tools this turn may call.
top_pnumber, необязателен — Nucleus sampling, from 0 to 1.
userstring, необязателен — An opaque label for the end user this request is made on behalf of, as OpenAI-compatible clients send it.

ChatMessage

членчто это
cache_controlChatCacheControl, необязателен — Accepted and NOT CARRIED: this marks the turn as a prompt-cache anchor, the way OpenAI-compatible clients write it when they address an Anthropic model, but the supplier wire this protocol is served by has no member for an anchor, so the cached-token counts in usage come back as though it had not been sent.
contentstring or array of ChatContentPart, необязателен — The turn's text, in either spelling this protocol defines: a bare string, or a list of typed parts joined in order.
namestring, необязателен — The tool this result came from, as OpenAI-compatible clients write it on a tool turn.
role"system" or "developer" or "user" or "assistant" or "tool", обязателен — Who is speaking.
tool_call_idstring, необязателен — The call this result answers.
tool_callsarray of ChatToolCall, необязателен — The calls this assistant turn made, replayed back into the conversation so that a tool result has something in the history to answer.

ChatResponseFormat

членчто это
json_schemaStructuredSchema, необязателен — The named schema an answer must satisfy.
typestring, обязателен — The kind of format.

ChatStreamOptions

членчто это
include_usageboolean, необязателен — Whether the stream ends with a usage chunk — an event with an empty choices array carrying only usage — before the terminal [DONE] frame.

ChatTool

членчто это
functionChatToolFunction, обязателен
type"function", обязателен — The kind of tool.

Ответ:

application/jsonChatCompletionsReply
text/event-streamChatCompletionsChunk
при отказеChatCompletionsError

ChatCompletionsReply

членчто это
choicesarray of ReplyChoice, обязателен — The answer.
createdinteger, обязателен — The instant this completion was answered, as whole seconds since the Unix epoch.
idstring, обязателен — This request's Kumo identity.
modelstring, обязателен — The model this request named, echoed back exactly as it was sent.
object"chat.completion", обязателен — The kind of object this is.
usageReplyUsage, необязателен — What the supplier reported this request consumed.

ReplyChoice

членчто это
finish_reason"stop" or "length" or "tool_calls" or "content_filter", обязателен — Why the model stopped.
indexinteger, обязателен — The position of this choice.
messageReplyMessage, обязателен

ReplyUsage

членчто это
completion_tokensinteger, необязателен — Output tokens the supplier counted.
prompt_tokensinteger, необязателен — Input tokens the supplier counted, including any it served from its own cache.
prompt_tokens_detailsPromptTokensDetails, необязателен — How the input divides, when the supplier said.
total_tokensinteger, необязателен — Input and output together.

ChatCompletionsChunk

членчто это
choicesarray of ChunkChoice, обязателен — This chunk's delta.
createdinteger, обязателен — The instant this completion was answered, as whole seconds since the Unix epoch.
idstring, обязателен — This request's Kumo identity, identical on every chunk of one stream.
modelstring, обязателен — The model this request named, echoed back exactly as it was sent, on every chunk.
object"chat.completion.chunk", обязателен — The kind of object this is.
usageReplyUsage, необязателен — Present only on the usage chunk — the last event before [DONE] when stream_options.include_usage asked for one — and absent from every content chunk.

ChunkChoice

членчто это
deltaChunkDelta, обязателен
finish_reason"stop" or "length" or "tool_calls" or "content_filter", обязателен — Why the model stopped, stated once on the chunk that closes the answer and null until then.
indexinteger, обязателен — The position of this choice.

ReplyUsage

ReplyUsage — см. выше.

ChatCompletionsError

членчто это
errorChatCompletionsErrorBody, обязателен

ChatCompletionsErrorBody

членчто это
codestring, необязателен — The machine-readable reason.
messagestring, обязателен — What went wrong, in a fixed safe sentence.
paramstring, необязателен — The request member at fault, when one member is at fault.
type"invalid_request_error" or "not_found_error" or "authentication_error" or "permission_error" or "rate_limit_error" or "api_error", обязателен — The class of failure, in this protocol's own closed vocabulary.

POST /v1/embeddings

Метод
POST
Путь
/v1/embeddings
Аутентификация
Authorization: Bearer <key>
Операция
public.embeddings.create

Превратить пакет входов в векторы, по одному вектору на вход.

Create embedding vectors for a batch of inputs.

  • Протокол: возвращает по одному вектору на вход, в том же порядке, что и во входном пакете; тарифицируются только входные токены.
  • Потолок: у пакета есть предел числа входов и суммарного размера в байтах — запрос за этими пределами отклоняется до обращения к провайдеру.
  • Формат ответа: encoding_format обязателен и должен быть "base64" — векторы приходят как base64 от little-endian float32; запрос формата "float" или без указания формата отклоняется по имени.
  • Стриминг: у этой операции его нет.
{
  "encoding_format": "base64",
  "input": [
    "<input>"
  ],
  "model": "<model>"
}

Запрос несёт:

членчто это
encoding_format"base64", обязателен — Must be "base64": this surface does not serve the protocol's "float" default.
inputarray of string, обязателен — The batch of inputs to embed, at most 128 members and 131072 bytes in total.
modelstring, обязателен — The catalog model to embed with, as the customer names it.

Ответ:

application/jsonEmbeddingsResponseBody
при отказеEmbeddingsError

EmbeddingsResponseBody

членчто это
dataarray of EmbeddingsVector, обязателен — One vector per input, in the order the inputs were given.
modelstring, обязателен — The model the vectors were produced with.
object"list", обязателен — Always "list".
usageEmbeddingsUsage, обязателен — What the request cost.

EmbeddingsVector

членчто это
embeddingstring, обязателен — The vector components as base64-encoded little-endian float32 values, which is this protocol's own "base64" encoding format.
indexinteger, обязателен — The position of the input this vector is for.
object"embedding", обязателен — Always "embedding".

EmbeddingsUsage

членчто это
prompt_tokensinteger, обязателен — The input tokens charged for this request.
total_tokensinteger, обязателен — The total tokens charged, which on this surface equals prompt_tokens.

EmbeddingsError

членчто это
errorEmbeddingsErrorBody, обязателен — The failure.

EmbeddingsErrorBody

членчто это
codestring, обязателен — The machine-readable reason, shared with every Kumo surface.
messagestring, обязателен — A safe description of the failure.
request_idstring, необязателен — The Kumo request identifier, for support.
typestring, обязателен — The class of failure.

POST /v1/images/generations

Метод
POST
Путь
/v1/images/generations
Аутентификация
Authorization: Bearer <key>
Операция
public.images.generate

Сгенерировать одно или несколько изображений по текстовому промпту.

Generate images from a prompt.

  • Протокол: конверты запроса, ответа и ошибки совместимы с OpenAI — отказ несёт error.message, error.type и error.code, а не REST-конверт Kumo.
  • Тарификация: списывается за единицу изображения через то же ядро допуска, резервирования и расчёта, что и у остальных поверхностей моделей.
  • Не поддерживается: редактирование и вариации изображений эта операция не обслуживает.
{
  "model": "<model>",
  "prompt": "<prompt>"
}

Запрос несёт:

членчто это
modelstring, обязателен — The public model name to generate with.
ninteger, необязателен — How many images to generate.
promptstring, обязателен — The prompt to generate an image from.
sizestring, необязателен — The image size as WIDTHxHEIGHT, for example 1024x1024.

Ответ:

application/jsonImagesResponseBody
при отказеImagesErrorBody

ImagesResponseBody

членчто это
createdinteger, обязателен — When the images were generated, as a Unix timestamp in seconds.
dataarray of ImagesDataEntry, обязателен — The generated images, in the order the supplier answered them.

ImagesDataEntry

членчто это
b64_jsonstring, необязателен — The image bytes, base64-encoded.
urlstring, необязателен — A URL the image can be fetched from.

ImagesErrorBody

членчто это
errorImagesErrorPayload, обязателен — The refusal, in the OpenAI-compatible error shape.

ImagesErrorPayload

членчто это
codestring, обязателен — The machine-readable reason.
messagestring, обязателен — A safe human-readable description of the refusal.
paramstring, обязателен — Always null: this surface never names a field of the request.
typestring, обязателен — The coarse OpenAI error class.

POST /v1/messages

Метод
POST
Путь
/v1/messages
Аутентификация
Authorization: Bearer <key> or x-api-key: <key>
Операция
public.anthropic_messages.create

Протокол Anthropic Messages: отправляете разговор в его собственной форме, получаете одно сообщение или поток событий.

Create a message.

  • Протокол: нативный Anthropic Messages — max_tokens обязателен и без значения по умолчанию, системный промпт передаётся отдельным членом запроса, а инструменты несут input_schema без обёртки function.
  • Стриминг: при stream: true ответ приходит как text/event-stream с именованными событиями протокола — message_start, блоки контента, message_delta, message_stop; отказ после начала потока выражается ошибкой внутри потока, без message_stop.
  • Аутентификация: ключ Kumo передаётся заголовком Authorization: Bearer или, как в нативном API, самим значением в заголовке x-api-key — любой из них впускает вызывающего, и оба называют один и тот же ключ.
  • Игнорируемые члены: metadata, thinking, output_config и context_management принимаются, но не влияют на ответ — каждый называет это в собственном описании.
{
  "max_tokens": 128,
  "messages": [
    {
      "content": "<content>",
      "role": "user"
    }
  ],
  "model": "<model>"
}

Запрос несёт:

членчто это
context_managementobject, необязателен — This protocol's context-management configuration, as the beta spells it.
max_tokensinteger, обязателен — The maximum number of tokens to generate.
messagesarray of MessagesInputMessage, обязателен — The conversation, oldest turn first.
metadataMessagesMetadata, необязателен — This protocol's request metadata.
modelstring, обязателен — The catalog model to answer with, as the customer names it.
output_configobject, необязателен — This protocol's output-effort configuration, as the beta spells it.
stop_sequencesarray of string, необязателен — Sequences that end the answer when the model produces one.
streamboolean, необязателен — Stream the answer as this protocol's own named events over text/event-stream: message_start, content_block_start, content_block_delta, content_block_stop, message_delta, message_stop.
systemstring or array of MessagesSystemBlock, необязателен — The system prompt, beside the conversation rather than as a turn of it.
temperaturenumber, необязателен — How much randomness to use, from 0 to 1.
thinkingobject, необязателен — This protocol's extended-thinking configuration, as the beta spells it.
tool_choiceMessagesToolChoice, необязателен — Forces one of the declared tools.
toolsarray of MessagesTool, необязателен — The tools this turn may call.
top_kinteger, необязателен — Keep only the K most likely tokens when sampling.
top_pnumber, необязателен — Nucleus sampling, from 0 to 1.

MessagesInputMessage

членчто это
contentstring or array of MessagesContentBlock, обязателен — What the turn says.
role"user" or "assistant" or "system", обязателен — Who is speaking.

MessagesMetadata

членчто это
user_idstring, необязателен — An opaque identifier the caller keeps for its own end user.

MessagesSystemBlock

членчто это
cache_controlMessagesCacheControl, необязателен — Marks this block as a prompt-cache anchor.
textstring, обязателен — The block's text.
type"text", обязателен — Always "text".

MessagesToolChoice

членчто это
disable_parallel_tool_useboolean, необязателен — Whether at most one tool may be called in one answer; the default is that several may be.
namestring, необязателен — The tool to force.
type"auto" or "any" or "tool" or "none", обязателен — What the request requires: "auto" leaves the choice to the model, "any" requires a call to some declared tool, "tool" requires a call to the one "name" states, and "none" forbids a call while the declarations stay visible.

MessagesTool

членчто это
allowed_callersarray of string, необязателен — The beta's list of tools permitted to call this one.
cache_controlMessagesCacheControl, необязателен — Marks this declaration as a prompt-cache anchor; the tool list is part of the cached prefix.
defer_loadingboolean, необязателен — The beta's request to load this declaration only when it is first needed.
descriptionstring, необязателен — What the tool does.
eager_input_streamingboolean, необязателен — The beta's request to begin streaming this tool's arguments before they are complete.
input_examplesarray of object, необязателен — The beta's example arguments for this tool, each the JSON object input_schema describes.
input_schemaobject, необязателен — The tool's parameters, as the JSON Schema the caller wrote for its own tool.
max_usesinteger, необязателен — The beta's ceiling on how many times a server-side tool may run.
namestring, обязателен — The tool's name.
strictboolean, необязателен — The beta's request that the arguments conform exactly to input_schema.
typestring, необязателен — The kind of declaration.

Ответ:

application/jsonMessagesReply
text/event-streamMessagesStreamEvent
при отказеMessagesError

MessagesReply

членчто это
contentarray of MessagesReplyBlock, обязателен — The answer's blocks, in order.
idstring, обязателен — The Kumo request identifier for this answer.
modelstring, обязателен — The model the customer named.
rolestring, обязателен — Always "assistant".
stop_reason"end_turn" or "max_tokens" or "stop_sequence" or "tool_use", обязателен — Why the answer ended.
typestring, обязателен — Always "message".
usageMessagesReplyUsage, необязателен — What the request cost, exactly as this platform settles it.

MessagesReplyBlock

членчто это
idstring, необязателен — On a tool use, its identifier.
inputobject, необязателен — On a tool use, the arguments as the JSON object the supplier produced.
namestring, необязателен — On a tool use, the tool called.
textstring, необязателен — On a text block, the text.
type"text" or "tool_use", обязателен — Which kind of block this is.

MessagesReplyUsage

членчто это
cache_creation_input_tokensinteger, обязателен — Input tokens written to the prompt cache.
cache_read_input_tokensinteger, обязателен — Input tokens served from the prompt cache.
input_tokensinteger, обязателен — Input tokens charged, excluding cache reads and writes.
output_tokensinteger, обязателен — Output tokens charged.

MessagesStreamEvent

членчто это
content_blockMessagesStreamBlock, необязателен — On content_block_start, the opening block.
deltaMessagesStreamDelta, необязателен — On content_block_delta, the fragment; on message_delta, the closing facts.
errorMessagesErrorBody, необязателен — On error, the failure, in this protocol's own envelope.
indexinteger, необязателен — On the block events, which block.
messageMessagesStreamMessage, необязателен — On message_start, the opening envelope: the answer's identity and the account's input half.
type"message_start" or "content_block_start" or "content_block_delta" or "content_block_stop" or "message_delta" or "message_stop" or "ping" or "error", обязателен — Which event this is; it is also the SSE frame's event name.
usageMessagesReplyUsage, необязателен — On message_delta, what the request cost — exactly as this platform settles it, and exactly what the unary reply would state.

MessagesStreamBlock

членчто это
idstring, необязателен — On a tool use, its identifier.
inputobject, необязателен — On a tool use, the opening input — the empty object; the arguments arrive as input_json_delta fragments.
namestring, необязателен — On a tool use, the tool called.
textstring, необязателен — On a text block, the opening text — empty; the text arrives as deltas.
type"text" or "tool_use", обязателен — Which kind of block opened.

MessagesStreamDelta

членчто это
partial_jsonstring, необязателен — On input_json_delta, the fragment of the call's input object, as partial JSON text.
stop_reason"end_turn" or "max_tokens" or "stop_sequence" or "tool_use", необязателен — On message_delta, why the answer ended.
textstring, необязателен — On text_delta, the fragment of the answer's text.
type"text_delta" or "input_json_delta", необязателен — On content_block_delta, which fragment this is; absent on message_delta.

MessagesErrorBody

членчто это
codestring, необязателен — The machine-readable reason, shared with every Kumo surface.
messagestring, обязателен — A safe description of the failure.
paramstring, необязателен — The member the failure is about, when it is about one.
type"invalid_request_error" or "not_found_error" or "authentication_error" or "permission_error" or "rate_limit_error" or "api_error" or "overloaded_error", обязателен — The class of failure.

MessagesStreamMessage

членчто это
contentarray of MessagesReplyBlock, обязателен — Always empty here: the blocks arrive as events.
idstring, обязателен — The Kumo request identifier for this answer, identical on every event of one stream.
modelstring, обязателен — The model the customer named.
rolestring, обязателен — Always "assistant".
typestring, обязателен — Always "message".
usageMessagesReplyUsage, обязателен — The account's input half, as the supplier stated it on opening; the closing message_delta states the settled whole.

MessagesReplyUsage

MessagesReplyUsage — см. выше.

MessagesError

членчто это
errorMessagesErrorBody, обязателен — The failure.
type"error", обязателен — Always "error".

MessagesErrorBody

MessagesErrorBody — см. выше.

POST /v1/messages/count_tokens

Метод
POST
Путь
/v1/messages/count_tokens
Аутентификация
Authorization: Bearer <key> or x-api-key: <key>
Операция
public.anthropic_messages.count_tokens

Посчитать, сколько токенов потратил бы запрос Messages, не тратя их.

Count message input tokens.

  • Протокол: возвращает детерминированную локальную оценку числа входных токенов для подмножества членов запроса Messages — model, messages, system, tools, tool_choice, thinking, metadata, context_management — без обращения к провайдеру, без резервирования и без списаний с баланса.
  • Аутентификация: тот же ключ, что и у /v1/messages — заголовком Authorization: Bearer или x-api-key.
  • Отклоняемые члены: всё, что относится только к генерации, — max_tokens, stream, output_config, stop_sequences, temperature, top_p — на этой операции отклоняется.
{
  "messages": [
    {
      "content": "<content>",
      "role": "user"
    }
  ],
  "model": "<model>"
}

Запрос несёт:

членчто это
context_managementobject, необязателен — This protocol's context-management configuration, as the beta spells it.
messagesarray of MessagesInputMessage, обязателен — The conversation, oldest turn first.
metadataMessagesMetadata, необязателен — This protocol's request metadata.
modelstring, обязателен — The catalog model to answer with, as the customer names it.
systemstring or array of MessagesSystemBlock, необязателен — The system prompt, beside the conversation rather than as a turn of it.
thinkingobject, необязателен — This protocol's extended-thinking configuration, as the beta spells it.
tool_choiceMessagesToolChoice, необязателен — Forces one of the declared tools.
toolsarray of MessagesTool, необязателен — The tools this turn may call.

MessagesInputMessage

MessagesInputMessage — см. выше.

MessagesMetadata

MessagesMetadata — см. выше.

MessagesSystemBlock

MessagesSystemBlock — см. выше.

MessagesToolChoice

MessagesToolChoice — см. выше.

MessagesTool

MessagesTool — см. выше.

Ответ:

application/jsonAnthropicTokenCountReply
при отказеMessagesError

AnthropicTokenCountReply

членчто это
estimatedboolean, обязателен — Always true until an exact local tokenizer is available.
input_tokensinteger, обязателен — The deterministic local estimate of input tokens.

MessagesError

MessagesError — см. выше.

MessagesErrorBody

MessagesErrorBody — см. выше.

GET /v1/models

Метод
GET
Путь
/v1/models
Аутентификация
None — this operation is open.
Операция
public.models.list

Перечислить все модели, на которые шлюз отвечает прямо сейчас.

List enabled, evidence-backed models.

  • Протокол: возвращает только активные модели каталога, у которых включена хотя бы одна возможность в опубликованной сейчас конфигурации провайдеров.
  • Поддержка протоколов и модальностей: ровно пересечение объявлений каталога и подтверждённых маршрутизацией доказательств — выключенные или недоказанные сочетания в список не попадают.
{
  "catalog_revision": 1,
  "data": [
    {
      "banner_seed": 1,
      "canonical_name": "<canonical_name>",
      "capabilities": [
        {
          "modality_code": "text_generation",
          "protocol_code": "responses",
          "status": "enabled",
          "streaming_status": "unsupported",
          "strict_semantics_status": "unsupported",
          "structured_output_mode": "none",
          "structured_output_status": "unsupported",
          "structured_output_streaming_status": "unsupported",
          "tools_status": "unsupported"
        }
      ],
      "description_en": "<description_en>",
      "description_ru": "<description_ru>",
      "display_name_en": "<display_name_en>",
      "display_name_ru": "<display_name_ru>",
      "id": "<id>",
      "modality_codes": [
        "text_generation"
      ],
      "model_id": "<model_id>",
      "object": "model",
      "protocol_codes": [
        "responses"
      ],
      "supplier_count": 1,
      "vendor": {
        "code": "<code>",
        "display_name_en": "<display_name_en>",
        "display_name_ru": "<display_name_ru>",
        "id": "<id>"
      }
    }
  ],
  "loaded_at": "<loaded_at>",
  "object": "list",
  "stale": true
}

Запрос не несёт тела.

Ответ:

application/jsonPublicModelCatalog
при отказеErrorEnvelope

PublicModelCatalog

членчто это
catalog_revisioninteger, обязателен — The append-only catalog revision.
dataarray of PublicCatalogModel, обязателен
loaded_atstring, обязателен
object"list", обязателен
staleboolean, обязателен — True only when a database refresh failed; the response then retains revision diagnostics but advertises no model capabilities.

PublicCatalogModel

членчто это
aliasesarray of string, необязателен
banner_seedinteger, обязателен — The seed of the model's halftone banner.
canonical_namestring, обязателен
capabilitiesarray of ModelCapability, обязателен
context_window_tokensinteger, необязателен — How many tokens this model accepts in one request.
description_enstring, обязателен
description_rustring, обязателен
display_name_enstring, обязателен
display_name_rustring, обязателен
header_badge"top" or "value" or "fast", необязателен — The card this model fills in the header models panel.
idstring, обязателен — The name an API request names this model by — the canonical name, so an OpenAI-compatible client that lists models and sends back data[].id as model is answered.
max_output_tokensinteger, необязателен — How many tokens this model may answer with in one call.
modality_codesarray of "text_generation" or "embeddings" or "image_generation", обязателен
model_idstring, обязателен — The catalog's UUID for this model, the key that pricing, key scopes and usage rows join on.
object"model", обязателен
protocol_codesarray of "responses" or "chat_completions" or "anthropic_messages" or "embeddings" or "images", обязателен
released_onstring, необязателен — The day this model's maker released it, as yyyy-mm-dd.
showcase_positioninteger, необязателен — The model's place on the landing model carousel, ascending.
supplier_countinteger, обязателен — How many distinct suppliers currently carry this model.
typical_requestCatalogTypicalRequest, необязателен — What one average request to this model actually spends, measured over the platform's own finished traffic.
vendorCatalogVendor, обязателен

ErrorEnvelope

членчто это
errorErrorBody, обязателен — The envelope payload.

ErrorBody

членчто это
codestring, обязателен — Machine-readable error code.
field_detailsarray of FieldDetail, необязателен — Per-field rejections, when the error is a validation error.
limitLimitDetail, необязателен — Present when the error is a limit or funding-source rejection.
messagestring, обязателен — Safe human-readable fallback.
promotionPromotionDetail, необязателен — Present when the error is a named promotion refusal.
request_idstring, обязателен — Matches the X-Request-Id response header.
versionstring, обязателен — Envelope version.

POST /v1/responses

Метод
POST
Путь
/v1/responses
Аутентификация
Authorization: Bearer <key>
Операция
public.responses.create

Более новый протокол OpenAI Responses: отправляете входные элементы, получаете один объект ответа или поток событий.

Create a response.

  • Протокол: нативный OpenAI Responses — входные и выходные элементы, словарь usage и конверт ошибки принадлежат этому протоколу, а не переведены из другого.
  • Стриминг: при stream: true ответ приходит как text/event-stream с именованными событиями протокола — response.created, элементы вывода и их дельты, затем ровно одно финальное событие: response.completed или response.failed.
  • Потолок вывода: max_output_tokens необязателен — если он не указан, действует опубликованное по умолчанию конечное значение, а явный ноль отклоняется как запрос нулевого вывода.
  • Игнорируемые члены: parallel_tool_calls, reasoning, include, prompt_cache_key, client_metadata и text.verbosity принимаются, но не влияют на ответ; store допускает только false, а previous_response_id проверяется лишь на владение и не продолжает контекст на стороне сервера.
{
  "input": "<input>",
  "model": "<model>"
}

Запрос несёт:

членчто это
client_metadataobject, необязателен — Metadata the client keeps about its own session.
includearray of string, необязателен — Extra members the caller asks the answer to carry.
inputstring or array of ResponsesInputItem, обязателен — The conversation, in either spelling this protocol defines: a bare string, or a list of typed items in order.
instructionsstring, необязателен — The system prompt, as this protocol carries it: a member of the request rather than a turn of the conversation.
max_output_tokensinteger, необязателен — The output ceiling.
modelstring, обязателен — The model to answer with: a canonical name or an alias the published catalog carries.
parallel_tool_callsboolean, необязателен — Whether the model may make several tool calls in one turn.
previous_response_idstring, необязателен — A response of this organization that this request follows.
prompt_cache_keystring, необязателен — An opaque key the caller uses to group requests for prompt caching.
reasoningobject, необязателен — This protocol's reasoning configuration.
storeboolean, необязателен — Whether the supplier should retain this response for later retrieval.
streamboolean, необязателен — Whether to stream the answer.
textResponsesTextConfig, необязателен — How the answer's text is shaped.
tool_choice"auto" or "none" or "required" or object, необязателен — What this request requires of its tool list, as a bare mode word or as an object naming one declared tool.
toolsarray of ResponsesTool, необязателен — The tools this turn may call.

ResponsesInputItem

членчто это
actionobject, необязателен — What a supplier-side search DID, as the supplier described it and as this surface published it.
argumentsstring, необязателен — The arguments the call was made with, as the JSON text the model produced.
call_idstring, необязателен — The call this item is or answers.
contentstring or array of ResponsesInputContentPart, необязателен — The text of a message item, and the reasoning prose of a reasoning item, in either spelling this protocol defines: a bare string, or a list of typed parts.
encrypted_contentstring, необязателен — The supplier's own encrypted record of a reasoning item, as it was given to the client.
idstring, необязателен — The identity this item carried when the caller last saw it.
inputstring, необязателен — The model's FREEFORM answer to a custom tool, as the text it produced: a patch, a query, whatever the tool's own grammar admits.
namestring, необязателен — The tool that was called.
namespacestring, необязателен — The group the called tool was declared in, on a function_call or a custom_tool_call, when the request that produced the call declared its tools in namespaces.
outputstring or array of ResponsesInputContentPart, необязателен — The result of running the tool, in either spelling this protocol defines: a bare string, or a list of parts of kind input_text, which is what a tool result's parts are.
role"system" or "user" or "developer" or "assistant", необязателен — Who is speaking.
statusstring, необязателен — How far the item got, in this protocol's own vocabulary and carried as the caller stated it.
summaryarray of ResponsesInputContentPart, необязателен — A reasoning item's summary, in parts of kind summary_text.
toolsarray of ResponsesToolNamespace, необязателен — The namespaced tool declarations of an additional_tools item.
type"message" or "function_call" or "function_call_output" or "additional_tools" or "custom_tool_call" or "custom_tool_call_output" or "reasoning" or "web_search_call", необязателен — Which kind of item this is.

ResponsesTextConfig

членчто это
formatResponsesTextFormat, необязателен — The named schema an answer must satisfy.
verbosity"low" or "medium" or "high", необязателен — How much the answer should say.

ResponsesTool

членчто это
descriptionstring, необязателен — What the tool does.
executionstring, необязателен — Which side runs a TOOL_SEARCH — the reference spells "client" and "server".
external_web_accessboolean, необязателен — Whether a WEB_SEARCH may reach the open web.
filtersResponsesWebSearchFilters, необязателен — What a WEB_SEARCH is limited to.
formatResponsesToolFormat, необязателен — How a CUSTOM tool's freeform answer is shaped.
namestring, необязателен — The tool's name, as it will come back on the call.
parametersobject, необязателен — The tool's parameters, as the JSON Schema the caller wrote for its own tool.
search_content_typesarray of string, необязателен — Which kinds of content a WEB_SEARCH may return.
search_context_sizestring, необязателен — How much search context a WEB_SEARCH should gather.
strictboolean, необязателен — Whether the supplier must enforce the parameter schema rather than be encouraged toward it.
type"function" or "custom" or "tool_search" or "web_search", обязателен — The kind of tool.
user_locationResponsesWebSearchLocation, необязателен — Where a WEB_SEARCH should answer as though it were.

Ответ:

application/jsonResponsesReply
text/event-streamResponsesStreamEvent
при отказеResponsesError

ResponsesReply

членчто это
created_atinteger, обязателен — The instant this response was answered, as whole seconds since the Unix epoch.
idstring, обязателен — This request's Kumo identity.
modelstring, обязателен — The model this request named, echoed back exactly as sent.
object"response", обязателен — The kind of object this is.
outputarray of ResponsesOutputItem, обязателен — What the model produced, in order, as typed items.
status"completed" or "incomplete", обязателен — How the answer ended.
usageResponsesUsage, необязателен — What the supplier reported this request consumed.

ResponsesOutputItem

членчто это
actionobject, необязателен — What a supplier-side search DID, as the supplier described it.
argumentsstring, необязателен — The arguments, as the JSON text the supplier produced.
call_idstring, необязателен — The call's identity, to quote when answering it on the next turn.
contentarray of ResponsesOutputContentPart, необязателен — The message's content, in parts, and a reasoning item's own reasoning text, in parts of kind reasoning_text.
encrypted_contentstring, необязателен — The supplier's own encrypted record of a reasoning item.
idstring, необязателен — The item's own identity, as the supplier stated it.
inputstring, необязателен — The model's freeform answer to a CUSTOM tool, as the text it produced.
namestring, необязателен — The tool that was called.
namespacestring, необязателен — The group the called tool was declared in, on a function_call or a custom_tool_call, when this request declared its tools in namespaces.
role"assistant", необязателен — Who is speaking.
statusstring, необязателен — How far a supplier-side search has got, and how far a reasoning item got.
summaryarray of ResponsesOutputContentPart, необязателен — A reasoning item's summary, in parts of kind summary_text.
type"message" or "function_call" or "custom_tool_call" or "web_search_call" or "reasoning", обязателен — Which kind of item this is.

ResponsesUsage

членчто это
input_tokensinteger, необязателен — Input tokens the supplier counted, including any it served from its own cache.
input_tokens_detailsResponsesInputTokensDetails, необязателен — How the input divides, when the supplier said.
output_tokensinteger, необязателен — Output tokens the supplier counted.
total_tokensinteger, необязателен — Input and output together.

ResponsesStreamEvent

членчто это
content_indexinteger, необязателен — The index of the content part this event is about, within its own output item.
deltastring, необязателен — The fragment a delta event carries: text on response.output_text.delta, the model's own refusal on response.refusal.delta, argument text on response.function_call_arguments.delta, and a custom tool's freeform input on response.custom_tool_call_input.delta.
itemResponsesOutputItem, необязателен — The item, on response.output_item.added — opened, so a call carries its identity and no arguments yet — on response.output_item.done, finished, and on the three web_search_call stage events, carrying the status the search has reached.
output_indexinteger, необязателен — The index of the output item this event is about.
partResponsesOutputContentPart, необязателен — The content part, on response.content_part.added — opened, so it carries its kind and no text yet — and on response.content_part.done, assembled, carrying exactly the text the fragments between the two events delivered.
responseResponsesStreamSnapshot, необязателен — The response, on the response-scoped events: opening on response.created, complete with output and usage on response.completed, and carrying this protocol's error envelope on response.failed.
sequence_numberinteger, обязателен — This event's position in the stream that carried it, counting from zero and rising by one on every event the customer is sent.
type"response.created" or "response.output_item.added" or "response.content_part.added" or "response.output_text.delta" or "response.refusal.delta" or "response.function_call_arguments.delta" or "response.custom_tool_call_input.delta" or "response.web_search_call.in_progress" or "response.web_search_call.searching" or "response.web_search_call.completed" or "response.content_part.done" or "response.output_item.done" or "response.completed" or "response.failed", обязателен — Which event this is.

ResponsesOutputItem

ResponsesOutputItem — см. выше.

ResponsesOutputContentPart

членчто это
refusalstring, необязателен — The model's own refusal, on a refusal part.
textstring, необязателен — The answer's text, on an output_text part, and the reasoning prose on a summary_text or reasoning_text part.
type"output_text" or "refusal" or "summary_text" or "reasoning_text", обязателен — The kind of part.

ResponsesStreamSnapshot

членчто это
created_atinteger, обязателен — The instant this response was answered, as whole seconds since the Unix epoch.
errorResponsesErrorBody, необязателен — This protocol's own error envelope, on response.failed.
idstring, обязателен — This request's Kumo identity, identical on every event of one stream.
modelstring, обязателен — The model this request named, echoed back exactly as sent, on every snapshot.
object"response", обязателен — The kind of object this is.
outputarray of ResponsesOutputItem, необязателен — What the model produced, in order, on response.completed.
status"in_progress" or "completed" or "incomplete" or "failed", обязателен — Where the answer stands.
usageResponsesUsage, необязателен — What the supplier reported this request consumed, on response.completed.

ResponsesError

членчто это
errorResponsesErrorBody, обязателен

ResponsesErrorBody

членчто это
codestring, необязателен — The machine-readable reason.
messagestring, обязателен — What went wrong, in a fixed safe sentence.
paramstring, необязателен — The request member at fault, when one member is at fault.
type"invalid_request_error" or "not_found_error" or "authentication_error" or "permission_error" or "rate_limit_error" or "api_error", обязателен — The class of failure, in this protocol's own closed vocabulary.

Каждая операция выше выпущена из описания API, против которого собрана эта сборка. О том, как получить всю эту документацию одним Markdown-документом, — на машиночитаемой странице.