Skip to Content
ModelsDeepSeek

DeepSeek family

DeepSeek’s V4 series models, including V4.1 Flash, V4 Pro and V4 Flash. They are called through the OpenAI-compatible API and also support the Anthropic-native API, so they work directly in tools such as Claude Code.

Common tasks

Models

The V4 series has a 1M-token context and a maximum output of 384K tokens. V4.1 Flash accepts image input; the other models are text-only. For the full model list and live prices, see the model page .

Common model IDs (copy them exactly)
DeepSeek V4.1 Flashdeepseek/deepseek-v4.1-flashSupports image input
DeepSeek V4 Prodeepseek/deepseek-v4-pro-0813
DeepSeek V4 Flashdeepseek/deepseek-v4-flash-0731

Aliases and versions

AliasPoints toNotes
deepseek-v4-prodeepseek/deepseek-v4-pro-0813Always points to the latest V4 Pro version
deepseek-v4-flashdeepseek/deepseek-v4-flash-0731Always points to the latest V4 Flash version
deepseek-flashdeepseek/deepseek-v4.1-flash—
  • Use aliases without the deepseek/ prefix, e.g. "model": "deepseek-v4-pro"; deepseek/deepseek-v4-pro returns 404.
  • deepseek-chat and deepseek-reasoner from DeepSeek’s official API are not available on OfoxAI; use the model IDs in the table above instead.
  • The earlier versions deepseek/deepseek-v4-pro-0423 and deepseek/deepseek-v4-flash-0423 can still be called, but enable thinking differently from the newer versions — see Thinking mode.

Examples

deepseek_basic.py
import os from openai import OpenAI client = OpenAI(base_url="https://api.ofox.ai/v1", api_key=os.environ["OFOX_API_KEY"]) resp = client.chat.completions.create( model="deepseek/deepseek-v4-flash-0731", messages=[{"role": "user", "content": "Explain idempotency in one sentence."}], extra_body={"thinking": {"type": "disabled"}}, ) print(resp.choices[0].message.content)

Thinking mode

Key pointV4.1 Flash, V4 Pro and V4 Flash think by default, and complex questions can take more than 2 minutes. If you don’t need thinking, set the thinking type to disabled.
ModelDefaultTurn thinking offTurn thinking on
V4.1 Flash, V4 Pro (0813), V4 Flash (0731)On"thinking": {"type": "disabled"}On by default
V4 Pro (0423), V4 Flash (0423)OffOff by default"reasoning_effort": "high"

In our tests on the same math problem, V4 Pro thought for about 12,000 tokens by default and took about 2 minutes; with thinking off it took about 20 seconds. Thinking tokens are billed at the output rate; the count is in usage.completion_tokens_details.reasoning_tokens.

Reading the thinking content

deepseek_reasoning.py
import os from openai import OpenAI client = OpenAI(base_url="https://api.ofox.ai/v1", api_key=os.environ["OFOX_API_KEY"]) resp = client.chat.completions.create( model="deepseek/deepseek-v4-flash-0731", messages=[{"role": "user", "content": "What is 17 × 23?"}], ) msg = resp.choices[0].message details = getattr(msg, "reasoning_details", None) or [] print("[Thinking]", "".join(d.get("text", "") for d in details)) print("[Answer]", msg.content)
  • In non-streaming responses, thinking content is in message.reasoning_details; concatenate the text of each item in order.
  • In streaming responses, thinking content is in delta.reasoning_content, the same as DeepSeek’s official API.
  • In multi-turn conversations, you don’t need to send thinking content back in the message history.

Use in Claude Code

The DeepSeek V4 series supports the Anthropic-native API at https://api.ofox.ai/anthropic, so it works in Claude Code and other tools built on the Anthropic protocol:

Claude Code settings
ANTHROPIC_BASE_URLhttps://api.ofox.ai/anthropic
ANTHROPIC_AUTH_TOKENPaste your OfoxAI API key
ANTHROPIC_MODELdeepseek/deepseek-v4-pro-0813
Terminal
curl https://api.ofox.ai/anthropic/v1/messages \ -H "x-api-key: $OFOX_API_KEY" \ -H "anthropic-version: 2023-06-01" \ -H "Content-Type: application/json" \ -d '{ "model": "deepseek/deepseek-v4-flash-0731", "max_tokens": 4000, "thinking": {"type": "disabled"}, "messages": [{"role": "user", "content": "Explain idempotency in one sentence."}] }'
  • On the Anthropic API, thinking content is returned as thinking blocks, and "thinking": {"type": "disabled"} also turns thinking off.
  • Set a large enough max_tokens when thinking is on. If the budget runs out, the response may contain only a thinking block and no answer.

