大模型网摘deepseek.wang

API · 2026-11-04

DeepSeek's Anthropic-Compatible Endpoint: Wiring Up Claude Code and the Anthropic SDK

DeepSeek's API grew up speaking the OpenAI format, but the official Quick Start docs now list two base URLs side by side: the OpenAI-format endpoint at https://api.deepseek.com and an Anthropic-format endpoint at https://api.deepseek.com/anthropic. In other words, SDKs and tools that speak the "Anthropic dialect" can now call deepseek-flash and deepseek-v4-pro by swapping one URL — no adapter code required. Here is how the endpoint works, where it fits, and what to watch out for.

Two base URLs, two model names

Per the official docs, the two on-sale model names are deepseek-flash (served by DeepSeek-V4.1-Flash-1017) and deepseek-v4-pro (DeepSeek-V4-Pro-0813), both callable in either API format. The flash tier offers a 1M-token context window, up to 384K output tokens, and image input; v4-pro matches the 1M context but does not support vision. In the Models & Pricing feature table, the "Anthropic API" column is checked for both models, listed alongside Responses API, Tool Calls and JSON Output as baseline capabilities.

Model naming is also worth a note: the legacy names deepseek-v4-flash and deepseek-v4-flash-vision-exp are still accepted, but those models have been retired — requests are served by DeepSeek-V4.1-Flash-1017 and billed at flash prices. Old scripts keep running through the version transition, which removes one migration headache.

Why an Anthropic endpoint: the tooling reality

The answer sits in the docs' new Agent Integrations section: Claude Code, Codex, OpenCode, OpenClaw, Hermes, Reasonix, WorkBuddy/CodeBuddy and Qoder are all listed, and the official wording is that if you use tools like Claude Code, GitHub Copilot or OpenCode, you can point them at DeepSeek as the backend model directly — no code needed. DeepSeek's own agent harness, DeepSeek Harness, is in developer preview for harness developers worldwide (see our earlier coverage of the dsh-superagent open-source release).

The logic is straightforward: Anthropic's message format has become one of the de facto interfaces for coding agents. By adopting the dialect itself, DeepSeek plugs into an existing tool ecosystem instead of waiting for each vendor to add support for yet another third-party format.

What the minimal setup looks like

With the Anthropic Python SDK, the only change is the base_url on the client:

from anthropic import Anthropic
import os

client = Anthropic(
    base_url="https://api.deepseek.com/anthropic",
    api_key=os.environ["DEEPSEEK_API_KEY"],
)

Terminal tools like Claude Code follow the same idea: point the Anthropic endpoint setting at DeepSeek's URL, supply your DeepSeek API key (typically via an environment variable such as ANTHROPIC_BASE_URL), and set the model name to deepseek-flash or deepseek-v4-pro. Exact field names vary by tool — defer to the official Agent Integrations guide rather than any second-hand config. New to the platform? Start with API key setup; if you prefer the OpenAI SDK, see the OpenAI compatibility notes.

Same dialect switch, same price list

The Anthropic endpoint bills against the same price table as the OpenAI one. For deepseek-flash: input is $0.15 per 1M tokens off-peak on a cache miss ($0.30 at peak), output is $0.60 off-peak ($1.20 at peak), and cache-hit input drops to $0.003. Peak hours are defined officially as 01:00–04:00 and 06:00–10:00 UTC, Monday through Friday, excluding Chinese public holidays; all other hours are off-peak. deepseek-v4-pro runs $0.66 in / $1.98 out (off-peak). The 1M context window is available in either format.

Who it fits, and what to check

Two audiences benefit most: developers already using Claude Code or OpenCode who want a low-cost trial of a Chinese frontier model — two config lines and you can compare; and teams standardizing on one agent framework — the same tool configuration can be flipped between backend models for side-by-side evaluation. One caveat: the docs do not itemize, as of publication, how fully Anthropic-specific features (such as certain server-side tools) are covered on this endpoint, so run a regression pass on your own workloads before a production switch. For more billing detail, continue with model names, pricing and limits.