Compressions
Compression models shorten a long context, such as a contract, a knowledge base article, or retrieved documents, down to the parts that matter for one prompt. Use them before an expensive chat model when input tokens drive your cost, or when a context won’t fit the next model’s window. A compression costs a fraction of the input tokens it saves on a frontier model.
Context compression is a setting that shrinks chat requests automatically. This endpoint is an explicit call you make, and you decide what to send next.
Send a compression request
Send context, the text to shorten, and prompt, the question it’s being shortened for. Both are required and can’t be blank.
The cURL request returns:
compressed_prompt holds the parts of context relevant to prompt, not the prompt itself, so send both to the next model. compression_ratio is compressed_tokens divided by original_tokens. The text can repeat sentences and change their order, so use it as model input, not as text to show a person.
Reference
scaledown/compress bills the original tokens as input at $0.05 per million, with no output cost, reported as usage.cost in USD. It doesn’t stream, and it isn’t available to organizations with zero data retention. GET /v1/models lists it among the ScaleDown models, paged at 50 by default, so pass limit (up to 500) when you search.