OpenRouter recommends tagging requests for per-customer LLM costs

openrouter.ai10 min read

To prevent unexpected margins loss on flat-price AI products, developers can track Large Language Model costs per customer by passing stable internal identifiers in the request user field and recording actual charges from usage.cost. Testing demonstrates that request counts alone fail to reflect actual costs, which can vary significantly depending on token usage and model choice. Developers can enforce spending limits through application-level budgeting or per-customer API keys. Open article →