GET

/v1/schemas/baseten/chat/v1%2Fchat%2Fcompletions

kind inputactivity chathash 72f1a985…extracted Oct 28, 2026version currentsource upstream spec ↗

Request body

45 properties · 2 required · 20 $defs
propertytypedescriptionconstraints
messages*ChatCompletionMessage[]A list of messages representing the conversation history. Supports roles: `system`, `user`, `assistant`, and `tool`.
model*stringThe model slug to use for completion, such as `deepseek-ai/DeepSeek-V4.1-Flash-1017`. Find available models at [Model APIs](https://app.baseten.co/model-apis/create).
frequency_penaltynumberPenalizes tokens based on how frequently they appear in the text so far. Positive values decrease repetition. Support varies by model.default: 0
logit_biasobjectA map of token IDs to bias values (-100 to 100). Use this to increase or decrease the likelihood of specific tokens appearing in the output.
logprobsbooleanIf `true`, returns log probabilities of the output tokens. Log probability support varies by model.default: false
top_logprobsintegerNumber of most likely tokens to return at each position (0-20). Requires `logprobs: true`. Log probability support varies by model.default: 0
max_tokensintegerMaximum number of tokens to generate. If your request input plus `max_tokens` exceeds the model's context length, `max_tokens` is truncated. If your request exceeds the context length by more than 16k tokens or if `max_tokens` signals no preference, context re…1 ≤ n ≤ 262144 · default: 4096
nintegerNumber of completions to generate. Only `1` is supported.default: 1
presence_penaltynumberPenalizes tokens based on whether they have appeared in the text so far. Positive values encourage the model to discuss new topics. Support varies by model.default: 0
response_formatResponseFormatText | ResponseFormatJson …Specifies the output format. Use `{"type": "json_object"}` for JSON mode, or `{"type": "json_schema", "json_schema": {...}}` for structured outputs with a specific schema.
seedintegerRandom seed for deterministic generation. Determinism is not guaranteed across different hardware or model versions.
stopstring | string[]Up to 32 sequences where the API stops generating further tokens. Can be a string or array of strings.
streambooleanIf `true`, responses are streamed back as server-sent events (SSE) as they are generated.default: false
stream_optionsStreamOptionsOptions for streaming responses. Set `include_usage: true` to receive token usage statistics in the final chunk. Requires `stream: true` to be set to non-null.
temperaturenumberControls randomness in the output. Lower values like 0.2 produce more focused and deterministic responses. Higher values like 1.5 produce more creative and varied output.0 ≤ n ≤ 4
top_pnumberNucleus sampling: only consider tokens with cumulative probability up to this value. Lower values like 0.1 produce more focused output.0 < n ≤ 1 · default: 1
toolsChatCompletionToolsParam[]A list of tools (functions) the model may call. Each tool should have a `type: "function"` and a `function` object with `name`, `description`, and `parameters`.
tool_choiceenum | ChatCompletionNamedToolChoicePara…Controls which tool (if any) the model calls.
parallel_tool_callsbooleanIf `true`, the model can call multiple tools in a single response.default: true
userstringA unique identifier for the end-user, useful for tracking and abuse detection.
best_ofintegerNumber of candidate sequences to generate and return the best from. Only a value of 1 is supported.1 ≤ n ≤ 1
top_kintegerLimits token selection to the top K most probable tokens at each step. Lower values like 10 produce more focused output. Set to -1 to disable.default: 50
top_p_minnumberMinimum value for dynamic `top_p`. When set, `top_p` dynamically adjusts but does not go below this value.default: 0
min_pnumberMinimum probability threshold for token selection. Filters out tokens with probability below `min_p * max_probability`.default: 0
reasoningobjectPer-request reasoning controls. `max_tokens` caps reasoning tokens independently of the top-level `max_tokens` and overrides the model's default reasoning cap. Enforced on DeepSeek V4 Flash 0731, where reasoning is otherwise capped at 4096 tokens per request; other models ignore it. Applies when reasoning is enabled.nullable
reasoning_effortenumHow much reasoning a reasoning-capable model performs before answering. The gateway accepts `none`, `minimal`, `low`, `medium`, `high`, `xhigh`, and `max`; models without reasoning support ignore the parameter. See the Model APIs reasoning page for per-model values.none | minimal | low | medium | high | xhigh · +1 more · nullable
repetition_penaltynumberMultiplicative penalty for repeated tokens. Values greater than 1.0 discourage repetition, values less than 1.0 encourage it.default: 1
length_penaltynumberExponential penalty applied to sequence length during beam search. Values greater than 1.0 favor longer sequences.default: 1
early_stoppingbooleanIf `true`, stops generation when at least `n` complete candidates are found.default: false
badstring | string[]Words or phrases to avoid in the output. Support varies by model.
bad_token_idsinteger[]Token IDs to avoid in the output. Support varies by model.
stop_token_idsinteger[]List of token IDs that cause generation to stop when encountered.
include_stop_str_in_outputbooleanIf `true`, includes the matched stop string in the output.default: false
ignore_eosbooleanIf `true`, continues generating past the end-of-sequence token.default: false
min_tokensintegerMinimum number of tokens to generate before stopping. Useful for ensuring responses are not too short.default: 0
skip_special_tokensbooleanIf `true`, removes special tokens from the generated output.default: true
spaces_between_special_tokensbooleanIf `true`, adds spaces between special tokens in the output.default: true
truncate_prompt_tokensintegerIf set, truncates the prompt to this many tokens. Useful for handling inputs that may exceed context limits.n ≥ 1
echobooleanIf `true` and the last message role matches the generation role, prepends that message to the output.default: false
add_generation_promptbooleanIf `true`, adds the generation prompt from the chat template, such as `<|assistant|>`. Set to `false` for completion-style generation.default: true
add_special_tokensbooleanIf `true`, adds special tokens like BOS to the prompt beyond what the chat template adds. For most models, the chat template handles special tokens, so this should be `false`.default: false
documentsobject[]A list of documents for RAG (retrieval-augmented generation). Each document is a dict with string keys and values that the model can reference.
chat_templatestringA custom Jinja template for formatting the conversation. If not provided, uses the model's default template.
chat_template_argsobjectAdditional arguments to pass to the chat template renderer.
disaggregated_paramsDisaggregatedParamsAdvanced parameters for disaggregated serving. Used internally for distributed inference.

Validate a payload

before you spend tokens
shell
$ curl -X POST https://modelschemas.com/v1/validate \
    -d '{"provider":"baseten","endpointId":"v1/chat/completions","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}