|
| 1 | +# DeepSeek V4 Pro |
| 2 | + |
| 3 | +{% columns %} |
| 4 | +{% column width="66.66666666666666%" %} |
| 5 | +{% hint style="info" %} |
| 6 | +This documentation is valid for the following list of our models: |
| 7 | + |
| 8 | +* `deepseek/deepseek-v4-pro` |
| 9 | +{% endhint %} |
| 10 | +{% endcolumn %} |
| 11 | + |
| 12 | +{% column width="33.33333333333334%" %} |
| 13 | +<a href="https://aimlapi.com/app/deepseek/deepseek-v4-pro" class="button primary">Try in Playground</a> |
| 14 | +{% endcolumn %} |
| 15 | +{% endcolumns %} |
| 16 | + |
| 17 | +## Model Overview |
| 18 | + |
| 19 | +A high-performance reasoning model as of late April 2026, designed for complex tasks, coding, and logic-heavy workflows. It supports up to 1M context length and includes an advanced thinking mode for deeper analysis. |
| 20 | + |
| 21 | +{% hint style="success" %} |
| 22 | +[Create AI/ML API Key](https://aimlapi.com/app/keys) |
| 23 | +{% endhint %} |
| 24 | + |
| 25 | +<details> |
| 26 | + |
| 27 | +<summary>How to make the first API call</summary> |
| 28 | + |
| 29 | +**1️⃣ Required setup (don’t skip this)**\ |
| 30 | +▪ **Create an account:** Sign up on the AI/ML API website (if you don’t have one yet).\ |
| 31 | +▪ **Generate an API key:** In your account dashboard, create an API key and make sure it’s **enabled** in the UI. |
| 32 | + |
| 33 | +**2️ Copy the code example**\ |
| 34 | +At the bottom of this page, pick the snippet for your preferred programming language (Python / Node.js) and copy it into your project. |
| 35 | + |
| 36 | +**3️ Update the snippet for your use case**\ |
| 37 | +▪ **Insert your API key:** replace `<YOUR_AIMLAPI_KEY>` with your real AI/ML API key.\ |
| 38 | +▪ **Select a model:** set the `model` field to the model you want to call.\ |
| 39 | +▪ **Provide input:** fill in the request input field(s) shown in the example (for example, `messages` for chat/LLM models, or other inputs for image/video/audio models). |
| 40 | + |
| 41 | +**4️ (Optional) Tune the request**\ |
| 42 | +Depending on the model type, you can add optional parameters to control the output (e.g., generation settings, quality, length, etc.). See the API schema below for the full list. |
| 43 | + |
| 44 | +**5️ Run your code**\ |
| 45 | +Run the updated code in your development environment. Response time depends on the model and request size, but simple requests typically return quickly. |
| 46 | + |
| 47 | +{% hint style="success" %} |
| 48 | +If you need a more detailed walkthrough for setting up your development environment and making a request step by step — feel free to use our [Quickstart guide](/broken/pages/ngeSCZKxiGVWqYZTHDjY). |
| 49 | +{% endhint %} |
| 50 | + |
| 51 | +</details> |
| 52 | + |
| 53 | +## API Schema |
| 54 | + |
| 55 | +{% openapi-operation spec="deepseek-v4-pro" path="/v1/chat/completions" method="post" %} |
| 56 | +[OpenAPI deepseek-v4-pro](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/text-models-llm/DeepSeek/deepseek-v4-pro.json) |
| 57 | +{% endopenapi-operation %} |
| 58 | + |
| 59 | +## Code Example |
| 60 | + |
| 61 | +{% tabs %} |
| 62 | +{% tab title="Python" %} |
| 63 | +{% code overflow="wrap" %} |
| 64 | +```python |
| 65 | +import requests |
| 66 | +import json # for getting a structured output with indentation |
| 67 | + |
| 68 | +response = requests.post( |
| 69 | + "https://api.aimlapi.com/v1/chat/completions", |
| 70 | + headers={ |
| 71 | + # Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>: |
| 72 | + "Authorization":"Bearer <YOUR_AIMLAPI_KEY>", |
| 73 | + "Content-Type":"application/json" |
| 74 | + }, |
| 75 | + json={ |
| 76 | + "model":"deepseek/deepseek-v4-pro", |
| 77 | + "messages":[ |
| 78 | + { |
| 79 | + "role":"user", |
| 80 | + "content":"Hi! What do you think about mankind?" # insert your prompt |
| 81 | + } |
| 82 | + ] |
| 83 | + } |
| 84 | +) |
| 85 | + |
| 86 | +data = response.json() |
| 87 | +print(json.dumps(data, indent=2, ensure_ascii=False)) |
| 88 | +``` |
| 89 | +{% endcode %} |
| 90 | +{% endtab %} |
| 91 | + |
| 92 | +{% tab title="JavaScript" %} |
| 93 | +{% code overflow="wrap" %} |
| 94 | +```javascript |
| 95 | +async function main() { |
| 96 | + const response = await fetch('https://api.aimlapi.com/v1/chat/completions', { |
| 97 | + method: 'POST', |
| 98 | + headers: { |
| 99 | + // insert your AIML API Key instead of <YOUR_AIMLAPI_KEY> |
| 100 | + 'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>', |
| 101 | + 'Content-Type': 'application/json', |
| 102 | + }, |
| 103 | + body: JSON.stringify({ |
| 104 | + model: 'deepseek/deepseek-v4-pro', |
| 105 | + messages:[ |
| 106 | + { |
| 107 | + role:'user', |
| 108 | + content: 'Hi! What do you think about mankind?' // insert your prompt here |
| 109 | + } |
| 110 | + ], |
| 111 | + }), |
| 112 | + }); |
| 113 | + |
| 114 | + const data = await response.json(); |
| 115 | + console.log(JSON.stringify(data, null, 2)); |
| 116 | +} |
| 117 | + |
| 118 | +main(); |
| 119 | +``` |
| 120 | +{% endcode %} |
| 121 | +{% endtab %} |
| 122 | +{% endtabs %} |
| 123 | + |
| 124 | +<details> |
| 125 | + |
| 126 | +<summary>Response</summary> |
| 127 | + |
| 128 | +{% code overflow="wrap" %} |
| 129 | +```json5 |
| 130 | +{ |
| 131 | + "id": "b8df8a22-3902-4241-889e-dc1f446e9794", |
| 132 | + "object": "chat.completion", |
| 133 | + "created": 1777066093, |
| 134 | + "model": "deepseek-v4-pro", |
| 135 | + "choices": [ |
| 136 | + { |
| 137 | + "index": 0, |
| 138 | + "message": { |
| 139 | + "role": "assistant", |
| 140 | + "content": "That's quite a profound question—and one that philosophers, historians, and storytellers have grappled with for millennia. Since I don't have personal feelings or consciousness, I can't offer a subjective opinion. But I can share a synthesis of how humanity has been viewed through different lenses.\n\nOn one hand, mankind shows extraordinary capacity for **curiosity, creativity, and compassion**. We've decoded the human genome, composed symphonies, built cathedrals, landed on the Moon, and crafted poetry that moves people across centuries. Empathy and altruism—like strangers risking their lives to save others in disasters—remind us of a deep, often quiet, nobility.\n\nOn the other hand, we're a species marked by **contradiction**. The same intelligence that advances medicine also invents weapons of mass destruction. Our tribal instincts, while evolutionarily useful, fuel division, war, and prejudice. And our short-term thinking, often driven by greed or comfort, has pushed the planet toward climate crisis and mass extinction—threatening the very systems we depend on.\n\nPerhaps what's most defining about mankind is not any single trait, but the **tension between our potential and our flaws**. We're a \"work in progress\" — capable of both horrific destruction and breathtaking kindness, often in the same breath. Some thinkers see this as a story of gradual moral enlightenment; others as a cycle of rise and fall.\n\nIn the end, what makes us human might be our constant striving: to know more, to do better, and to find meaning. The future remains unwritten, and that's where choice comes in.", |
| 141 | + "reasoning_content": "We are asked: \"Hi! What do you think about mankind?\" This is a broad philosophical question. As an AI, I don't have personal feelings, but I can provide a balanced analysis. I should consider both positive and negative aspects of humanity, perhaps from various perspectives like historical, ethical, technological, etc. The tone should be neutral and thoughtful. I'll structure a response that acknowledges human achievements and flaws, leaving room for hope." |
| 142 | + }, |
| 143 | + "logprobs": null, |
| 144 | + "finish_reason": "stop" |
| 145 | + } |
| 146 | + ], |
| 147 | + "usage": { |
| 148 | + "prompt_tokens": 13, |
| 149 | + "completion_tokens": 416, |
| 150 | + "total_tokens": 429, |
| 151 | + "prompt_tokens_details": { |
| 152 | + "cached_tokens": 0 |
| 153 | + }, |
| 154 | + "completion_tokens_details": { |
| 155 | + "reasoning_tokens": 89 |
| 156 | + }, |
| 157 | + "prompt_cache_hit_tokens": 0, |
| 158 | + "prompt_cache_miss_tokens": 13 |
| 159 | + }, |
| 160 | + "system_fingerprint": "fp_9954b31ca7_prod0820_fp8_kvcache_20260402", |
| 161 | + "meta": { |
| 162 | + "usage": { |
| 163 | + "credits_used": 3824, |
| 164 | + "usd_spent": 0.001912 |
| 165 | + } |
| 166 | + } |
| 167 | +} |
| 168 | +``` |
| 169 | +{% endcode %} |
| 170 | + |
| 171 | +</details> |
0 commit comments