Skip to main content
POST
Chat completion: DeepSeek V4 Flash text generation
Используйте песочницу справа, чтобы протестировать напрямую: поместите Bearer sk-your-api-key в Authorization. Пример по умолчанию уже отключает глубокое рассуждение (thinking.disabled), так что при отправке вы сразу получаете быстрый ответ.
Эта модель по умолчанию много рассуждает — даже на вопрос в одну строку сначала выдает сотни reasoning tokens. Оставляйте "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

Краткая справка по параметрам

Контекстные и выходные пределы

Ввод длиной 322,055 token был обработан за 14.77 секунды, и искомый фрагмент в середине документа был извлечён корректно.

Неявный кэш

Параметры не нужны — при идентичном длинном префиксе попадание происходит во втором запросе: Кэшированные tokens тарифицируются по $0.028 за миллион. Держите временные метки, случайные ID и другой изменяющийся контент в конце prompt — если смешивать их с префиксом, коэффициент попадания падает до нуля.

Нужен структурированный вывод? Используйте инструменты

Возьмите строку JSON из choices[0].message.tool_calls[0].function.arguments — она надежно парсится.

Авторизации

Authorization
string
header
обязательно

API Key obtained from the APIYI console

Тело

application/json
model
enum<string>
по умолчанию:deepseek-v4-flash-ga-260731
обязательно

Model ID, fixed to deepseek-v4-flash-ga-260731

Доступные опции:
deepseek-v4-flash-ga-260731
messages
object[]
обязательно

Message array in standard OpenAI format. Text only — image content blocks are not supported

max_tokens
integer
по умолчанию:500

Max output tokens, hard ceiling 393,216. Reasoning counts toward this when thinking is on

Требуемый диапазон: x <= 393216
thinking
object

Deep thinking switch. Passing {"type": "disabled"} saved 200+ reasoning tokens on simple tasks in our tests

reasoning_effort
enum<string>

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
boolean
по умолчанию:false

Stream the response over SSE. Pair with stream_options.include_usage to get usage at the end

temperature
number

Sampling temperature

top_p
number

Nucleus sampling threshold

stop
string[]

Stop sequences, verified to truncate correctly

seed
integer

Random seed

logprobs
boolean

Return token log probabilities, verified to be populated

tools
object[]

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

id
string

Request ID

model
string
choices
object[]

Completion results. Besides content, message carries reasoning_content when thinking is on

usage
object

Usage. completion_tokens_details.reasoning_tokens is reasoning spend; prompt_tokens_details.cached_tokens is the implicit cache hit