v1

latestOpenAPI 3.0.02026-07-1741634.0 KB
Inference

Create chat completion

Generates a completion for the supplied prompt. Streaming mode is supported. All extra options described in the documentation are optional and follow the OpenAI‑compatible naming.

post/chat/completions

Request body

modelstring required

The unique identifier of the model to use.

streamboolean

If true, the server streams tokens as they are generated.

max_tokensinteger

Maximum number of tokens to generate.

stopstring[]

Stop sequences – generation stops before emitting any of these strings.

temperaturenumber

Adjusts randomness of the output.

dynatemp_rangenumber

Dynamic‑temperature range – final temperature is sampled from [temperature‑range, temperature+range].

dynatemp_exponentnumber

Exponent for dynamic‑temperature scaling.

top_kinteger

Restricts sampling to the K most probable tokens.

top_pnumber

Nucleus sampling cutoff (cumulative probability).

min_pnumber

Minimum probability for a token to be considered relative to the most likely token.

typical_pnumber

Enable locally typical sampling with parameter p.

n_predictinteger

Maximum number of tokens to predict; -1 = unlimited, 0 = evaluate prompt only.

n_indentinteger

Minimum line indentation for generated code.

n_keepinteger

Tokens from the prompt to retain when context is exceeded. 0 = none, -1 = all.

presence_penaltynumber

Presence penalty (0.0 = disabled).

frequency_penaltynumber

Frequency penalty (0.0 = disabled).

repeat_penaltynumber

Repetition penalty for token sequences.

repeat_last_ninteger

How many last tokens to consider for repeat penalty (0 = disabled, -1 = context size).

dry_multipliernumber

DRY (Don’t Repeat Yourself) multiplier (0.0 = disabled).

dry_basenumber

DRY base value.

dry_allowed_lengthinteger

Length after which DRY penalty grows exponentially.

dry_penalty_last_ninteger

How many tokens to scan for DRY repetitions (0 = disabled, -1 = context size).

dry_sequence_breakersstring[]

Sequence breakers for DRY sampling.

xtc_probabilitynumber

Probability for token removal via XTC sampler (0.0 = disabled).

xtc_thresholdnumber

Minimum probability threshold for XTC.

mirostatinteger

Enable Mirostat sampling (0 = disabled, 1 = Mirostat, 2 = Mirostat 2.0).

mirostat_taunumber

Target entropy for Mirostat.

mirostat_etanumber

Learning rate for Mirostat.

grammarstring

Grammar for grammar‑based sampling.

json_schemaobject

JSON schema for grammar‑based sampling.

seedinteger

RNG seed; -1 = random.

ignore_eosboolean

Continue generating after EOS token.

logit_biasobject

Modify the likelihood of a token appearing. Accepts a JSON object mapping token IDs to a bias value from -100 to 100, or false to ban a token.

n_probsinteger

If > 0, top-N token probabilities are returned.

min_keepinteger

Force samplers to return at least N tokens.

t_max_predict_msinteger

Maximum generation time in milliseconds (0 = disabled).

id_slotinteger

Assign the request to a specific inference slot (-1 = auto).

cache_promptboolean

Reuse KV cache from previous requests when possible.

return_tokensboolean

Include raw token IDs in the response.

samplersstring[]

Ordered list of samplers to apply.

timings_per_tokenboolean

Include timing information per token.

return_progressboolean

Include prompt‑processing progress when streaming.

post_sampling_probsboolean

Return top‑N probabilities after sampling.

response_fieldsstring[]

Select which fields to include in the response.

multimodal_datastring[]

Base64‑encoded multimodal data (images, audio, …). Must match the number of <__media__> markers in the prompt.

Response

Completion result

idstring required

Unique identifier for the completion.

object'chat.completion' required
createdinteger required

Unix timestamp of creation.

modelstring required

Model used for the completion.

system_fingerprintstring

Fingerprint of the system configuration used.

generation_settingsobject

The generation settings used for the completion.

promptstring

The processed prompt.

truncatedboolean

True if the context size was exceeded.

tokens_cachedinteger

Number of tokens from the prompt which were reused from a cache.

tokens_evaluatedinteger

Number of tokens evaluated in total from the prompt.