Optimization

Prompt compression

Shrinking a prompt to fewer tokens without losing what the model needs — trimming boilerplate, deduplicating context, summarizing history — so you pay for less input.

Example

An agent's prompt carries a 6,000-token conversation history, much of it redundant. Compressing it to a 1,500-token summary of the salient facts cuts input cost by 75% on every subsequent step, and often improves answers by removing noise.