The MiniMax API automatically detects repeated context and caches it through prefix matching. M3.1-Flash can use this mechanism directly, but the page does not publish a cache TTL, invalidation rules, or specific rates. Costs should be calculated from the token usage in each response and the current Pay as You Go pricing page.
Suitable tasks: Multi-turn conversations, fixed system prompts, fixed tool lists, long documents, or other API calls with repeated context.
Unsuitable tasks: Configurations that require persistent caching, cross-session reuse, a guaranteed cache duration, or fixed rates; the page does not disclose these details.
Applicable model version: MiniMax-M3.1-Flash. The original Supported models section also lists other M-series models, but this article does not extrapolate their pricing or behavior.
Applicable client, Agent, or API: The MiniMax Anthropic-compatible API, OpenAI-compatible API, and SDKs or Agents that can read the corresponding usage fields.
Recommended reasoning tier and parameters: Caching itself requires no additional request parameters. Put fixed content first and dynamic user information later. Set output parameters such as max_tokens according to the task.
The following is a minimal configuration condensed from the Anthropic SDK example on the original page. The first request establishes a reusable prefix. Subsequent requests should keep the tool list, system prompt, and leading user content unchanged, then append the changes for the current turn at the end.
import anthropic
client = anthropic.Anthropic(
base_url="https://api.minimax.io/anthropic",
)
response = client.messages.create(
model="MiniMax-M3.1-Flash",
system="You are an assistant responsible for analyzing long documents.",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "Fixed document content...\n\nQuestion for this round: Please extract the key points from Chapter 3.",
}
],
}
],
max_tokens=10240,
)
print({
"input_tokens": response.usage.input_tokens,
"output_tokens": response.usage.output_tokens,
"cache_hit_tokens": response.usage.cache_read_input_tokens,
})For the OpenAI-compatible API, the corresponding observation fields are: usage.prompt_tokens for total input tokens, and usage.prompt_tokens_details.cached_tokens for the tokens served from cache.
Set the model to MiniMax-M3.1-Flash and confirm that the input reaches 512 tokens; the original page says that caching does not apply below this threshold.
Organize the request in the order “tool list → system prompts → user messages,” placing static content first and dynamic content last.
Send a series of requests with the same content prefix. Record total input, cached input, new input, output, and response latency separately.
For the Anthropic-compatible API, read cache_read_input_tokens; for the OpenAI-compatible API, read prompt_tokens_details.cached_tokens.
Estimate the cost of each request with the formula below:
New input tokens = total input tokens − cached tokens
Cost per request (USD) = (new input tokens × input price
+ cached tokens × cache-hit price
+ output tokens × output price) ÷ 1,000,000
Price unit: USD / million tokensFill in the input price, cache-hit price, and output price in USD per million tokens from the current Pay as You Go pricing page. For the Anthropic protocol, total input is input_tokens + cache_read_input_tokens; for the OpenAI protocol, take total input directly from prompt_tokens. Do not treat the example token counts in this article as an actual bill.
The original page describes caching as automatic caching that requires no change to the API call method; it claims that repeated content can reduce latency and cost.
The original page explicitly lists MiniMax-M3.1-Flash as a supported model and uses model="MiniMax-M3.1-Flash" in its Anthropic SDK example.
Caching applies to API calls with at least 512 input tokens.
The matching order is “tool list → system prompts → user messages”; changing the content of any module may affect caching performance.
Anthropic-compatible usage: cache_read_input_tokens is the number of cached tokens, and input_tokens is the number of new input tokens.
OpenAI-compatible usage: prompt_tokens_details.cached_tokens is the number of cached tokens, and prompt_tokens is the total number of input tokens.
The example response on the original page contains input_tokens: 108, output_tokens: 91, cache_creation_input_tokens: 0, and cache_read_input_tokens: 14813; this is a documentation example, not a measured M3.1-Flash bill.
The original page gives differentiated pricing rules: cached input is charged at a discounted rate, new input at the standard input rate, and output at the standard output rate; the specific amounts are linked to the Pay as You Go page.
This is a configuration for context reuse and cost and latency observation, not a prompt that improves model accuracy; a cache hit does not change the model's capabilities or task evaluation criteria.
The page does not disclose the cache TTL, lifecycle, invalidation conditions, or guarantees across requests or sessions. Do not use it to promise how long a cache will be retained.
The page does not provide specific input, cache-hit, or output prices. Reopen the pricing page to verify the rates whenever they change.
The page does not provide a hit rate, latency reduction, or real billing samples. Documentation examples cannot replace tests on the actual workload.
cache_creation_input_tokens appears only in the example response. The original page does not further explain its billing meaning or lifecycle semantics, so do not expand it into a rule that cache writes incur a charge.
Placing dynamic content at the end is the official best practice, but whether a request hits the cache must still be determined from the usage in each response.
On 2026-10-21, the original page was opened and read through the Tabbit isolated task M31 prompt08 cache. The body, code example, supported model, usage fields, caching threshold, matching order, and cost formula were all visible; the original extracted evidence is saved at /tmp/m31-cache-evidence.txt. During the duplicate check, the target directory was confirmed to contain no file with the same name. Existing documents only reference this page in navigation and do not constitute a standalone cache-cost configuration entry.
MiniMax M3.1 Flash