GET
/v1/schemas/baseten/chat/v1%2Fchat%2Fcompletions
Accept:
Request body
45 properties · 2 required · 20 $defs| property | type | description | constraints |
|---|---|---|---|
| messages* | ChatCompletionMessage[] | A list of messages representing the conversation history. Supports roles: `system`, `user`, `assistant`, and `tool`. | |
| model* | string | The 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_penalty | number | Penalizes tokens based on how frequently they appear in the text so far. Positive values decrease repetition. Support varies by model. | default: 0 |
| logit_bias | object | A 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. | |
| logprobs | boolean | If `true`, returns log probabilities of the output tokens. Log probability support varies by model. | default: false |
| top_logprobs | integer | Number of most likely tokens to return at each position (0-20). Requires `logprobs: true`. Log probability support varies by model. | default: 0 |
| max_tokens | integer | Maximum 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 |
| n | integer | Number of completions to generate. Only `1` is supported. | default: 1 |
| presence_penalty | number | Penalizes 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_format | ResponseFormatText | 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. | |
| seed | integer | Random seed for deterministic generation. Determinism is not guaranteed across different hardware or model versions. | |
| stop | string | string[] | Up to 32 sequences where the API stops generating further tokens. Can be a string or array of strings. | |
| stream | boolean | If `true`, responses are streamed back as server-sent events (SSE) as they are generated. | default: false |
| stream_options | StreamOptions | Options 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. | |
| temperature | number | Controls 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_p | number | Nucleus 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 |
| tools | ChatCompletionToolsParam[] | 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_choice | enum | ChatCompletionNamedToolChoicePara… | Controls which tool (if any) the model calls. | |
| parallel_tool_calls | boolean | If `true`, the model can call multiple tools in a single response. | default: true |
| user | string | A unique identifier for the end-user, useful for tracking and abuse detection. | |
| best_of | integer | Number of candidate sequences to generate and return the best from. Only a value of 1 is supported. | 1 ≤ n ≤ 1 |
| top_k | integer | Limits 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_min | number | Minimum value for dynamic `top_p`. When set, `top_p` dynamically adjusts but does not go below this value. | default: 0 |
| min_p | number | Minimum probability threshold for token selection. Filters out tokens with probability below `min_p * max_probability`. | default: 0 |
| reasoning | object | Per-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_effort | enum | How 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_penalty | number | Multiplicative penalty for repeated tokens. Values greater than 1.0 discourage repetition, values less than 1.0 encourage it. | default: 1 |
| length_penalty | number | Exponential penalty applied to sequence length during beam search. Values greater than 1.0 favor longer sequences. | default: 1 |
| early_stopping | boolean | If `true`, stops generation when at least `n` complete candidates are found. | default: false |
| bad | string | string[] | Words or phrases to avoid in the output. Support varies by model. | |
| bad_token_ids | integer[] | Token IDs to avoid in the output. Support varies by model. | |
| stop_token_ids | integer[] | List of token IDs that cause generation to stop when encountered. | |
| include_stop_str_in_output | boolean | If `true`, includes the matched stop string in the output. | default: false |
| ignore_eos | boolean | If `true`, continues generating past the end-of-sequence token. | default: false |
| min_tokens | integer | Minimum number of tokens to generate before stopping. Useful for ensuring responses are not too short. | default: 0 |
| skip_special_tokens | boolean | If `true`, removes special tokens from the generated output. | default: true |
| spaces_between_special_tokens | boolean | If `true`, adds spaces between special tokens in the output. | default: true |
| truncate_prompt_tokens | integer | If set, truncates the prompt to this many tokens. Useful for handling inputs that may exceed context limits. | n ≥ 1 |
| echo | boolean | If `true` and the last message role matches the generation role, prepends that message to the output. | default: false |
| add_generation_prompt | boolean | If `true`, adds the generation prompt from the chat template, such as `<|assistant|>`. Set to `false` for completion-style generation. | default: true |
| add_special_tokens | boolean | If `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 |
| documents | object[] | 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_template | string | A custom Jinja template for formatting the conversation. If not provided, uses the model's default template. | |
| chat_template_args | object | Additional arguments to pass to the chat template renderer. | |
| disaggregated_params | DisaggregatedParams | Advanced parameters for disaggregated serving. Used internally for distributed inference. |
Validate a payload
before you spend tokensshell
$ curl -X POST https://modelschemas.com/v1/validate \
-d '{"provider":"baseten","endpointId":"v1/chat/completions","payload":{…}}'
→ {"valid": false, "errors": [{"path": "#", "keyword": "required", …}]}