How to pay less
Ten techniques: the first ones cut costs several times over, the last ones protect you from surprises. You pay for input and output tokens; output is usually 4–5 times more expensive. Prices are in Models & pricing.
1A cheap model for simple tasks
Give sorting requests, pulling a phone number from an email, short translations and spelling fixes to deepseek-v4.1-flash, qwen3.8-flash or claude-haiku-5-5. Keep claude-sonnet-5 and claude-opus-5-5 for code, long reasoning and important texts. Run 20–30 of your real requests through a cheap and a strong model: no visible difference, take the cheap one. More in How to choose a model.
Example: sorting 10,000 support tickets by topic: claude-opus-5-5 $4.80, claude-haiku-5-5 $0.29, deepseek-v4.1-flash $0.17.
2A cheap worker, a strong reviewer
A cheap model writes the draft; a strong one only reviews it and gives a short verdict. How to wire it up: Agent orchestration.
Example: 1,000 product descriptions: all on claude-opus-5-5 $5.60; deepseek-v4.1-flash writes, claude-opus-5-5 reviews: $2.96.
3Prompt cache: the unchanging part first
Put the instruction and knowledge base at the start of the request, and the question, date or name at the end. The cache works by itself, no cache_control needed. The current time in the first line of the instruction breaks the cache.
claude-sonnet-5andclaude-opus-5-5: in our test 40–70% of the repeated part was read from the cache. A cache read on Opus 5.5 costs $0.08 instead of $0.8 per 1M tokens.- The first cache write costs a little more than regular input (Sonnet: $0.5 instead of $0.4 per 1M); it pays off from the second or third repeat.
- On DeepSeek a cache read costs the same as regular input.
claude-haiku-5-5did not cache in our test.
Example: a bot on claude-sonnet-5 with a 20,000-token instruction, 1,000 questions a day: $8.64 a day without the cache, $3.60–5.76 with it.
4The Standard channel for requests without repeats
claude-sonnet-5-standard and claude-opus-5-5-standard charge one price for any token, input and output alike: $0.2 for Sonnet and $0.3 for Opus per 1M. No cache discount. Worth it when every request is new and the model writes a lot: translations, forms, descriptions, emails. Not worth it for a bot with a large fixed instruction: a cache read on regular Sonnet ($0.04) is cheaper.
Example: translating 1,000 documents: claude-sonnet-5 $7.20, claude-sonnet-5-standard $1.20.
5Response cache X-Zukko-Cache: true
With this header Zukko returns the saved answer to an exactly identical request (same model, text and settings) for free. Useful when you restart a crashed pipeline.
- Kept for 7 days, only successful answers up to 2 MB. Each account has its own cache.
- The response carries
X-Zukko-Cache: hitandX-Zukko-Cost-Micros: 0and does not appear in your spending history. - For Claude use the header, not
temperature: 0: newer Claude models may reject non-defaulttemperaturevalues.
Example: a 1,000-row pipeline crashed on row 600: restarting costs $2.00 without the cache, $0.80 with it. Details: Key limits, idempotency and caching.
6Idempotency-Key: no double charge on retries
Send a unique value; a retry with the same value returns the saved answer and is not charged again.
- Works for
/v1/chat/completions,/v1/messagesand/v1/responses. The answer is kept for 24 hours. - The same value with a different request body gets
422 idempotency_conflict. - Retry after the first request has finished or failed. Two simultaneous requests are both charged.
resp = client.chat.completions.create(
model="deepseek-v4.1-flash",
messages=[{"role": "user", "content": f"Classify the sentiment of this review: {review_text}"}],
extra_headers={"Idempotency-Key": f"reviews-2026-10-26-row-{row_id}"},
)Example: 10,000 requests, 3% resent after network drops: an extra $0.90 per run without the key, $0 with it.
7Short answers
Ask in the instruction: "Answer in 2–3 sentences", "JSON only, no explanations". max_tokens is only a safety net: the model stops mid-sentence, so leave headroom. Don't turn on reasoning for simple tasks.
Example: a bot on claude-sonnet-5, 1,000 answers a day, answers cut from ~600 to ~200 tokens: ~$24 a month saved.
8Short chat history
The model gets the whole conversation every time. Send only the last 10–20 messages, or every 20 messages replace the old ones with a summary from a cheap model. Keep the instruction first so it stays in the cache.
MAX_MESSAGES = 10
def build_messages(system_prompt, history):
# The instruction always comes first, then only the latest messages
return [{"role": "system", "content": system_prompt}] + history[-MAX_MESSAGES:]Example: 1,000 conversations of 40 messages on claude-sonnet-5: $49 with the full history, $21 with a 10-message window.
9Key limits
In the dashboard give each key a daily and monthly spend cap (once reached, requests get 429 and cost nothing) and a list of allowed models. Create a separate key for every bot, agent or contractor. The limits are soft: the last request let through can go slightly over the cap.
Example: an agent looping on claude-opus-5-5 burns ~$53 an hour. With a $2 daily key limit the damage is about $2.
10Watch your spending
- Dashboard: the Usage page.
- API: GET /v1/usage and GET /v1/balance.
- The
X-Zukko-Cost-Microsheader in every non-streaming response: the cost in millionths of a dollar (1500= $0.0015).
Run the example twice; the second answer comes from the cache and costs 0:
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.zukko.pro/v1", api_key=os.environ["ZUKKO_API_KEY"])
raw = client.chat.completions.with_raw_response.create(
model="deepseek-v4.1-flash",
messages=[{"role": "user", "content": "Capital of France? One word."}],
max_tokens=100,
extra_headers={"X-Zukko-Cache": "true"},
)
resp = raw.parse()
print(resp.choices[0].message.content)
print("Cache:", raw.headers.get("X-Zukko-Cache", "none"))
print("Cost, $:", int(raw.headers.get("X-Zukko-Cost-Micros", "0")) / 1_000_000)