DeepSeek V4 Pro
DeepSeek V4 Pro
Tutorial

DeepSeek Responses API: How to Call It vs Chat

✍️ DeepSeek V4 Pro Team 📅 Sep 9, 2026 ⏱️ 8 min read 🔄 Updated Sep 9, 2026
DeepSeek Responses API: How to Call It vs Chat
📑 Table of Contents

Introduction

Search DeepSeek Responses API, and many people merge it with “Codex setup” or “a drop-in Chat Completions swap.” They are three different paths.

On the same base_url (https://api.deepseek.com), DeepSeek API natively supports the OpenAI-style Responses format: call client.responses.create, send instructions + input, and read a typed output item list. This site is an independent community; treat the official Using the Responses API guide as the compatibility source of truth. Below is how to call it from your own code, streaming differences, and when to keep Chat Completions / Codex — not another one-click script walkthrough.

DeepSeek Responses API: client.responses.create call overview
DeepSeek Responses API: client.responses.create call overview

I. What DeepSeek Responses API Is — vs Codex and Chat

PathWhat you are doingTypical entry
Chat CompletionsYour service / SDK with a messages arrayclient.chat.completions.create
Responses APIYour service / SDK with instructions + inputclient.responses.create
Codex clientsCLI / desktop / VS Code via wire_api=responsesSee DeepSeek Codex setup

In one line: Responses is the protocol surface; Codex is a client that consumes it; Chat Completions remains the broadest compatibility default. DeepSeek added Responses for Codex first; current docs list deepseek-v4-flash / deepseek-v4-pro / deepseek-v4-flash-vision-exp. Thinking controls differ: Chat uses thinking + reasoning_effort; Responses uses reasoning.effort (none turns it off) — see DeepSeek thinking mode.

II. Minimal Call: Change the Method, Not the base_url

from openai import OpenAI

client = OpenAI(
    api_key="YOUR_KEY",
    base_url="https://api.deepseek.com",
)

response = client.responses.create(
    model="deepseek-v4-flash",
    instructions="You are a helpful assistant.",
    input="Hi, how are you?",
)

print(response.output_text)

Essentials:

  1. Pass at least one of input or instructions. instructions is inserted as the first system message.
  2. Use output_text for the final answer shortcut; walk output items when you need reasoning / tool rows (thinking mode often emits reasoning then message).
  3. Keys still come from the official platform; overview: DeepSeek API.

III. Streaming: No data: [DONE] — Listen for Event Names

With stream=True, you get a semantic SSE event sequence (event + rising sequence_number), ending on response.completed / incomplete / failed — not the Chat Completions data: [DONE] trailer.

stream = client.responses.create(
    model="deepseek-v4-flash",
    instructions="You are a helpful assistant.",
    input="Hi, how are you?",
    stream=True,
)

for event in stream:
    if event.type == "response.output_text.delta":
        print(event.delta, end="")

Practice: drive the typewriter UI from response.output_text.delta; wait for response.completed for the full object including usage. Reasoning deltas: response.reasoning_text.delta. Full event table: official guide.

IV. Stateless Traps: Do Not Rely on previous_response_id

DeepSeek’s Responses implementation is stateless:

Habit from OpenAI ResponsesOn DeepSeek
previous_response_id continuationUnsupported; always null
store / conversationUnsupported; store is always false
Server remembers the last turnNo — put history into this request’s input
Unsupported parametersOften silently ignored (no error) — HTTP 200 ≠ every field applied

So multi-turn is a client job: resend the full input item list. Oversized input returns 400 (no auto-truncation). Cache still follows automatic prefix rules: context caching; rate limits: 429 guide.

DeepSeek Responses API vs Chat Completions: stateless and streaming differences
DeepSeek Responses API vs Chat Completions: stateless and streaming differences

V. When to Use Responses vs Stay on Chat

ScenarioPick
Existing chat.completions stack; stability firstKeep Chat Completions
Codex, or an Agent loop already written for ResponsesResponses (Codex wiring: Codex setup)
Need typed output items (reasoning / function_call / web_search_call)Responses fits better
Only swapping base_url for OpenAI-compatible chatChat Completions is the shortest path
Image inputResponses: input_image + deepseek-v4-flash-vision-exp; same limits as Chat vision

Tools: function and server-side web_search work; apply_patch is the Codex-compatible custom name. Other built-in tool types are often ignored. Trust the official compatibility table — do not assume 1:1 with OpenAI cloud.

VI. FAQ

Do I need a new SDK?
Usually no. Official OpenAI Python / Node SDKs work after you change base_url and the key, then call responses.create.

Is this the same as the Anthropic-compatible endpoint?
No. Anthropic-compatible traffic uses https://api.deepseek.com/anthropic; Responses stays on the OpenAI-compatible base_url. Do not mix field shapes.

How do I turn thinking off?
Responses: reasoning.effort = "none". Do not paste Chat’s extra_body.thinking shape.

Can production use Responses as the only entry?
Yes, if you accept statelessness and silent ignores. Cover streaming end events, client-held history, and tool round-trip shapes with integration tests.

Summary

Shortest DeepSeek Responses API path: same base_url → client.responses.create → stream by event name (no DONE) → resend input yourself for multi-turn. Use Codex client config for Codex; keep Chat Completions for the broadest everyday compatibility. Official docs own the matrix; this page is a chooser and foot-gun list.

Further reading

Share this article:
D

DeepSeek V4 Pro Team

DeepSeek V4 Pro technical team

✨

Ready to experience DeepSeek V4?

Start chatting now and feel the power of 1M-token context.

🚀 Start Chatting

Free · No sign-up required

🧭 In this series

Explore related guides and hub pages in this topic cluster.

Category hub

Tutorial →

Related resources

📚 Recommended Reading