iCreatAI News
Skip to content
Trending storyUpdating

OpenRouter releases tutorial on tracking and limiting LLM costs per customer

1 reports1 sources55 min agoUpdated

Understand this story

AI overview

OpenRouter released a tutorial on how to track and limit LLM costs per customer: pass a stable customer ID in the user field of Chat Completions requests, and record usage.cost in each response rather than estimating costs by token count. OpenRouter says it tested this with three simulated customers each sending 10 requests; the most expensive customer cost $0.693814 and the cheapest $0.0030792, a 225x difference. On limits, the tutorial distinguishes two cases: when customers share one API key, spending limits must be enforced in the application; when customers each hold their own key, per-customer API key limits can be used. The Management API requires a management key.

AI overview based on source reports · Updated 15 min ago

Coverage timeline

Follow the coverage to explore different perspectives.

Dec 4
  1. OpenRouter Announcements
    Track and Cap LLM Cost per Customer (With Real Numbers)

    OpenRouter tested three simulated customers making ten requests each and found the most expensive customer cost 225 times as much as the cheapest ($0.693814 vs $0.0030792), showing request count alone doesn't reflect customer cost. It recommends passing a stable customer ID in the user field, recording usage.cost from each response rather than estimating from token counts, and reconciling totals against generation records and Broadcast. For spending caps, application-level reservations are needed when customers share a key, while per-customer API key limits apply otherwise; a $0.02 key limit blocked the 15th request, and a $0.05 key accumulated $0.067792 before the next request was rejected.

Activity for this story

Not enough continuous observations to show a trend yet.