Does Unlid support prompt caching, and how are cached tokens billed?

Yes, on models that list a cached-input price. Caching is automatic: you send nothing special, and when the start of a request (system prompt, tool definitions, earlier messages) repeats a recent request, the repeated part is billed at the cheaper cached-input price instead of the normal input price.

How it is billed

Each request costs (prompt − cached) × input + cached × cached input + completion × output, using the token counts the inference host reports. The cached count is in the response's usage.prompt_tokens_details.cached_tokens. A model without a cached-input price bills every prompt token at the input price.

Models with a cached-input price

ModelInput / 1MCached input / 1M
GLM 5.3 Flash glm-5.3-flash-uncensored$0.24$0.084
GLM-5.3 Flash glm-5.3-flash-abliterated$0.13$0.027
DeepSeek V4.1 Flash deepseek-v4.1-flash-uncensored$0.40$0.010
DeepSeek V4.1 Flash 1017 deepseek-v4.1-flash-abliterated$0.13$0.020
DeepSeek V4.1 Flash 1017 deepseek-v4.1-flash-abliterated-fast$0.13$0.027
GLM 5.3 glm-5.3-uncensored$1.52$0.37
Qwen3.8 27B qwen3.8-27b-uncensored$1.20$0.26
GLM-5.3 glm-5.3-abliterated$1.07$0.16
MiMo V2.6 Flash mimo-v2.6-flash-uncensored$0.61$0.24
MiMo V2.6 Flash mimo-v2.6-flash-abliterated$0.61$0.33
Qwen3.8 27B qwen3.8-27b-uncensored:thinking$1.20$0.26
GLM 4.7 Flash glm-4.7-flash-heretic$0.084$0.042
Abliterated Model Large v2 (GLM 5.3 base) abliterated-model-large-v2$3.09$0.31
Abliterated Model (multimodal) abliterated-model$1.03$0.10
Abliterated Model Large Flash (DeepSeek V4.1 Flash base) abliterated-model-large-flash$1.03$0.10
Qwen3.8 27B qwen3.8-27b-abliterated$0.25$0.033
MiMo V2.6 Flash mimo-v2.6-flash-uncensored:thinking$0.61$0.24
DeepSeek V4.1 Flash deepseek-v4.1-flash-heretic$0.24$0.016
DeepSeek V4.1 Flash deepseek-v4.1-flash-heretic:thinking$0.24$0.016
Qwen3.8 27B qwen3.8-27b-uncensored-fast$1.02$0.18
Qwen3.8 27B qwen3.8-27b-uncensored-fast:thinking$1.02$0.18
Kimi K3.1 Pro kimi-k3.1-pro-abliterated$1.60$0.16
DeepSeek V4.1 Flash 1017 Abliterated CSF deepseek-v4.1-flash-1017-abliterated-lossless-csf$0.34$0.022
Gemma 4 26B gemma-4-26b-storyteller$0.086$0.002
DeepSeek V4.1 Flash 1017 deepseek-v4.1-flash-fast$0.011$0.002
MiniMax M3.1 Flash minimax-m3.1-flash$0.021$0.002
Kimi K3.1 Pro kimi-k3.1-pro$0.27$0.16

How to get more cache hits

  • Keep the beginning of the request identical between calls: same system prompt, same tool list in the same order, and only append new messages at the end.
  • Put anything that changes per request (dates, user names, retrieved documents) after the stable part.
  • Anthropic-style cache_control markers are accepted and ignored: caching does not depend on them.

Cache hits depend on the inference host keeping the prefix warm, so they are likely for an active agent session and not guaranteed for a request after a long pause.

Related questions

Something not covered? Ask in the support chat at the bottom right, or see the FAQ and the API docs.