DeepSeek Guide — whale logoDeepSeek GuideFAN SITE
API SETUP4 MIN READ

DeepSeek V4 Pro API Setup: Base URL, Model ID & First Call

UPDATED: AUG 16, 2026AUTHOR: INDEPENDENT FAN GUIDE
OVERVIEW

Call DeepSeek V4 Pro with model deepseek-v4-pro, base URL api.deepseek.com, reasoning_effort low/high/max. OpenAI + Anthropic formats and Codex setup.

01

The V4 Pro API in One Paragraph

The DeepSeek V4 Pro API is OpenAI-compatible: keep your existing DeepSeek API key, point at `https://api.deepseek.com` and set `model` to `deepseek-v4-pro`. That is the whole migration — the GA release on August 13 kept the model ID unchanged, so nothing breaks for existing callers[1][3].

  • Base URL: https://api.deepseek.com (OpenAI format)
  • Model ID: deepseek-v4-pro (unchanged since preview)
  • Auth: standard DeepSeek API key (Bearer)
  • Thinking: enabled by default, controllable via the thinking parameter
  • Reasoning effort: low / high / max, defaults to high
NOTE

Legacy model names deepseek-chat and deepseek-reasoner were retired on July 24, 2026 — if your code still uses them, update the model field[1].

02

First Call: OpenAI-Compatible Format

A minimal call using the official OpenAI SDK against the DeepSeek endpoint[3].

The API returns reasoning in `reasoning_content` and the final answer in `content`, mirroring how V4 Flash behaves. Everything you already built for Flash — streaming, JSON output, tool calls — works the same way against Pro[3].

Rate limits: V4 Pro allows 500 concurrent requests by default, versus 2,500 for Flash. If you plan bursty load, account for the lower ceiling[2].

example_code.py
from openai import OpenAI

client = OpenAI(
    api_key="<DeepSeek API Key>",
    base_url="https://api.deepseek.com",
)

response = client.chat.completions.create(
    model="deepseek-v4-pro",
    messages=[{"role": "user", "content": "Write a Python function that parses CSV with a quoted-field edge case."}],
    reasoning_effort="high",
)

print(response.choices[0].message.content)
03

Thinking Mode & Reasoning Effort

V4 Pro ships with thinking enabled by default, and the GA release added three explicit reasoning-effort levels: `low`, `high`, and `max`[1][4].

  • low: fast, shallow reasoning — simple tasks, high-volume chat
  • high: deep reasoning for complex problems — the default
  • max: maximum depth for the hardest problems — agentic and math workloads
  • FIM and chat prefix completion are only available in non-thinking mode
  • In thinking mode, temperature / top_p / presence_penalty / frequency_penalty are ignored
NOTE

The reasoning effort guide breaks down which level to pick for which workload, including the cost impact (reasoning tokens bill at output rates)[2].

example_code.py
# Explicit thinking + effort
response = client.chat.completions.create(
    model="deepseek-v4-pro",
    messages=[{"role": "user", "content": "Solve this competitive-programming problem."}],
    reasoning_effort="max",
    extra_body={"thinking": {"type": "enabled"}},
)
Sponsored
04

Anthropic-Compatible Endpoint

DeepSeek exposes an Anthropic-compatible endpoint at `https://api.deepseek.com/anthropic` so Claude Code and other Anthropic-SDK clients can point at V4 Pro without a proxy[1].

The Claude Code setup page walks through the full config, including the reasoning-effort block syntax. The same endpoint works for the rest of the V4 family — swap the model to `deepseek-v4-flash` for the cheaper tier.

example_code.py
# Anthropic-style call (Claude Code, etc.)
# base_url: https://api.deepseek.com/anthropic
# model:    deepseek-v4-pro
# reasoning block with effort set to none | low | high | max
05

Multi-Turn & Tool Calls: Gotchas

Two failure modes trip up most people moving from preview-era code to the GA build[3].

If you hit a 400 after enabling tools, the usual cause is the missing reasoning_content echo. Keep the assistant turn's reasoning field in your state and pass it back verbatim[3].

  • Multi-turn with tools: you must return `reasoning_content` from the previous turn in the next request, or the call fails with a 400 error
  • Thinking mode is default-on: non-thinking callers (FIM, prefix completion) must explicitly disable thinking
  • Reasoning tokens count as output tokens — a max-effort call can surprise you on cost
NOTE

All of these behaviors are shared with the rest of the V4 lineup; the Flash API guide documents the same conventions.

Sponsored
06

Codex & the Responses API

The GA build added native OpenAI Responses API support, and DeepSeek ships a one-click setup script for Codex clients[5].

  • The script writes ~/.codex/models.json with deepseek-v4-pro and deepseek-v4-flash metadata (1M context, reasoning levels low/high/max)
  • It adds a [model_providers.deepseek] block to ~/.codex/config.toml
  • All Codex clients (CLI, ChatGPT desktop, VS Code extension) share the same config — configure once
  • Rerun the script anytime to switch models or restore your previous config
NOTE

Before GA (Aug 6), Responses API worked only for Flash; the 0813 release enabled it for Pro[5]. See the Responses API guide for manual models.json/config.toml setup.

example_code.py
# One-click Codex setup (macOS / Linux)
bash <(curl -fsSL https://cdn.deepseek.com/api-docs/codex-deepseek-setup-en.sh)

# Windows PowerShell
irm https://cdn.deepseek.com/api-docs/codex-deepseek-setup-en.ps1 | iex
Sponsored
Sponsored