ChatCompletionRequest schema

FieldType and description
model
Required
string

Model identifier (e.g., deepseek-ai/DeepSeek-V4-Pro).

messages
Required
array of ChatMessage

The conversation history. When the last message in the conversation is from the assistant, the model answers with a new assistant message. On some models this needs a short user message: "Continue." is then added, with a notice in _devup.warnings. A model that cannot answer such a conversation returns HTTP 400 conversation_must_end_with_user before any charge.

maxItems: 512

Array itemsChatMessage

ChatMessage

max_tokensinteger

Maximum tokens to generate in the response. The largest accepted value is the model's own max_output_tokens in GET /v1/models; a larger value (for max_tokens or max_completion_tokens) returns HTTP 400 invalid_max_tokens. When neither is sent, the reply is limited to the model's default output length, which is at most its max_output_tokens. Reasoning models spend part of this budget thinking before they answer. With images, audio or video in the request, set it high enough — 2000 or more is a safe start — or the reply can come back empty with finish_reason "length".

minimum: 1

temperaturenumber

Sampling temperature (0–2).

minimum: 0; maximum: 2

top_pnumber

Nucleus sampling probability.

minimum: 0; maximum: 1

streamboolean

If true, returns an SSE stream of partial completions.

default: false

stopschema

Stop sequence(s) to end generation.

oneOf
string
array of string
Array itemsstring
frequency_penaltynumber

Penalizes repeated tokens based on frequency.

presence_penaltynumber

Penalizes tokens based on presence in the text so far.

toolsarray of object

A list of tools (functions) the model may call.

Array itemsobject
tool_choiceschema

Controls which tool is called by the model.

oneOf
string
object
reasoning_effortstring

How much the model reasons before answering, on models that reason on request (for example low, medium, high). Reasoning tokens are billed as output tokens.

reasoningobject

{"enabled": true} asks for reasoning. On models that take reasoning_effort, it is applied as reasoning_effort: "medium" with a notice in _devup.warnings; when reasoning_effort is also sent, reasoning_effort applies. {"enabled": false} does not turn reasoning off on those models; a notice says so.

FieldType and description
enabledboolean
response_formatobject

Response format constraint (e.g., {"type":"json_object"}). On a model that returns JSON inside a Markdown code fence, the fence around the whole reply is removed, with or without streaming, and the notice json_fence_removed is returned. On a model that does not apply json_schema itself but enforces tool calls, a json_schema request without streaming is answered through a forced tool call and returned as message.content (notice structured_output_via_tool). A reply that does not match the schema is tried once more at no cost; if it still does not match, strict: true returns 400 structured_output_mismatch (not billed), otherwise the JSON is returned with the notice structured_output_not_matched.

service_tierstring

Request Priority or Flex processing on supported models. Omit for the standard tier. On models without the requested tier, the request is processed on the standard tier. See https://docs.devupai.com/docs/service-tiers

Allowed values: ["priority","flex"]

prompt_cache_keystring

Identifies a cached prompt prefix. Send the same key on following requests to read the cache.

prompt_cache_optionsobject

Writes the prompt prefix to the cache for the given retention time. Send it only on the request that writes the cache; every request that includes it writes again and is billed at the write price. Not allowed together with service_tier.

FieldType and description
mode
Required
string

Allowed values: ["explicit"]

ttl
Required
string

Allowed values: ["5m","1h"]