Does prompt caching count toward the limit?

Cached input still counts, at a lower rate, on both. Codex does not charge for cache writes; Claude does not count reused project content again. Neither publishes the exact discount inside a subscription window.

Codex

Cached input counts at a lower rate; cache writes are free.

In the published credit rates, cached input tokens cost a tenth of regular input (GPT-5.6 Sol: 100 credits per million input tokens, 10 for cached input), and Codex does not charge for cache writes. For the 5-hour and weekly allowance included in a plan, OpenAI only says that caching affects usage; it does not publish the discount.

What the official docs say

Charges are based on the model used and the actual input, cached input, and output tokens consumed.
OpenAI Help Center · ChatGPT Rate Card
Codex does not charge for cache writes.
OpenAI Help Center · ChatGPT Rate Card
Model choice, context, reasoning, tool use, retrieval, and caching all affect usage, so prompt length alone isn't a reliable estimate.
OpenAI Developers · Codex pricing

Claude

Cache reads count, at the cached rate; reused project content does not count again.

On claude.ai, project content is cached and only new or uncached parts count when reused. In Claude Code every turn re-reads the whole conversation at the cached rate, so a one-line question in a long session still draws usage for the whole history. The cache lasts an hour on a subscription (five minutes for subagents, and once you are on usage credits); a break longer than that reprocesses your full context. Anthropic does not publish the discount as applied to subscription limits.

What the official docs say

Content in projects is cached and doesn't count against your limits when reused. Similar prompts you use frequently are partially cached.
Claude Help Center · Usage limit best practices
With prompt caching, Claude Code re-reads that history at the cached token rate, so a one-line question in a session that has been open all day still draws usage for the whole conversation.
Claude Code docs · Manage costs effectively
Cache misses: your first message after a break longer than the cache lifetime misses the cache and reprocesses your full context. The lifetime is an hour on a subscription and drops to five minutes once you're drawing on usage credits
Claude Code docs · Manage costs effectively
cache_read_input_tokens — Tokens served from cache on this turn, billed at roughly 10% of the standard input rate
Claude Code docs · How Claude Code uses prompt caching

In practice

  • The expensive moment is the first message after a long break: the cache has expired and everything is reprocessed.
  • Claude Code flags cache misses in /usage when they reach 10% of recent usage.

Quotes checked against the live docs on 2026-09-15.

Answers rest on official OpenAI and Anthropic documentation, quoted and linked on each page · Not endorsed by either.