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

Справочник API

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

Открыть как Markdown

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

POST /v1/chat/completions

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

Create a chat completion.

Answers one Chat Completions request against a model of the published catalog, authenticated by a Kumo API key. It is this protocol served natively and not a translation of another: the request members, the response shape, the usage vocabulary and the error envelope are this protocol's own. A stream=true request is answered as text/event-stream — chat.completion.chunk events, a usage chunk when stream_options.include_usage asks for one, then the terminal [DONE] frame; a refusal decided before the first event is answered as this protocol's ordinary JSON error, and a failure after it ends the stream without its terminal frame. An output ceiling is required — max_tokens or max_completion_tokens — because a billable dimension with no finite ceiling cannot be reserved for before the upstream call.

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

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.
response_formatChatResponseFormat, необязателен — A structured output requirement.
streamboolean, необязателен — Whether to stream the answer.
stream_optionsChatStreamOptions, необязателен — Options that apply only when stream is true.
tool_choiceChatToolChoice, необязателен — A requirement that one named declared tool be called on this turn.
toolsarray of ChatTool, необязателен — The tools this turn may call.

Ответ:

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

POST /v1/embeddings

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

Create embedding vectors for a batch of inputs.

Returns one vector per input, in the order the inputs were given. Billing counts input tokens only: this surface produces no output tokens and no image units, and the ledger records zero for both. The batch is bounded — at most 128 inputs and 131072 bytes in total — and a request outside those bounds is refused before any provider is called. Streaming is not part of this surface. encoding_format must be stated and must be "base64": vectors are returned as base64-encoded little-endian float32, and this surface does not serve this protocol's "float" default. A request asking for float, or asking for nothing and therefore for float, is refused by name rather than answered in another format.

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

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

POST /v1/images/generations

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

Generate images from a prompt.

Generates one or more images from a text prompt with an image-capable model. The request and response envelopes are OpenAI-compatible, and so is the error envelope: refusals carry error.message, error.type and error.code rather than Kumo's REST envelope. Billing is per image unit, debited through the same admission, reservation and settlement kernel as every other model surface. Edits and variations are not served.

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

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

POST /v1/messages

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

Create a message.

Answers one Anthropic Messages request against a model of the published catalog, authenticated by a Kumo API key. It is this protocol served NATIVELY and not a translation of another: max_tokens is required and has no default, the system prompt is a member of the request rather than a turn of the conversation, tools carry input_schema with no function wrapper, the answer states stop_reason and content blocks, and refusals arrive in this protocol's own error envelope. A tool exchange is carried natively — an assistant's calls as tool_use blocks with input as the JSON object the tool schema describes, and their results as tool_result blocks of the following user turn. A stream=true request is answered as text/event-stream carrying this protocol's own named events — message_start, content_block_start, content_block_delta, content_block_stop, message_delta, message_stop — with a refusal decided before the first event answered as this protocol's ordinary JSON error, and a failure after it expressed in-stream as this protocol's error event, the stream then ending without message_stop. The credential may be presented as Authorization: Bearer <key> or, as the native API does it, bare in the x-api-key header; either admits the caller and both name the same Kumo key. Sampling is carried to the supplier unchanged: temperature, top_p and stop_sequences. Four members are ACCEPTED AND HAVE NO EFFECT, and each says so in its own description rather than being refused or silently honoured — metadata, which this platform does not forward because it would describe a customer's own user to a supplier, and thinking, output_config and context_management, which are beta configuration this platform proves on no tuple.

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

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_pnumber, необязателен — Nucleus sampling, from 0 to 1.

Ответ:

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

POST /v1/messages/count_tokens

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

Count message input tokens.

Authenticates a Kumo API key and returns a deterministic local estimate for the same native Messages input accepted by /v1/messages. It performs no provider call, creates no customer request or reservation, touches no balance, and consumes no customer RPS/RPM quota. max_tokens and stream are generation-only and are refused on this operation. The credential may be presented as Authorization: Bearer <key> or, as the native API does it, bare in the x-api-key header; either admits the caller and both name the same Kumo key.

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

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.

Ответ:

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

GET /v1/models

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

List enabled, evidence-backed models.

Returns only active catalog models that have at least one enabled capability in the currently published provider configuration. Protocol and modality support are the exact intersection of catalog declarations and routable provider evidence; disabled or unproven tuples are absent.

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

Ответ:

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

POST /v1/responses

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

Create a response.

Answers one Responses request against a model of the published catalog, authenticated by a Kumo API key. It is this protocol served natively and not a translation of another: the input items, the output items, the usage vocabulary and the error envelope are this protocol's own. A stream=true request is answered as text/event-stream in this protocol's own named events — response.created, the output items and their deltas, then exactly one terminal event: response.completed carrying the finished body and usage, or response.failed carrying this protocol's error envelope. A failure before the first event is answered as this protocol's ordinary JSON error; cancellation releases what the request held. The output ceiling — max_output_tokens — is optional, and a request stating none is answered under this surface's published default of 32768 tokens; this platform requires a FINITE bound before the upstream call, and a published default is one the caller can read in advance. An explicit zero is refused: it is a request for no output at all. instructions is implemented and becomes the conversation's leading system turn; a developer turn is carried as a system turn, the two being one role under two names. store is accepted only as false, because this platform retains no response and accepting true would promise a retrieval that cannot happen. Six members are ACCEPTED AND HAVE NO EFFECT, each saying so in its own description rather than being refused or silently honoured — parallel_tool_calls, reasoning, include, prompt_cache_key, client_metadata and text.verbosity. A previous_response_id is validated for OWNERSHIP and is not honoured as server-side context: this platform persists no prompt, response or chunk, so there is nothing to continue from and the caller sends its own context.

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

client_metadataobject, необязателен — Metadata the client keeps about its own session.
includearray of string, необязателен — Extra members the caller asks the answer to carry.
inputarray of ResponsesInputItem, обязателен — The conversation, in order, as typed items.
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_choiceResponsesToolChoice, необязателен — A requirement that one named declared tool be called on this turn.
toolsarray of ResponsesTool, необязателен — The tools this turn may call.

Ответ:

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

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