GET

/v1/schemas/fireworks/chat/v1/completions

kind inputactivity chathash 1afe9db1…extracted Oct 6, 2026version currentsource upstream spec ↗
fieldrecorded source
schemaSource linked above.

upstream-spec

Source trace
57f6232bb90ea9e9c47731c95d2e9c8c8c1885e363e8e24a6b466b23ea3f7fc1
{
  "fetchedAt": 1791264700,
  "extractorVersion": "1",
  "verifiedAt": null
}

Request body

42 properties · 2 required · 9 $defs
propertytypedescriptionconstraints
model*stringThe name of the model to use.
prompt*string | string[] | integer[] | …The prompt to generate completions for.
userstringA unique identifier representing your end-user, which can help monitor and detect abuse.nullable
prompt_cache_keystringA key used for prompt caching session affinity. Requests with the same prompt_cache_key are routed to the same backend to maximize KV cache hit rates. This is the preferred field for session affinity (takes priority over the 'user' field).nullable
prompt_cache_isolation_keystringIsolation key for prompt caching to separate cache entries.nullable
raw_outputbooleanReturn raw output from the model.nullable
perf_metrics_in_responsebooleanWhether to include performance metrics in the response body. **Non-streaming requests:** Performance metrics are always included in response headers (e.g., `fireworks-prompt-tokens`, `fireworks-server-time-to-first-token`). Setting this to `true` additionally includes the same metrics in the response body under the `perf_metrics` field. **Streaming requests:** Performance metrics are only included in the response body under the `perf_metrics` field in the final chunk (when `finish_reason` is set). This is because headers may not be accessible during streaming. The response body `perf_metrics` field contains the following metrics: **Basic Metrics (all deployments):** - `prompt-tokens`: Number of tokens in the prompt - `cached-prompt-tokens`: Number of cached prompt tokens - `server-time-to-first-token`: Time from request start to first token (in seconds) - `server-processing-time`: Total processing time (in seconds, only for completed requests) **Predicted Outputs Metrics:** - `speculation-prompt-tokens`: Number of speculative prompt tokens - `speculation-prompt-matched-tokens`: Number of matched speculative prompt tokens (for completed requests) **Dedicated Deployment Only Metrics:** - `speculation-generated-tokens`: Number of speculative generated tokens (for completed requests) - `speculation-acceptance`: Speculation acceptance rates by position - `backend-host`: Hostname of the backend server - `num-concurrent-requests`: Number of concurrent requests - `deployment`: Deployment name - `tokenizer-queue-duration`: Time spent in tokenizer queue - `tokenizer-duration`: Time spent in tokenizer - `prefill-queue-duration`: Time spent in prefill queue - `prefill-duration`: Time spent in prefill - `generation-queue-duration`: Time spent in generation queue - `generation-duration`: Time spent in generationnullable
streambooleanWhether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message.nullable
stream_optionsStreamOptionsOptions for streaming responses. Only valid with ``stream=true``. Fireworks includes a final SSE chunk carrying usage totals by default; set ``include_usage=false`` to opt out. The ``buffer_tokens`` / ``buffer_ms`` / ``buffer_mode`` fields coalesce SSE chunks by token count and/or time (vLLM backend; override the deployment default).nullable
nintegerHow many completions to generate for each prompt.default: 1
service_tierenumThe service tier to use for the request. Specifies the processing type used for serving the request. Only "priority" is supported, while all other values will be treated as "default" tier.auto | default | flex | priority · default: "default"
stopstring | string[]Up to 4 sequences where the API will stop generating further tokens. The returned text will NOT contain the stop sequence.nullable
max_tokensintegerThe maximum number of tokens to generate in the completion. If the token count of your prompt plus max_tokens exceeds the model's context length, the behavior depends on context_length_exceeded_behavior. By default, max_tokens will be lowered to fit in the context window instead of returning an error.nullable
max_completion_tokensintegerAlias for max_tokens. Cannot be specified together with max_tokens.nullable
temperaturenumberWhat sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or top_p but not both. Required range: `0 <= x <= 2` Example: `1`nullable
top_kintegerTop-k sampling is another sampling method where the k most probable next tokens are filtered and the probability mass is redistributed among only those k next tokens. The value of k controls the number of candidates for the next token at each step during text generation. Must be between 0 and 100. Required range: `0 <= x <= 100` Example: `50`nullable
top_pnumberAn alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both. Required range: `0 <= x <= 1` Example: `1`nullable
min_pnumberMinimum probability threshold for token selection. Only tokens with probability >= min_p are considered for selection. This is an alternative to `top_p` and `top_k` sampling. Required range: `0 <= x <= 1`nullable
typical_pnumberTypical-p sampling is an alternative to nucleus sampling. It considers the most typical tokens whose cumulative probability is at most typical_p. Required range: `0 <= x <= 1`nullable
frequency_penaltynumberNumber between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. Reasonable value is around 0.1 to 1 if the aim is to just reduce repetitive samples somewhat. If the aim is to strongly suppress repetition, then one can increase the coefficients up to 2, but this can noticeably degrade the quality of samples. Negative values can be used to increase the likelihood of repetition. See also `presence_penalty` for penalizing tokens that have at least one appearance at a fixed rate. OpenAI compatible (follows OpenAI's conventions for handling token frequency and repetition penalties). Required range: `-2 <= x <= 2`nullable
presence_penaltynumberNumber between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. Reasonable value is around 0.1 to 1 if the aim is to just reduce repetitive samples somewhat. If the aim is to strongly suppress repetition, then one can increase the coefficients up to 2, but this can noticeably degrade the quality of samples. Negative values can be used to increase the likelihood of repetition. See also `frequency_penalty` for penalizing tokens at an increasing rate depending on how often they appear. OpenAI compatible (follows OpenAI's conventions for handling token frequency and repetition penalties). Required range: `-2 <= x <= 2`nullable
repetition_penaltynumberApplies a penalty to repeated tokens to discourage or encourage repetition. A value of `1.0` means no penalty, allowing free repetition. Values above `1.0` penalize repetition, reducing the likelihood of repeating tokens. Values between `0.0` and `1.0` reward repetition, increasing the chance of repeated tokens. For a good balance, a value of `1.2` is often recommended. Note that the penalty is applied to both the generated output and the prompt in decoder-only models. Required range: `0 <= x <= 2`nullable
mirostat_targetnumberDefines the target perplexity for the Mirostat algorithm. Perplexity measures the unpredictability of the generated text, with higher values encouraging more diverse and creative outputs, while lower values prioritize predictability and coherence. The algorithm dynamically adjusts the token selection to maintain this target during text generation. If not specified, Mirostat sampling is disabled.nullable
mirostat_lrnumberSpecifies the learning rate for the Mirostat sampling algorithm, which controls how quickly the model adjusts its token distribution to maintain the target perplexity. A smaller value slows down the adjustments, leading to more stable but gradual shifts, while higher values speed up corrections at the cost of potential instability.nullable
seedintegerRandom seed for deterministic sampling.nullable
logprobsinteger | booleanInclude log probabilities in the response. This accepts either a boolean or an integer:nullable
top_logprobsintegerAn integer specifying the number of most likely tokens to return at each token position, each with an associated log probability. Must be between 0 and the deployment's `--max-logprobs` limit (5 by default). When `logprobs` is set, `top_logprobs` can be used to modify how many top log probabilities are returned. If `top_logprobs` is not set, the API will return up to `logprobs` tokens per position.nullable
sampling_maskenumOpt-in sampling mask metadata for generated tokens. When set to `"count"`, each generated token in the new logprobs format includes the number of token logits still eligible for sampling after filters such as top_p and top_k are applied. `"non_zero_list"` additionally returns active token IDs in `sampling_mask`; `"non_zero_buffer"` additionally returns a base64-encoded little-endian uint32 buffer of active token IDs. Non-zero payloads are omitted for positions with more active tokens than 1000.count | non_zero_list | non_zero_buffer · nullable
echobooleanEcho back the prompt in addition to the completion.nullable
echo_lastintegerEcho back the last N tokens of the prompt in addition to the completion. This is useful for obtaining logprobs of the prompt suffix but without transferring too much data. Passing `echo_last=len(prompt)` is the same as `echo=True`nullable
ignore_eosbooleanThis setting controls whether the model should ignore the End of Sequence (EOS) token. When set to `True`, the model will continue generating tokens even after the EOS token is produced. By default, it stops when the EOS token is reached.default: false
context_length_exceeded_behaviorenumWhat to do if the token count of prompt plus `max_tokens` exceeds the model's context window.error | truncate · default: "truncate"
response_formatResponseFormatAllows to force the model to produce specific output format. Setting to `{ "type": "json_object" }` enables JSON mode, which guarantees the message the model generates is valid JSON. If `"type"` is `"json_schema"`, a JSON schema must be provided. E.g., `response_format = {"type": "json_schema", "json_schema": <json_schema>}`. Important: when using JSON mode, it's crucial to also instruct the model to produce JSON via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. In this case the return value might not be a valid JSON.nullable
logit_biasobjectModify the likelihood of specified tokens appearing in the completion. Accepts a json object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling.nullable
speculationstring | integer[]Speculative decoding prompt or token IDs to speed up generation.nullable
predictionPredictedOutput | stringOpenAI-compatible predicted output for speculative decoding. Can be a PredictedOutput object or a simple string. Automatically transformed to speculation.nullable
metadataobjectAdditional metadata to store with the request for tracing/distillation.nullable
reasoning_effortenum | integer | booleanControls reasoning generation for raw completions. A positive integer sets a hard thinking-token cap and forces the model''s end-thinking delimiter. On DeepSeek V4.1, integers below 1024 are not a token cap (1-100 is the prompt scale and 101-1023 maps to `''lo…nullable
reasoning_historyenumControls how historical assistant reasoning content is included in the prompt for multi-turn conversations. **Accepted values:** - `null`: Use model/template default behavior (for **GLM-4.7**, the model/template default is `'interleaved'`, i.e. historical reasoning is cleared by default) - `'disabled'`: Strip `reasoning_content` from all messages before prompt construction - `'interleaved'`: Strip `reasoning_content` from messages up to (and including) the last user message - `'preserved'`: Preserve historical `reasoning_content` across the conversation **Model support:** | Model | Default | Supported values | | --- | --- | --- | | Kimi K2.7 | `'preserved'` | `'disabled'`, `'interleaved'`, `'preserved'` | | Kimi K2.6 | `'interleaved'` | `'disabled'`, `'interleaved'`, `'preserved'` | | Kimi K2 Instruct | `'preserved'` | `'disabled'`, `'interleaved'`, `'preserved'` | | MiniMax M2 | `'interleaved'` | `'disabled'`, `'interleaved'` | | GLM-5.2 | `'interleaved'` | `'disabled'`, `'interleaved'`, `'preserved'` | | GLM-4.7 | `'interleaved'` | `'disabled'`, `'interleaved'`, `'preserved'` | | GLM-4.6 | `'interleaved'` | `'disabled'`, `'interleaved'` | | Qwen 3.6 | `'preserved'` | `'disabled'`, `'preserved'` | | DeepSeek V4 | `'interleaved'` | `'interleaved'` | For other models, refer to the model provider's documentation. **Note:** This parameter controls prompt formatting only. To disable reasoning computation entirely, use `reasoning_effort='none'`.disabled | interleaved | preserved · nullable
thinkingThinkingConfigEnabled | ThinkingConfigDisabled | ThinkingConfigAdaptiveAlternative reasoning configuration for raw completions. `budget_tokens` sets a hard thinking-token cap. Raw completions do not apply a conversation template, so the prompt must establish the intended reasoning state.nullable
return_token_idsbooleanReturn token IDs alongside text to avoid retokenization drift.nullable
imagesstring[] | string[][]The list of base64 encoded images for visual language completition generation.nullable

Types

9 $defs

ChatMessageContentobject

type*string
textstringnullable
image_urlChatMessageContentImageURLnullable
video_urlChatMessageContentVideoURLnullable

ChatMessageContentImageURLobject

url*stringImage link or base64 data URI. ``mm_file://{file_id}`` is also accepted for assets uploaded via the Files API.
detailstringDetail level for image understanding. One of ``low`` / ``default`` / ``high`` (model-specific defaults table). Used to pick a default ``max_long_side_pixel`` when that field is absent.nullable
max_long_side_pixelintegerPer-image cap on the long side after resizing. When omitted, the model derives a default from ``detail``. Currently honored by MiniMax M3 VL preprocessing; other VL models ignore this field. See the M3 VL preprocessing spec (2026-05-29) for the full 3-step resize semantics (long-side cap → short-side floor at 112 px → hard total-pixel cap).nullable

ChatMessageContentVideoURLobject

url*stringVideo link or base64 data URI. ``mm_file://{file_id}`` is accepted for assets uploaded via the Files API (recommended for files > 50 MB).
detailstringDetail level for video understanding. One of ``low`` / ``default`` / ``high``.nullable
max_framesintegernullable
spatial_limitintegernullable
sample_fpsnumberFrame sampling rate (Kimi K2.5 VL legacy name). For MiniMax M3 VL prefer the canonical ``fps`` field.nullable
fpsnumberFrame sampling rate, in [0.2, 5] Hz for MiniMax M3 VL (was [0.5, 2] in the pre-2026-05-29 spec). Higher values are more sensitive to motion at the cost of more tokens; lower values are cheaper but less responsive to fast scene changes. Equivalent to ``sample_fps`` on non-M3 video models.nullable
max_long_side_pixelintegerPer-frame cap on the long side after resizing. When omitted, the model derives a default from ``detail``. Currently honored by MiniMax M3 VL preprocessing; other VL models ignore this field.nullable

PredictedOutputobject

OpenAI-compatible struct for the "speculation" field.

content*string | ChatMessageContent[]
typeconst"content" · default: "content"

ResponseFormatobject

type*enumjson_object | json_schema | grammar | text
schemaobject | stringnullable
grammarstringnullable
json_schemaobject | stringnullable

StreamOptionsobject

include_usagebooleanWhether to include a trailing SSE chunk with usage totals (with an empty `choices` array). Unlike the OpenAI spec, Fireworks includes usage by default for streaming responses; set this to `false` to opt out. When emitted, usage rides a separate final chunk (before `data: [DONE]`), not the chunk carrying `finish_reason`.nullable
include_internal_contentbooleanWhen true, include an `internal_content` object (`token_ids`) inside each streaming delta — equivalent to `return_token_ids`, emitted under `choices[].delta.internal_content`. Omitted entirely from response chunks when false.nullable
buffer_tokensintegerCoalesce streaming SSE chunks until this many text deltas (~tokens) accumulate before flushing a merged chunk. 0 disables the token threshold. Honored only on the vLLM backend; overrides the deployment default when set.n ≥ 0 · nullable
buffer_msnumberCoalesce streaming SSE chunks for up to this many milliseconds before flushing a merged chunk. 0 disables the time threshold. Honored only on the vLLM backend; overrides the deployment default when set.n ≥ 0 · nullable
buffer_modeenumWhen both buffer_tokens and buffer_ms are set: 'any' flushes when either threshold is reached; 'all' flushes only when both are. Overrides the deployment default when set; defaults to 'any'.any | all · nullable

ThinkingConfigAdaptiveobject

Configuration that lets the model decide whether to think (MiniMax M3).

type*const"adaptive"

ThinkingConfigDisabledobject

Configuration for disabling extended thinking (Anthropic-compatible format).

type*const"disabled"

ThinkingConfigEnabledobject

Configuration for enabling extended thinking (Anthropic-compatible format).

typeconst"enabled" · default: "enabled"
budget_tokensintegerDetermines how many tokens the model can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality. Must be >= 1024 if specified.nullable
keepconstControls whether historical reasoning content is preserved in the prompt. When set to `"all"`, all previous assistant turns' reasoning_content is included in the rendered prompt (equivalent to `reasoning_history: "preserved"`). When omitted (null), the model uses its default history behavior. Only valid when `type` is `"enabled"`."all" · nullable
budget_end_strstringNatural-language transition phrase that the model is forced to emit just before the end-thinking token (`</think>`) when `budget_tokens` is exhausted. This produces a more natural conclusion than a hard token slam (matches vLLM's `reasoning_end_str` behavior). Defaults to a built-in phrase. Set to "" to disable the bridge and force `</think>` immediately. Only meaningful when `budget_tokens` is set.nullable
effortenum | integer | booleanReasoning effort level (Kimi/Moonshot spec). Accepts the same values as top-level `reasoning_effort`; when set it takes precedence over (overwrites) `reasoning_effort`.nullable

Validate a payload

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