How do you connect the DeepSeek API and choose a model?

See which API protocol your tool needs, when to use V4 Flash or V4 Pro, and how to connect the Agent you already use.

These are third-party tools configured to call the DeepSeek API. They are not Agents built on DeepSeek Harness.

Looking for Harness-native Agents? View the DSH Agent directory.

How common Agents connect to DeepSeek

DeepSeek AI Agent for Codex

Codex uses OpenAI Responses, while DeepSeek currently documents Chat Completions and Anthropic Messages-compatible interfaces. A protocol bridge such as Moon Bridge, or a switching tool that performs the conversion, is therefore usually required.

DeepSeek Agent setup for Codex

DeepSeek AI Agent for Claude Code

Claude Code accepts custom provider settings. You can point it at DeepSeek with environment variables in settings.json, or use CC Switch if you prefer a visual setup.

Claude Code with DeepSeek API

DeepSeek AI Agent for OpenClaw

OpenClaw supports custom model providers during onboarding. The guide covers provider config, Skills, MCP and chat-platform integration with DeepSeek as the model backend.

OpenClaw DeepSeek API guide

What the DeepSeek API Supports Natively

Coding agents speak different wire protocols. DeepSeek natively mirrors two of them — OpenAI Chat Completions and Anthropic Messages. It does not expose OpenAI Responses, which is why tools like Codex need a bridge. Official DeepSeek docs list two base URLs. Point the matching SDK or agent at the right one, paste your DeepSeek API key, and pick deepseek-v4-pro or deepseek-v4-flash.

AspectOpenAI Chat CompletionsOpenAI ResponsesAnthropic Messages
EndpointPOST /v1/chat/completionsPOST /v1/responsesPOST /v1/messages
Main payloadmessages: [{role, content}]input (string or item list)messages + top-level system
AuthAuthorization: BearerAuthorization: Bearerx-api-key / ANTHROPIC_API_KEY
Content shapeMostly plain text stringsTyped items (message, function_call, reasoning…)Content blocks (type: text, …)
StateStateless — resend full historyDesigned for agent loops and richer itemsStateless — resend full history
Typical toolsopenai SDK, most OpenAI-compatible agentsCodex CLI (Responses-only)Claude Code, Copilot CLI (Anthropic mode)

OpenAI Chat Completions

Native yes

Drop-in for most OpenAI-compatible clients. Change base_url and api_key; keep calling /chat/completions.

https://api.deepseek.com

Anthropic Messages

Native yes

Same key, Anthropic-shaped path. Claude Code and similar tools switch by setting ANTHROPIC_BASE_URL.

https://api.deepseek.com/anthropic

OpenAI Responses

Not native

No official /v1/responses. Codex and other Responses-only clients need a local bridge such as Moon Bridge.

bridge required → /guides/codex

Using Codex with DeepSeek?

Codex speaks OpenAI Responses. DeepSeek speaks Chat Completions and Anthropic Messages. Moon Bridge sits in the middle: Codex → Responses → Moon Bridge → DeepSeek.

Codex + Moon Bridge guide

V4 Flash or V4 Pro: which one should you use?

The API setup is the same. Choose mainly by task difficulty, response speed, and how much a long run can cost.

DeepSeek V4 Flash

Use it by default
deepseek-v4-flash

Fast and cost-efficient for everyday requests and frequent Agent calls.

  • Quick questions, summaries, extraction, and batch processing
  • Everyday code changes, single-file work, and short Agent runs
  • Workloads where latency, throughput, and cost matter most

Start with Flash. Move to Pro when the task keeps branching, spans a large codebase, or repeatedly fails on hard constraints.

Read the full model guide

DeepSeek V4 Pro

Use it for harder work
deepseek-v4-pro

The stronger choice for deep reasoning, full-repository coding, and long tool-driven tasks.

  • Cross-file refactors, architecture changes, and repository-wide debugging
  • Hard reasoning with multiple constraints or ambiguous evidence
  • Long Agent runs that must plan, use tools, verify, and recover

Use Pro when completion quality matters more than speed and cost. Routine steps can still stay on Flash.

Read the full model guide

Find your Agent

