AI gateway
What is AI gateway?
An AI gateway is a single API endpoint that sits between your application and one or more model providers, handling authentication, routing, failover and billing.
How Kodwen does it
The Kodwen gateway answers at https://ai.codai.ro/v1 and serves one public model name, Kodwen, backed by Claude models on Google Vertex and Azure AI Foundry.
Read the docs: AI gateway
Model routing
What is Model routing?
Model routing is choosing, for each request, which concrete model and deployment serves it.
How Kodwen does it
Each Kodwen alias carries a chain of provider and model entries. On every request the gateway walks the chain, skips adapters marked unhealthy and dispatches to the first healthy one; the chain is refreshed from the registry every minute.
Read the docs: Model routing
Model alias
What is Model alias?
A model alias is a stable model name that the gateway resolves to a concrete model at request time, so client code does not change when the model behind it does.
How Kodwen does it
Kodwen is the public alias. Workload aliases such as kodwen-fast, kodwen-explorer and codai-max are hidden from /v1/models but resolvable by any key that can address Kodwen.
Read the docs: Model alias
Prompt caching
What is Prompt caching?
Prompt caching lets a provider reuse the already-processed prefix of a prompt across requests, so repeated context is billed at a fraction of fresh input.
How Kodwen does it
Prompt caching is on by default for every model. The X-Codai-Cache header can turn it off, except on Kodwen* aliases, where the opt-out is ignored. Cache token counts come back in x-codai-cache-read and x-codai-cache-write.
Read the docs: Prompt caching
Verified task
What is Verified task?
A verified task is a unit of work whose success was checked — by a passing verifier, by re-executing the result, or by the user confirming it.
How Kodwen does it
Kodwen counts a task as one verified success only on a passing verdict, a confirmed re-execution or a user confirmation. An infrastructure error is never counted as a success.
Read the docs: Verified task
Pay per verified task
What is Pay per verified task?
Pay per verified task is a pricing model where you pay for work that was checked to succeed, not for every token a model produces.
How Kodwen does it
Each Kodwen plan includes verified tasks per month; beyond them each verified successful task costs €1.20; unusually large tasks (above €1.20 of model usage) are billed for the excess at standard token rates. A task that is neither verified nor confirmed is charged at raw token cost from the wallet, with no flat fee.
Read the docs: Pay per verified task
BYOK (bring your own key)
What is BYOK (bring your own key)?
BYOK means you use your own provider API keys through a service, so model usage is billed by the provider to you directly.
How Kodwen does it
The Kodwen Services plan (BYOK) costs €3.99 per month with a 7-day trial: the main model runs on your own provider keys, and Kodwen adds transcription, voice, web search, memory and sync. BYOK traffic is never used for training.
Read the docs: BYOK (bring your own key)
MCP (Model Context Protocol)
What is MCP (Model Context Protocol)?
The Model Context Protocol (MCP) is an open protocol that lets AI clients discover and call tools, prompts and resources exposed by a server.
How Kodwen does it
Kodwen runs an MCP server at https://ai.codai.ro/mcp, authorised with OAuth 2.1 (PKCE required, Dynamic Client Registration enabled), with tools for chat and model listing, plus memory tools on plans with persistent memory.
Read the docs: MCP (Model Context Protocol)
Streamable HTTP
What is Streamable HTTP?
Streamable HTTP is the MCP transport that carries client messages as HTTP POST requests to one endpoint and can stream server responses back on the same connection.
How Kodwen does it
The Kodwen MCP server speaks Streamable HTTP, spec 2025-11-25, wire-compatible with 2025-06-18, at POST https://ai.codai.ro/mcp.
Read the docs: Streamable HTTP
Data residency
What is Data residency?
Data residency is the commitment about which geographic region stores and processes your data.
How Kodwen does it
The Kodwen database runs in Google Cloud europe-west1 (Belgium). Usage metadata is deleted after 30 days and message text is scrubbed after 7 days. Prompts are not used for training unless you opt in.
Read the docs: Data residency
Failover
What is Failover?
Failover is automatically sending a request to a backup deployment or model when the primary one is unavailable.
How Kodwen does it
Kodwen fails over between approved deployments and, only when every primary lane is down, sideways to the next model in the chain. The x-codai-routed-to response header tells you which model served each request.
Read the docs: Failover
Wire format
What is Wire format?
A wire format is the exact request and response shape an API expects, such as OpenAI Chat Completions, the OpenAI Responses API or Anthropic Messages.
How Kodwen does it
The Kodwen gateway speaks all three: POST /v1/chat/completions, POST /v1/responses and POST /v1/messages. The OpenAI SDK uses the base URL https://ai.codai.ro/v1; the Anthropic SDK uses the root https://ai.codai.ro.
Read the docs: Wire format