Most LLM traffic repeats itself. A chatbot resends the same system prompt on every turn, and an agent resends its tool definitions and the whole conversation so far. Prompt caching lets the model read that repeated prefix from a cache, and cached input is billed at a fraction of the normal input rate. This guide covers how it works on GetVibe API and how to get the most out of it.
What you pay for cached input
Every text model in our catalog lists its cache terms. In https://getvibeapi.com/api/catalog, each model variant carries:
cachedInputUsd: the price per 1M cached input tokens.cacheReadMult: the cached price as a fraction of the normal input price.cacheWriteMult: how writing to the cache is billed relative to normal input.
At the time of writing, almost every text model lists cacheReadMult: 0.1, meaning a cached input token costs a tenth of a normal one, and cacheWriteMult: 1. The one exception is Claude Fable 5.1, with 0.025 for reads and 1.25 for writes. These values can change, so read them from the catalog or from each model page rather than hard-coding them.
| Model | Price (input · output) |
|---|---|
| Claude Opus 5.5 | $0.2027 input · $1.0134 output per 1M tokens |
| GPT-6 Sol | $0.1096 input · $0.548 output per 1M tokens |
| DeepSeek V4.1 Flash | $0.0112 input · $0.0445 output per 1M tokens |
The model pages list the cached-input price next to these numbers.
OpenAI models: automatic
On /v1/chat/completions, OpenAI-family models cache automatically. When several requests start with the same stable prefix, that prefix is read from the cache. You do not need any special field. What matters is that the start of the request does not change. We pass the request body through byte for byte without reordering fields, so a prefix that is identical on your side stays identical upstream.
Claude: cache_control breakpoints
Claude caches only when the request carries an explicit cache_control breakpoint. Repeating the prefix alone does not turn caching on. Put the breakpoint at the end of the part that does not change:
curl https://getvibeapi.com/v1/messages \
-H "x-api-key: $GETVIBE_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-5.5",
"max_tokens": 256,
"system": [
{"type": "text", "text": "A large fixed instruction worth caching...",
"cache_control": {"type": "ephemeral"}}
],
"messages": [{"role": "user", "content": "Question about the instruction"}]
}'
If you do not send a breakpoint yourself, the gateway inserts one for you, on both /v1/messages and /v1/chat/completions. If you manage breakpoints yourself, your markup is left as it is.
Five rules for a cacheable prompt
- Stable content first, variable content last. System prompt, tool definitions and reference documents go at the top. The user's new message goes at the end.
- No timestamps or request IDs in the prefix. One changing character near the top invalidates everything after it.
- Keep tool definitions in a fixed order. Generating the tools list from an unordered map changes the prefix on every call.
- Append, do not rewrite, history. Agents that summarize or reorder earlier turns break the cache. Add new turns at the end.
- Stay on one model. A cache belongs to a model, so switching models mid-conversation starts cold.
Check that it works
Look at the usage object in the response. In the OpenAI format, cached tokens appear under prompt_tokens_details.cached_tokens. In the Anthropic format, look for cache_read_input_tokens and cache_creation_input_tokens. The usage view in your dashboard also shows a cache-hit share per model. If the cached count stays at zero across identical requests, something in your prefix is changing.
Next steps
Read the caching documentation, set up Claude Code on a custom endpoint (agents benefit most from caching), or compare cached prices on the Models page.