Open a guide for the exact endpoint, environment variables or config file, model name, and common fixes.

  • AstrBot

    Open-source agent assistant for Feishu, Telegram and more, extensible with skills, plugins, and MCPs.

    View setup guide
  • Claude Code

    AI coding assistant that runs in the terminal.

    View setup guide
  • Cline

    AI coding assistant extension for VS Code supporting multiple API providers.

    View setup guide
  • Codex

    OpenAI's coding agent.

    View setup guide
  • Crush

    Glamorous open-source AI coding agent for the terminal with multi-model support and LSP integration.

    View setup guide
  • Deep Code

    Open-source terminal AI coding assistant for DeepSeek-V4 with deep thinking, reasoning effort control, and Agent Skills.

    View setup guide
  • DeepSeek-TUI

    Open-source Rust terminal coding assistant for DeepSeek-V4 — Codex-style architecture, sandboxed tools, MCP client + server, 1M context.

    View setup guide
  • GitHub Copilot

    AI peer programmer built into VS Code.

    View setup guide
  • GitHub Copilot CLI

    Terminal-native AI coding assistant with agentic capabilities.

    View setup guide
  • Hermes

    Open-source self-improving AI agent built by Nous Research.

    View setup guide
  • Kilo Code

    AI coding assistant available as a CLI and editor extension.

    View setup guide
  • Langcli

    Open-source AI coding assistant 100% compatible with Claude Code, supporting mainstream LLM models.

    View setup guide
  • LobeHub

    Chief Agent Operator — hire, schedule, and report on your entire AI team, 24/7.

    View setup guide
  • nanobot

    Open-source lightweight AI agent with chat platform integration, memory, MCP, and more.

    View setup guide
  • Oh My Pi

    Terminal AI coding agent forked from Pi with OMP-specific tools, model roles, MCP, plugins, and agent workflows.

    View setup guide
  • OpenClaw

    Open-source personal AI assistant that plugs into chat tools (Feishu, WeChat) and is extensible via Skills.

    View setup guide
  • OpenCode

    Open-source AI coding assistant available in terminal, web, and other forms.

    View setup guide
  • Pi

    Minimal, extensible terminal coding harness with tree-structured sessions and custom providers.

    View setup guide
  • Qwen Code

    Coding agent CLI by the Alibaba Qwen team — now with built-in DeepSeek provider support.

    View setup guide
  • Reasonix

    DeepSeek-native coding agent that runs in the terminal — cache-first loop, MCP-native.

    View setup guide
  • WorkBuddy / CodeBuddy

    AI agent and coding assistant with custom OpenAI-compatible model configuration.

    View setup guide

DeepSeek AI Agent vs ChatGPT, Claude and Gemini

ChatGPT, Claude and Gemini are strong general-purpose assistants. A DeepSeek AI agent is a different idea: you keep a coding-agent shell (Codex, Claude Code, OpenClaw, etc.) and use the DeepSeek API as the model backend. That matters when you want agent workflows — not just chat — at lower API cost.

PlatformAgent supportAPI for coding agentsTypical cost
DeepSeek AI AgentWorks with Codex, Claude Code, OpenClaw + 20 agentsOpenAI Chat Completions-compatible DeepSeek APIFree credits / low API pricing
ChatGPT / Codex (default)Codex, Copilot CLI (OpenAI models only)OpenAI API — usage-basedSubscription + API fees
Claude (default)Claude Code (Anthropic models only)Anthropic API — usage-basedPro plan + API fees
Gemini (default)Limited agent toolingGoogle AI APIFree tier + paid tiers

Common setup questions

The short answers before you start changing API settings.

What API protocols does DeepSeek support natively?

+
DeepSeek natively supports OpenAI Chat Completions at https://api.deepseek.com and Anthropic Messages at https://api.deepseek.com/anthropic. It does not natively expose the OpenAI Responses API (/v1/responses). Tools that only speak Responses — such as Codex CLI — need a bridge like Moon Bridge.

Does DeepSeek support the OpenAI Responses API?

+
No. DeepSeek does not ship an official /v1/responses endpoint. Use Chat Completions or Anthropic Messages directly. For Codex and other Responses-only clients, run a local protocol bridge (for example Moon Bridge) that translates Responses requests into a protocol DeepSeek understands.

Can Codex use the DeepSeek API?

+
In practice, many Codex setups route requests through an OpenAI-compatible forwarding layer or switching tool rather than a single official toggle. If your Codex stack supports custom OpenAI-compatible endpoints, our Codex guide covers Moon Bridge, CC Switch and manual config paths.

Can Claude Code use the DeepSeek API?

+
Yes, when configured with the right environment variables and base URL in Claude Code settings, or through CC Switch for a GUI-based setup. See our Claude Code guide for the exact fields and common troubleshooting steps.

Is DeepSeek good for AI coding agents?

+
Many developers use DeepSeek for coding agents because its API is compatible with OpenAI Chat Completions, pricing is relatively low, and its models are strong on code and reasoning tasks. That compatibility does not include OpenAI Responses. Results still depend on the agent tool, protocol, prompt, and task — try a small real task first.

Should I use DeepSeek V4 Flash or V4 Pro?

+
Start with V4 Flash for everyday coding, summaries, batch work, and short Agent runs. Use V4 Pro for full-repository changes, hard reasoning, and long multi-step jobs where a failed run costs more than the extra model usage.

Official DeepSeek resources

Create a key on the official platform and check the API documentation for current models and parameters.