By setting the parameter: "cache_control": {"type": "ephemeral"}, prompt cache mode can be supported (Special access is required, please contact the administrator)
Request
Header Params
Body Params application/json
Example
{"model":"claude-3-7-sonnet-20250219","messages":[{"role":"user","content":[{"type":"text","text":"Summarize the content of the article in no more than 50 words.: {text}","cache_control":{"type":"ephemeral"}}]}]}
Request Code Samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl--location'/v1/messages' \
--header'Authorization: {{Authorization}}' \
--header'Content-Type: application/json' \
--data'{
"model": "claude-3-7-sonnet-20250219",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Summarize the content of the article in no more than 50 words.: {text}",
"cache_control": {
"type": "ephemeral"
}
}
]
}
]
}'