docs.anthropic.com

Prompt Caching (opens in new tab)

--- Prompt caching optimizes your API usage by allowing resuming from specific prefixes in your prompts. This significantly reduces processing time and costs for repetitive tasks or prompts with consistent elements. This feature is eligible for Zero Data Retention (ZDR). When your organization has a ZDR arrangement, data sent through this feature is not stored after the API response is returned. There are two ways to enable prompt caching: - **Automatic caching**: Add a single `cache_co...

Read the original article
Sign in to keep reading the full article.

Covered in 13 articles

DEV Community·
Discussed on DEV
Feeds
DEV Community·
Discussed on DEV
Feeds
DEV Community·
Discussed on DEV
Feeds
View all 13 ›

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help