DeepSeek V4.1-Flash API

Model ID: deepseek-v4.1-flash

A multimodal DeepSeek model for coding, image understanding, and tool-using agents, with a 1M-token context and optional thinking mode.

Off-peak pricing · Coding · Reasoning ·

Capabilities

Context window
1M tokens (official published limit)
Maximum output
384K tokens (official published limit)
Thinking modes
Thinking and non-thinking
  • Coding
  • Document analysis
  • Tool workflows
  • reasoning
  • streaming
  • function_calling
  • caching
  • vision
  • structured_output

API pricing

Model introduction

DeepSeek V4.1 Flash accepts text and images and returns text or JSON. Its long context and large output budget support connected coding and document workflows, while thinking controls and function calls help applications handle multi-step tasks.

Core strengths

Text and image context

Combine code, documents, and image evidence in a 1M-token context.

Flexible reasoning

Choose thinking or non-thinking behavior for the task.

Tools and reusable prompts

Use tool calls, JSON output, and automatic prefix caching in repeat workflows.

Use cases

Code generation, review, and debugging

Use source code and diagnostic evidence to propose and review changes.

Screenshot, chart, and scanned-document understanding

Reason about visual evidence together with the surrounding question.

Tool-using agents and structured data extraction

Return structured information and coordinate application-provided tools.

Specifications and limits

Input and output must fit the model context and the selected route limits. Visual inputs are used for understanding; this model generates text, not images or videos.

Getting started

Create a BulkToken API key

Sign in to BulkToken and open API Keys to create a key. Store it in the BULKTOKEN_API_KEY environment variable on your server.

Configure the API client

Use https://bulktoken.ai/v1 as the OpenAI SDK base URL and set model to deepseek-v4.1-flash. Authenticate with your BulkToken API key.

Send a request and inspect usage

Call POST /v1/chat/completions. Use stream: true for incremental output, then review the request and token usage in Usage Logs. Your key must have access to the selected model.

FAQ

Can it understand images?

Yes. V4.1 Flash supports native image input and produces text. It is not an image-generation model.

What are the context and output limits?

DeepSeek documents a 1M-token context and a maximum output of 384K tokens. Keep the combined request within the enabled route's limits.

Can I disable thinking?

The model supports thinking and non-thinking modes. The request setting depends on the BulkToken endpoint and adapter.

Does it support tools and JSON?

Yes. DeepSeek documents function calling and JSON output for this model.

Why do I see different model IDs?

DeepSeek's own API uses deepseek-flash. Some gateways use deepseek-v4.1-flash. Use the exact model ID shown in your BulkToken integration example.

Can I use the OpenAI SDK?

Yes. Set base_url to https://bulktoken.ai/v1, use your BulkToken API key, and select deepseek-v4.1-flash.

Does function calling run tools automatically?

No. Your application executes the requested tool and sends its result back with the matching tool-call ID. Model-generated tool calls are instructions for your application, not completed actions.

Code examples

See [the DeepSeek V4.1-Flash integration guide](/docs/deepseek-v4.1-flash) for Python, Node.js, and cURL examples. Install openai for the Python example.

Python

import os
from openai import OpenAI

client = OpenAI(api_key=os.environ["BULKTOKEN_API_KEY"], base_url="https://bulktoken.ai/v1")
stream = client.chat.completions.create(
    model="deepseek-v4.1-flash",
    messages=[{"role": "user", "content": "Explain a hash table in one sentence."}],
    stream=True,
)
for chunk in stream:
    if chunk.choices and chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

cURL

curl https://bulktoken.ai/v1/chat/completions \
  -H "Authorization: Bearer $BULKTOKEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "deepseek-v4.1-flash", "messages": [{"role": "user", "content": "Hello!"}], "stream": true}'