Skip to content

Caching discount

Keln bills prompt tokens served from cache at the model's cached rate; the exact number per model is on the Models & pricing page, and in /v1/models as pricing.input_cache_read. A cached token costs at most the uncached rate, and there is no write fee.

No configuration

There is no cache_control block, no cache API, and no TTL to manage.

Seeing it

  • API: usage.prompt_tokens_details.cached_tokens on every response.
  • Portal: cached-token badges on the Usage day view and the Billing ledger.
"usage": {
  "prompt_tokens": 1874,
  "completion_tokens": 212,
  "prompt_tokens_details": { "cached_tokens": 1792 }
}

That request's input cost: 82 × input rate + 1792 × cached rate.

Getting the most from it

  • Keep prefixes stable. Keep the shared part (system prompt, examples) byte-identical and put variable content after it. Matching is keyed on the early part of the conversation, and caches match exact prefixes.
  • Longer shared prefixes match more. A sentence or two in common is too short to match; a system prompt, a few-shot block, or an attached document is long enough.
  • Sessions stay warm for an hour. Keln keeps a session on the capacity that holds its context for an hour of inactivity, and a context in use stays cached for as long as it is used.
  • Templates match across conversations. Keln matches a system-prompt template reused across your workspace everywhere it appears, not only inside one conversation.
  • Capability comes before cache. If a request needs something the cached route can't do, for example you add tools or JSON mode mid-conversation, Keln routes it to a route that can serve it, even if that means missing the cache.
  • Misses are neutral. A cache miss bills at the normal input rate.

Rates per model: Models & pricing.