No items found.
Start Building
Guide

Open-Source LLM API: Run Kimi K3, DeepSeek V4, Qwen3 Without Managing GPUs

DeepSeek, Kimi K3, and Qwen all ship OpenAI-compatible APIs. Here is what each actually costs right now, and when self-hosting beats paying per token.

Author photo
packet.ai Team
August 19, 2026

You don't need a GPU cluster to run DeepSeek, Kimi K3, or Qwen. Each ships an official, OpenAI-compatible open source LLM API: point your existing SDK at a different base URL, and you're calling a frontier open-weight model without provisioning a single GPU. None of these are a free ai api in the strictest sense, but between free trial credits and genuinely low per-token rates, the practical cost of testing all three is close to nothing. This guide covers what each one actually costs today, how they compare, and when self-hosting instead makes more sense.

Key takeaways

  • DeepSeek, Kimi K3, and Qwen all ship OpenAI-compatible APIs. Switching from OpenAI or between any of them is usually a two-line change: base_url and api_key
  • DeepSeek V4 Flash is the cheapest serious option at $0.22/$0.66 per million input/output tokens, with automatic prompt caching dropping repeated input to $0.007/M
  • Kimi K3 costs more ($3.00/$15.00 per million) but leads on long-context and agentic coding benchmarks; its license requires a separate commercial agreement only above $20M/year in resale revenue, not for normal use
  • Qwen's flagship is mid-priced ($0.60/$3.60), with a genuinely free tier (Qwen3.5 Flash at $0.10/$0.40) for high-volume, lower-stakes workloads
  • The API route makes sense below roughly 2-5 million tokens a day. Above that, self-hosting on your own GPU usually becomes cheaper, assuming reasonable utilization

"Open source" here means open-weight: the model parameters are downloadable and self-hostable, distinct from the API access this post is actually about. This post covers calling these models through their official hosted APIs, the fastest way to use them without touching a GPU. For the self-hosting side of each model specifically, see the packet.ai DeepSeek V4 GPU requirements guide, Kimi K3 GPU requirements guide, and Qwen VRAM requirements guide. And if the whole idea of inference (running a trained model to get a response) versus training is new, the packet.ai What Is LLM Inference guide covers the fundamentals this post builds on.

Open-Source, Open-Weight, and OpenAI-Compatible Aren't the Same Thing

