How-To Guide

How to Use DeepSeek in 2026: App, API, Self-Host & Real Costs

DeepSeek is the cheapest frontier-class model of 2026, and there are three ways to use it: the free chat app for everyday questions, the very cheap API for building, or self-hosting the open weights for full data control. This guide walks each route, how to get an API key, a worked code example, what DeepSeek actually costs across real workloads, how its context-caching discount works, when self-hosting is worth the GPUs, and which DeepSeek model to pick.

How to use DeepSeek — the app, the API, self-hosting the open weights, and real workload costs

Three ways to use DeepSeek

How this is sourced. Prices are from DeepSeek's API pricing page and the live DataLLM Lab catalog, June 2026. The workload cost figures are our own model, computed from those rates against the token assumptions in the methodology box. For the full price table see the DeepSeek API guide; for benchmarks, the DeepSeek V4 review.

Get a DeepSeek API key

  1. Sign up at platform.deepseek.com and verify your account.
  2. Create a key in the API keys section; copy it once.
  3. Add credit (new accounts often get trial credit). Store the key as export DEEPSEEK_API_KEY=...

What DeepSeek costs to run

DeepSeek's reputation is "cheap," but the real story is how cheap on actual traffic. Here's the modeled monthly cost across five canonical workloads, with two frontier models for contrast:

Monthly workloadDeepSeek V4-ProDeepSeek V4-FlashDeepSeek V3.2GPT-5.4Claude Opus 4.7
Support chatbot$27.8$8.96$13.3$280$500
RAG / knowledge base$104$33.6$52.8$800$1,500
Coding agent$56.5$18.2$26.9$575$1,025
Batch extraction$72.2$23.2$37.2$495$950
Content generation$43.5$14.0$18.2$650$1,100
Methodology. Cost = input_price × input volume + output_price × output volume. Monthly volumes: Support chatbot 40M in / 12M out, RAG 200M / 20M, Coding agent 80M / 25M, Batch extraction 150M / 8M, Content generation 20M / 40M. The context-caching discount (below) lowers the input-heavy rows further.

A RAG app on V3.2 runs about $53/month versus $1,500 on Claude Opus — roughly 28x cheaper for quality within a few points on many tasks. That gap is the whole reason DeepSeek became the default cheap option.

Why it's so cheap

On output price — usually the bigger half of the bill — DeepSeek undercuts the Western frontier by an order of magnitude:

Output price per 1M tokens — DeepSeek vs the frontierJune 2026Claude Opus 4.7$25GPT-5.4$15Gemini 3.1 Pro$12DeepSeek V4-Pro$0.87
Chart: DataLLM Lab — output price per 1M tokens, June 2026. DeepSeek V4-Pro (highlighted) is a fraction of the US frontier's price.

How to call it (worked example)

The API is OpenAI-compatible — use the OpenAI SDK with DeepSeek's base URL, stream long output, and handle errors:

from openai import OpenAI, APIError
client = OpenAI(base_url="https://api.deepseek.com/v1", api_key="$DEEPSEEK_API_KEY")

try:
    stream = client.chat.completions.create(
        model="deepseek-v4-pro",            # or deepseek-v4-flash for the cheap tier
        messages=[{"role": "user", "content": "Review this function..."}],
        stream=True,
    )
    for chunk in stream:
        if chunk.choices[0].delta.content:
            print(chunk.choices[0].delta.content, end="", flush=True)
except APIError as e:
    print("DeepSeek API error:", e.status_code, e.message)   # 401 key, 429 rate, 402 balance

The context-caching discount

DeepSeek bills repeated input prefixes at a much lower context-cache-hit rate than fresh input. If your app resends a large fixed context — a long system prompt, tool schemas, or a retrieved document — every turn, those repeated tokens are served from cache cheaply. For agents and RAG this is a real lever: keep the stable part of the prompt at the front and the variable user turn at the end, so the prefix stays cacheable across calls. The input-heavy rows of the cost table above (RAG, batch extraction) drop meaningfully once caching kicks in.

