Updated
Prompt caching on an abliterated LLM API
When a request starts with the same tokens as an earlier one, those tokens come from cache and bill at the cached rate. It is automatic on every model and format, with no cache_control markers.
https://api.silkcompute.com
SYSTEM = open("style-guide.md").read() # long, and the same every time
def review(diff):
reply = client.chat.completions.create(
model="deepseek-v4.1-flash-1017-uncensored",
messages=[
{"role": "system", "content": SYSTEM}, # stable start
{"role": "user", "content": diff}, # what changes goes last
],
)
print(reply.usage.prompt_tokens_details.cached_tokens)
return reply.choices[0].message.contentimport { readFileSync } from 'node:fs'
const SYSTEM = readFileSync('style-guide.md', 'utf8') // long, and the same every time
async function review(diff) {
const reply = await client.chat.completions.create({
model: 'deepseek-v4.1-flash-1017-uncensored',
messages: [
{ role: 'system', content: SYSTEM }, // stable start
{ role: 'user', content: diff }, // what changes goes last
],
})
console.log(reply.usage.prompt_tokens_details?.cached_tokens)
return reply.choices[0].message.content
}# Send the same long system prompt twice, then read the cached count.
curl -s https://api.silkcompute.com/chat/completions \
-H "Authorization: Bearer $SILK_API_KEY" \
-H "Content-Type: application/json" \
-d @request.json | jq '.usage.prompt_tokens_details.cached_tokens'How it works
AutomaticNothing to turn onEvery model and format caches, with no markers in the request.
More hitsKeep the start identicalSame system prompt, tools in the same order and earlier turns as they were.
OrderChanging parts lastPut anything that changes, such as a date or request id, after the stable start.
Where the count shows
| Format | Cached tokens |
|---|---|
| Chat Completions | usage.prompt_tokens_details.cached_tokens |
| Responses | usage.input_tokens_details.cached_tokens |
| Messages | usage.cache_read_input_tokens |
Cached rates per 1M tokens
Read November 18, 2026. Output rates are on the pricing page.
| Model | Input | Cached input | Cached as % of input |
|---|---|---|---|
| Kimi K3.1 Pro | $3.50 | $0.35 | 10% |
| DeepSeek V4.1 Flash 1017 | $0.24 | $0.038 | 16% |
| DeepSeek V4.1 Flash 1017 Fast | $0.24 | $0.05 | 21% |
| GLM-5.3 | $2.00 | $0.30 | 15% |
| GLM-5.3 Flash | $0.24 | $0.06 | 25% |