AiCredits
Pricing guide

How OpenRouter Pricing Works: Credits and Markup Explained

OpenRouter pricing is more than a model rate: credits, top-up fees, routing, and retries all shape your effective cost. Here is how to calculate it.

Published 2026-12-04 Updated 2026-12-04 7 min

OpenRouter pricing in one sentence

OpenRouter is an API marketplace. You prepay credits, then each model call deducts the upstream provider's rate for whichever route OpenRouter selects. The sticker price on a model page is only one part of your bill.

The markup most developers are looking for is rarely a single per-token number. It usually shows up as a platform fee when you buy credits, a fee for bringing your own provider key, a spread from provider routing, or the opportunity cost of money sitting in a prepaid balance. OpenRouter is strong at making many models available through one key; the tradeoff is that your effective cost per successful task has more layers.

Where the markup actually hides

  • Credit-purchase fee: usually the clearest markup. You pay it when you top up, not when a request runs, so it is easy to miss in per-request logs.

  • Route spread: the same model can be served by different upstream providers at different rates. Default routing optimizes for availability or latency, not always for your cheapest acceptable route.

  • BYOK fee: if you connect your own provider key, check whether the aggregator still charges a platform fee for routing the request.

  • Retries and fallbacks: a failed call, a timeout, or a validation retry can consume tokens. Your real cost is tokens per successful task, not tokens per request.

  • Idle balance: prepaid credits are cash parked at the platform. If you top up in large chunks, that float is part of your economics.

The credit math developers miss

Per-token pricing is a poor decision metric for agents, extraction pipelines, and code review bots. A cheaper model that rambles, needs a second pass, or fails structured output can cost more than a stronger model that finishes in one call. The right unit is cost per successful task: tokens on the chosen route plus your share of the top-up fee plus retry tokens plus idle balance.

OpenRouter gives you the raw material to measure this: usage fields on each response and model metadata. Pull those into your own logs. If you only look at the dashboard total, you will know you spent credits but not which prompt, route, or retry pattern burned them.

import os
import json
import time
from openai import OpenAI

client = OpenAI(
    api_key=os.environ['AICREDITS_API_KEY'],
    base_url='https://api.aicreditsapi.com/v1',
)

def run_task(prompt: str, max_retries: int = 2):
    for attempt in range(max_retries + 1):
        start = time.time()
        resp = client.chat.completions.create(
            model='deepseek-v4-flash',
            messages=[
                {'role': 'system', 'content': 'Return only the final answer. Be concise.'},
                {'role': 'user', 'content': prompt},
            ],
            temperature=0.2,
            max_tokens=400,
        )
        usage = resp.usage
        record = {
            'attempt': attempt,
            'latency_s': round(time.time() - start, 3),
            'prompt_tokens': usage.prompt_tokens,
            'completion_tokens': usage.completion_tokens,
            'total_tokens': usage.total_tokens,
            'answer': resp.choices[0].message.content,
        }
        print(json.dumps(record))
        if record['answer'] and record['answer'].strip():
            return record
    raise RuntimeError('Empty response after retries')

if __name__ == '__main__':
    run_task('Explain why prepaid API credits change engineering incentives in two sentences.')

A practical cost-control loop

  • Default to deepseek-v4-flash for high-volume work; reserve deepseek-v4-pro for tasks where a wrong answer is expensive.

  • Track prompt tokens, completion tokens, retries, and task success in one record. Aggregate by task type, not just by model.

  • Use cache-friendly prompts: stable system instructions and reusable context cost less when they hit cache.

  • Batch non-urgent work and run it off-peak when rates are lower. Off-peak costs less; cache hits are cheaper; pro costs more than flash.

  • Pin providers when consistency matters, and make fallbacks explicit. Silent routing can change both latency and effective rate.

  • Set a task-level token budget, not only an account-level credit alert. A budget on the unit of work catches runaway prompts earlier.

OpenRouter vs buying DeepSeek credits directly

