Models › DeepSeek V4.1-Flash API

DeepSeek V4.1-Flash API

Updated 2026-10-20

DeepSeek V4.1-Flash is DeepSeek's open-weight Mixture-of-Experts model: about 763B total parameters with 6 of 384 experts active per token, a 1M-token context window, and MIT-licensed weights. It is fast and inexpensive for its size, which makes it a common default for agents, coding assistants, RAG and high-volume batch jobs.

On OneFast API it is available as deepseek-v4.1-flash behind the same API key as Claude, GPT, Gemini and 150+ other models.

Pricing

UsagePrice (USD per 1M tokens)
Input$0.1471
Input — cache hit$0.0029
Output$0.5882

Billing is pay-as-you-go in USD, per 1M tokens. Repeated prompt prefixes are cached automatically and billed at the cache-hit price — no parameters needed. Failed requests are not billed. The price shown is the public list price; after signing in, the console shows the price for your own groups.

Model at a glance

Model ID deepseek-v4.1-flash
Developer DeepSeek
Weights Open (MIT) — deepseek-ai/DeepSeek-V4.1-Flash-1017
Architecture MoE, ~763B total parameters, 6 of 384 experts active per token
Context window (model spec) 1M tokens
Endpoints /v1/chat/completions, /v1/responses, /v1/messages
Prompt caching Automatic
Structured output response_format: {"type": "json_object"}

Quickstart

Create an API key in the console, then point any OpenAI SDK at https://api.onefast.ai/v1.

cURL

curl https://api.onefast.ai/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4.1-flash",
    "messages": [{"role": "user", "content": "Write a haiku about fast inference."}]
  }'

Python

# pip install openai
import os
from openai import OpenAI

client = OpenAI(api_key=os.environ["API_KEY"], base_url="https://api.onefast.ai/v1")
resp = client.chat.completions.create(
    model="deepseek-v4.1-flash",
    messages=[{"role": "user", "content": "Write a haiku about fast inference."}],
)
print(resp.choices[0].message.content)

Node.js

// npm install openai
import OpenAI from "openai";

const client = new OpenAI({ apiKey: process.env.API_KEY, baseURL: "https://api.onefast.ai/v1" });
const resp = await client.chat.completions.create({
  model: "deepseek-v4.1-flash",
  messages: [{ role: "user", content: "Write a haiku about fast inference." }],
});
console.log(resp.choices[0].message.content);

JSON output

Ask for a JSON object and describe the shape in the prompt:

Python

resp = client.chat.completions.create(
    model="deepseek-v4.1-flash",
    response_format={"type": "json_object"},
    messages=[
        {"role": "system", "content": "Reply with JSON: {\"sentiment\": \"positive|negative|neutral\", \"score\": 0-1}"},
        {"role": "user", "content": "The latency dropped by half after we switched."},
    ],
)

Using it from Claude Code and other Anthropic-format tools

deepseek-v4.1-flash also works on the Anthropic Messages endpoint (https://api.onefast.ai/v1/messages); the gateway converts the format. See Claude Code setup and Claude Messages.

Differences from the official DeepSeek API

  • Same model ID style, OpenAI-compatible request format. Existing DeepSeek or OpenAI SDK code works by changing base_url and the API key.
  • One key for every model. Switch to Claude, GPT, Gemini, Kimi or GLM by changing model only.
  • Automatic failover. Requests are routed across multiple providers and retried on a healthy route when one fails.
  • USD billing with itemized logs per request in the console.

Self-hosting instead?

DeepSeek open-sourced its inference engine, DeepInfer, which serves this model. It requires B200/B300 or Ascend 950 GPUs and a 64 + 64 GPU unit to run efficiently, and ships without an HTTP server or KV cache. Read DeepInfer explained to estimate whether self-hosting makes sense for your volume.

FAQ

Is this the full V4.1-Flash model? deepseek-v4.1-flash is the DeepSeek V4.1-Flash model as named by DeepSeek. Model behavior, context limits and pricing are listed on this page; contact support through a ticket if you need details for a specific deployment.

How is caching billed? Cache hits are billed at the cache-hit price shown above. Hits appear in the usage field of each response and in your console logs.

Can I try it before topping up? Trial credits are available on request — open a ticket with a few lines about your use case.