Skip to content
Discussion options

You must be logged in to vote

No, it's a separate price. cacheRead is the USD price per 1M cached input tokens (prompt cache hits), next to input and output, which are also per 1M tokens. Use whatever the provider lists as "cached input" or "context caching" for that model.

You can see it in estimateCost: cached tokens are subtracted from the input count and billed at cacheRead, everything else at input. The cached count comes from the AI SDK's inputTokenDetails.cacheReadTokens (agent.ts).

It's also optional, not required (ModelPricing). If you leave it out, cached tokens are billed at the full input price, so the cost estimate just comes out a bit high. A few entries like gpt-5.5-pro and most of the grok models alrea…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Mahir29Flame
Comment options

Answer selected by Mahir29Flame
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants