Search⌘ K
AI Features

Cost-Aware Development with OpenRouter

Explore how to manage AI development costs using OpenRouter. Understand pricing models, monitor usage, and implement prompt caching to reduce token expenses. Learn to set financial guardrails like per-key spend limits and organizational policies to control and predict spending effectively.

The previous lessons covered model selection and reliability. The third critical aspect of production AI development is cost. This lesson covers OpenRouter’s tools for monitoring spending, understanding pricing, reducing token costs with prompt caching, and applying financial controls.

Understanding the pricing model

OpenRouter’s pricing is transparent: it passes through the provider’s own pricing with zero markup on inference. The primary cost is based on tokens, the small pieces of text that models process.

The key things to know are as follows:

  • Prompt vs. completion tokens: Models charge different rates for the tokens you send in your prompt (input) and the tokens the model generates (output). Completion tokens are almost always more ...