The request
Onlymodel and messages are required.
Fields warpllm models
string
required
A
provider/model routing string. See Model routing.array
required
Conversation turns. Each message carries
role and content, plus
tool_calls and tool_call_id where the turn is part of a
tool-calling exchange. content is a string or an
array of content parts (text, image, audio, file, refusal).number
Sampling temperature.
integer
Ceiling on tokens generated for the completion.
number
Nucleus sampling cutoff.
string | string[]
Sequences that end generation.
object
{ "include_usage": true } asks for a final usage chunk.array
Tool definitions the model may call. See Tool calling.
string | object
Whether and which tool the model must call.
object
{ "type": "json_object" } or a JSON Schema. See
Structured outputs.string
Reasoning budget hint for models that accept one.
Fields warpllm does not model
A field absent from that list is forwarded to the provider untouched rather than rejected. This is deliberate: a provider parameter warpllm has not learned yet is still usable today.In Python the request parameter is a
Mapping, so any key type-checks. In
TypeScript chatCompletions is generic in the request type, which is what
lets { ...request, seed: 7 } compile without a cast. In Rust the struct
carries a flattened unknown_fields map that round-trips anything it does
not name.The response
A non-streamed call returns one whole completion.model in the response is warpllm’s routing string, not the upstream
name. A reply to openrouter/anthropic/claude-sonnet-4 says exactly that, so
a log line identifies the route you asked for.Response fields
string
required
string
required
integer
required
string
required
The
provider/model string that was routed.array
required
Each carries
index, finish_reason, message, and optional logprobs.
The message carries content, refusal, role, and optional annotations,
audio, function_call, and tool_calls.object
prompt_tokens, completion_tokens, total_tokens, plus
prompt_tokens_details (cached_tokens, cache_write_tokens,
audio_tokens) and completion_tokens_details (reasoning_tokens,
accepted_prediction_tokens, rejected_prediction_tokens, audio_tokens)
where the provider reports them.string
string
object
Provider moderation results, where the provider returns them.
Why responses come back as plain data
The bindings hand you the JSON shape rather than a wrapper object. Rust has already parsed and validated the response; rebuilding it into Python or JavaScript objects would redo that work to return the same fields under the same names.
So Python reads
completion["choices"][0]["message"]["content"] while Node and
Rust read completion.choices[0].message.content.
Next
Streaming
The chunk shape and how a stream ends.
Errors
What comes back instead when a request fails.