Use Case

Reduce AI application spend without weakening the product

Use Compress by itself to remove unnecessary input tokens before inference. Add UsageTap metering when you also need customer limits, usage forecasts, and billing outputs.

Compress prompts before inference

Call UsageTap Compress directly or enable it in the OpenAI and Anthropic wrappers. Compress works without UsageTap metered events and returns the original input when compression is skipped.

Account for cached input tokens

When you also use UsageTap metering, report vendor cache hits separately so cost reporting distinguishes uncached input from discounted cache reads.

Select the right model strength

Use entitlements and vendor hints to route routine work to standard models while reserving premium models and heavier reasoning for calls that need them.

Block abuse before it reaches the vendor

Add UsageTap metering when you need customer quotas, burst limits, and blocking policies alongside prompt compression.

Cost controls

Four ways to reduce request cost

Start with prompt compression. Add model selection, cache-aware reporting, and customer usage controls where they improve the economics of your application.

  • Original and compressed tokens
  • Tokens removed and reduction percentage
  • Compression path and warnings
  • Estimated downstream savings
  • Optional customer and feature attribution
  • Optional cached-token reporting
Example flow
const compressed = await fetch(
  "https://compress.usagetap.com/compress",
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.USAGETAP_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      text: reportPrompt,
      aggressiveness: 0.5,
    }),
  },
).then((response) => response.json());

const response = await openai.responses.create({
  model: "gpt-5.6-luna",
  input: compressed.compressed_text,
});

What teams see

Each Compress response reports the original and compressed token counts, reduction, elapsed time, warnings, and the path taken. Optional UsageTap metering adds customer, feature, model, cache, and cost context.

What customers feel

Prompts reach the model with fewer unnecessary tokens. You can preserve critical text, evaluate representative inputs, and fall back to the original prompt when compression does not produce a useful result.

Control AI cost before the invoice arrives

Start with standalone compression, then add metering and customer controls if you need them.

Explore UsageTap Compress