API 参考

OpenAI 兼容 API;使用公开目录中的模型 ID,通过同一 Base URL 调用。

逐次 USD 账单 · 公开模型定价 · Base URL: https://api.deepseekbridge.com/v1

对话补全端点支持 stream: true。流式响应与非流式响应均按实际结算结果记录在控制台账单明细中。

所有公开可售模型共用相同对话端点。要使用任意模型,将 model 参数替换为模型目录中的模型 ID。 模型.

快速开始

curl https://api.deepseekbridge.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"Hello!"}]}'

选择模型

调用方式完全一致,只需要把请求体里的 model 改成目标模型 ID。下面是新增主力国产模型的示例。

Qwen3.6

Qwen/Qwen3.6-35B-A3B
{
  "model": "Qwen/Qwen3.6-35B-A3B",
  "messages": [
    {"role": "user", "content": "Write a concise bilingual product launch email."}
  ]
}

GLM-5.1

Pro/zai-org/GLM-5.1
{
  "model": "Pro/zai-org/GLM-5.1",
  "messages": [
    {"role": "user", "content": "Review this API design and list the top risks."}
  ]
}

MiniMax M2.5

MiniMaxAI/MiniMax-M2.5
{
  "model": "MiniMaxAI/MiniMax-M2.5",
  "messages": [
    {"role": "user", "content": "Draft a vivid short story opening in Chinese."}
  ]
}

Kimi K2.5

Pro/moonshotai/Kimi-K2.5
{
  "model": "Pro/moonshotai/Kimi-K2.5",
  "messages": [
    {"role": "user", "content": "Summarize the following long document into decisions and action items."}
  ]
}

SDK 使用

Python

from openai import OpenAI

client = OpenAI(
    base_url="https://api.deepseekbridge.com/v1",
    api_key="YOUR_API_KEY"
)
response = client.chat.completions.create(
    model="deepseek-v4-flash",
    messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)

Node.js

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.deepseekbridge.com/v1",
  apiKey: "YOUR_API_KEY",
});
const response = await client.chat.completions.create({
  model: "deepseek-v4-flash",
  messages: [{ role: "user", content: "Hello!" }],
});

流式输出

设置 stream: true 即可实时 token 流式输出。

Python

stream = client.chat.completions.create(
    model="deepseek-v4-flash",
    messages=[{"role": "user", "content": "Tell me a story"}],
    stream=True,
)
for chunk in stream:
    print(chunk.choices[0].delta.content or "", end="")

Node.js

const stream = await client.chat.completions.create({
  model: "deepseek-v4-flash",
  messages: [{ role: "user", content: "Tell me a story" }],
  stream: true,
});
for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content || "");
}

思考模式(推理)

DeepSeek V4 模型支持思考模式用于复杂推理。通过 thinking 参数开启。

{
  "model": "deepseek-v4-flash",
  "messages": [{"role": "user", "content": "Prove that sqrt(2) is irrational"}],
  "thinking": {"type": "enabled"}
}

思考内容通过 reasoning_content 返回;工具调用场景的后续请求需按 DeepSeek 官方说明回传该字段。

公开计价规则

模型目录展示用户实际结算单价;控制台逐次展示输入/输出 Tokens 与已结算扣费金额。

分段定价、按图片/视频/字符计费以及无法单独结算缓存价的型号,暂不列入公开可售目录。

错误码

状态码含义
400请求错误 — 检查 JSON 和参数
401API Key 无效或缺失
402余额不足 — 充值通道审核期间请联系管理员
429请求过多或当前服务容量不足 — 请稍后重试
500服务器错误 — 如果持续出现请联系支持

可用模型 ID 与固定别名

下列名称可直接用作 model 参数;短别名固定映射到对应模型,不会自动切换模型。

model 参数模型
deepseek-v4-flashDeepSeek V4 Flash
deepseek-v4-proDeepSeek V4 Pro
deepseek-ai/DeepSeek-V3.2DeepSeek V3.2
glm-4GLM-4 32B
kimi-k2.6Kimi K2.6
Qwen/Qwen3.6-35B-A3BQwen3.6 35B A3B
Pro/zai-org/GLM-5.1GLM-5.1
MiniMaxAI/MiniMax-M2.5MiniMax M2.5
gpt-4oGPT-4o
gpt-4.1GPT-4.1
gpt-4o-miniGPT-4o Mini
claude-opusClaude Opus 4.7
claude-sonnetClaude Sonnet 4.6
claude-haikuClaude Haiku 4.5
gemini-proGemini 3.1 Pro

所有模型 (32)

在 API 调用中使用完整模型 ID。通过 GET /v1/models 查看可用模型(需 API key)。

gpt-4ogpt-4.1gpt-4o-miniclaude-opusclaude-sonnetclaude-haikugemini-progpt-5gpt-4.1-minigemini-2.5-progemini-2.5-flashgrok-4.3llama-4-scoutmistral-largedeepseek-v4-flashdeepseek-v4-prodeepseek-ai/DeepSeek-V3.2deepseek-ai/DeepSeek-R1Pro/moonshotai/Kimi-K2.6THUDM/GLM-4-32B-0414Pro/moonshotai/Kimi-K2.5Pro/zai-org/GLM-5.1Pro/zai-org/GLM-5Pro/zai-org/GLM-4.7MiniMaxAI/MiniMax-M2.5Qwen/Qwen3.6-35B-A3BQwen/Qwen3.6-27BQwen/Qwen3.5-122B-A10BQwen/Qwen3.5-27Bstepfun-ai/Step-3.5-FlashinclusionAI/Ling-flash-2.0tencent/Hunyuan-A13B-Instruct

端点

方法路径描述
POST/v1/chat/completions对话补全
GET/v1/models列出所有模型

认证

在 Authorization 请求头中包含你的 API Key。在控制台查看你的 Key。

Authorization: Bearer sk-xxxxxxxxxxxxxxxx

响应透明度

API 响应返回模型标识与 usage 数据;实际扣费和记录耗时请在控制台逐次账单中核对。

// Real response (abbreviated)

{
  "id": "chatcmpl-abc123",
  "object": "chat.completion",
  "model": "deepseek-v4-flash",        // model identifier returned by the API
  "created": 1716500000,
  "usage": {
    "prompt_tokens": 24,              // reported input tokens
    "completion_tokens": 156,         // reported output tokens
    "total_tokens": 180
  },
  "choices": [{
    "message": { "role": "assistant", "content": "..." },
    "finish_reason": "stop"
  }]
}
model

API 返回的模型标识,可与模型目录交叉核对。

usage

响应报告的输入与输出 token;实际扣费以控制台已结算明细为准。

Latency

控制台展示每次已结算调用记录的总耗时。

延迟与性能

控制台记录每次已结算调用的总耗时;在客户端使用 curl -w 可另行测量端到端时间。

// Measure end-to-end client time

curl -sS -o /dev/null -w 'total=%{time_total}s\n' https://api.deepseekbridge.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-v4-flash","messages":[{"role":"user","content":"Hi"}]}'
curl -w timing

用 curl -w 从客户端测量 DNS、TCP、TLS、TTFB 与总耗时,适合排查客户端到 API 的链路表现。

Dashboard

控制台定期刷新请求数、tokens、费用和逐次记录的总耗时,数据来自 API 账单日志。

Model choice

推理模型和大模型通常比轻量模型响应更慢;延迟还受提示长度及当前服务容量影响。

Billing record

控制台账单明细显示请求 ID、用量、已结算金额与记录耗时,便于逐次核对。

速率限制

请求过多时 API 会返回相应状态码;如需约定容量请联系我们。 Contact us.