Features / Caching
Long chats that fit, repeats that cost a tenth.
Turn on the response cache and an identical request is answered from it for a tenth of the charge. Add middle-out and a chat longer than the model’s window drops its middle turns instead of failing.
One long turn, three ways
- Turn
- 24,000 in → 600 outGLM-5.3 Uncensored
- Full price
- $0.0073
- Prompt cached
- $0.0024the prompt at the cached input rate
- Response cache hit
- $0.0007a tenth of the original charge
Rates per million tokens
- Model
- GLM-5.3 Uncensored
- Input
- $0.282
- Cached input
- $0.0799
- Output
- $0.846
Response cache
Opt in per request with x-uplink-cache: on, or give a key a default time to live. A hit comes back with x-uplink-cache: HIT and x-uplink-cache-age; a miss is answered by the model and stored. It works on chat completions, messages and embeddings.
curl -i https://api.uncensoredllm.ai/v1/chat/completions \ -H "Authorization: Bearer sk-ullm-live-…" \ -H "Content-Type: application/json" \ -H "x-uplink-cache: on" \ -H "x-uplink-cache-ttl: 3600" \ -d '{"model": "glm-5.3-uncensored", "messages": [{"role": "system", "content": "You are the game master."}, {"role": "user", "content": "Describe the starting village."}]}'Middle-out for long roleplay chats
A long chat sends the whole history every turn. With transforms: ["middle-out"], a prompt that would overflow the model’s window loses whole messages from the middle until it fits; the character sheet in the system prompt, the opening message and the latest turn stay. x-uplink-compressed says how many were dropped. The longest window on this catalog is 1,048,576 tokens.
from openai import OpenAI client = OpenAI(base_url="https://api.uncensoredllm.ai/v1", api_key="sk-ullm-live-…")raw = client.chat.completions.with_raw_response.create( model="glm-5.3-uncensored", messages=history, # the whole chat, however long it has grown extra_body={"transforms": ["middle-out"]},)print("messages dropped:", raw.headers.get("x-uplink-compressed", "0"))print(raw.parse().choices[0].message.content)Make both the key’s default
A key can cache every request and compress every overflow without a header; x-uplink-cache: off or transforms: [] turns either off for one request.
curl -X PATCH https://api.uncensoredllm.ai/v1/keys/KEY_ID \ -H "Authorization: Bearer $ULLM_ADMIN_KEY" \ -H "Content-Type: application/json" \ -d '{"response_cache_ttl": 600, "context_overflow": "middle-out"}'Context windows per build are on each model page; the field list is in the console docs.
Questions
The same model and the same body from your organization, ignoring stream, user and metadata. A repeat inside the time to live is answered from the cache, streamed or not, with x-uplink-cache: HIT.
A tenth of the original charge: the 24,000-token turn on this page costs $0.0073 on GLM-5.3 Uncensored and $0.0007 from the cache. The usage it reports counts zero tokens.
Five minutes unless you set x-uplink-cache-ttl, from 60 seconds to a day. A key can have its own default, and x-uplink-cache-clear drops the stored answer.
Whole messages from the middle of the chat, only when the prompt plus room for the answer is longer than the model’s context window. The system prompt, the first user message and the latest turn are kept, and a tool call stays with its result.
No. Prompt caching bills the repeated start of a prompt at the model’s cached input rate while the model still writes a new answer. The response cache returns a stored answer to an identical request without asking the model.