Skip to content

DeepSeek V4.1 Flash

Mixture-of-experts model; 8,192-token context for prompt, reasoning and answer together, one request at a time.

deepseek-v4.1-flash

Capabilities

Context length
8,192 tokens: the prompt, the reasoning and the answer together
Parallel requests
1 per account (max_parallel)
Thinking
On by default; off with chat_template_kwargs.enable_thinking: false
Tools and JSON output
tools, tool_choice and response_format are passed to the model unchanged
Input and output
Text only

Request

The example streams the reply. A non-streamed request that sends no response byte for 100 s ends with 524, a gateway timeout. A streamed request for a model that is not loaded waits for the load and receives : loading comments meanwhile (Streaming).

curl

curl -N https://api.albastov.com/v1/chat/completions \
  -H "Authorization: Bearer $ALBASTAR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-v4.1-flash",
    "stream": true,
    "max_tokens": 1000,
    "messages": [
      {"role": "user",
       "content": "How does a process differ from a thread? Three sentences."}
    ]
  }'

Python

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.albastov.com/v1",
    api_key=os.environ["ALBASTAR_API_KEY"],
)
stream = client.chat.completions.create(
    model="deepseek-v4.1-flash",
    stream=True,
    max_tokens=1000,
    messages=[{
        "role": "user",
        "content": "How does a process differ from a thread? Three sentences.",
    }],
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)
print()

JavaScript

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.albastov.com/v1",
  apiKey: process.env.ALBASTAR_API_KEY,
});
const stream = await client.chat.completions.create({
  model: "deepseek-v4.1-flash",
  stream: true,
  max_tokens: 1000,
  messages: [{
    role: "user",
    content: "How does a process differ from a thread? Three sentences.",
  }],
});
for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? "");
}

Every parameter, response header and error: Chat completions reference.