DeepSeek V4 Pro API examples with APIDot: cURL, Node.js, request fields, responses, and production notes.
Try on APIDot | Get API Key | API Docs | Pricing | Main Examples
DeepSeek V4 Pro API for 1M-token long-context text chat, Pro-grade deep reasoning, complex coding, agentic planning, research synthesis, and OpenAI-compatible chat completions.
This repository turns that APIDot workflow into runnable server-side examples: a cURL request, a native Node.js example, request fields, response handling notes, and production integration guardrails.
DeepSeek V4 Pro is the high-depth Pro-tier model in the DeepSeek V4 text series. It is built for million-token reasoning, complex coding, full-codebase analysis, dense document review, and long-horizon planning where the task needs more depth than the Flash variant.
Choose DeepSeek V4 Pro for difficult reasoning, multi-file debugging, research synthesis, legal or financial review, and workflows where answer quality matters more than the lowest token cost. DeepSeek V4 Flash remains the better default for high-volume long-context traffic that does not need Pro-level depth.
On APIDot, use model ID deepseek-v4-pro through the existing OpenAI-compatible POST /v1/chat/completions path with Bearer authentication. The page supports streaming responses, usage fields for prompt and completion tokens, and separate APIDot input/output token pricing.
POST /v1/chat/completions
Send OpenAI-compatible chat completions requests to DeepSeek V4 Pro through APIDot.
- Use
deepseek-v4-profor 1M-token long-context text chat, complex code review, research synthesis, and long-horizon agent planning. - Keep reasoning-mode choices in your system prompt or user prompt. APIDot does not add a dedicated
thinking_modefield for this model. - Read assistant text from
data.choices[0].message.contentwhen the response is wrapped by APIDot, orchoices[0].message.contentfor raw OpenAI-compatible responses. - Read input and output usage from
usage.prompt_tokensandusage.completion_tokensso billing can be checked separately. - Set
stream: trueonly when your client is prepared to consume server-sent chat completion chunks.
cp .env.example .env
# Edit .env and set APIDOT_API_KEY
cd node
npm startUse curl/generate.md when you want a copy-paste cURL request instead of Node.js.
Submit to APIDot:
curl --fail-with-body --request POST \
--url https://api.apidot.ai/v1/chat/completions \
--header "Authorization: Bearer $APIDOT_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "deepseek-v4-pro",
"messages": [
{
"role": "system",
"content": "You are a concise technical assistant."
},
{
"role": "user",
"content": "Summarize the migration risks in five bullets."
}
],
"max_tokens": 512
}'Primary payload:
{
"model": "deepseek-v4-pro",
"messages": [
{
"role": "system",
"content": "You are a concise technical assistant."
},
{
"role": "user",
"content": "Summarize the migration risks in five bullets."
}
],
"max_tokens": 512
}{
"model": "deepseek-v4-pro",
"messages": [
{
"role": "system",
"content": "You are a concise technical assistant."
},
{
"role": "user",
"content": "Summarize the migration risks in five bullets."
}
],
"max_tokens": 512
}| Field | Type | Required | Description |
|---|---|---|---|
| model | string | yes | Target model ID. Use deepseek-v4-pro. |
| messages | object[] | yes | Conversation array in OpenAI-compatible chat format. |
| messages[].role | string | yes | Message role. Use system, user, or assistant. |
| messages[].content | string | yes | Text content for the message. |
| temperature | number | no | Sampling temperature from 0 to 2 when you choose to override defaults. |
| top_p | number | no | Nucleus sampling value from 0 to 1. |
| max_tokens | integer | no | Maximum output tokens to return. |
| stream | boolean | no | Set true to receive streaming chat completion chunks. |
| Field | Type | Description |
|---|---|---|
| code | integer | APIDot status code when the response is wrapped. Successful calls return 200. |
| data.id | string | Chat completion response ID. |
| data.choices[].message.content | string | Generated assistant text. |
| data.usage.prompt_tokens | integer | Input token count billed at the DeepSeek V4 Pro input rate. |
| data.usage.completion_tokens | integer | Output token count billed at the DeepSeek V4 Pro output rate. |
| data.usage.total_tokens | integer | Total token count across input and output. |
{
"code": 200,
"data": {
"id": "chatcmpl_1234567890",
"object": "chat.completion",
"model": "deepseek-v4-pro",
"choices": [{"index": 0, "message": {"role": "assistant", "content": "The key risks are..."}, "finish_reason": "stop"}],
"usage": {"prompt_tokens": 64, "completion_tokens": 96, "total_tokens": 160}
}
}| Code | Name | Description |
|---|---|---|
| 400 | invalid_request_error | The request body is missing required chat fields or includes invalid values. |
| 401 | authentication_error | Missing, expired, or invalid Bearer API key. |
| 402 | insufficient_credits | The account does not have enough credits for the requested token usage. |
| 404 | model_not_found | The selected public model ID is not mapped in the backend vendor feature configuration. |
| 500 | service_error | The model request failed or timed out. |
- Keep APIDot API keys in server-side environment variables.
- Persist selected model, request payload, user ID, and response metadata together for support and cost review.
- Avoid logging API keys, private prompts, customer data, private media URLs, or internal callback URLs.
- Validate request fields before sending traffic to APIDot.
- Retry transient network failures with backoff, but do not retry unchanged invalid payloads.
- Committing a real API key or
.envfile. - Calling APIDot directly from browser code instead of a server-side environment.
- Logging private prompts, customer data, API keys, or internal callback URLs.
- Reusing request fields from another model without checking this model's docs.
Send deepseek-v4-pro in the model field.
Use Authorization: Bearer $APIDOT_API_KEY when calling /v1/chat/completions.
Yes. It accepts the standard chat completions payload shape for text chat.
Yes. Set stream: true to receive streaming chat completion chunks.
- Website: https://apidot.ai
- Docs: https://apidot.ai/docs
- DeepSeek V4 Pro docs: https://apidot.ai/docs/deepseek-v4-pro
- DeepSeek V4 Pro model page: https://apidot.ai/models/deepseek-v4-pro
- GitHub organization: https://github.com/APIDotAI
- Main examples: https://github.com/APIDotAI/apidot-examples