konduit gateway API
OpenAI-compatible inference over European providers, with per-request sovereignty routing, and Anthropic's Messages API for organisations granted it.
OpenAPI 3.1.1 · version 1.10.0 · download the document
konduit speaks the OpenAI chat completions, legacy completions and
embeddings APIs, and Mistral's fill-in-the-middle completions for code. Its
audio transcription API is specified here and served once a transcription
model is listed in GET /models; none is yet. An existing OpenAI SDK talks
to it by changing two settings — the base URL and the key — and needs to
know nothing else.
For organisations a model of modality messages is granted to, konduit
also speaks Anthropic's own Messages API (POST /messages and
POST /messages/count_tokens, tag Messages). The same holds there: an
Anthropic SDK or client changes its base URL to https://api.konduit.eu
(without /v1) and its key, sent as x-api-key or as a Bearer token.
Those models are served by Anthropic, not by a European provider, and are
not offered to other organisations: for them both routes answer 404 not_found_error, exactly as for a model that does not exist.
On top of that compatibility konduit adds three things, all of them optional to use and none of them breaking an SDK that ignores them:
- a
providerobject in the request body, which is the sovereignty policy: which countries, which certifications, which operators may serve this one request; - the
Konduit-ProviderandKonduit-Deploymentresponse headers, which name who actually served it; - an extended
GET /v1/models, whose entries carry pricing and asovereigntyblock beside OpenAI's four fields, andGET /v1/models/{model}for one of them.
Errors follow OpenAI's envelope, except on the two Messages routes, whose
errors follow Anthropic's (AnthropicError). konduit's own
machine-readable codes are listed under ErrorEnvelope; the ones prefixed upstream_ describe
something a provider did, and the ones without that prefix describe something
konduit decided before any provider was asked.
Base URL
https://api.konduit.eu/v1 — Production.
Authentication
ApiKeyAuth — http (bearer)
Authorization: Bearer <key>. The scheme is matched case-insensitively.
The only other place a key is read from is the x-api-key header, see
XApiKeyAuth; there is no query parameter.
A key is a configurable prefix (kdt- unless an install changes it)
followed by 32 characters of lowercase base32. Keys are minted in the
console and shown once.
A 401 carries no WWW-Authenticate header, deliberately: OpenAI's API
sends none, and a drop-in replacement that sent one would make some
clients behave differently against konduit than against the API they
were written for.
XApiKeyAuth — apiKey
x-api-key: <key>, the header Anthropic's SDKs and n8n's Anthropic
nodes send. It is accepted on every route, not only on the Messages
routes, and the key is the same one. When a request carries an
Authorization header, that header is the key presented and x-api-key
is not read, so a wrong Bearer key beside a valid x-api-key is
refused.
Endpoints
POST /chat/completions
Create a chat completion
Relays a chat completion to whichever deployment konduit's routing chose for it, and returns the provider's own response bytes.
What konduit reads, and what it forwards
The body is forwarded to the provider as it arrived, with the routing
decision written into it and nothing else. konduit validates only that
the body is one JSON object, that model is a non-empty string, and that
messages has at least one entry; temperature, tools,
response_format and anything OpenAI ships next travel through
untouched and unvalidated, because judging them is the provider's job.
It also refuses (invalid_request) a body a JSON parser could read two
ways: two keys, at the top level or inside stream_options, that are
the same once case is ignored, or one of the fields it reads (model,
messages, stream, stream_options, max_tokens,
max_completion_tokens, n, provider, and include_usage inside
stream_options) spelled in any other case, such as "Stream".
The exceptions to byte-for-byte relaying are exactly four: provider
is removed, model is replaced by the chosen provider's own name for the
deployment, on a streaming request stream_options.include_usage is set
to true, and for a deployment whose chat template accepts only
nine-character alphanumeric tool-call ids, every tool_calls[].id and
tool_call_id in messages that is not already one is replaced by one,
the same for a call and its result.
Which deployment serves it
model resolves against konduit's catalog, most specific first:
| You send | konduit tries |
|---|---|
a deployment id from GET /v1/models |
exactly that deployment |
provider/model |
every deployment of that model from that provider |
model:variant |
every provider's deployment of that model in that variant |
model |
every deployment of that model, from every provider |
A prefix before the first / is read as a provider only when konduit's
catalog knows a provider by that name — so a model id that contains a
slash still resolves as a model.
An embedding model — modality: embedding in GET /models — is not
served here: it is refused with 400 model_does_not_support_endpoint,
whose message names POST /v1/embeddings, before any credit is
reserved or any provider is asked. Every chat deployment serves this
route; deployment.endpoints in GET /models lists it for each.
Everything that survives the provider policy is then ordered cheapest
first (input plus output price per million tokens) and tried in that
order. A candidate that fails before konduit has committed to an answer
is replaced by the next one; on a stream, that boundary is the first
flushed byte.
This endpoint requires the chat:write scope. A key with no scopes is
unrestricted.
Request body
application/json — ChatCompletionRequest
| Field | Type | Notes |
|---|---|---|
model * | string | A model, a model at a provider, one exact deployment, or a variant. See the resolution table on the operation. |
messages * | object[] | The conversation. konduit counts the entries and forwards them; it never reads one, which is why no message schema is given here — the provider's own is the one that applies. |
stream | boolean | Serve the completion as server-sent events. |
stream_options | StreamOptions | Forwarded to the provider with every field it arrived with. konduit sets exactly one of them. |
max_completion_tokens | integer | The completion ceiling. konduit reads it to size the credit reservation the request needs before it runs; it is forwarded like every other field. |
max_tokens | integer | Deprecated. OpenAI's deprecated spelling of |
n | integer | How many choices to generate. Each is a completion the provider
bills, so konduit reads it to reserve credit for that many
completions of the ceiling above; it is forwarded like every other
field. It must be an integer. The per-request reservation limit
clamps only a single choice: with |
provider | ProviderPolicy | konduit's sovereignty and preference statement about one request. It is removed from the body before anything goes upstream — no provider ever sees konduit's routing vocabulary. A body field rather than a header, because every OpenAI client library
has a way to add an unknown field to a request body ( Three of the four fields are filters and one is a preference: |
The smallest request konduit accepts
{
"model": "mistral-small-3.2",
"messages": [
{
"role": "user",
"content": "Say hello in one word."
}
]
}Pin one deployment by its catalog id
{
"model": "scaleway/mistral-small-3.2",
"messages": [
{
"role": "user",
"content": "Say hello in one word."
}
]
}Germany or France only, zero retention, Scaleway preferred
{
"model": "mistral-small-3.2",
"messages": [
{
"role": "user",
"content": "Say hello in one word."
}
],
"provider": {
"countries": [
"DE",
"FR"
],
"zero_retention": true,
"order": [
"scaleway"
]
}
}A stream that also wants the usage chunk
{
"model": "mistral-small-3.2",
"stream": true,
"stream_options": {
"include_usage": true
},
"messages": [
{
"role": "user",
"content": "Say hello in one word."
}
]
}Responses
| Status | Description |
|---|---|
200 | The completion. For Headers: |
400 | konduit refused the request before routing it: a body that is not one
JSON object, no A provider can also refuse a request konduit accepted, and konduit keeps
the provider's own status when it does — so a 400 may instead carry
A body konduit could not acceptAn image sent to a model without visionAn embedding model sent to chat completionsA chat model sent to a completions route none of its deployments serveAn unrecognised key inside `provider`The provider rejected the request, at the provider's own status |
401 | No key was sent, or the key is not valid. No key was sentA key was sent and refused |
402 | The organisation's available credit does not cover the reservation this request needs. Retrying does not help; a top-up does. Out of credit |
403 | The credential is genuine and refused anyway: either the key does not
carry the scope this endpoint requires ( The key is valid but not authorised for this endpointThe organisation behind the key is not active |
404 | The request has nowhere to go: konduit's catalog knows no deployment
under the requested name ( konduit serves no such modelThe policy excluded every deployment |
413 | The request body exceeded the gateway's limit, 20 MiB (20971520 bytes) unless the operator configured another. The message quotes the limit in bytes. Base64 adds a third to an image, so one phone photo is typically 4-11 MB on the wire. Body over 20 MiB |
429 | A rate limit was reached. Headers: konduit's own rate limitThe provider is out of capacity |
502 | The hop after konduit did not answer the question usably. Either every
candidate deployment konduit tried failed, and the last failure was a
provider error (
Headers: The provider returned an errorThe provider rejected konduit's own credentialThe provider could not be reached at allThe provider answered past konduit's response bound |
503 | konduit cannot answer right now. Headers: This gateway has no catalog yetNo adapter for any operator serving this modelCredit could not be reservedToo many request bytes in flight; retry shortlyThe provider said it was overloaded (its own message is relayed when readable) |
504 | The provider did not answer in time. The provider did not answer in time |
POST /completions
Create a completion (legacy)
Relays an OpenAI legacy completions request — a prompt to continue
rather than a conversation — to whichever deployment konduit's routing
chose for it, and returns the provider's own response bytes. Code
assistants that template fill-in-the-middle into prompt themselves
use it for autocomplete.
Which deployments serve it
Only the chat deployments whose deployment.endpoints in
GET /models lists /v1/completions. Whether an operator serves the
route is a property of how it serves the weights, so konduit probes it
per deployment. model resolves as on POST /chat/completions, and
then every deployment that does not serve this route is dropped: a
model with none left is refused with
400 model_does_not_support_endpoint before any credit is reserved or
any provider is asked — an embedding model with the message naming
POST /v1/embeddings. A fallback only ever reaches another deployment
that serves the route.
What konduit reads, and what it forwards
konduit validates only that the body is one JSON object, that model
is a non-empty string and that prompt is one string. The legacy
API's array forms — several prompts, or token ids — are refused with
400 invalid_request: the provider answers them with one completion
per element, which the credit konduit reserves for one would not
cover, so send one request per prompt. It also refuses
(invalid_request) a body a JSON parser could read two ways, judged
against the fields it reads here: model, prompt, stream,
stream_options, max_tokens, n, best_of, provider, and
include_usage inside stream_options.
The exceptions to byte-for-byte relaying are exactly three: provider
is removed, model is replaced by the chosen provider's own name for
the deployment, and on a streaming request
stream_options.include_usage is set to true. Everything else —
suffix, stop, echo, logprobs — reaches the provider as sent
and is the provider's to judge. The providers behind this route refuse
suffix with a 400 (upstream_invalid_request); send
fill-in-the-middle with a suffix to POST /fim/completions instead.
What it costs
Like a chat completion: the provider's own usage, at the
deployment's input and output prices. max_tokens sizes the credit
reserved before the request runs, times n or best_of, whichever
is larger, because each is a completion the provider bills. The
per-request reservation limit clamps only a request for one: one for
several whose whole reservation would exceed it is refused with
400 invalid_request before anything is reserved. Without
max_tokens the reservation is sized from the deployment's
max_output_tokens, or from its whole context window when it
publishes none, while the provider's own default may be as short as 16
tokens. The difference is released when the request is charged, but
until then it is credit that cannot be spent, so send max_tokens.
This endpoint requires the completions:write scope. A key with no
scopes is unrestricted.
Request body
application/json — CompletionRequest
| Field | Type | Notes |
|---|---|---|
model * | string | A model, a model at a provider, or one exact deployment, resolved as on a chat completion among the deployments that serve the route. |
prompt * | string | The text to continue — for fill-in-the-middle, the code before the
cursor. konduit checks that it is one string and never reads it.
The legacy API's array forms are refused with |
suffix | string | Fill-in-the-middle only: the code after the cursor. Forwarded
unread. The providers behind |
stream | boolean | Serve the completion as server-sent events. |
stream_options | StreamOptions | Forwarded to the provider with every field it arrived with. konduit sets exactly one of them. |
max_tokens | integer | The completion ceiling. konduit reads it to size the credit reservation the request needs before it runs; it is forwarded like every other field. |
n | integer | How many completions to return. Each is billed, so konduit reserves
credit for that many; forwarded like every other field. It must be
an integer. Above 1, a request whose whole reservation would exceed
the per-request limit is refused with |
best_of | integer | Legacy completions only: how many completions the provider
generates to return the best |
provider | ProviderPolicy | konduit's sovereignty and preference statement about one request. It is removed from the body before anything goes upstream — no provider ever sees konduit's routing vocabulary. A body field rather than a header, because every OpenAI client library
has a way to add an unknown field to a request body ( Three of the four fields are filters and one is a preference: |
Continue a prompt
{
"model": "llama-3.3-70b-instruct",
"prompt": "def add(a, b):\n ",
"max_tokens": 16
}A stream that also wants the usage chunk
{
"model": "llama-3.3-70b-instruct",
"prompt": "def add(a, b):\n ",
"max_tokens": 16,
"stream": true,
"stream_options": {
"include_usage": true
}
}Responses
| Status | Description |
|---|---|
200 | The completion. For Headers: |
400 | konduit refused the request before routing it: a body that is not one
JSON object, no A provider can also refuse a request konduit accepted, and konduit keeps
the provider's own status when it does — so a 400 may instead carry
A body konduit could not acceptAn image sent to a model without visionAn embedding model sent to chat completionsA chat model sent to a completions route none of its deployments serveAn unrecognised key inside `provider`The provider rejected the request, at the provider's own status |
401 | No key was sent, or the key is not valid. No key was sentA key was sent and refused |
402 | The organisation's available credit does not cover the reservation this request needs. Retrying does not help; a top-up does. Out of credit |
403 | The credential is genuine and refused anyway: either the key does not
carry the scope this endpoint requires ( The key is valid but not authorised for this endpointThe organisation behind the key is not active |
404 | The request has nowhere to go: konduit's catalog knows no deployment
under the requested name ( konduit serves no such modelThe policy excluded every deployment |
413 | The request body exceeded the gateway's limit, 20 MiB (20971520 bytes) unless the operator configured another. The message quotes the limit in bytes. Base64 adds a third to an image, so one phone photo is typically 4-11 MB on the wire. Body over 20 MiB |
429 | A rate limit was reached. Headers: konduit's own rate limitThe provider is out of capacity |
502 | The hop after konduit did not answer the question usably. Either every
candidate deployment konduit tried failed, and the last failure was a
provider error (
Headers: The provider returned an errorThe provider rejected konduit's own credentialThe provider could not be reached at allThe provider answered past konduit's response bound |
503 | konduit cannot answer right now. Headers: This gateway has no catalog yetNo adapter for any operator serving this modelCredit could not be reservedToo many request bytes in flight; retry shortlyThe provider said it was overloaded (its own message is relayed when readable) |
504 | The provider did not answer in time. The provider did not answer in time |
POST /fim/completions
Create a fill-in-the-middle completion
Relays a fill-in-the-middle request — the code before the cursor in
prompt, the code after it in suffix — to a deployment that serves
Mistral's FIM endpoint, and returns the provider's own response bytes.
The answer is chat-shaped: choices[].message.content holds the text
to insert, and a stream sends chat.completion.chunk frames.
Which deployments serve it
Only the chat deployments whose deployment.endpoints in
GET /models lists /v1/fim/completions; any other model is refused
with 400 model_does_not_support_endpoint before any credit is
reserved or any provider is asked. model resolves as on
POST /chat/completions, and a fallback only ever reaches another
deployment that serves the route.
What konduit reads, and what it forwards
The same as on POST /completions: model and a prompt that is one
string must be there, the same fields are checked for a second
reading, and the same three exceptions to byte-for-byte relaying
apply. suffix, stop and
min_tokens are forwarded unread. Mistral refuses a field it does not
know with a 422 (upstream_invalid_request), which is one reason
konduit's provider object never reaches it.
What it costs
Like a chat completion: the provider's own usage, at the
deployment's input and output prices. Mistral puts the counts on the
last content chunk of a stream; a client that did not ask for usage
receives that chunk with usage set to null.
Send max_tokens: it sizes the credit reserved before the request
runs. Without it the reservation is the deployment's
max_output_tokens, or its whole context window when it publishes
none — 256 000 tokens for codestral-2508 — on every request an
editor sends, which a modest balance answers with
402 insufficient_balance long before the real completions would
have cost that much.
This endpoint requires the completions:write scope. A key with no
scopes is unrestricted.
Request body
application/json — CompletionRequest
| Field | Type | Notes |
|---|---|---|
model * | string | A model, a model at a provider, or one exact deployment, resolved as on a chat completion among the deployments that serve the route. |
prompt * | string | The text to continue — for fill-in-the-middle, the code before the
cursor. konduit checks that it is one string and never reads it.
The legacy API's array forms are refused with |
suffix | string | Fill-in-the-middle only: the code after the cursor. Forwarded
unread. The providers behind |
stream | boolean | Serve the completion as server-sent events. |
stream_options | StreamOptions | Forwarded to the provider with every field it arrived with. konduit sets exactly one of them. |
max_tokens | integer | The completion ceiling. konduit reads it to size the credit reservation the request needs before it runs; it is forwarded like every other field. |
n | integer | How many completions to return. Each is billed, so konduit reserves
credit for that many; forwarded like every other field. It must be
an integer. Above 1, a request whose whole reservation would exceed
the per-request limit is refused with |
best_of | integer | Legacy completions only: how many completions the provider
generates to return the best |
provider | ProviderPolicy | konduit's sovereignty and preference statement about one request. It is removed from the body before anything goes upstream — no provider ever sees konduit's routing vocabulary. A body field rather than a header, because every OpenAI client library
has a way to add an unknown field to a request body ( Three of the four fields are filters and one is a preference: |
Complete the middle of a function
{
"model": "codestral-2508",
"prompt": "def add(a, b):\n ",
"suffix": "\n\nprint(add(1, 2))",
"max_tokens": 64
}Responses
| Status | Description |
|---|---|
200 | The completion. For Headers: |
400 | konduit refused the request before routing it: a body that is not one
JSON object, no A provider can also refuse a request konduit accepted, and konduit keeps
the provider's own status when it does — so a 400 may instead carry
A body konduit could not acceptAn image sent to a model without visionAn embedding model sent to chat completionsA chat model sent to a completions route none of its deployments serveAn unrecognised key inside `provider`The provider rejected the request, at the provider's own status |
401 | No key was sent, or the key is not valid. No key was sentA key was sent and refused |
402 | The organisation's available credit does not cover the reservation this request needs. Retrying does not help; a top-up does. Out of credit |
403 | The credential is genuine and refused anyway: either the key does not
carry the scope this endpoint requires ( The key is valid but not authorised for this endpointThe organisation behind the key is not active |
404 | The request has nowhere to go: konduit's catalog knows no deployment
under the requested name ( konduit serves no such modelThe policy excluded every deployment |
413 | The request body exceeded the gateway's limit, 20 MiB (20971520 bytes) unless the operator configured another. The message quotes the limit in bytes. Base64 adds a third to an image, so one phone photo is typically 4-11 MB on the wire. Body over 20 MiB |
429 | A rate limit was reached. Headers: konduit's own rate limitThe provider is out of capacity |
502 | The hop after konduit did not answer the question usably. Either every
candidate deployment konduit tried failed, and the last failure was a
provider error (
Headers: The provider returned an errorThe provider rejected konduit's own credentialThe provider could not be reached at allThe provider answered past konduit's response bound |
503 | konduit cannot answer right now. Headers: This gateway has no catalog yetNo adapter for any operator serving this modelCredit could not be reservedToo many request bytes in flight; retry shortlyThe provider said it was overloaded (its own message is relayed when readable) |
504 | The provider did not answer in time. The provider did not answer in time |
POST /embeddings
Create embeddings
Relays an embeddings request to whichever embedding deployment konduit's routing chose for it, and returns the provider's own response bytes.
What konduit reads, and what it forwards
The body is forwarded to the provider as it arrived, with the routing
decision written into it and nothing else: provider is removed and
model is replaced by the chosen provider's own name for the
deployment. konduit validates only that the body is one JSON object,
that model is a non-empty string, and that there is something to
embed — input, or messages for a multimodal embedding model that
takes text and images in one conversation-shaped request. It also
refuses (invalid_request) a body whose top-level object holds two keys
that are the same once case is ignored, or spells one of the fields it
reads (model, input, messages, provider) in any other case, such
as "Input".
encoding_format, dimensions and anything a provider adds travel
through untouched and unvalidated, and konduit adds no defaults of its
own.
Which deployment serves it
model resolves exactly as on POST /chat/completions, among the
catalog's embedding deployments only — modality: embedding in
GET /models. A chat model sent here is refused with
400 model_does_not_support_endpoint, whose message names
POST /v1/chat/completions, before any credit is reserved or any
provider is asked. Candidates are ordered cheapest first, and one that
fails with a 429 or a 5xx is replaced by the next. One that answers
200 is not, even if its body then never comes: the provider computed,
and bills, every vector before it sent that status, so konduit answers
502 upstream_error and records the request for reconciliation rather
than buying the vectors again elsewhere.
The response, and what it costs
The provider's response is relayed as it arrives rather than collected
first, so a large batch — hundreds of inputs at thousands of dimensions
is tens of megabytes of JSON — reaches the client without konduit
holding it. konduit reads the top-level usage and id out of those
bytes as they pass and bills the provider's own count at the
deployment's input price: an embedding deployment has no output price.
A response whose usage never reaches konduit is recorded for
reconciliation, never charged on an estimate: it is charged only if the
provider's own numbers prove the usage within three days, and after that
konduit absorbs the cost.
The status is committed with the first byte of the provider's body. A provider that fails after that, before the whole document has gone out, has the connection cut off rather than the response finished: the client sees a broken connection, never a 200 carrying truncated JSON. Not every SDK retries a failure that arrives after the status — openai-node does not — so treat it as a transport error and retry.
One timeout covers the whole exchange: the provider computing every vector and the client downloading them must finish within the gateway's upstream timeout, 120 seconds unless the operator configured another. A client that stops reading for 30 seconds is taken for gone, sooner if the operator configured a shorter upstream idle timeout.
This endpoint requires the embeddings:write scope. A key with no
scopes is unrestricted.
Request body
application/json — EmbeddingRequest
| Field | Type | Notes |
|---|---|---|
model * | string | An embedding model, a model at a provider, or one exact deployment.
It resolves the way |
input | any | What to embed: a string, or an array of them for a batch. konduit checks that it is there and never reads it, so its shape, how many entries a batch may hold and how long each may be are the provider's limits to enforce. |
messages | object[] | The conversation-shaped input of a multimodal embedding model: text
and |
provider | ProviderPolicy | konduit's sovereignty and preference statement about one request. It is removed from the body before anything goes upstream — no provider ever sees konduit's routing vocabulary. A body field rather than a header, because every OpenAI client library
has a way to add an unknown field to a request body ( Three of the four fields are filters and one is a preference: |
One string
{
"model": "qwen3-embedding-8b",
"input": "The quick brown fox jumps over the lazy dog."
}A batch, pinned to one deployment
{
"model": "stackit/e5-mistral-7b-instruct",
"input": [
"The API is fast and reliable.",
"The system reacts just in time and is stable."
]
}Text and an image in one vector
{
"model": "stackit/qwen3-vl-embedding-8b",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "A red bicycle against a white wall."
},
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="
}
}
]
}
]
}Responses
| Status | Description |
|---|---|
200 | The provider's own JSON response body, relayed unchanged as it arrives. Headers: |
400 | konduit refused the request before routing it: a body that is not one
JSON object, no A provider can also refuse a request konduit accepted, and konduit keeps
the provider's own status when it does — so a 400 may instead carry
A body konduit could not acceptAn image sent to a model without visionAn embedding model sent to chat completionsA chat model sent to a completions route none of its deployments serveAn unrecognised key inside `provider`The provider rejected the request, at the provider's own status |
401 | No key was sent, or the key is not valid. No key was sentA key was sent and refused |
402 | The organisation's available credit does not cover the reservation this request needs. Retrying does not help; a top-up does. Out of credit |
403 | The credential is genuine and refused anyway: either the key does not
carry the scope this endpoint requires ( The key is valid but not authorised for this endpointThe organisation behind the key is not active |
404 | The request has nowhere to go: konduit's catalog knows no deployment
under the requested name ( konduit serves no such modelThe policy excluded every deployment |
413 | The request body exceeded the gateway's limit, 20 MiB (20971520 bytes) unless the operator configured another. The message quotes the limit in bytes. Base64 adds a third to an image, so one phone photo is typically 4-11 MB on the wire. Body over 20 MiB |
429 | A rate limit was reached. Headers: konduit's own rate limitThe provider is out of capacity |
502 | The hop after konduit did not answer the question usably. Either every
candidate deployment konduit tried failed, and the last failure was a
provider error (
Headers: The provider returned an errorThe provider rejected konduit's own credentialThe provider could not be reached at allThe provider answered past konduit's response bound |
503 | konduit cannot answer right now. Headers: This gateway has no catalog yetNo adapter for any operator serving this modelCredit could not be reservedToo many request bytes in flight; retry shortlyThe provider said it was overloaded (its own message is relayed when readable) |
504 | The provider did not answer in time. The provider did not answer in time |
POST /systemone
Ask a decision model
Relays a decision request to whichever decision deployment konduit's
routing chose for it, and returns the provider's own response bytes. A
decision model answers a set of questions about a state — a text
and what goes with it — with a choice, a score or a probability for
each.
This endpoint is available to organisations a decision model is granted
to. A key whose organisation holds no grant for the model it names is
answered exactly as for a model that does not exist: 404 model_not_found.
What konduit reads, and what it forwards
The body is forwarded to the provider as it arrived, with the routing
decision written into it and nothing else: provider is removed and
model is replaced by the chosen provider's own name for the
deployment. state and questions are relayed unread. konduit
validates that the body is one JSON object, that model is a non-empty
string, that state is present, and that questions is a non-empty
object, and refuses (invalid_request) a body that carries assets,
konduit relaying text-only decision requests, or a stream other than
false, because decision requests are not streamed. It also refuses a
body whose top-level object holds two keys that are the same once case
is ignored, or spells one of the fields it reads (model, state,
questions, assets, stream, provider) in any other case. Every
refusal comes before any credit is reserved or any provider is asked.
Which deployment serves it
model resolves exactly as on POST /chat/completions, among the
catalog's decision deployments only — modality: decision in
GET /models. Any other model sent here is refused with
400 model_does_not_support_endpoint, whose message names the endpoint
that serves it, and a decision model sent to another endpoint is
refused the same way, naming this one. Candidates are ordered cheapest
first, and one that fails with a 429 or a 5xx is replaced by the next.
The response, and what it costs
The provider's response is relayed unchanged. konduit reads its
top-level usage — input_tokens and output_tokens — and bills the
provider's own count at the deployment's input price; a decision
deployment's output is free. A response without a usable usage is
recorded for reconciliation, never charged on an estimate.
This endpoint requires the decisions:write scope. A key with no
scopes is unrestricted.
Request body
application/json — DecisionRequest
| Field | Type | Notes |
|---|---|---|
model * | string | A decision model, a model at a provider, or one exact deployment.
It resolves the way |
state * | any | What the questions are about: any JSON value, relayed unread. It
must be present and not |
questions * | object | The questions to answer, by name. Their shape is the provider's to judge; the answers come back under the same names. |
provider | ProviderPolicy | konduit's sovereignty and preference statement about one request. It is removed from the body before anything goes upstream — no provider ever sees konduit's routing vocabulary. A body field rather than a header, because every OpenAI client library
has a way to add an unknown field to a request body ( Three of the four fields are filters and one is a preference: |
One choice question
{
"model": "example-decision-model",
"state": {
"text": "The match ended 2:1 after extra time."
},
"questions": {
"topic": {
"type": "choice",
"criteria": {
"politik": "about politics",
"sport": "about sport"
}
}
}
}Responses
| Status | Description |
|---|---|
200 | The provider's own JSON response body, relayed unchanged. Headers: |
400 | konduit refused the request before routing it: a body that is not one
JSON object, no A provider can also refuse a request konduit accepted, and konduit keeps
the provider's own status when it does — so a 400 may instead carry
A body konduit could not acceptAn image sent to a model without visionAn embedding model sent to chat completionsA chat model sent to a completions route none of its deployments serveAn unrecognised key inside `provider`The provider rejected the request, at the provider's own status |
401 | No key was sent, or the key is not valid. No key was sentA key was sent and refused |
402 | The organisation's available credit does not cover the reservation this request needs. Retrying does not help; a top-up does. Out of credit |
403 | The credential is genuine and refused anyway: either the key does not
carry the scope this endpoint requires ( The key is valid but not authorised for this endpointThe organisation behind the key is not active |
404 | The request has nowhere to go: konduit's catalog knows no deployment
under the requested name ( konduit serves no such modelThe policy excluded every deployment |
413 | The request body exceeded the gateway's limit, 20 MiB (20971520 bytes) unless the operator configured another. The message quotes the limit in bytes. Base64 adds a third to an image, so one phone photo is typically 4-11 MB on the wire. Body over 20 MiB |
429 | A rate limit was reached. Headers: konduit's own rate limitThe provider is out of capacity |
502 | The hop after konduit did not answer the question usably. Either every
candidate deployment konduit tried failed, and the last failure was a
provider error (
Headers: The provider returned an errorThe provider rejected konduit's own credentialThe provider could not be reached at allThe provider answered past konduit's response bound |
503 | konduit cannot answer right now. Headers: This gateway has no catalog yetNo adapter for any operator serving this modelCredit could not be reservedToo many request bytes in flight; retry shortlyThe provider said it was overloaded (its own message is relayed when readable) |
504 | The provider did not answer in time. The provider did not answer in time |
POST /messages
Create a message
Relays a request in Anthropic's Messages API to the deployment konduit's routing chose for it, and returns the provider's own response, buffered or streamed. A client written for that API — an Anthropic SDK, n8n's Anthropic nodes, Claude Code — changes its base URL and its key and nothing else.
This endpoint is available to organisations a model of modality
messages is granted to. A key whose organisation holds no grant for
the model it names is answered exactly as for a model that does not
exist: a 404 of type not_found_error.
What konduit reads, and what it forwards
The body is forwarded as it arrived, with the routing decision written
into it and nothing else: provider is removed and model is replaced
by the chosen provider's own name for the deployment, which for these
models is the id you sent. system, messages, tools, thinking,
cache_control, speed, inference_geo and every other field,
including fields Anthropic ships next, travel through untouched, in the
order they arrived, because prompt caching depends on it. konduit
validates only that the body is one JSON object, that model is a
non-empty string, that messages is a non-empty array, that
max_tokens is a positive integer and that stream, when present, is a
boolean; judging the rest is the provider's job. It also refuses
(invalid_request_error) a body a JSON parser could read two ways: two
keys that are the same once case is ignored, or one of the fields it
reads (model, provider, stream, max_tokens, messages, speed,
inference_geo) spelled in any other case.
Two request headers are relayed upstream, verbatim: anthropic-version
and anthropic-beta. When the client sends no anthropic-version,
konduit sends 2023-06-01. The beta query parameter is relayed too;
no other query parameter and no other header is.
Which deployment serves it
model resolves as on POST /chat/completions, among the catalog's
messages deployments only. Any other model sent here is refused with
a 400 whose message names the endpoint that serves it, and a
messages model sent to another endpoint is refused the same way,
naming this one. This route accepts the provider policy as the other
routes do.
The response
The response is relayed unchanged: the body of a buffered request, and
every event of a stream — each event: line, ping events and unknown
events included — with usage exactly as the provider reported it. A
stream carries no data: [DONE]; it ends with message_stop. The
provider's request-id, retry-after, x-should-retry and
anthropic-ratelimit-* headers reach the client, on success and on an
error, together with Konduit-Provider and Konduit-Deployment.
What it costs
konduit bills from the usage the provider reports, never from an
estimate. Five token classes are each charged at the deployment's own
price: input_tokens, output_tokens, cache_read_input_tokens, and
cache writes in two classes, five-minute and one-hour
(cache_creation; without the split, all five-minute). The prices are in
pricing in GET /models. A prompt over the deployment's long-prompt
threshold, usage.speed: "fast" and usage.inference_geo: "us" each
multiply every class's price by the deployment's multiplier, and the
three stack. Each web search, usage.server_tool_use.web_search_requests,
is charged at the deployment's price per search. When usage.iterations
is present, every entry is charged at the prices of the model that ran
it. Usage the catalog has no price for, such as fast on a deployment
that states no fast multiplier, is relayed and the record is marked for
reconciliation: nothing is charged in part, and nothing is estimated.
This endpoint requires the chat:write scope. A key with no scopes is
unrestricted.
Request body
application/json — MessagesRequest
| Field | Type | Notes |
|---|---|---|
model * | string | A model from |
messages * | object[] | The conversation. konduit checks that it is a non-empty array and forwards it; it never reads an entry, which is why no message schema is given here. |
max_tokens * | integer | The completion ceiling. konduit reads it to size the credit reservation the request needs before it runs; it is forwarded like every other field. |
stream | boolean | Serve the message as server-sent events. |
provider | ProviderPolicy | konduit's sovereignty and preference statement about one request. It is removed from the body before anything goes upstream — no provider ever sees konduit's routing vocabulary. A body field rather than a header, because every OpenAI client library
has a way to add an unknown field to a request body ( Three of the four fields are filters and one is a preference: |
The smallest request konduit accepts
{
"model": "claude-sonnet-5-5",
"max_tokens": 256,
"messages": [
{
"role": "user",
"content": "Say hello in one word."
}
]
}A stream, with a cached system prompt
{
"model": "claude-sonnet-5-5",
"max_tokens": 1024,
"stream": true,
"system": [
{
"type": "text",
"text": "You read build logs and say what broke.",
"cache_control": {
"type": "ephemeral"
}
}
],
"messages": [
{
"role": "user",
"content": "Why did the last run fail?"
}
]
}Responses
| Status | Description |
|---|---|
200 | The message. For Headers: |
400 | konduit refused the request before routing it: a body that is not one JSON
object, no messagesBadRequest |
401 | No key was sent, or the key is not valid. Type messagesUnauthorized |
402 | The organisation's available credit does not cover the reservation this
request needs. Type messagesPaymentRequired |
403 | The key lacks the messagesForbidden |
404 | The model does not exist, is retired, or is not granted to the calling
organisation; the three are answered identically. Type messagesNotFound |
413 | The request body is larger than konduit accepts. Type messagesPayloadTooLarge |
429 | A rate limit was hit, konduit's own or the provider's. Type
Headers: messagesTooManyRequests |
500 | An error the provider answered with, relayed unchanged: its status, its body
and its messagesServerError |
502 | The provider failed or could not be reached, or refused konduit's own
credentials. Type messagesBadGateway |
503 | konduit cannot serve the request right now: its catalog or its ledger is
unavailable. Type messagesServiceUnavailable |
504 | The provider did not answer in time. Type messagesGatewayTimeout |
529 | The provider is overloaded, an answer relayed unchanged. Type
messagesOverloaded |
POST /messages/count_tokens
Count the tokens of a message
Asks the provider how many input tokens a Messages request would use.
It is routed exactly like POST /messages — by model, by modality,
by the provider policy and by the key's entitlements — and relayed
the same way: provider is removed, model is replaced by the
provider's own name for the deployment, everything else goes upstream
untouched, and the response comes back unchanged, with the same
headers and the same error rules.
It is not billed. konduit reserves no credit for it and records no
usage for it. The only validation is that the body is one JSON object
with a non-empty string model; the rest is the provider's to judge.
This endpoint requires the chat:write scope. A key with no scopes is
unrestricted.
Request body
application/json — CountTokensRequest
| Field | Type | Notes |
|---|---|---|
model * | string | A model from |
messages | object[] | Forwarded unread. |
provider | ProviderPolicy | konduit's sovereignty and preference statement about one request. It is removed from the body before anything goes upstream — no provider ever sees konduit's routing vocabulary. A body field rather than a header, because every OpenAI client library
has a way to add an unknown field to a request body ( Three of the four fields are filters and one is a preference: |
Count one user message
{
"model": "claude-sonnet-5-5",
"messages": [
{
"role": "user",
"content": "Say hello in one word."
}
]
}Responses
| Status | Description |
|---|---|
200 | The provider's own count, relayed unchanged. Headers: |
400 | konduit refused the request before routing it: a body that is not one JSON
object, no messagesBadRequest |
401 | No key was sent, or the key is not valid. Type messagesUnauthorized |
403 | The key lacks the messagesForbidden |
404 | The model does not exist, is retired, or is not granted to the calling
organisation; the three are answered identically. Type messagesNotFound |
413 | The request body is larger than konduit accepts. Type messagesPayloadTooLarge |
429 | A rate limit was hit, konduit's own or the provider's. Type
Headers: messagesTooManyRequests |
500 | An error the provider answered with, relayed unchanged: its status, its body
and its messagesServerError |
502 | The provider failed or could not be reached, or refused konduit's own
credentials. Type messagesBadGateway |
503 | konduit cannot serve the request right now: its catalog or its ledger is
unavailable. Type messagesServiceUnavailable |
504 | The provider did not answer in time. Type messagesGatewayTimeout |
529 | The provider is overloaded, an answer relayed unchanged. Type
messagesOverloaded |
POST /audio/transcriptions
Transcribe audio
Relays a transcription request to whichever transcription deployment konduit's routing chose for it, and returns the provider's own response bytes.
No transcription deployment is listed yet, so until one is, every
request here is refused before any provider is asked. GET /models
shows one, with modality: transcription, once it is listed; take
model from there.
What konduit reads, and what it forwards
The body is multipart/form-data, as OpenAI's. konduit reads four of
its parts — model, provider, stream and response_format — and
relays every other one (file, language, prompt, temperature,
timestamp_granularities[], anything a provider adds) in its original
order with its bytes unchanged. The routing decision is written in as
on the JSON endpoints: the model part's value becomes the chosen
provider's own name for the deployment, in its original position, and
the provider part is removed. The body is re-framed rather than
patched — a new boundary, and each part's header rebuilt from the
name, filename and Content-Type konduit read — so that konduit
and the provider read exactly the same parts.
provider is the same sovereignty policy as on chat completions, sent
as one part whose value is the JSON object (with openai-python:
extra_body={"provider": json.dumps({...})}). A policy spread over
provider[...] parts, the way a client flattens a nested object into a
form, is refused with invalid_policy rather than read.
konduit refuses, with 400 invalid_request and before any credit is
reserved or any provider is asked:
- a body that is not
multipart/form-datawith a boundary, that does not parse to its closing delimiter, or that carries more than 1000 parts; - a part whose
Content-Dispositionis not exactly oneform-datawith a name, or that carries aContent-Transfer-Encoding; - a
filename*in a charset other than UTF-8 or US-ASCII, or split into RFC 2231 continuations; model,provider,streamorresponse_formatsent twice, in another letter case, or with a filename;- a missing or blank
model; - a
response_formatother thanjsonorverbose_json; - a
streamother thanfalse: konduit does not stream transcriptions.
Which deployment serves it
model resolves exactly as on POST /chat/completions, among the
catalog's transcription deployments only — modality: transcription in
GET /models. A chat or embedding model sent here, or a transcription
model sent to one of the other endpoints, is refused with
400 model_does_not_support_endpoint, whose message names the endpoint
that serves it. Candidates are ordered cheapest first, and one that
fails with a 429 or a 5xx is replaced by the next.
The response, and what it costs
The provider's answer is relayed unchanged, usage included. A
transcription is billed per second of audio: the provider's own
usage.seconds (when usage.type is duration or absent; a fraction
counts as a whole second) at the deployment's price per audio hour,
pricing.unit: micro_eur_per_audio_hour in GET /models, rounded up
to a whole micro-EUR. A response without such a usage is recorded for
reconciliation and never charged on an estimate. While the request
runs, konduit holds the per-request ceiling, the most any one request
may reserve, because an upload's size does not bound how long its
audio runs; the hold is released down to the charge.
A transcription counts against a key's requests-per-minute limit and not against its tokens-per-minute limit. A transcription may take up to ten minutes, fallbacks included, unless the operator configured another bound. A request, the audio file and every other field together, may be 20 MiB like every request body; keep the file a little under that.
This endpoint requires the audio:write scope. A key with no scopes is
unrestricted.
Request body
multipart/form-data — TranscriptionRequest
| Field | Type | Notes |
|---|---|---|
file * | string | The audio, as a file part. |
model * | string | Resolved as on chat completions, among transcription deployments:
an id |
provider | string | The routing policy as a JSON object in one part. Never forwarded. |
response_format | string | One of: json verbose_json Anything else is refused with a 400. Absent is the provider's default, json. |
stream | string | One of: false konduit does not stream transcriptions; any other value is refused with a 400. |
language | string | Relayed unchanged. |
prompt | string | Relayed unchanged. |
temperature | number | Relayed unchanged. |
timestamp_granularities[] | string[] | Relayed unchanged. |
Responses
| Status | Description |
|---|---|
200 | The provider's own JSON response body, relayed unchanged. Headers: response_format json |
400 | konduit refused the request before routing it: a body that is not one
JSON object, no A provider can also refuse a request konduit accepted, and konduit keeps
the provider's own status when it does — so a 400 may instead carry
A body konduit could not acceptAn image sent to a model without visionAn embedding model sent to chat completionsA chat model sent to a completions route none of its deployments serveAn unrecognised key inside `provider`The provider rejected the request, at the provider's own status |
401 | No key was sent, or the key is not valid. No key was sentA key was sent and refused |
402 | The organisation's available credit does not cover the reservation this request needs. Retrying does not help; a top-up does. Out of credit |
403 | The credential is genuine and refused anyway: either the key does not
carry the scope this endpoint requires ( The key is valid but not authorised for this endpointThe organisation behind the key is not active |
404 | The request has nowhere to go: konduit's catalog knows no deployment
under the requested name ( konduit serves no such modelThe policy excluded every deployment |
413 | The request body exceeded the gateway's limit, 20 MiB (20971520 bytes) unless the operator configured another. The message quotes the limit in bytes. Base64 adds a third to an image, so one phone photo is typically 4-11 MB on the wire. Body over 20 MiB |
429 | A rate limit was reached. Headers: konduit's own rate limitThe provider is out of capacity |
502 | The hop after konduit did not answer the question usably. Either every
candidate deployment konduit tried failed, and the last failure was a
provider error (
Headers: The provider returned an errorThe provider rejected konduit's own credentialThe provider could not be reached at allThe provider answered past konduit's response bound |
503 | konduit cannot answer right now. Headers: This gateway has no catalog yetNo adapter for any operator serving this modelCredit could not be reservedToo many request bytes in flight; retry shortlyThe provider said it was overloaded (its own message is relayed when readable) |
504 | The provider did not answer in time. The provider did not answer in time |
GET /models
List what the calling key may call
Lists exactly what the calling key may call: the deployments its
organisation and member are entitled to, narrowed by the key's own
model allowlist. Answers from the catalog snapshot the gateway holds in
memory, so it never blocks on konduit's control plane. A gateway that
has never managed to load a catalog answers 503 catalog_unavailable;
one whose catalog database is merely unreachable keeps serving the last
snapshot it loaded.
The first four fields of each entry are OpenAI's model object, so an OpenAI SDK lists konduit's models without knowing anything about konduit. Everything after them is konduit's extension.
This endpoint requires a key like every other one, and the
models:read scope; a key with no scopes is unrestricted. It is not the
public catalog: its active deployments, with their prices, hosting
country and certifications, are listed without a key at
https://konduit.eu/en/models/. Deprecated deployments that still serve
are listed only here.
Responses
| Status | Description |
|---|---|
200 | The catalog snapshot. |
401 | No key was sent, or the key is not valid. No key was sentA key was sent and refused |
403 | The credential is genuine and refused anyway: either the key does not
carry the scope this endpoint requires ( The key is valid but not authorised for this endpointThe organisation behind the key is not active |
429 | A rate limit was reached. Headers: konduit's own rate limitThe provider is out of capacity |
503 | konduit cannot answer right now. Headers: This gateway has no catalog yetNo adapter for any operator serving this modelCredit could not be reservedToo many request bytes in flight; retry shortlyThe provider said it was overloaded (its own message is relayed when readable) |
GET /models/{model}
Retrieve one deployment
Answers with the one entry GET /models lists under this id, byte for
byte the same object, from the same in-memory snapshot. It calls no
provider and is not billed.
model is a deployment id exactly as GET /models publishes it, such as
scaleway/mistral-small-3.2 or hetzner/qwen3.6-35b-a3b:fp8. It
contains a /, which may be sent
as is or percent-encoded as %2F — current OpenAI SDKs encode it, older
ones do not, and both reach the same deployment. Only an exact id
matches: the shorter names a completion request accepts, such as
mistral-small-3.2, name a set of deployments rather than one, and are
answered 404 model_not_found here.
A model the key may not see, because its organisation or member is not
entitled to it or the key's allowlist excludes it, answers
404 model_not_found exactly like an unknown one.
A deprecated deployment is still served, as in the list. A retired one,
an unknown id and an empty one are 404 model_not_found. A gateway that
has never loaded a catalog answers 503 catalog_unavailable.
Requires the models:read scope, like the list. A key with no scopes is
unrestricted.
Responses
| Status | Description |
|---|---|
200 | The deployment, in the shape of one |
401 | No key was sent, or the key is not valid. No key was sentA key was sent and refused |
403 | The credential is genuine and refused anyway: either the key does not
carry the scope this endpoint requires ( The key is valid but not authorised for this endpointThe organisation behind the key is not active |
404 | The request has nowhere to go: konduit's catalog knows no deployment
under the requested name ( konduit serves no such modelThe policy excluded every deployment |
429 | A rate limit was reached. Headers: konduit's own rate limitThe provider is out of capacity |
503 | konduit cannot answer right now. Headers: This gateway has no catalog yetNo adapter for any operator serving this modelCredit could not be reservedToo many request bytes in flight; retry shortlyThe provider said it was overloaded (its own message is relayed when readable) |
GET /usage
The credit behind this key, and the limits it is held to
Answers from the key that authenticated the request plus one read on konduit's ledger. The balance is the organisation's: every key of an organisation sees the same three numbers, because the balance is what explains a refused request and hiding it from the people whose requests are being refused protects nothing.
limits reports what the rate limiter will actually hold this key to.
The key numbers are the key's own. The organisation numbers are the
organisation's own where it has them and this deployment's default
where it does not, resolved per field. A field is null only when
neither is set, which is the one case where "no ceiling" is true; it is
never 0.
This endpoint requires the usage:read scope. A key with no scopes is
unrestricted and may call it; a key that was narrowed to other scopes
is refused with 403 insufficient_scope. It is rate limited like every
other route, against the same per-key bucket.
Nothing here is cached. A wedged ledger costs this call the ledger
timeout and a 503 ledger_unavailable; completions are failing for the
same reason at that moment.
Responses
| Status | Description |
|---|---|
200 | The balance and the effective limits. |
401 | No key was sent, or the key is not valid. No key was sentA key was sent and refused |
403 | The credential is genuine and refused anyway: either the key does not
carry the scope this endpoint requires ( The key is valid but not authorised for this endpointThe organisation behind the key is not active |
429 | A rate limit was reached. Headers: konduit's own rate limitThe provider is out of capacity |
503 | konduit cannot answer right now. Headers: This gateway has no catalog yetNo adapter for any operator serving this modelCredit could not be reservedToo many request bytes in flight; retry shortlyThe provider said it was overloaded (its own message is relayed when readable) |
Schemas
ChatCompletionRequest
An OpenAI chat completions request, plus konduit's optional provider
policy. Additional properties are allowed and are forwarded to the
provider untouched — this schema names the fields konduit itself reads,
not the fields it accepts.
| Field | Type | Notes |
|---|---|---|
model * | string | A model, a model at a provider, one exact deployment, or a variant. See the resolution table on the operation. |
messages * | object[] | The conversation. konduit counts the entries and forwards them; it never reads one, which is why no message schema is given here — the provider's own is the one that applies. |
stream | boolean | Serve the completion as server-sent events. |
stream_options | StreamOptions | Forwarded to the provider with every field it arrived with. konduit sets exactly one of them. |
max_completion_tokens | integer | The completion ceiling. konduit reads it to size the credit reservation the request needs before it runs; it is forwarded like every other field. |
max_tokens | integer | Deprecated. OpenAI's deprecated spelling of |
n | integer | How many choices to generate. Each is a completion the provider
bills, so konduit reads it to reserve credit for that many
completions of the ceiling above; it is forwarded like every other
field. It must be an integer. The per-request reservation limit
clamps only a single choice: with |
provider | ProviderPolicy | konduit's sovereignty and preference statement about one request. It is removed from the body before anything goes upstream — no provider ever sees konduit's routing vocabulary. A body field rather than a header, because every OpenAI client library
has a way to add an unknown field to a request body ( Three of the four fields are filters and one is a preference: |
StreamOptions
Forwarded to the provider with every field it arrived with. konduit sets exactly one of them.
| Field | Type | Notes |
|---|---|---|
include_usage | boolean | Whether you receive the final usage chunk. konduit always asks the
provider for it — provider-native counts are the only thing it will
bill from — and withholds it from a client that did not ask. A chunk
that carries usage next to completion content cannot be withheld, so
it is relayed with |
ProviderPolicy
konduit's sovereignty and preference statement about one request. It is removed from the body before anything goes upstream — no provider ever sees konduit's routing vocabulary.
A body field rather than a header, because every OpenAI client library
has a way to add an unknown field to a request body (extra_body in
openai-python) and few make it easy to add a header to one call.
Three of the four fields are filters and one is a preference: require,
countries and zero_retention decide which deployments may serve the
request, order decides only which of them is tried first. An
unrecognised key is refused with invalid_policy rather than ignored —
a typo in a sovereignty filter that silently did not filter would send a
prompt to a country the customer asked it to stay out of.
| Field | Type | Notes |
|---|---|---|
require | string[] | Certification types the serving provider must hold — all of them,
not any. Matched case-insensitively against the certifications
published in |
countries | string[] | ISO 3166-1 alpha-2 hosting countries a deployment may run in — any of them. Matched against the deployment's effective hosting country, so a deployment that overrides its provider's is judged on its own value. |
zero_retention | boolean | Require an operator that stores neither prompt nor completion.
|
order | string[] | Provider ids in the order you would like them tried. A preference, not a filter: a provider that is not named still serves, it just sorts after every provider that is. Within one rank the cheapest deployment still goes first. |
ChatCompletion
The provider's own response body, relayed byte for byte. konduit reads
id, model and usage out of it for its own records and changes
none of them; the fields below are what any OpenAI-compatible provider
sends, and a provider that sends more sends it through.
| Field | Type | Notes |
|---|---|---|
id | string | |
object | string | |
created | integer | |
model | string | The provider's own name for what served the request, which is not the string that was sent when a provider resolved an alias. |
choices | object[] | |
usage | CompletionUsage | Provider-native token counts. konduit never computes them and never estimates them: a response that carries no usage object is recorded as needing reconciliation rather than filled in. |
CompletionRequest
A legacy or fill-in-the-middle completions request, plus konduit's
optional provider policy. Additional properties are allowed and are
forwarded to the provider untouched — this schema names the fields
konduit itself reads, and suffix, which it forwards without reading,
not the fields it accepts.
| Field | Type | Notes |
|---|---|---|
model * | string | A model, a model at a provider, or one exact deployment, resolved as on a chat completion among the deployments that serve the route. |
prompt * | string | The text to continue — for fill-in-the-middle, the code before the
cursor. konduit checks that it is one string and never reads it.
The legacy API's array forms are refused with |
suffix | string | Fill-in-the-middle only: the code after the cursor. Forwarded
unread. The providers behind |
stream | boolean | Serve the completion as server-sent events. |
stream_options | StreamOptions | Forwarded to the provider with every field it arrived with. konduit sets exactly one of them. |
max_tokens | integer | The completion ceiling. konduit reads it to size the credit reservation the request needs before it runs; it is forwarded like every other field. |
n | integer | How many completions to return. Each is billed, so konduit reserves
credit for that many; forwarded like every other field. It must be
an integer. Above 1, a request whose whole reservation would exceed
the per-request limit is refused with |
best_of | integer | Legacy completions only: how many completions the provider
generates to return the best |
provider | ProviderPolicy | konduit's sovereignty and preference statement about one request. It is removed from the body before anything goes upstream — no provider ever sees konduit's routing vocabulary. A body field rather than a header, because every OpenAI client library
has a way to add an unknown field to a request body ( Three of the four fields are filters and one is a preference: |
TextCompletion
The provider's own legacy completion response, relayed byte for byte.
konduit reads id, model and usage out of it for its own records
and changes none of them.
| Field | Type | Notes |
|---|---|---|
id | string | |
object | string | |
created | integer | |
model | string | The provider's own name for what served the request. |
choices | object[] | |
usage | CompletionUsage | Provider-native token counts. konduit never computes them and never estimates them: a response that carries no usage object is recorded as needing reconciliation rather than filled in. |
CompletionUsage
Provider-native token counts. konduit never computes them and never estimates them: a response that carries no usage object is recorded as needing reconciliation rather than filled in.
| Field | Type | Notes |
|---|---|---|
prompt_tokens | integer | |
completion_tokens | integer | |
total_tokens | integer |
TranscriptionRequest
The parts konduit reads or documents. Any other part is relayed to the provider unchanged and unvalidated.
| Field | Type | Notes |
|---|---|---|
file * | string | The audio, as a file part. |
model * | string | Resolved as on chat completions, among transcription deployments:
an id |
provider | string | The routing policy as a JSON object in one part. Never forwarded. |
response_format | string | One of: json verbose_json Anything else is refused with a 400. Absent is the provider's default, json. |
stream | string | One of: false konduit does not stream transcriptions; any other value is refused with a 400. |
language | string | Relayed unchanged. |
prompt | string | Relayed unchanged. |
temperature | number | Relayed unchanged. |
timestamp_granularities[] | string[] | Relayed unchanged. |
Transcription
The provider's answer. verbose_json adds fields such as language
and segments, relayed as they come.
| Field | Type | Notes |
|---|---|---|
text * | string | |
usage | TranscriptionUsage | Provider-native duration. konduit bills |
TranscriptionUsage
Provider-native duration. konduit bills seconds when type is
duration or absent, and never estimates it.
| Field | Type | Notes |
|---|---|---|
type | string | |
seconds | number |
EmbeddingRequest
An OpenAI embeddings request, plus konduit's optional provider policy.
Additional properties are allowed and are forwarded to the provider
untouched — this schema names the fields konduit itself reads, not the
fields it accepts. encoding_format and dimensions are among the
ones it forwards without reading.
input must be present and not null, or messages must be an array
with at least one entry; which of the two a model takes is the
provider's to say.
| Field | Type | Notes |
|---|---|---|
model * | string | An embedding model, a model at a provider, or one exact deployment.
It resolves the way |
input | any | What to embed: a string, or an array of them for a batch. konduit checks that it is there and never reads it, so its shape, how many entries a batch may hold and how long each may be are the provider's limits to enforce. |
messages | object[] | The conversation-shaped input of a multimodal embedding model: text
and |
provider | ProviderPolicy | konduit's sovereignty and preference statement about one request. It is removed from the body before anything goes upstream — no provider ever sees konduit's routing vocabulary. A body field rather than a header, because every OpenAI client library
has a way to add an unknown field to a request body ( Three of the four fields are filters and one is a preference: |
DecisionRequest
A decision request, plus konduit's optional provider policy.
Additional properties are allowed and are forwarded to the provider
untouched, except assets and a stream other than false, which
konduit refuses.
| Field | Type | Notes |
|---|---|---|
model * | string | A decision model, a model at a provider, or one exact deployment.
It resolves the way |
state * | any | What the questions are about: any JSON value, relayed unread. It
must be present and not |
questions * | object | The questions to answer, by name. Their shape is the provider's to judge; the answers come back under the same names. |
provider | ProviderPolicy | konduit's sovereignty and preference statement about one request. It is removed from the body before anything goes upstream — no provider ever sees konduit's routing vocabulary. A body field rather than a header, because every OpenAI client library
has a way to add an unknown field to a request body ( Three of the four fields are filters and one is a preference: |
DecisionResponse
The provider's own response body; see the operation for how it is relayed and billed.
| Field | Type | Notes |
|---|---|---|
model | string | The provider's own name for what served the request. |
answers | object | One answer per question, under the question's name. |
usage | object | The provider's own token count, which is what konduit bills. An
answer without |
EmbeddingList
The provider's own response body; see the operation for how it is
relayed and billed. The fields below are what an OpenAI-compatible
provider sends, and a provider that sends more — an id, a created
— sends it through. An embedding produces no completion, so usage
usually has no completion_tokens, or has them as 0.
| Field | Type | Notes |
|---|---|---|
object | string | |
data | any[] | |
model | string | The provider's own name for what served the request. |
usage | CompletionUsage | Provider-native token counts. konduit never computes them and never estimates them: a response that carries no usage object is recorded as needing reconciliation rather than filled in. |
Embedding
| Field | Type | Notes |
|---|---|---|
object | string | |
index | integer | The position of the input this vector belongs to. |
embedding | any | The vector: an array of floats, or a base64 string where the request
asked for |
MessagesRequest
An Anthropic Messages request, plus konduit's optional provider
policy. Every other field of the Messages API is passed through
unchanged: this schema names the fields konduit itself reads, not the
fields it accepts.
| Field | Type | Notes |
|---|---|---|
model * | string | A model from |
messages * | object[] | The conversation. konduit checks that it is a non-empty array and forwards it; it never reads an entry, which is why no message schema is given here. |
max_tokens * | integer | The completion ceiling. konduit reads it to size the credit reservation the request needs before it runs; it is forwarded like every other field. |
stream | boolean | Serve the message as server-sent events. |
provider | ProviderPolicy | konduit's sovereignty and preference statement about one request. It is removed from the body before anything goes upstream — no provider ever sees konduit's routing vocabulary. A body field rather than a header, because every OpenAI client library
has a way to add an unknown field to a request body ( Three of the four fields are filters and one is a preference: |
CountTokensRequest
An Anthropic token-counting request, plus konduit's optional provider
policy. Every other field is passed through unchanged.
| Field | Type | Notes |
|---|---|---|
model * | string | A model from |
messages | object[] | Forwarded unread. |
provider | ProviderPolicy | konduit's sovereignty and preference statement about one request. It is removed from the body before anything goes upstream — no provider ever sees konduit's routing vocabulary. A body field rather than a header, because every OpenAI client library
has a way to add an unknown field to a request body ( Three of the four fields are filters and one is a preference: |
Message
The provider's own response body; see the operation for how it is relayed and billed.
| Field | Type | Notes |
|---|---|---|
id | string | |
type | string | Always message. |
role | string | |
model | string | The provider's own name for the model that produced the message. |
content | object[] | |
stop_reason | string | null | |
usage | object | The provider's own counts, relayed unchanged, and what konduit bills from. Fields konduit does not read are left as they arrived. |
CountTokensResponse
The provider's own response body.
| Field | Type | Notes |
|---|---|---|
input_tokens * | integer |
AnthropicError
The error body of POST /messages and POST /messages/count_tokens,
in Anthropic's shape so that an Anthropic SDK classifies it as it does
the provider's own errors. konduit's own refusals on these two routes
use it: authentication, scope, rate limit, validation, routing, balance
and ledger. konduit's statuses and messages stay its own; the type is
chosen by status — 400 invalid_request_error, 401 authentication_error, 402 billing_error, 403 permission_error,
404 not_found_error, 413 request_too_large, 429 rate_limit_error, 529 overloaded_error, and api_error for every
other 5xx (timeout_error for a 504). The error.code field of
ErrorEnvelope does not exist here.
An error the provider answered with is relayed unchanged — its status,
its body, and its request-id, retry-after and x-should-retry
headers — because Anthropic's clients decide whether to retry from its
own wording. The exception is a 401 or 403 from the provider: it is
about konduit's credentials, not the caller's, and is answered as a
502 api_error. The body is never logged.
| Field | Type | Notes |
|---|---|---|
type * | string | Always error. |
error * | object | |
request_id | string | null | Present on an error the provider answered with. |
ModelList
| Field | Type | Notes |
|---|---|---|
object * | string | Always list. |
data * | any[] |
Model
| Field | Type | Notes |
|---|---|---|
id * | string | konduit's deployment id, |
object * | string | Always model. |
created * | integer | Unix seconds. |
owned_by * | string | The operator, not konduit. "Who runs this" is the answer a customer asking about sovereignty wants from this field. |
display_name * | string | |
description * | string | One sentence about what the model is for. An empty string when nobody has described the model; it is always present, never omitted, so a client can tell "not described" from a konduit too old to have the field. |
modality * | string | One of: chat embedding image transcription decision messages What the weights produce. A closed set in the catalog schema for a
given API version, so a consumer may branch on it exhaustively; a
new value arrives with a new minor version ( |
context_window * | integer | |
max_output_tokens * | integer | null | |
reasoning * | boolean | Whether this model answers with reasoning tokens before its reply, left alone. Those tokens are billed as output, so two deployments' output prices are comparable only when this field agrees. It states behaviour, not capability: it does not claim the weights
are merely able to reason, and makes no claim about whether that can
be switched off. It is outside |
capabilities * | object | What the weights can do, not what this deployment charges for. |
deployment * | object | |
pricing * | object | The unit travels with the number on purpose. A client that assumed
euros per token would be wrong by twelve orders of magnitude. A
transcription deployment is priced per hour of audio and billed per
second of it, so its unit is A |
sovereignty * | Sovereignty | Already resolved against the provider, so a consumer never has to know that a deployment may override its operator's values. |
Usage
| Field | Type | Notes |
|---|---|---|
object * | string | Always usage. |
organisation_id * | string | The organisation the authenticating key belongs to. |
api_key_id * | string | The id of the key that made this request — the same id the console shows — so a client can confirm which key it is holding without ever seeing the secret again. |
balance * | Balance | The organisation's wallet, field for field what the console reads.
Amounts are integers in micro-EUR: |
limits * | Limits | |
expires_at * | string | null | When this key stops authenticating. |
Balance
The organisation's wallet, field for field what the console reads.
Amounts are integers in micro-EUR: 1000000 is one euro.
| Field | Type | Notes |
|---|---|---|
currency * | string | ISO 4217. Always |
booked_micro_eur * | integer | Every entry ever written to the wallet, summed. |
reserved_micro_eur * | integer | Every open reservation against the wallet, summed. Never negative. |
available_micro_eur * | integer | Booked minus reserved. It may be negative: a settlement is allowed to exceed the reservation that preceded it, because the provider's usage counts are the only billing truth and a reservation is only ever an estimate. |
Limits
| Field | Type | Notes |
|---|---|---|
key * | Limit | One pair of ceilings, per minute. |
organisation * | Limit | One pair of ceilings, per minute. |
Limit
One pair of ceilings, per minute. null is no ceiling — never zero per
minute. For organisation, a number may be this deployment's default
rather than something the organisation configured; the limiter enforces
exactly what is reported here.
| Field | Type | Notes |
|---|---|---|
requests_per_minute * | integer | null | |
tokens_per_minute * | integer | null |
Sovereignty
Already resolved against the provider, so a consumer never has to know that a deployment may override its operator's values.
| Field | Type | Notes |
|---|---|---|
hosting_country * | string | ISO 3166-1 alpha-2. |
ownership * | string | Whether a party outside the EU can direct this operator — control
in fact, not the nationality of its capital. |
zero_retention * | boolean | |
tier * | string | |
note * | string | null | |
certifications * | object[] | Never null. A provider that has attested nothing sends |
ErrorEnvelope
The error body of every endpoint except the two Messages routes, whose
errors are AnthropicError. param is always null: konduit never
blames a single field, because naming one would mean quoting it, and a
field name plus its value is request content.
| Field | Type | Notes |
|---|---|---|
error * | object |