# AI Gateway - AI Gateway custom costs support cache tokens

Publisher-attributed story with a reviewed brief or permitted publisher paragraph. The original publisher is responsible for the linked reporting.

- Publisher: Cloudflare Developers
- Category: AI
- Original publication time: 2026-09-09T00:00:00Z
- First observed by NexusTechWire: 2026-10-01T15:54:34Z
- Original source: https://developers.cloudflare.com/changelog/post/2026-09-09-custom-cache-token-costs/
- NexusTechWire record: https://nexustechwire.com/news/news-b42aef51112a17d2eb49

## From the publisher

AI Gateway custom costs now support cache-read and cache-write token rates. This lets custom cost metrics reflect negotiated cache pricing across providers. Add per\_cache\_read\_token or per\_cache\_write\_token to the cf-aig-custom-cost header: \{ "per\_token\_in": 0.000001, "per\_token\_out": 0.000002, "per\_cache\_read\_token": 0.0000001, "per\_cache\_write\_token": 0.0000005 \} Cache-token pricing activates when either cache rate is present. An omitted cache rate defaults to per\_token\_in. If both cache rates are omitted, AI Gateway preserves the existing input and output calculation. Providers can include cache tokens within input tokens or report them separately. AI Gateway automatically accounts for these differences and prevents double-counting. For more information, refer to Custom costs.

Source license: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). Publisher excerpt shortened and converted to plain text. Original source license applies.

Read the full original: [Cloudflare Developers](https://developers.cloudflare.com/changelog/post/2026-09-09-custom-cache-token-costs/)

This record does not reproduce the complete article or represent independent confirmation of every source claim.
