Providers
Anthropic
Common questions about Anthropic provider
How do I use the Anthropic cache?
Anthropic cache allows you to cache parts of a prompt. As explained in their documentation, you need to opt-in within the prompt to start caching parts of it.
To do this, add cacheControl: true
to the front matter of your prompt.
Once this is set up, you can start caching specific parts of the prompt:
If you want an entire message to be cached, add the cache directive to the user
, assistant
, or system
tags: