Skip to main content
POST
Create chat completion

Authorizations

Authorization
string
header
required

Your Seekr API key, sent in the Authorization header with no 'Bearer' prefix.

Body

application/json
messages
ChatCompletionMessageParam · object[]
required

Conversation so far, as a list of messages.

model
string | null

ID of the model to use.

frequency_penalty
number | null
default:0

Penalty applied to tokens based on how often they already appear in the text. Positive values reduce repetition.

logit_bias
Logit Bias · object | null

Map of token IDs to a bias value. The bias is added to the model's logits before sampling.

logprobs
boolean | null
default:false

If true, returns the log probability of each output token.

top_logprobs
integer | null
default:0

Number of most likely tokens to return at each position, each with its log probability. Requires logprobs to be true.

max_tokens
integer | null
deprecated

Maximum number of tokens to generate.

max_completion_tokens
integer | null

Maximum number of tokens to generate in the completion.

n
integer | null
default:1

Number of completions to generate for each prompt.

presence_penalty
number | null
default:0

Penalty applied to tokens that already appear in the text. Positive values encourage the model to introduce new topics.

response_format
ResponseFormat · object

Format the model must use for its output.

seed
integer | null

Random seed for sampling. Requests with the same seed and parameters aim to return the same result.

Required range: -9223372036854776000 <= x <= 9223372036854776000
stop
default:[]

Sequences where generation stops. The matched stop sequence is omitted unless include_stop_str_in_output is true.

stream
boolean | null
default:false

If true, the response arrives as server-sent events while the model generates it.

stream_options
StreamOptions · object | null

Options for a streaming response. Set only when stream is true.

temperature
number | null

Sampling temperature. Higher values make the output more random, and lower values make it more focused and repeatable.

top_p
number | null

Nucleus sampling. The model samples only from the smallest set of tokens whose combined probability reaches this value.

tools
ChatCompletionToolsParam · object[] | null

Tools the model can call.

tool_choice
default:none

Controls whether and which tool the model calls.

Allowed value: "none"
reasoning_effort
enum<string> | null

Constrains effort on reasoning for reasoning models. Currently supported values are none, minimal, low, medium, high, xhigh, and max. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.

Available options:
none,
minimal,
low,
medium,
high,
xhigh,
max
thinking_token_budget
integer | null

Maximum number of tokens allowed for thinking operations (reasoning models). Non-negative integer sets the limit; -1 means unlimited (treated as unset).

include_reasoning
boolean
default:true

Whether to include reasoning extracted by the backend in the response. Does not disable reasoning generation. Requires a model and backend that support reasoning output.

parallel_tool_calls
boolean | null
default:true

If true, the model can call more than one tool in a single turn.

user
string | null

Identifier for the end user, accepted for compatibility. Ignored by vLLM; other backends may use it.

If true, uses beam search instead of sampling to generate the output.

top_k
integer | null

Limits sampling to the K most likely tokens at each step.

min_p
number | null

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

repetition_penalty
number | null

Penalty applied to tokens that already appear in the prompt or the generated text. Values above 1 discourage repetition, and values below 1 encourage it.

length_penalty
number
default:1

Penalty on sequence length when beam search is on. Values above 0 favor longer sequences, and values below 0 favor shorter ones.

stop_token_ids
integer[] | null

Token IDs where generation stops.

include_stop_str_in_output
boolean
default:false

If true, includes the matched stop string in the output text.

ignore_eos
boolean
default:false

If true, generation continues after the end-of-sequence token.

min_tokens
integer
default:0

Minimum number of tokens to generate before a stop condition can end the output.

skip_special_tokens
boolean
default:true

If true, removes special tokens from the output text.

spaces_between_special_tokens
boolean
default:true

If true, adds spaces between special tokens in the output text.

truncate_prompt_tokens
integer | null

Maximum number of prompt tokens to keep. Use -1 for the model context limit. truncation_side selects which end is dropped; when unset, the backend uses its default.

Required range: -1 <= x <= 9223372036854776000
truncation_side
enum<string> | null

Which side to truncate from when truncate_prompt_tokens is active. 'right' keeps the first N tokens. 'left' keeps the last N tokens.

Available options:
left,
right
prompt_logprobs
integer | null

Number of log probabilities to return for each prompt token.

logprob_token_ids
integer[] | null

Specific vocab token IDs to return logprobs for at each generated position, in addition to the sampled token. Requires logprobs=True.

allowed_token_ids
integer[] | null

Token IDs the model is allowed to generate. All other tokens are blocked.

bad_words
string[]

Words the model avoids generating.

echo
boolean
default:false

If true, the new message will be prepended with the last message if they belong to the same role.

add_generation_prompt
boolean
default:true

If true, the generation prompt will be added to the chat template. This is a parameter used by chat template in tokenizer config of the model.

continue_final_message
boolean
default:false

If this is set, the chat will be formatted so that the final message in the chat is open-ended, without any EOS tokens. The model will continue this message rather than starting a new one. This allows you to "prefill" part of the model's response for it. Cannot be used at the same time as add_generation_prompt.

add_special_tokens
boolean
default:false

If true, special tokens (e.g. BOS) will be added to the prompt on top of what is added by the chat template. For most models the chat template takes care of adding the special tokens, so this should be left false.

documents
Documents · object[] | null

A list of dicts representing documents that will be accessible to the model if it is performing RAG (retrieval-augmented generation). If the template does not support RAG, this argument will have no effect. Each document should contain "title" and "text" keys.

chat_template
string | null

A Jinja template to use for this conversion. As of transformers v4.44, the default chat template is no longer allowed, so you must provide a chat template if the tokenizer does not define one.

chat_template_kwargs
Chat Template Kwargs · object | null

Additional keyword args to pass to the template renderer. Will be accessible by the chat template.

media_io_kwargs
Media Io Kwargs · object | null

Additional kwargs to pass to the media IO connectors, keyed by modality. Merged with engine-level media_io_kwargs.

mm_processor_kwargs
Mm Processor Kwargs · object | null

Additional kwargs to pass to the HF processor.

structured_outputs
StructuredOutputsParams · object | null

Additional keyword arguments for structured outputs.

priority
integer
default:0

The priority of the request (lower means earlier handling; default: 0). Any priority other than 0 will raise an error if the served model does not use priority scheduling.

Required range: -9223372036854776000 <= x <= 9223372036854776000
request_id
string | null

The request_id related to this request. If the caller does not set it, a random uuid will be generated. This id is used throughout the inference process and returned in the response.

return_tokens_as_token_ids
boolean | null

If specified with 'logprobs', tokens are represented as strings of the form 'token_id:{token_id}' so that tokens that are not JSON-encodable can be identified.

return_token_ids
boolean | null

If specified, the result will include token IDs alongside the generated text. In streaming mode, prompt_token_ids is included only in the first chunk, and token_ids contains the delta tokens for each chunk.

return_prompt_text
boolean | null

If true, the response will include prompt_text containing the prompt string produced by chat templating. In streaming mode it is sent only on the first chunk.

cache_salt
string | null

If specified, the prefix cache will be salted with the provided string to prevent an attacker from guessing prompts in multi-user environments. The salt should be random, protected from access by 3rd parties, and long enough to be unpredictable.

vllm_xargs
Vllm Xargs · object | null

Additional request parameters with (list of) string or numeric values, used by custom extensions.

repetition_detection
RepetitionDetectionParams · object | null

Parameters for detecting repetitive N-gram patterns in output tokens. If such repetition is detected, generation ends early.

Response

Successful response.

id
string
required

Unique ID of the response.

created
integer
required

Unix timestamp, in seconds, of when the response was created.

model
string
required

ID of the model that generated the response.

choices
ChatCompletionResponseChoice · object[]
required

List of generated completions.

usage
UsageInfo · object
required
object
string
default:chat.completion

Object type. Always chat.completion.

Allowed value: "chat.completion"
service_tier
enum<string> | null

Service tier reported by the backend, when available. May be null.

Available options:
auto,
default,
flex,
scale,
priority
system_fingerprint
string | null

Identifier for the backend configuration that served the request.

prompt_logprobs
(object | null)[] | null

Log probabilities for the prompt tokens.

prompt_token_ids
integer[] | null

Token IDs of the input prompt, included when return_token_ids is true.

prompt_text
string | null

Prompt text produced by the chat template, included when return_prompt_text is true.

metrics
PerRequestTimingMetrics · object | null

Timing and throughput measurements for this request, when reported by the backend.

Last modified on July 31, 2026