StartupAPI Docs

Prompt caching

Prompt caching

StartupAPI preserves uncached, cache-creation, cache-read, and output usage categories, then applies the production billing weights.

Reading time: 5 minutesExact production formula.Last updated: August 21, 2026

What prompt caching does

Large requests often repeat the same leading context — a long system prompt, a set of files, or a reference document — across many turns. Prompt caching stores that stable prefix so it does not have to be fully reprocessed each time.

Anthropic usage reports keep the categories separate: input_tokens is uncached input after the last cache breakpoint, cache_creation_input_tokens is the new cached prefix, cache_read_input_tokens is the reused prefix, and output_tokens is generated output.

How StartupAPI bills each category

The billing engine converts the three input categories into the billable input count (also called equivalent input), rounded up to a whole token:

equivalent input = ceil(uncached input + 1.25 × cache creation + 0.1 × cache read)

Equivalent input is charged at the model’s StartupAPI input rate. Output tokens remain separate and use the output rate. The monetary input and output components are each rounded up to an integer micro-cent before they are added.

Usage categoryProduction treatment
Uncached input tokens1.0 × the input rate
Cache creation/write tokens1.25 × the input rate
Cache read tokens0.1 × the input rate
Output tokens1.0 × the output rate

When it helps most

  • Long, stable system instructions reused across a session.
  • The same reference files or documents sent on many turns.
  • Agentic workflows that keep a consistent context prefix.