An open-source LLM API, as the phrase gets used in practice, is a hosted endpoint that runs an open-weight model on the provider's own infrastructure and charges per token, the same commercial arrangement as OpenAI or Anthropic's APIs, but for a model whose weights you could also download and run yourself. Worth being precise about the three terms doing work in that sentence, since they're often used interchangeably and shouldn't be: "open-weight" describes the model (downloadable parameters, not necessarily a permissive license), "open-source" implies a genuinely open license (which, as the Kimi K3 section below shows, isn't always true even for a model with public weights), and "OpenAI-compatible" describes the API's interface, nothing about licensing at all. The "open" part describes the model, loosely; the API itself is a completely ordinary paid service sitting on top of it.

This distinction matters because it's easy to assume "open source" implies free, and the APIs themselves are not free in the way downloading the weights is. What you're actually paying for is the GPU infrastructure, uptime, and scaling that running these models at production quality requires, the exact same cost structure any inference provider faces. Getting started is the same everywhere: sign up, generate an llm api key, and point your existing OpenAI SDK at the provider's base URL. The advantage over a closed-model API isn't that it's free; it's that you have the option to self-host later without switching model families, and pricing tends to be dramatically lower since these providers compete aggressively against each other and against the incentive for anyone to just self-host instead.

DeepSeek API Pricing and Setup

DeepSeek's API is the cheapest serious option covered here, and it's the one people search for most by a wide margin. The current models are deepseek-v4-flash and deepseek-v4-pro; the older deepseek-chat and deepseek-reasoner names are legacy aliases. DeepSeek changed its pricing structure on August 16, 2026, moving to peak/off-peak billing; the rates below reflect that update, not the flat rate that was in effect before it.

Model Input (cache miss) Input (cache hit) Output
V4 Flash $0.22/M $0.007/M $0.66/M
V4 Pro $0.66/M $1.98/M

Off-peak rates, per million tokens, effective as of DeepSeek's August 16, 2026 pricing update. Peak-hour rates (01:00-04:00 and 06:00-10:00 UTC) run roughly double.

Prompt caching is automatic and disk-based; no configuration needed. A system prompt or repeated document context that's already been seen gets billed at the cache-hit rate instead of cache-miss, a roughly 97% discount on that portion of the input. New accounts get a 5-million-token free grant, no credit card required, valid for 30 days, effectively a deepseek api free tier for evaluating the model before committing budget. Among open llm options, this is one of the more generous trial allowances available today.

from openai import OpenAI

client = OpenAI(
    api_key="your-deepseek-key",
    base_url="https://api.deepseek.com/v1",
)

response = client.chat.completions.create(
    model="deepseek-v4-flash",
    messages=[{"role": "user", "content": "Explain the deploy step by step."}],
)

Kimi API Pricing, Setup, and the License

The Kimi API, run by Moonshot AI, costs more than DeepSeek but leads on long-context and agentic coding benchmarks. Kimi K3, its 2.8-trillion-parameter flagship, is the model most worth using specifically for its 1M-token context and native tool-use strength. Every moonshot api call goes through the same OpenAI-compatible endpoint regardless of which Kimi model you target.

Model Input Output
Kimi K3 $3.00/M $15.00/M

Per million tokens, api.moonshot.ai official rates. Cached input is billed separately at a substantial discount.

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

response = client.chat.completions.create(
    model="kimi-k3",
    messages=[{"role": "user", "content": "Review this pull request."}],
)

⚡ The Kimi K3 license, precisely

K3 ships under its own license, not a standard MIT or Apache 2.0 term (that "Modified MIT" label applies to Moonshot's smaller K2.6/K2.7 models, not K3). For internal use, most commercial products, and calling the hosted API, there's no special obligation. The one real gate: if you run K3 as a "Model as a Service" business, reselling inference to third parties, and your combined revenue with affiliates exceeds $20M over any 12 months, you need a separate agreement with Moonshot before continuing commercially. A display requirement kicks in separately above 100M monthly users or $20M in monthly revenue. Worth noting: Alibaba has signaled a similar revenue-share structure for its next flagship Qwen model, so this kind of threshold may become more common across open-weight releases, not just Moonshot's.

Qwen API Pricing and Setup

Alibaba's Qwen family spans a genuinely wide price range, from a nearly-free high-volume tier to a flagship competitive with DeepSeek's Pro tier.

Model Input Output
Qwen3.5 Flash $0.10/M $0.40/M
Qwen3.5 Plus $0.40/M $2.40/M
Qwen3.5 397B (flagship) $0.60/M $3.60/M

Per million tokens, Alibaba Cloud Model Studio, International mode.

client = OpenAI(
    api_key="your-alibaba-key",
    base_url="https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
)

response = client.chat.completions.create(
    model="qwen3.5-flash",
    messages=[{"role": "user", "content": "Summarize this document."}],
)

Comparing DeepSeek, Kimi K3, and Qwen

Best for Choice
Lowest cost overall DeepSeek V4 Flash
Highest volume, lowest stakes Qwen3.5 Flash
Long context, agentic coding Kimi K3
Cost-quality balance DeepSeek V4 Pro or Qwen3.5 Plus

All three speak the OpenAI API, so testing more than one against your actual workload before committing is genuinely low-cost: the same code, three base URLs, a real comparison on your own prompts rather than someone else's benchmark.

Other Open-Weight Options Worth Knowing

DeepSeek, Kimi, and Qwen aren't the only open-weight families with a hosted API. Meta's Llama API and the Mistral API both follow the same OpenAI-compatible pattern, and the Huggingface Inference API is worth knowing about specifically because it hosts a huge range of open-weight models, not just one vendor's family, behind a single interface. None of these currently undercut DeepSeek on raw price for a comparably capable model, which is why this guide leads with the three above, but they're worth checking if a specific model in one of those families fits your use case better.

If you're pricing out a workload seriously, treat this as an llm api pricing comparison exercise, not a single-provider decision: run the same prompts against two or three candidates before committing budget to one.

Self-Hosted vs Managed: When the API Stops Making Sense

The API route wins on simplicity for as long as your volume stays modest: no GPU provisioning, no serving infrastructure, billed per token with no fixed cost. That advantage shrinks as volume grows, since per-token pricing doesn't get cheaper with scale the way owned or rented GPU capacity does.

The practical crossover, based on typical reserved-GPU-capacity economics, lands around 2 to 5 million tokens a day, assuming reasonable GPU utilization once self-hosted. Below that, the API is almost always the better call; the engineering time alone to stand up and maintain self-hosted serving costs more than the token savings. Above it, particularly for a workload with predictable, sustained volume, self-hosting starts to win on pure cost, and it also removes any dependence on a specific provider's uptime or pricing changes, like the DeepSeek pricing update that took effect mid-August.

For the actual GPU sizing math on each model, the dedicated DeepSeek, Kimi K3, and Qwen guides cover exactly what hardware each one needs.

A Middle Path: Token Factory

Between calling a model's own API directly and self-hosting from scratch, packet.ai's Token Factory is building a managed, OpenAI-compatible inference API for open-weight models: per-token billing with input and output metered separately, no minimums, and scale-to-zero so idle traffic costs nothing. Launch pricing starts at $0.06 per million tokens.

Token Factory is currently in private preview. Join the waitlist for early access and launch-pricing credits once it opens.

Frequently asked questions

DeepSeek V4 Flash, at $0.22 per million input tokens and $0.66 per million output tokens, with cache hits dropping to $0.007/M. Qwen3.5 Flash is cheaper on raw rate ($0.10/$0.40) but is a smaller, less capable model. For a serious frontier-class model, DeepSeek V4 Flash is the lowest-cost option covered here.
Yes, all three. Each provides a base URL that accepts standard OpenAI SDK calls, so switching from OpenAI or between any of the three is typically a two-line change: the base_url and api_key. Tool calling, streaming, and JSON mode all carry over.
It's open-weight under a custom license, not a standard open-source license like MIT or Apache 2.0. Internal use and most commercial products carry no special obligation. The gate applies specifically to Model-as-a-Service businesses reselling inference that exceed $20M in combined revenue over 12 months, which need a separate agreement with Moonshot. Using the hosted API itself doesn't trigger any of this; it only matters if you're self-hosting and reselling access.
Roughly above 2 to 5 million tokens a day of sustained volume, assuming reasonable GPU utilization once self-hosted. Below that threshold, the API is almost always cheaper once engineering time is factored in. Above it, particularly for predictable, high-volume workloads, renting your own GPU tends to win on cost and removes dependence on any single provider's pricing changes.
No. "Open source" or "open-weight" describes the model, meaning the parameters are downloadable and self-hostable. The hosted API that runs that model on the provider's infrastructure is a separate, paid service billed per token, the same commercial structure as a closed-model API like OpenAI's. Most providers do offer a free tier or trial credit for testing.

Last reviewed: August 19, 2026. DeepSeek pricing reflects the August 16, 2026 rate update. For self-hosting each model instead, see the DeepSeek, Kimi K3, and Qwen GPU requirements guides.

Waste less compute.

Same models. Same API. Fraction of the cost. Start free — no credit card required.

Start Building →

More from the blog