OpenRouter is the better fit when you need one API for many model families, built-in provider fallback, or a single procurement path for a team experimenting across vendors. Those are real strengths. If your product routes across OpenAI, Anthropic, Google, and DeepSeek, an aggregator can remove a lot of integration work.

If DeepSeek is your primary or only model, the calculus changes. You are paying for an aggregation layer whether or not you use it. AiCredits sells DeepSeek API credits directly, with card or PayPal and no Chinese phone or bank account required. You still pay for usage, but there is one fewer billing layer between you and the model. Check aicreditsapi.com/deepseek-prices for current rates.

NeedOpenRouterAiCredits DeepSeek credits
Many model families behind one keyStrong fitDeepSeek only
Built-in provider routing and fallbackYesYou implement retries in code
Payment without a Chinese phone/bankSupported, subject to platform termsCard or PayPal
Fewest billing layers for DeepSeekCredit top-up fee plus upstream rateDirect DeepSeek credits
Per-task cost visibilityDashboard plus usage fieldsUsage fields plus price page
Experimentation across vendorsExcellentNot the goal

When OpenRouter is the right call

Choose OpenRouter when model choice itself is the product requirement. Maybe you need to benchmark several vendors, keep a fallback for regional outages, or let different teams use different models without new billing relationships. The platform fee is easier to justify when the aggregation saves engineering time.

Choose direct DeepSeek credits when DeepSeek is the default and you want a simpler cost model. That is especially true for code linting, code review, structured extraction, and support triage, where deepseek-v4-flash handles most calls and deepseek-v4-pro is an exception path. Fewer layers make it easier to attribute spend to a feature.

A checklist before you top up

  • Calculate your effective cost per successful task for the last week, not the sticker rate.

  • Separate prompt tokens from completion tokens; output-heavy tasks behave differently.

  • Measure retry rate by task type. A high retry rate is a prompt bug or a model-fit problem.

  • Check whether your payment method adds fees to the credit purchase.

  • Decide whether you need many models or one good default. The answer changes the right vendor.

FAQ

Is OpenRouter's markup a per-token fee?

Not always. Model list prices are often the upstream provider's rates. The platform's economics can sit in the credit-purchase fee, BYOK routing, or provider spread. Calculate your effective rate after top-up fees and retries.

Do OpenRouter credits expire?

Check OpenRouter's current terms; credit policies can change. Do not assume unused balance is fully liquid.

How do I compare OpenRouter with AiCredits DeepSeek credits?

Use cost per successful task: token usage on the actual route, share of any top-up fee, retry tokens, and idle balance. Then compare against direct DeepSeek credit pricing at aicreditsapi.com/deepseek-prices.

Which DeepSeek model should I default to?

deepseek-v4-flash for most calls. Use deepseek-v4-pro when the task justifies a stronger, costlier model, such as multi-step code review or ambiguous analysis.

Can I use the OpenAI SDK with AiCredits?

Yes. Set base_url to https://api.aicreditsapi.com/v1 and use model='deepseek-v4-flash'. The code sample above is runnable with an AICREDITS_API_KEY environment variable.

Still stuck at DeepSeek's checkout?

This article explains why the payment fails. If what you actually need is a working key today, there is a shorter path: prepaid DeepSeek credits, no subscription, key issued to your account right after checkout.

  • $9 / $19 / $29 USD one-time credit packs — 1 USD = 500K credits (so $9 = 4.5M); billed by actual usage, never expires, tax excluded
  • Card, Apple Pay, Google Pay or Alipay via Creem — no PayPal account needed
  • Email signup only — no Chinese phone number, no Chinese bank account
  • Same DeepSeek models and the same OpenAI-compatible API — change one base_url

Get a DeepSeek key → Or try it free first

Not sure how prepaid billing works? See the full DeepSeek API credits guide → — packs, usage-based billing, supported models and payment methods.

Try Lint in 2 seconds

Wrote something? Paste it here for a free grammar check. No account needed.

More Tools →

Related Tools

Was this article helpful?

| Share on X Reddit Copy link
💬
反馈意见 / Feedback ×