Prompt compression for OpenRouter applications

Keep OpenRouter. Send it smaller prompts.

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

Runtime compressionFail-open ready
Before1,248 tokens
After782 tokens
Required content preserved466 saved tokens

Lower input costs

Send fewer billable input tokens through OpenRouter or directly to your model provider.

Faster long-context responses

Reduce the amount of context the model has to process on suitable workloads.

Better model focus

Remove duplicated and low-value context so important instructions and facts stand out.

Before and after

See what the model no longer needs to read.

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.

Continue in a private compression workbench.

Run up to 100 compression tests plus Prompt Review in Audit or Tighten mode without creating an account.

Open the free trial

Application context first

Built for the context AI applications actually send.

Conversation history

Reduce growing histories in assistants, support products and copilots.

Agent and tool output

Trim verbose tool responses, logs and repeated execution context before the next model call.

RAG results

Remove repetition and low-value retrieved text while retaining important facts, instructions and citations.

Application context

Compact structured records, tenant configuration, JSON and other application state included in prompts.

Also useful forLong documentsTranscriptsOther text-heavy inputs

Provider-neutral integration

Keep your provider. Send it smaller prompts.

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.

Install
npm install @usagetap/sdk openai
OpenRouter · UsageTap SDK
import 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

Start free. Pay only for tokens Compress removes.

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 →
Free allowance
5M tokens saved/month
After the allowance
$0.30 per 1M tokens saved
No saved tokens
No Compression usage charge

A category-level comparison

Not all prompt reduction works the same way.

CategoryContext-window truncationGeneral text compressionUsageTap Compress
Primary purposeMake an oversized request fit within a model limitShorten prose such as documents, websites and transcriptsOptimize dynamic context assembled by AI applications
Common inputsMessages selected by positionNatural-language textConversation history, RAG, tool output and structured application context
Protected contentContent may be removed based on locationDepends on the implementationExplicitly protect important instructions, values, identifiers and structures
Skip decisionPrimarily triggered by context limitsOften attempts compression on the supplied textCan skip unsuitable or uneconomic candidates
InspectionLimited visibility into removed contextDepends on the implementationInspect original input, output, token counts and transformations
FallbackRemoved content is not sentDepends on the implementationUse the original input when validation fails

Runtime safeguards

Protect, inspect, and fall back.

Protect exact instructions, identifiers, values, and structures; inspect the result; and use the original input when validation fails.

Protect what matters

Keep exact instructions, identifiers, numbers, code and structured content intact.

Skip poor candidates

Do not compress prompts that are already efficient or unsuitable.

Inspect every result

See the original input, compressed output, token counts and transformations.

Use the original when checks fail

When validation fails, UsageTap sends the original prompt.

Workload evaluation

Prove it on your own prompts.

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.

Get an OpenRouter prompt review

Savings calculator

Model your prompt savings.

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…

1M1B
Reduction assumption

Choose an assumption for your workload. Results vary.

Your input

25M

tokens

Saved

6.25M

tokens

Sent after compression

18.75M

tokens

Billable saved

1.3M

after free allowance

Original downstream input cost
Input cost after compression
Estimated input-cost savings
UsageTap Balance deduction$0.30 per 1M billable tokens saved
UsageTap Compress costPublished saved-token price is all-in
Estimated net savings after UsageTap Compress

Included Compress access is limited to 30 requests per minute. Custom terms can include different operating limits.

Practical questions about Compress

How is UsageTap different from OpenRouter context truncation?+

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.

Does UsageTap replace OpenRouter?+

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.

Does compression always make a request faster?+

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.

Can prompt compression improve response quality?+

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.

What content can UsageTap protect?+

You can protect exact instructions, identifiers, numbers, code, structured data, citations and other spans your application needs to preserve.

What happens when a prompt should not be compressed?+

UsageTap can skip prompts that are already efficient, unsuitable or uneconomic. If validation fails, your integration can use the original input instead.

Can I inspect the compressed prompt?+

Yes. Inspect the original input, compressed output, token counts, decision metadata and transformations before deciding how to use the result.

How is Compress priced?+

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.

Is UsageTap Compress separate from UsageTap Meter?+

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.

Make your next LLM request smaller.

Start free · No saving, no compression charge · See pricing