For full Claude Code setup steps, see Claude Code setup.

JSON output and tool calling

response_format supports {"type": "json_object"} and {"type": "json_schema", ...}; tool calling uses the standard tools parameter:

deepseek_json.py
import json import os from openai import OpenAI client = OpenAI(base_url="https://api.ofox.ai/v1", api_key=os.environ["OFOX_API_KEY"]) resp = client.chat.completions.create( model="deepseek/deepseek-v4-pro-0813", response_format={"type": "json_object"}, messages=[{"role": "user", "content": "Return price and currency as JSON: A bat and a ball cost $1.10 in total. The bat costs $1 more than the ball. How much does the ball cost?"}], extra_body={"thinking": {"type": "disabled"}}, ) print(json.loads(resp.choices[0].message.content))

When using json_object, state “return JSON” and the required fields in the prompt.

Prompt caching

DeepSeek automatically caches repeated request prefixes, with no changes to your request. The cached amount is in usage.prompt_tokens_details.cached_tokens, and the cached portion is billed at the cache read rate. Caching is best-effort; requests with the same prefix may still miss.

Providers

ModelProviders
V4.1 FlashDeepSeek official (deepseek), Volcano Engine (volcengine)
V4 Pro (0813), V4 Flash (0731)Volcano Engine (volcengine)
V4 Pro (0423), V4 Flash (0423)Azure AI Foundry (azure_foundry)

For how to select a provider, see Provider routing.

Common errors

Key pointSlow requests or empty answers are usually caused by thinking, which is on by default. Turn it off if you don’t need it.
HTTP · typeError messageCauseFix
404 model_not_foundModel 'deepseek/deepseek-v4-pro' not foundAn alias was used with the deepseek/ prefix, or the model ID is misspelledUse aliases without the prefix, or use the full model ID
404 model_not_foundModel 'deepseek-chat' not foundA model name from DeepSeek’s official API was usedUse deepseek-v4-flash or similar instead
200, empty answer or thinking content only—Thinking used up the output budgetIncrease max_tokens, or turn thinking off
Request timeout—Thinking is on by default, and complex questions take longerTurn thinking off, use streaming, or set the client timeout to 300 seconds or more

For other general errors, see Error Handling.

Official docs

The official docs describe behavior when calling DeepSeek directly. When calling through OfoxAI, model IDs and endpoints on this page take precedence.

FAQ

How do I write a DeepSeek model ID?

The full format is like deepseek/deepseek-v4-pro-0813. You can also use the aliases deepseek-v4-pro and deepseek-v4-flash (which always point to the latest version); aliases take no deepseek/ prefix.

Can I still use deepseek-chat and deepseek-reasoner?

They are not available on OfoxAI and return 404. Use deepseek-v4-flash or deepseek-v4-pro instead, and control thinking with the thinking parameter.

How do I turn off DeepSeek thinking?

Pass "thinking": {"type": "disabled"}; with the OpenAI SDK, put it in extra_body. V4.1 Flash, V4 Pro (0813) and V4 Flash (0731) think by default.

Why is DeepSeek V4 Pro so slow?

V4 Pro thinks by default, and on complex questions it may think for over 10,000 tokens and take more than 2 minutes. Turn thinking off when you do not need deep reasoning, or switch to V4 Flash.

Where is DeepSeek reasoning_content?

In streaming responses it is in delta.reasoning_content; in non-streaming responses it is in message.reasoning_details, where you concatenate the text of each item.

Can I use DeepSeek in Claude Code?

Yes. Set ANTHROPIC_BASE_URL to https://api.ofox.ai/anthropic and use a V4 series model ID such as deepseek/deepseek-v4-pro-0813.

Does DeepSeek support image input?

V4.1 Flash supports image input; the other DeepSeek models are text-only.

Last updated on