Where the money actually goes, and the eight levers that move it — ordered by impact.
Every turn resends the entire conversation. A 1,000-message session isn't 1,000× one message — it's roughly quadratic.
Nothing else in this list matters until that is understood: you are not paying for answers, you are paying for the transcript that precedes each answer.
Measured: 1,047 messages in one Telegram session → 3.4M input tokens.
/new resets the context. One task = one session.
prompt_caching.cache_ttl is 5m — set 1h for long sessions with pauses between turns.
execute_code and print only what matters; tool_budget spillover keeps big results on disk with just a path in context.
compression.threshold is 0.50 (floored at 0.75 for models under 512K context). Lower = compress earlier = cheaper but lossier. /compress manually before a long tail is cheaper than letting it fire mid-task.
/model is session-scoped, so you can switch per task.
/usageTokens and rate limits/insightsSpend over time/statusCurrent context sizeRule of thumb: if a session's context is over ~40% of the window and the task is done, /new.
Multiple keys per provider (credential pools) help with rate limits and rotation, not cost — same price per token.
Cost control is entirely about context size and model choice.