Unquant

Opening your workspace…

Unquant

Chat completions

OpenAI-compatible chat completions, with streaming, images, tool calling and reasoning control.

POST /v1/chat/completions

curl https://api.unquant.io/v1/chat/completions \
  -H "Authorization: Bearer $UNQUANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"glm-5.3-flash",
       "messages":[{"role":"user","content":"Hello!"}]}'

Request fields

Core
modelstringRequired

glm-5.3-flash or qwen-3.8-flash-next.

messagesarrayRequired

Roles system, user, assistant and tool. Content is a string or an array of text and image_url parts.

streamboolean

Stream the reply as server-sent events.

stream_optionsobject

{"include_usage": true} adds a final chunk with token counts.

Length
max_tokensinteger

Upper bound on the reply length.

max_completion_tokensinteger

Same as max_tokens.

Sampling
temperaturenumber

Randomness of sampling.

top_pnumber

Nucleus sampling.

top_kinteger

Sample from the k most likely tokens.

min_pnumber

Minimum relative probability for a token.

seedinteger

Seed for repeatable sampling.

stopstring or array

Stop sequences.

Repetition
frequency_penaltynumber

Penalise tokens by how often they appeared.

presence_penaltynumber

Penalise tokens that appeared at all.

repetition_penaltynumber

Multiplicative repetition penalty.

Tools
toolsarray

Functions the model may call, in the OpenAI format.

tool_choicestring or object

auto, none, required or a named function.

parallel_tool_callsboolean

Allow several tool calls in one turn.

Output
response_formatobject

JSON output.

logprobsboolean

Return token log probabilities.

top_logprobsinteger

How many alternatives to return per token.

ninteger

Must be 1: one completion per request.

Reasoning
reasoning_effortstring

Both models: none, low or high; GLM-5.3-Flash also takes max.

chat_template_kwargsobject

Template switches, such as {"enable_thinking": false}.

Other fields are ignored.

Response

response.choices[0].message.content

Usage counts are returned for your own monitoring; they are never billed.

Streaming

With "stream": true the reply arrives as server-sent events in the OpenAI chunk format, ending with data: [DONE]. Read the text from choices[0].delta.content.

Images

Both models accept images as image_url parts holding a base64 data URL (data:image/png;base64,..., JPEG or WebP). Image links by URL are not fetched and return 400.

{"role": "user", "content": [
  {"type": "text", "text": "Describe this image."},
  {"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,/9j/4AAQ..."}}
]}

Tool calling

Pass tools as in the OpenAI API. When the model calls a tool, the reply has finish_reason: "tool_calls" and message.tool_calls; run the tool, append a tool message with its result and the matching tool_call_id, and call again.

Reasoning

Both models reason before answering, and both take reasoning_effort: none for direct answers, low for light reasoning or high for harder problems; GLM-5.3-Flash also has max and defaults to high. The thinking is returned separately in reasoning_content, never mixed into content. "thinking": {"type": "disabled"} and "chat_template_kwargs": {"enable_thinking": false} also turn it off.

Concurrency

Your plan sets how many requests can run at once across all your keys. A request beyond that limit returns 429 straight away and is not queued; running requests are unaffected.

Developer guide