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 or deepseek-v4.1-flash-1017.

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

Every model: low or high; GLM-5.3-Flash and DeepSeek V4.1 Flash 1017 also take max. Qwen 3.8 Flash Next and DeepSeek V4.1 Flash 1017 also take none (thinking off); GLM-5.3-Flash always thinks and refuses it.

chat_template_kwargsobject

Template switches, such as {"enable_thinking": false} (Qwen 3.8 Flash Next and DeepSeek V4.1 Flash 1017; GLM-5.3-Flash always thinks).

Caching
prompt_cache_keystring

One stable value per conversation keeps its turns on the server that holds its cached prompt. Without it, a conversation is recognised by its system prompt and first message, so set it if your system prompt changes between turns.

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

Every model accepts 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

Every model reasons before answering and takes reasoning_effort: low for light reasoning or high for harder problems; GLM-5.3-Flash and DeepSeek V4.1 Flash 1017 also have max and default to high. The thinking is returned separately in reasoning_content, never mixed into content.

GLM-5.3-Flash always thinks: its reasoning cannot be turned off, and a request that asks for that is refused with a 400 error. Qwen 3.8 Flash Next and DeepSeek V4.1 Flash 1017 can also answer directly: send none, or "thinking": {"type": "disabled"} or "chat_template_kwargs": {"enable_thinking": false}.

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