CloseRouter

Caching

Cache lifetime and its effect on request cost.

When caching applies

Caching can reduce the cost of repeated input. Support, retention and prices depend on the selected provider. The rule below applies only to Chat routes with 20-minute and 120-minute write rates.

20-minute and 120-minute cache

For a Chat route listing 20-minute and 120-minute cache-write prices, you may pass numeric cache_ttl in JSON or one numeric X-Cache-TTL header. Both values are forwarded unchanged to the selected provider.

Omitting both selects 20 minutes. If either value is 120 or greater, the 120-minute tariff applies; otherwise the 20-minute tariff applies. This also resolves conflicting body and header values.

For such a route, an invalid or repeated header or a nonnumeric cache_ttl returns 400 before provider dispatch.

Billing and other routes

Under the Vokis tariff, the selected write price applies to all input tokens not read from cache, including new tokens after a cached prefix. The read price applies to cached input tokens. A write-tariff charge does not claim that the provider reported actual cache creation.

Other routes retain their own cache and billing rules; check the selected provider prices in the model catalog.