Which DeepSeek model

Hardest tasks V4-Pro

  • $0.435/$0.87. Top reasoning and coding when quality matters most.

High volume V4-Flash

  • $0.14/$0.28. Well-scoped tasks at ~⅓ the price — the workhorse.

On the gateway V3.2

  • $0.23/$0.34. Cheapest prior gen; callable on DataLLM Lab today.

Best move Flash-first

Self-hosting the open weights

DeepSeek V4 is open-weights (MIT), downloadable from Hugging Face, so you can run it on your own GPUs for full data control. The catch is scale: V4-Pro is a large mixture-of-experts model (trillion-plus total parameters with a smaller active set per token), so it needs serious multi-GPU hardware to serve at speed. The math usually works only when volume is very high or data must never leave your infrastructure — otherwise the cheap hosted API beats the all-in cost of GPUs, power, and ops. A common hybrid: self-host for the sensitive, high-volume path and call the API for everything else.

Using DeepSeek through a gateway

To use DeepSeek alongside other models — with failover — call it through a gateway. DataLLM Lab carries DeepSeek V3.2 with one OpenAI-compatible key:

client = OpenAI(base_url="https://www.datallmlab.com/v1", api_key="$DATALLMLAB_API_KEY")
resp = client.chat.completions.create(model="deepseek/deepseek-v3.2", messages=[{"role":"user","content":"Hello"}])

Use DeepSeek and 300+ models with one key

DeepSeek V3.2, Qwen3 Coder, Kimi K2.6, Claude Opus 4.7 and more — one OpenAI-compatible endpoint, live price comparison, failover.

FAQ

How do I use DeepSeek?

Three ways: the chat app (chat.deepseek.com), the cheap API (api.deepseek.com), or self-hosting the open weights (MIT). For building, the API is easiest and cheapest.

Is DeepSeek free to use?

The chat app is free; the API is paid but very cheap (V4-Pro ~$0.435/$0.87), often with trial credit. Open weights are free to download (you pay for GPUs).

How do I get a DeepSeek API key?

Sign up at platform.deepseek.com, create a key, add credit. OpenAI-compatible at https://api.deepseek.com/v1. Or reach DeepSeek via a gateway like DataLLM Lab.

Which DeepSeek model should I use?

V4-Pro for hard tasks, V4-Flash for high volume (~⅓ the price), V3.2 for the cheapest prior gen. On a coding agent, Flash is ~$18/mo vs $57 for Pro. Route Flash-first, escalate on failure.

Can I self-host DeepSeek?

Yes — V4 is open-weights (MIT) on Hugging Face. It's a large MoE needing serious multi-GPU hardware, so self-hosting suits high-volume or data-sensitive use; otherwise the cheap API wins.

Does DeepSeek have a caching discount?

Yes — repeated input prefixes bill at a low context-cache-hit rate. For agents/RAG reusing a big fixed context, keep the stable part at the front to maximize hits.

Is DeepSeek safe to use?

Self-hosted open weights run locally — no data leaves. With the app/API, the usual provider data terms apply; review them for sensitive data.

How much cheaper is DeepSeek than GPT-5 or Claude?

On a modeled RAG workload, V3.2 is ~$53/mo vs $800 for GPT-5.4 and $1,500 for Claude Opus — roughly 15-30x cheaper for quality within a few points.

Is the DeepSeek API OpenAI-compatible?

Yes — set base_url to https://api.deepseek.com/v1 and the model id (e.g. deepseek-v4-pro). The OpenAI SDK works unchanged.

Written by
Kevin Fan

Founder of DataLLM Lab, the unified LLM gateway. Kevin tests models the boring way — same prompts, real costs, unedited outputs — and writes up what the runs actually show.

One API for every model

One API, every model.

Get a single API key for Claude Opus 4.7, GPT-5.4, and 300+ more — with automatic price comparison and routing to the best model for every request.