Skip to main content
Prompt caching ensures that identical prompt sections (long system prompts, tool definitions, reference documents, conversation history) are fully processed only once. On subsequent requests, those sections are retrieved from the cache and billed at approximately 10% of the normal input price. Hostlinku passes through Anthropic’s caching mechanism as-is and does not add any special fees for caching; the effective rates per model are listed in the Model Catalog.

How Pricing Works

Some of the latest models use lower cache read rates: claude-opus-5-5 and claude-sonnet-5-5 at 0.05×, and claude-fable-5-1 at 0.025×. The exact figures for each model are listed in the Model Catalog—that page displays the Original price and the price per Service Mode. The default cache lifetime is 5 minutes from the last use (extended each time it is hit). This means the cache pays for itself if the same block is used at least twice; the more often it is used, the greater the savings. Pricing per model is available in the Model Catalog (in the cache_read / cache_write columns).

Minimum threshold per model

Blocks below this threshold will not be cached, and cache_creation_input_tokens / cache_read_input_tokens will be set to 0 without an error message.

Principles of Prompt Structure

The cache works based on prefixes—all content before the cache_control header must be byte-for-byte identical to count as a hit. Organize the prompts from the most static to the most dynamic:
  1. tools (function definitions) — rarely changes
  2. system — instructions, personas, reference documents
  3. Old messages — conversation history
  4. Latest user messages — they’re constantly changing, so don’t cache them
A maximum of 4 cache_control headers per request. The most common: one at the end of system.

Anthropic Format (/v1/messages)

Used by the Anthropic SDK, Claude Code, Cursor, Cline, and other tools that use the Anthropic protocol. system is written as a block array; then, add cache_control to the last static block:
The response reports a cache token separate from input_tokens:
In the second request with the same system, the values became cache_creation_input_tokens: 0 and cache_read_input_tokens: 3601 — that’s a sign the cache is working. Python (Anthropic SDK)

OpenAI Format (/v1/chat/completions)

For applications using the OpenAI SDK, define the content system as an array of content parts and include cache_control in each part. Hostlinku translates this to Anthropic—this applies only to the Claude model.
The cache tokens appear in usage.prompt_tokens_details:
Python (OpenAI SDK)

Claude Code, Cursor, Cline, and agent

These tools already set cache_control themselves in the system prompt and their tool definitions. Once you point the base URL to Hostlinku (see IDE & Agent Integration), caching happens automatically—no additional configuration is needed. In the logs, you’ll see a large Cache Read for nearly every subsequent request within a single session.

Check the console

Open the Request Log in the console. Each row displays Input, Output, Cache Read, Cache Write (total), details for Cache Write 5m / Cache Write 1h, and the final cost. Per-TTL details are only populated if the upstream sends them—otherwise, the column displays — (not 0), while the total is still recorded. A quick way to verify that the cache is working:

Model Support

Any other questions? Check out the FAQ or contact Support.