Skip to content

Glossary

Prompt caching

Reusing the already-processed beginning of a prompt across calls, so the unchanged part is billed at a fraction of the usual input price.

The cache works on a prefix: everything from the first token up to the first difference. Put the stable material — system prompt, tool definitions, the document you keep asking about — at the front, and the changing part at the end.

That single rule decides the bill on repetitive work. A run that shuffles its prompt on every call pays full input price every time; a run that keeps the head identical pays it once and then a fraction. This is also why per-machine details in the prompt are worth moving out of it: they differ everywhere and break the shared prefix.