Prompt caching lets a model provider reuse the parts of a request it has already processed, such as the tools, the system prompt, and earlier messages, instead of processing them again on every call. It is a common way to cut the cost and latency of an agent, which resends that content on every model call. Model providers cache in one of two ways: some let the request carry explicit cache points, while others support only implicit caching and decide on their own what to reuse. This page covers how Strands caches on each, and where caching falls short today. For pricing on cache writes and reads, see your model provider’s documentation.

## Models that support explicit caching

These models take explicit cache points:

-   Anthropic Claude, on Amazon Bedrock and through the Anthropic API.
-   Amazon Nova on Amazon Bedrock.
-   OpenAI GPT-5.6 and later on the Responses API, through OpenAI or Bedrock Mantle.

To use them, set a cache configuration on the model with the `auto` strategy, which is also the default. Strands then places the cache points for you:

(( tab "Python" ))
```python
from strands import Agent
from strands.models import BedrockModel, CacheConfig

# The default Bedrock model is Anthropic Claude.
model = BedrockModel(cache_config=CacheConfig(strategy="auto"))

agent = Agent(model=model)
```
(( /tab "Python" ))

(( tab "TypeScript" ))
```typescript
import { Agent, BedrockModel } from '@strands-agents/sdk'

// The default Bedrock model is Anthropic Claude.
const model = new BedrockModel({ cacheConfig: { strategy: 'auto' } })

const agent = new Agent({ model })
```
(( /tab "TypeScript" ))

Strands puts the static content (tools, system prompt, and messages) before the cache point. Ephemeral content, such as the text a [context injector](/docs/user-guide/sdk/plugins/context-injector/index.md) adds for one model call, goes after it, so the injected text never enters the cache and the static prefix still reads from it on the next call. For per-provider options, see [Amazon Bedrock prompt caching](/docs/user-guide/sdk/model-providers/amazon-bedrock-prompt-caching/index.md) and [OpenAI Responses](/docs/user-guide/sdk/model-providers/openai-responses/index.md).

## Models that support implicit caching

If your model supports only implicit caching, the model provider decides what to cache. Strands can’t put dynamic content after a cache point, because there isn’t one. Content that changes between calls changes the prefix the provider compares, so some of the [harness’s default settings](/docs/user-guide/harness/configure/context-and-caching/index.md) break the cache through normal use.

Strands relies on Gemini’s implicit caching and doesn’t use its explicit cached-content API. See [Gemini context caching](https://aistudio.google.com/docs/caching). OpenAI GPT and xAI models through the Amazon Bedrock Converse API support only implicit caching, and Strands doesn’t cache `gpt-oss` there. Amazon Bedrock lists which APIs take explicit cache points for each OpenAI model in [Prompt caching for models from OpenAI](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html#prompt-caching-openai).

## Known gaps

In the following cases, caching silently does nothing or costs more than leaving it off. Some are provider limits and some are current Strands limitations; each section says which.

### Context and memory injection

A [context injector](/docs/user-guide/sdk/plugins/context-injector/index.md), the [context manager](/docs/user-guide/sdk/context-management/index.md), and the [memory manager](/docs/user-guide/sdk/memory/managing-memory/index.md) all add ephemeral content to the latest message before a model call. On a model with explicit caching, Strands keeps that content after the cache point. On a model with implicit caching, Strands removes the earlier injected content from history on the next call, so the new request differs from the previous one at the point of the first earlier injection:

-   Providers that cache each request as a whole, such as OpenAI models on Converse, read nothing.
-   Providers that match the longest prefix they have seen lose everything after that point, which in a long conversation is often all but the tools and system prompt.

This is a current Strands limitation. To keep the cache, use a model with explicit caching.

### OpenAI models on the Converse API

OpenAI models on Converse support only implicit caching, so the injection gap above applies: with a context injector that fires on every model call, every call writes to the cache and none reads from it. On GPT-5.6 and later, writes cost 1.25 times the input rate. To cache these models, use the Responses API through `OpenAIResponsesModel``OpenAIModel` with Bedrock Mantle and a cache configuration.

Converse rejects cache points for these models with an `AccessDeniedException`, so don’t place them by hand or use the `"anthropic"``'anthropic'` strategy. The default `auto` strategy places none. To stay on Converse without paying for writes that are never read, turn implicit caching off:

(( tab "Python" ))
```python
from strands import Agent
from strands.models import BedrockModel

model = BedrockModel(
    model_id="us.openai.gpt-6-luna",
    # Converse forwards this to the model; with no cache points it caches nothing.
    additional_request_fields={"prompt_cache_options": {"mode": "explicit"}},
)

agent = Agent(model=model)
```
(( /tab "Python" ))

(( tab "TypeScript" ))
```typescript
import { Agent, BedrockModel } from '@strands-agents/sdk'

const model = new BedrockModel({
  modelId: 'us.openai.gpt-6-luna',
  // Converse forwards this to the model; with no cache points it caches nothing.
  additionalRequestFields: { prompt_cache_options: { mode: 'explicit' } },
})

const agent = new Agent({ model })
```
(( /tab "TypeScript" ))

This also turns off the reads you get when a request does extend the previous one, so use it only when your agent’s context changes on every call.

## Provider limits

Each model provider sets its own limits on caching, such as which models cache, the minimum prompt size that is cached, the maximum number of cache points per request, and how long a cache entry lasts. Strands doesn’t change these limits. For the limits that apply to your model, see the model provider’s documentation:

-   [Amazon Bedrock prompt caching](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html)
-   [Anthropic prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching)
-   [OpenAI prompt caching](https://developers.openai.com/api/docs/guides/prompt-caching)
-   [Gemini context caching](https://aistudio.google.com/docs/caching)

## Related pages

- [Result caching](/docs/user-guide/evals-sdk/how-to/result_caching/index.md) (1 shared tag)
- [Anthropic](/docs/user-guide/sdk/model-providers/anthropic/index.md) (1 shared tag)
- [Amazon Bedrock](/docs/user-guide/sdk/model-providers/amazon-bedrock/index.md) (1 shared tag)


## Implementation

### Python

- [harness-sdk/strands-py/src/strands/injection/_message_injection.py](https://github.com/strands-agents/harness-sdk/blob/main/strands-py/src/strands/injection/_message_injection.py)

### TypeScript

- [harness-sdk/strands-ts/src/injection/message-injection.ts](https://github.com/strands-agents/harness-sdk/blob/main/strands-ts/src/injection/message-injection.ts)
