In short.
Together AI's prompt caching guide is a practical reference for developers building applications on Together inference, with benefits that depend on repeated matching prefixes and best effort cache availability. It explains how to organize stable instructions, tools and conversation history, use prompt_cache_key to improve routing, and measure reused tokens through response usage fields. Serverless savings depend on the model having a cached input price; dedicated inference continues to bill GPU time. Exact prices, workload performance and cache-hit reliability are not established, and no requests were executed for this report.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage is the complete documentation page at [https://docs.together.ai/docs/inference/chat/prompt-caching.md], including its text, code examples, embedded image descriptions and Mintlify hosting notice. Linked pages, the documentation index and external diagram image files are excluded. No code or API requests were executed; cache behavior, token counts and performance effects are documented claims or illustrations rather than independently measured results.
The overview
Identity
This is Together's documentation page titled Prompt caching at [https://docs.together.ai/docs/inference/chat/prompt-caching.md]. It teaches developers how automatic prompt-prefix caching works on Together's serverless and dedicated model inference services.
The resource includes explanations, diagram descriptions and Python, TypeScript and cURL examples. It is a guide to a hosted inference feature, rather than a downloadable cache implementation.
Assessment
The guide is useful for applications that repeatedly send substantial instructions, reference material, tool definitions or conversation history to the same Together model. It connects request structure to cache reuse and shows where to inspect actual cached-token counts.
Its main limitation is predictability: matching requests can still miss the cache, and the page provides no measured latency improvement or financial savings for a representative workload. Its sample output illustrates the feature; it does not establish expected performance.
Users
The clearest audiences are developers building conversational assistants, support applications or other services with repeated prompt beginnings. Developers maintaining tool-using conversations can also use the guidance on keeping tool definitions and earlier messages stable.
Beginners get an explanation of why repeated input can cost less to process. Experienced developers get details about chat-template rendering, routing stickiness, serialization order and model-dependent usage fields. The examples assume familiarity with API requests and response objects.
Capabilities
The documented feature automatically reuses previously processed prompt prefixes, which can reduce input computation and time to first token. Together states that caching does not change how the model generates its output.
The guide covers optional request grouping with prompt_cache_key, cached-token reporting and billing treatment. It also explains how stable instructions, tools, images, conversation history and reasoning settings can contribute to a reusable prefix.
Using it
Requirements
Using the feature requires access to Together's serverless or dedicated inference service. The REST example authenticates with a Together API key; the SDK examples use the Python together package and the TypeScript together-ai package. The shell example also uses cURL and jq.
Cache reuse requires requests to the same model with matching initial tokens. The page specifies no SDK or runtime versions, and it gives no fixed minimum cacheable prefix length or token granularity because those vary by model and can change.
Mechanism
A model computes key-value, or KV, states while processing input tokens. Prompt caching saves these intermediate states for an initial sequence of tokens so a later request can reuse that computation.
Matching happens after the model's chat template converts the request into tokens. Messages, images, tool definitions and settings rendered by the template can therefore affect the match. A request reuses the longest available matching prefix; processing resumes from the first differing token.
Entries typically last about an hour on a best effort basis. Serverless caching is shared across the fleet, and heavy load can cause earlier eviction. The page does not establish cache isolation boundaries or a guaranteed retention period.
Setup
Caching needs no activation parameter, header or account setting. Put stable instructions, reference material and examples before changing request content. Append conversation messages while preserving earlier content, tool definitions, tool order and serialization order.
Choose reasoning settings consistently for a conversation. For models using preserved thinking, the guide says to return earlier reasoning unchanged so it remains part of the matching prefix.
Optionally pass a stable prompt_cache_key, such as a conversation identifier or system-prompt version. Python places it inside extra_body; TypeScript and REST use a top-level request field. The key improves routing odds without guaranteeing a hit. On dedicated endpoints, it also supplies routing stickiness to the same deployment.
Example
The Acme Cloud support example builds a stable system prompt containing 300 plan-tier refund statements, then asks separate questions about tiers 12 and 40. It uses model moonshotai/Kimi-K3, max_tokens set to 64 and prompt_cache_key set to acme-support.
The illustrative output shows 3,417 prompt tokens on each request, with 21 cached tokens on the first and 3,327 on the second. The second request processes the remaining 90 tokens after the shared prefix. These counts come from the documentation; the examples were not executed.
The examples read usage.prompt_tokens_details.cached_tokens and fall back to usage.cached_tokens because models can report the count in different locations. The page defines aggregate cache reuse as total cached tokens divided by total prompt tokens.
Assessment & evidence
Limitations
Early changes can sharply reduce reuse: timestamps, usernames, edited history, reordered JSON keys, changed tools or different reasoning settings can end the matching prefix. Cache entries cannot be reused across different models.
There is no cache ID or expiry control, no guaranteed hit from prompt_cache_key and no fixed threshold developers should design around. Best effort eviction limits the predictability of performance and savings.
The TypeScript example uses type casts and notes that its SDK usage type does not yet declare cached-token fields. The relevant SDK version and whether that typing limitation still applies are unknown.
Fit rationale
The guide's recommendations follow directly from prefix matching: placing stable material first preserves more reusable computation, while changing an early message forces the following tokens to be processed again.
The strongest fit is a workload with long, recurring prefixes sent to the same model while cache entries remain available. A workload with mostly unique beginnings has less reusable input. Financial benefit additionally depends on the deployment's billing model and the availability of a cached input price.
Alternatives
The page describes two deployment paths within Together: serverless inference, where qualifying cached tokens receive a separate input rate, and dedicated inference, where saved computation can improve deployment capacity under GPU-time billing.
It supplies no comparison with other providers, self-hosted caching systems or response caches. Their relative cost, performance and suitability are not assessed.
Evidence
The sole source is Together's complete Prompt caching documentation page at [https://docs.together.ai/docs/inference/chat/prompt-caching.md]. Its explanations and examples support the reported API behavior and billing rules.
The evidence contains illustrative token counts but no independent measurements, controlled latency benchmarks or workload cost comparisons. Linked pricing tables, model catalogues and related documentation are outside the available evidence.
Access & freshness
Costs
For serverless inference, reused tokens are billed at the model's cached input rate when one is listed. Other input tokens use the standard input rate, and there is no cache-write charge. Models without a cached input price bill all input tokens at the standard rate.
Dedicated inference bills GPU time rather than tokens, so caching brings no cached-token discount. The documented benefit is reduced computation, potentially improving capacity and time to first token. Cache-hit requests still count toward rate limits.
The page contains no numeric input prices, cached input prices or GPU rates. Exact costs and workload savings are unknown.
Rights
The page provides no explicit licence for its explanatory text, diagrams or code examples. Permission to redistribute or adapt those materials is unknown from this evidence.
It also does not establish the service's contractual data-use terms, cache isolation guarantees or data-retention obligations. The approximate cache lifetime describes operational behavior rather than a contractual deletion commitment.
Freshness
The page was captured at 2026-11-26T01:44:30.911Z. It contains no publication or last-update date, so the capture time does not establish when its guidance was written.
The documentation explicitly allows cache thresholds and granularity to change. Numeric prices and SDK versions are absent, so current rates and SDK typing behavior require separate confirmation.
Next steps
Identify the longest stable beginning in a representative workload, move changing content after it, and keep model choice, tools and reasoning settings consistent. Use a stable prompt_cache_key where requests belong to the same conversation or prompt version.
When evaluating an integration, record prompt tokens, cached tokens and time to first token across repeated requests. Calculate aggregate reuse from summed token counts and assess savings using the model's actual rates. Confirm current SDK field support and service terms before relying on them. These evaluations have not been performed for this report.
