curl --request POST \
--url https://api.apiyi.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "deepseek-v4-flash-ga-260731",
"messages": [
{
"role": "user",
"content": "Introduce yourself in one sentence"
}
]
}
'import requests
url = "https://api.apiyi.com/v1/chat/completions"
payload = {
"model": "deepseek-v4-flash-ga-260731",
"messages": [
{
"role": "user",
"content": "Introduce yourself in one sentence"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'deepseek-v4-flash-ga-260731',
messages: [{role: 'user', content: 'Introduce yourself in one sentence'}]
})
};
fetch('https://api.apiyi.com/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.apiyi.com/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'deepseek-v4-flash-ga-260731',
'messages' => [
[
'role' => 'user',
'content' => 'Introduce yourself in one sentence'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.apiyi.com/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"deepseek-v4-flash-ga-260731\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Introduce yourself in one sentence\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.apiyi.com/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"deepseek-v4-flash-ga-260731\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Introduce yourself in one sentence\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apiyi.com/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"deepseek-v4-flash-ga-260731\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Introduce yourself in one sentence\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"model": "<string>",
"choices": [
{}
],
"usage": {}
}DeepSeek V4 Flash Chat API Reference
DeepSeek V4 Flash GA (deepseek-v4-flash-ga-260731) Chat Completions API reference and playground: OpenAI-compatible, 1M context, thinking toggle and implicit caching.
curl --request POST \
--url https://api.apiyi.com/v1/chat/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "deepseek-v4-flash-ga-260731",
"messages": [
{
"role": "user",
"content": "Introduce yourself in one sentence"
}
]
}
'import requests
url = "https://api.apiyi.com/v1/chat/completions"
payload = {
"model": "deepseek-v4-flash-ga-260731",
"messages": [
{
"role": "user",
"content": "Introduce yourself in one sentence"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'deepseek-v4-flash-ga-260731',
messages: [{role: 'user', content: 'Introduce yourself in one sentence'}]
})
};
fetch('https://api.apiyi.com/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.apiyi.com/v1/chat/completions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'deepseek-v4-flash-ga-260731',
'messages' => [
[
'role' => 'user',
'content' => 'Introduce yourself in one sentence'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.apiyi.com/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"deepseek-v4-flash-ga-260731\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Introduce yourself in one sentence\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.apiyi.com/v1/chat/completions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"deepseek-v4-flash-ga-260731\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Introduce yourself in one sentence\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apiyi.com/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"deepseek-v4-flash-ga-260731\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Introduce yourself in one sentence\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"model": "<string>",
"choices": [
{}
],
"usage": {}
}Bearer sk-your-api-key in
Authorization. The default example already disables deep thinking
(thinking.disabled), so you get a fast response on send."thinking": {"type": "disabled"} from the example while debugging.
For capabilities, pricing and caching, see the
DeepSeek V4 Flash overview.- When thinking is on, give
max_tokensroom (reasoning counts toward the output quota) — 3000+ recommended response_formathas no effect: passingjson_schemareturns 200 while ignoring the schema entirely. Usetoolsfor structured outputnis silently ignored: passingn=2returns 200 with exactly one element inchoices- Text-only model — passing image content blocks returns
Model do not support image input
Parameter Quick Reference
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
model | string | ✓ | — | Fixed to deepseek-v4-flash-ga-260731 |
messages | array | ✓ | — | Standard OpenAI message array, text only |
max_tokens | int | — | Output quota, hard ceiling 393,216; 3000+ when thinking is on | |
thinking.type | string | enabled | disabled reliably turns thinking off; auto also accepted | |
reasoning_effort | string | — | Only minimal is deterministic (0 reasoning tokens); low/medium/high/max are not monotonic, see overview | |
stream | bool | false | SSE streaming; pair with stream_options.include_usage for usage | |
temperature / top_p | number | — | Sampling parameters, both effective | |
stop | array | — | Stop sequences, verified to truncate | |
seed / logprobs | — | — | Both effective | |
tools | array | — | Function Call — tool arguments are genuinely constrained |
Context and Output Ceilings
| Item | Hard ceiling | Error raised |
|---|---|---|
| Input | 1,048,570 tokens | Input length ... exceeds the maximum length 1048570 |
Output max_tokens | 393,216 | integer above maximum value, expected a value <= 393216 |
Implicit Cache
No parameters needed — an identical long prefix hits on the second request:| Round | prompt_tokens | cached_tokens | Hit rate |
|---|---|---|---|
| 1 | 15,634 | 0 | — |
| 2 | 15,634 | 15,616 | 99.9% |
| 3 | 15,634 | 15,616 | 99.9% |
Need Structured Output? Use tools
{
"model": "deepseek-v4-flash-ga-260731",
"messages": [{"role": "user", "content": "Beijing is 25 degrees today"}],
"tools": [{
"type": "function",
"function": {
"name": "submit_result",
"parameters": {
"type": "object",
"properties": {
"city": {"type": "string"},
"temp_c": {"type": "number"}
},
"required": ["city", "temp_c"]
}
}
}]
}
choices[0].message.tool_calls[0].function.arguments — it parses reliably.Authorizations
API Key obtained from the APIYI console
Body
Model ID, fixed to deepseek-v4-flash-ga-260731
deepseek-v4-flash-ga-260731 Message array in standard OpenAI format. Text only — image content blocks are not supported
Show child attributes
Show child attributes
Max output tokens, hard ceiling 393,216. Reasoning counts toward this when thinking is on
x <= 393216Deep thinking switch. Passing {"type": "disabled"} saved 200+ reasoning tokens on simple tasks in our tests
Show child attributes
Show child attributes
Reasoning depth tier. Only minimal is deterministic (reasoning tokens always 0); low/medium/high/max do not form a monotonic ladder, and within-tier variance exceeds between-tier differences
minimal, low, medium, high, max Stream the response over SSE. Pair with stream_options.include_usage to get usage at the end
Sampling temperature
Nucleus sampling threshold
Stop sequences, verified to truncate correctly
Random seed
Return token log probabilities, verified to be populated
Function Call tool list in standard OpenAI format. Tool arguments are genuinely constrained — use this instead of response_format when you need structured output
Response
Completion succeeded
Was this page helpful?