Understand OpenRouter model pricing tiers and cost calculation. Use when budgeting or comparing model costs. Trigger with phrases like 'openrouter pricing', 'openrouter cost', 'model pricing', 'openrouter budget'.
This skill explains OpenRouter's per-token pricing model, how to calculate costs for different models, and strategies for staying within budget.
/models endpoint and inspect pricing.prompt and pricing.completion fields for each model(prompt_tokens * prompt_price + completion_tokens * completion_price) using the usage object from each responseX-OpenRouter-Cost response header or query to check remaining credits/api/v1/auth/keygoogle/gemma-2-9b-it:free) and reserve expensive models for complex reasoning| Error | Cause | Fix |
|---|---|---|
| 402 Payment Required | Insufficient credits for the chosen model | Top up credits or switch to a cheaper/free model |
| Unexpected costs | Completion tokens exceeded max_tokens | Always set max_tokens to cap output length |
| Price mismatch | Using outdated pricing data | Re-query /models endpoint; pricing updates dynamically |
See ${CLAUDE_SKILL_DIR}/references/errors.md for full error reference.
See ${CLAUDE_SKILL_DIR}/references/examples.md for runnable code samples.