Conversation history
Reduce growing histories in assistants, support products and copilots.
Prompt compression for OpenRouter applications
Compress conversation history, RAG results, tool output and application context before OpenRouter routes the request—reducing input tokens and helping the model focus on what matters.
Start free · No saving, no compression charge · See pricing
Send fewer billable input tokens through OpenRouter or directly to your model provider.
Reduce the amount of context the model has to process on suitable workloads.
Remove duplicated and low-value context so important instructions and facts stand out.
Before and after
Original
1,248
tokens
Compressed
782
tokens
Removed
37%
of input
Repeated background and low-value restatements are removed or rewritten.
Protected instructions, values and identifiers remain unchanged.
Results vary by prompt, workload and model.
The outcome is visible without playback; the short product film shows the transformation in action.
Run up to 100 compression tests plus Prompt Review in Audit or Tighten mode without creating an account.
Application context first
Reduce growing histories in assistants, support products and copilots.
Trim verbose tool responses, logs and repeated execution context before the next model call.
Remove repetition and low-value retrieved text while retaining important facts, instructions and citations.
Compact structured records, tenant configuration, JSON and other application state included in prompts.
Provider-neutral integration
Choose OpenAI, Anthropic, UsageTap Gateway, or OpenRouter. Add the UsageTap SDK, call Compress over HTTPS, or use the same language-agnostic flow from Python.
View SDK setup options →Provider or route
Integration style
Your selection
Keep the OpenRouter SDK and add the UsageTap SDK to compress context.
npm install @usagetap/sdk openaiimport OpenAI from "openai";
import { withCompression } from "@usagetap/sdk/openrouter";
const provider = new OpenAI({
baseURL: "https://openrouter.ai/api/v1",
apiKey: process.env.OPENROUTER_API_KEY,
});
const openrouter = withCompression(provider, {
apiKey: process.env.USAGETAP_API_KEY,
minContextTokens: 1_000,
});
const response = await openrouter.chat.completions.create({
model: "anthropic/claude-sonnet-4",
messages,
});Simple prepaid pricing
No subscription or credit card is required. Real-time Compress is part of the same prepaid UsageTap Balance as Meter and optional AI-powered work.
See all UsageTap pricing →A category-level comparison
| Category | Context-window truncation | General text compression | UsageTap Compress |
|---|---|---|---|
| Primary purpose | Make an oversized request fit within a model limit | Shorten prose such as documents, websites and transcripts | Optimize dynamic context assembled by AI applications |
| Common inputs | Messages selected by position | Natural-language text | Conversation history, RAG, tool output and structured application context |
| Protected content | Content may be removed based on location | Depends on the implementation | Explicitly protect important instructions, values, identifiers and structures |
| Skip decision | Primarily triggered by context limits | Often attempts compression on the supplied text | Can skip unsuitable or uneconomic candidates |
| Inspection | Limited visibility into removed context | Depends on the implementation | Inspect original input, output, token counts and transformations |
| Fallback | Removed content is not sent | Depends on the implementation | Use the original input when validation fails |
Runtime safeguards
Protect exact instructions, identifiers, values, and structures; inspect the result; and use the original input when validation fails.
Keep exact instructions, identifiers, numbers, code and structured content intact.
Do not compress prompts that are already efficient or unsuitable.
See the original input, compressed output, token counts and transformations.
When validation fails, UsageTap sends the original prompt.
Workload evaluation
We’ll evaluate 50–100 representative OpenRouter requests and show saved tokens, compression latency, end-to-end latency, quality results, and fallback rate before you change production traffic.
Savings calculator
Your first 5M saved tokens are free each month. After that, UsageTap deducts $0.30 per 1M saved tokens. Compare that charge with your downstream input-token cost to estimate the net saving for your workload.
Downstream model
Loading the latest model prices…
Your input
25M
tokens
Saved
6.25M
tokens
Sent after compression
18.75M
tokens
Billable saved
1.3M
after free allowance
Included Compress access is limited to 30 requests per minute. Custom terms can include different operating limits.
Context truncation helps an oversized request fit by removing messages or content, commonly based on position or limits. UsageTap is an additional optimization layer that evaluates eligible context before routing, protects selected content, exposes the transformation and can skip poor candidates.
No. Keep your OpenRouter client, model choices, routing and provider fallbacks. UsageTap wraps the client and sends OpenRouter a smaller prompt when compression is suitable.
No. Sending fewer tokens can reduce model processing time, especially for long-context workloads, but compression itself also takes time. The net result depends on the prompt, model and deployment, so evaluate end-to-end latency on representative requests.
Removing repetition and irrelevant context can help a model focus on important information, but it is not a universal quality improvement. Quality must be evaluated against the specific application workload.
You can protect exact instructions, identifiers, numbers, code, structured data, citations and other spans your application needs to preserve.
UsageTap can skip prompts that are already efficient, unsuitable or uneconomic. If validation fails, your integration can use the original input instead.
Yes. Inspect the original input, compressed output, token counts, decision metadata and transformations before deciding how to use the result.
The first 5 million saved tokens each month are free. After that, Compress deducts $0.30 of UsageTap Balance per 1 million saved tokens. The published saved-token rate is all-in; no additional UsageTap percentage fee is added. Skipped requests, unchanged results, compression errors and fallback to the original prompt record zero saved-token usage.
Yes. Compress works on its own. Use Meter for customer usage economics, Compress for prompt input efficiency, or both when your application needs both capabilities.
Start free · No saving, no compression charge · See pricing