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": {}
}Справочник по Chat API DeepSeek V4 Flash
Справочник по Chat Completions API и песочница для DeepSeek V4 Flash GA (deepseek-v4-flash-ga-260731): совместимость с OpenAI, контекст 1M, переключатель thinking и неявное кэширование.
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 в
Authorization. Пример по умолчанию уже отключает глубокое рассуждение
(thinking.disabled), так что при отправке вы сразу получаете быстрый ответ."thinking": {"type": "disabled"} из примера при отладке.
Сведения о возможностях, тарификации и кэшировании см. в
обзоре DeepSeek V4 Flash.- Когда включено рассуждение, давайте
max_tokensзапас (рассуждение учитывается в квоте на вывод) — рекомендуется 3000+ response_formatне имеет эффекта: при передачеjson_schemaвозвращается 200, при этом схема полностью игнорируется. Используйтеtoolsдля структурированного выводаnигнорируется без предупреждения: при передачеn=2возвращается 200 с ровно одним элементом вchoices- Модель только для текста — при передаче блоков image content возвращается
Model do not support image input
Краткая справка по параметрам
| Параметр | Тип | Обязательно | По умолчанию | Примечания |
|---|---|---|---|---|
model | string | ✓ | — | Фиксировано в deepseek-v4-flash-ga-260731 |
messages | array | ✓ | — | Стандартный массив сообщений OpenAI, только текст |
max_tokens | int | — | Квота вывода, жёсткий максимум 393,216; 3000+ при включённом thinking | |
thinking.type | string | enabled | disabled надёжно отключает thinking; также принимается auto | |
reasoning_effort | string | — | Только minimal является детерминированным (0 reasoning tokens); low/medium/high/max не монотонны, см. обзор | |
stream | bool | false | Потоковая передача SSE; используйте вместе с stream_options.include_usage для учёта использования | |
temperature / top_p | number | — | Параметры sampling, оба работают | |
stop | array | — | Stop sequences, проверено: обрезают вывод | |
seed / logprobs | — | — | Оба работают | |
tools | array | — | Function Call — аргументы инструмента действительно ограничены |
Контекстные и выходные пределы
| Элемент | Жёсткий предел | Возникающая ошибка |
|---|---|---|
| Ввод | 1,048,570 token | Input length ... exceeds the maximum length 1048570 |
Вывод max_tokens | 393,216 | integer above maximum value, expected a value <= 393216 |
Неявный кэш
Параметры не нужны — при идентичном длинном префиксе попадание происходит во втором запросе:| Раунд | prompt_tokens | cached_tokens | Коэффициент попадания |
|---|---|---|---|
| 1 | 15,634 | 0 | — |
| 2 | 15,634 | 15,616 | 99.9% |
| 3 | 15,634 | 15,616 | 99.9% |
Нужен структурированный вывод? Используйте инструменты
{
"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 — она надежно парсится.Авторизации
API Key obtained from the APIYI console
Тело
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
Ответ
Completion succeeded
Была ли эта страница полезной?