You pay for every token in and every token out. Cut the request before the answer, and the answer before the loop. A cache hit needs an unchanged prefix. Thinking, tool results, images, retries, and resent history still count.
Send the slice
Retrieve the passage that answers the question. Memory is queried, not dumped into the prompt.
Pick the mechanism
Code for deterministic work, one call for one judgment, and an agent only when it must observe and call again.
Cap the answer
Set the completion cap to the schema, not the model maximum. Thinking tokens spend that same budget.
Freeze the prefix
Instructions, tools, and fixed documents go first so the provider can cache them. What changes goes last.