Agent skill · business finance · jeremylongshore
openrouter-pricing-basics
Understand OpenRouter pricing, calculate costs, and optimize spend.
Why this skill is useful
Provides specific cost calculation methods and API commands for OpenRouter that the AI wouldn't reliably generate on its own.
What it needs
Requires curl, jq, python3 installed locally. Requires openrouter account access. About 4k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
OpenRouter Pricing Basics Overview OpenRouter charges per token with separate rates for prompt (input) and completion (output) tokens. Prices are listed per token in the models API (multiply by 1M for per-million rates). Credits are prepaid with a 5.5% processing fee ($0.80 minimum). Free models are available for testing and low-volume use. Prerequisites An OpenRouter API key (sk-or-v1-...) exported as OPENROUTERAPIKEY — see the openrouter-install-auth skill for setup curl and jq for the model-pricing and credit-balance queries Python 3.8+ with the OpenAI SDK plus the requests package for the cost-calculation and generation-endpoint snippets Prepaid credits for paid models — the public models/pricing endpoint needs no auth, but real completions require credits or a :free model Instructions 1. Read How Pricing Works: prepaid credits (5.5% fee, $0.80 minimum) are drawn down per request as (prompttokens promptrate) + (completiontokens completionrate). 2. Query per-token rates via GET /api/v1/models per Query Model Pricing, and place candidate models in the Cost Tiers table (free → premium). 3. Estimate spend before committing: run estimatecost() from Calculate Request Cost with your expected prompt/completion token counts. 4. After sending real traffic, fetch the exact charge with GET /api/v1/generation?id= per Track Actual Cost Per Request. 5. Watch the balance via GET /api/v1/auth/key per Check Credit Balance, and enable auto-topup for production keys. 6. Cut costs with the :floor and :free variants per Save Money with Variants, and check Special Pricing for reasoning tokens, image inputs, per-request fees, and BYOK. How Pricing Works 1. Buy credits at openrouter.ai/credits (5.5% fee, $0.80 minimum) 2. Each request deducts (prompttokens promptrate) + (completiontokens completionrate) 3. Check balance via GET /api/v1/auth/key or the dashboard 4. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/openrouter-pricing-basics