Formats, fallback models, limits and a price on every request

Keydan speaks the two common request formats and adds what you would otherwise write yourself: fallbacks, retries without double charges, limits and a price for every call.

Works in the tools you already use

Editors
  • VS Code
  • Cursor
  • Windsurf
  • JetBrains
  • Zed
  • Neovim
Agents
  • Hermes Agent
  • Claude Code
  • Cline
  • Roo Code
  • Kilo Code
  • OpenCode
  • GitHub Actions
Automation and bots
  • n8n
  • LangChain
  • Open WebUI
  • Docker
  • Telegram bots
  • Prepaid onlyno debts and no surprise charges: past the plan only if you turn it on
  • A key per tooleach with its own limit; revoked in a second
  • Every request in the logtokens, model and price of each call
  • Two standard API formatsthe libraries your tools already use

Two formats, one key

Keep the client library you already have. Chat Completions clients use the base URL with /v1, Messages clients without it. The model ids and the key are the same.

In the docs →
Chat Completions
POST /v1/chat/completions
{
  "model": "kd-balanced",
  "messages": [{"role": "user", "content": "…"}]
}
Messages
POST /v1/messages
{
  "model": "kd-balanced",
  "max_tokens": 1024,
  "messages": [{"role": "user", "content": "…"}]
}
Your appKeydankd-maxbusykd-balancedansweredkd-faststandby1234the answer names kd-balanced and its price
fallback
{
  "model": "kd-balanced",
  "fallback": {
    "requested_model": "kd-max",
    "served_model": "kd-balanced",
    "attempts": 2,
    "reason": "model_unavailable"
  }
}

Fallback models

List up to three more models in models. Only a model without capacity hands the request on; a rejected request is never repeated elsewhere. The answer says what happened.

In the docs →

kd-auto: the model is chosen for each request

Send kd-auto instead of a model id. Light requests go to a fast model, heavy ones to the strongest, and a busy model hands the request to the next. You pay the price of the model that answered.

In the docs →
  1. 01Request

    Your request arrives with model: kd-auto.

  2. 02Assessment

    The size of the context, tools, images, the answer length, reasoning and the task in the last message.

  3. 03Choice

    The fitting tier: kd-fast, kd-balanced or kd-max. The answer's route object says which and why.

  4. 04Fallback

    No capacity on the chosen model: the request goes to a stronger one, then a lighter one.

kd-auto or one model for everything

kd-auto compared with one model for every request
kd-autoOne model
ModelChosen for each requestThe same for every request
CostSimple requests on cheaper modelsEvery request at the price of that model
QualityHard requests on the strongest modelLimited to what one model can do
When a model is busyThe next tier answersThe request waits or fails
New modelsAdded to the tiers on our sideYou switch and retest yourself

Prompt caching

A long beginning that repeats is read from the cache at the cache price. Every Chat Completions answer reports cost and cost_details.cache_savings.

In the docs →
Request 1long prefix · input pricenew partRequest 2, the same beginningthe same prefix · cache read pricenew partThe cache read price is a fraction of the input price; the answer reports what it saved.
stream: true
data: {"choices":[{"delta":{"content":"Hel"}}]}
data: {"choices":[{"delta":{"content":"lo"}}]}
data: {"choices":[],"usage":{"total_tokens":42,"cost":0.000126}}
data: [DONE]

Streaming and tools

Server-sent events in both formats, function calling and image input wherever the model supports them.

In the docs →

Retries without double charges

Send an Idempotency-Key with a request. If the connection drops, the same key returns the same answer and nothing is charged twice.

In the docs →
Your clientKeydanModelIdempotency-Key: a1the connection dropsthe same key a1 againthe same answer, no second chargeruns once
Cabinet$500 a monthMember: Anna$120 a monthMember: Ivanno own limitService$300 a monthkey: idekey: botkey: backendthe tightest limit applies

Limits that nest

Monthly limits for the cabinet, each member and each key; subscription windows of 5 hours and a week; a 402 or a 429 with the reset time when a limit is reached.

In the docs →

A log and a price for every request

The dashboard shows tokens, cache reads and the price of each request, by day, model and key, with a CSV export.

Keydan dashboard: spend by day with a table of tokens and prices
The Keydan dashboard with sample data.

Money without surprises

What you pay for and when, in plain words.

  • Prices in dollars, not an inner currencyA request costs what the catalogue says. The price comes back in every answer and stays in the request log, so there is nothing to convert.
  • Your balance does not expireTopped-up balance has no end date and works without a subscription. A plan is only for those who find the windows cheaper.
  • Renewal is yours to stopSwitch it off in the dashboard with one button. Before the first charge after the trial we send an e-mail two days ahead.
  • Past the plan only if you allow itWithout your consent not a cent goes past the plan's windows.

Start with one key