TECHNOLOGY

Why can a short Carbon agent turn still reprocess earlier tokens?

In this article
THE QUICK TAKE

Compare cache usage and billed input for short and long appended turns while preserving the common prefix.

Carbon’s model page lists implicit caching support. The Gemini caching guide describes a Gemini 4 agent-loop rule that depends on how many tokens the next request adds. Cost analysis for a repeated prompt needs the recorded cache-hit usage, particularly when tool results and answers are short.

Read the model-specific rule

The guide says Gemini 4 caches the full previous request only when the next request adds at least 2,050 tokens. Otherwise the last 2,050 tokens of the previous request are reprocessed at the standard input rate. The documented minimum input size for a Carbon cache hit is another condition. Treat these as distinct constraints.

Preserve a stable prefix

Build a synthetic conversation with a fixed long system and document prefix. Append a small tool result, then a larger result in a separate matched run. Keep the model, ordering and timing comparable. Changes to timestamps, retrieved document order or hidden framework prompts can alter prefix reuse even when the user-visible request seems unchanged.

Inspect usage rather than infer hits

Use the documented cached-token usage field and reconcile it with the billable token categories for the chosen API. Measure the latency too, but do not use a faster response as a substitute for usage evidence. Warm servers, queueing and shorter outputs can all make timing change independently of cache hits.

Choose useful content over artificial padding

Evaluate the actual agent’s short-turn distribution and total accepted-task cost. Adding meaningless tokens solely to cross a threshold can consume more resources and change behavior. Prefer measuring natural tool-result aggregation where the application already needs it. The resulting policy should preserve correctness while reflecting the provider’s documented accounting and your observed traffic.

Primary sources

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles