2026-06-03 · flo2 blog

Using DeepSeek on OpenRouter (and Cheaper BYOK Options)

If you want to call DeepSeek models without signing up for yet another provider account, routing through OpenRouter DeepSeek is the most common shortcut. One prepaid balance, one OpenAI-compatible endpoint, and you can reach DeepSeek's chat and reasoning models alongside everything else in OpenRouter's catalog. This guide covers how to do that in practice — the model slug format, a working request you can adapt, and the honest trade-offs on cost and data handling — plus a note on when skipping the aggregator entirely and going direct, or using a BYOK gateway, saves you real money.

Why developers use DeepSeek on OpenRouter

DeepSeek is available directly through its own API platform. So the first question is why anyone routes through OpenRouter at all when they could call api.deepseek.com directly. The reasons are practical, and they are worth naming rather than glossing over, because knowing them tells you whether the trade-off is worth it for your situation.

These are legitimate reasons. The flip side — cost — is covered below, because it matters and is often glossed over in articles that want you to sign up for something.

How to use DeepSeek via OpenRouter: model slugs and endpoint

OpenRouter uses a namespaced model ID format: provider/model-name. For DeepSeek models, the namespace is deepseek. The two main families map to slugs that look like:

Important: OpenRouter's model catalog is updated frequently as new versions ship and old ones are deprecated. The slugs above match the long-standing IDs, but you should verify the current list on OpenRouter's models page before hard-coding any string into production code. Filter by "deepseek" to see all available variants and their current per-token prices.

OpenRouter's base URL is https://openrouter.ai/api/v1, and the endpoint is the standard /chat/completions path. Any OpenAI-compatible client works by swapping the base URL and key. Here is a minimal curl example calling the chat model — replace the model slug with whatever the current live ID is:

curl https://openrouter.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek/deepseek-chat",
    "messages": [
      {
        "role": "user",
        "content": "Explain the difference between input and output token pricing in one paragraph."
      }
    ]
  }'

The same call with the Python OpenAI SDK looks like this:

from openai import OpenAI

client = OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key="sk-or-your-openrouter-key",
)

response = client.chat.completions.create(
    # Verify current slug at openrouter.ai/models
    model="deepseek/deepseek-chat",
    messages=[
        {"role": "user", "content": "What is 17 multiplied by 43?"}
    ],
)
print(response.choices[0].message.content)

For the DeepSeek R1 OpenRouter path — the reasoning model — swap the model string to the current R1 slug. R1 is worth using when you need correct answers on multi-step problems rather than fast answers on straightforward ones. Expect higher output token counts because the model reasons through the problem before replying; budget for that in your cost estimates.

OpenRouter-specific request headers

OpenRouter supports a few extra headers that are useful in practice. HTTP-Referer lets you identify your app in OpenRouter's dashboard, and X-Title sets a human-readable name for the request source. Neither is required, but they help with usage attribution when you run multiple projects through the same key.

curl https://openrouter.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  -H "HTTP-Referer: https://yourapp.com" \
  -H "X-Title: MyApp" \
  -H "Content-Type: application/json" \
  -d '{"model": "deepseek/deepseek-chat", "messages": [{"role":"user","content":"Hello"}]}'

The cost angle: OpenRouter credits vs. direct DeepSeek vs. BYOK

DeepSeek's native API is already one of the cheapest options for a capable frontier-class model. When you route it through OpenRouter, the effective cost rises slightly because OpenRouter operates on a prepaid credit model — there is a layer of platform margin, processing fees, or a spread built into the credit-purchase mechanism. The exact figure is something to verify on OpenRouter's current pricing page, not a number to take from a blog post, but the direction is consistent: direct is usually cheaper per token than via an aggregator, for the same underlying model.

If cost is the primary driver, the options in rough order of cheapest-to-most-convenient are:

The convenience vs. cost trade-off is real, and where you land on it depends on your volume. For prototypes and low-volume experiments, the OpenRouter credit model is fine. For production workloads billing thousands of dollars a month in tokens, the per-token spread starts to show up as a line item that is worth addressing.

Data governance considerations for DeepSeek-class models

DeepSeek is a Chinese AI lab, and its models have attracted scrutiny in some regulated industries and jurisdictions. This is not a reason to avoid the models — the open-weight variants especially are widely deployed — but it is something to think through before shipping to production.

For more background on OpenRouter as a platform — how it works, how it bills, and what it is genuinely best suited for — see our full explainer on what is OpenRouter.

An alternative: bring your own DeepSeek key to a zero-markup gateway

If the credit spread bothers you but you still want a unified endpoint, a routing layer, and fallback without managing it yourself, the BYOK gateway model is the middle path. You supply your own DeepSeek API key (and keys from other providers), and the gateway routes your requests through them — so you pay the provider's list price directly with no markup on tokens.

flo2 is a developer-first LLM gateway built on this model. One OpenAI- and Anthropic-compatible API key routes to any provider you wire in, including DeepSeek, with zero token markup, automatic fallback, and routing to the cheapest or fastest available option. It is free during beta, which makes it reasonable to try even if you are already running on OpenRouter — the migration is a base URL and key swap, same as going to OpenRouter in the first place.

The short summary: OpenRouter DeepSeek works, is convenient, and is a sensible default when you are consolidating model access behind one balance. The cost of that convenience is a small per-token spread and a data chain that is worth understanding for sensitive workloads. For teams where the token economics start to matter, going direct to DeepSeek or routing via a zero-markup BYOK gateway like flo2 is the next natural step.

One key, every model — zero markup.
Bring your own provider keys. flo2 routes to the cheapest, fastest model with fallback, racing and true cost accounting — free during Beta.
Get your flo2 key →
© 2026 flo2.com — the zero-markup LLM gateway & router. flow → to