--- title: "Send fewer input tokens to your model" description: "Before each model call, send the conversation to POST /api/v1/compress and send the shorter one it returns to your model." canonical: https://past.dev/docs/memory-api/compressor last-updated: 2026-12-02 --- # Send fewer input tokens to your model > Before each model call, send the conversation to POST /api/v1/compress and send the shorter one it returns to your model. Product: past.dev Memory API. Source: https://past.dev/docs/memory-api/compressor It is not part of recall: nothing is compressed unless your code calls it. Flex and Enterprise include it, on for every project; an Owner or an Admin turns it off in the console's Compressor tab. On Pay as you go it returns the conversation as sent, with `compression.on` `false`. [Pricing](/pricing) lists the plans. - A tool result of 100 tokens or more that repeats an earlier one comes back as `[same output as tool call ]`. - A log or a listing of 2,000 tokens or more loses whole lines, at most 50% of its tokens, and `[...]` marks each removed run. Code, diffs, data and prose are never cut. - First and last lines, error and warning lines and diff headers always stay, byte for byte. - A tool result is cut the same way every time, so your prompt cache keeps working. Send the whole conversation each time. Shapes read: OpenAI Chat Completions (`role` `tool`), Anthropic Messages (`tool_result`) and OpenAI Responses (`function_call_output`). ```curl curl -X POST https://api.past.dev/api/v1/compress \ -H "Authorization: Bearer $PAST_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "messages": [ { "role": "tool", "tool_call_id": "call_1", "content": "" } ] }' ``` ```200ok { "messages": [{ "role": "tool", "tool_call_id": "call_1", "content": "..." }], "compression": { "on": true, "originalTokens": 41200, "tokensSaved": 9800, "units": 2 } } ``` Each 8,000 tokens a new cut removes count as 1 recall (`units`); resent cuts and repeats are free. On Flex and Enterprise that is free within fair use.