Unquant

Opening your workspace…

Unquant

चैट कम्प्लीशन

OpenAI-compatible chat completions, streaming, images, tool calling और 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 या qwen-3.8-flash-next या deepseek-v4.1-flash-1017।

messagesarrayRequired

Roles system, user, assistant और tool। Content एक string या text और image_url parts का array है।

streamboolean

Reply को server-sent events के रूप में stream करें।

stream_optionsobject

{"include_usage": true} token counts के साथ एक final chunk जोड़ता है।

Length
max_tokensinteger

Reply length पर upper bound।

max_completion_tokensinteger

max_tokens के समान।

Sampling
temperaturenumber

Sampling की randomness।

top_pnumber

Nucleus sampling।

top_kinteger

k सबसे likely tokens में से sample करें।

min_pnumber

किसी token के लिए minimum relative probability।

seedinteger

Repeatable sampling के लिए seed।

stopstring or array

Stop sequences।

Repetition
frequency_penaltynumber

Tokens को कितनी बार appear हुए उसके हिसाब से penalise करें।

presence_penaltynumber

जो tokens appear हुए उन्हें penalise करें।

repetition_penaltynumber

Multiplicative repetition penalty।

Tools
toolsarray

वे functions जिन्हें model call कर सकता है, OpenAI format में।

tool_choicestring or object

auto, none, required या एक named function।

parallel_tool_callsboolean

एक turn में कई tool calls की अनुमति दें।

Output
response_formatobject

JSON output।

logprobsboolean

Token log probabilities return करें।

top_logprobsinteger

प्रति token कितने alternatives return करें।

ninteger

1 होना चाहिए: प्रति request एक completion।

Reasoning
reasoning_effortstring

हर model: low या high; GLM-5.3-Flash और DeepSeek V4.1 Flash 1017 max भी लेते हैं। Qwen 3.8 Flash Next और DeepSeek V4.1 Flash 1017 none भी लेते हैं (thinking off); GLM-5.3-Flash हमेशा सोचता है और इसे refuse करता है।

chat_template_kwargsobject

Template switches, जैसे {"enable_thinking": false} (Qwen 3.8 Flash Next और DeepSeek V4.1 Flash 1017; GLM-5.3-Flash हमेशा सोचता है)।

Caching
prompt_cache_keystring

प्रति conversation एक stable value उसके turns को उस server पर रखती है जो उसका cached prompt hold करता है। इसके बिना, conversation उसके system prompt और पहले message से पहचाना जाता है, इसलिए इसे set करें अगर आपका system prompt turns के बीच बदलता है।

बाकी fields ignore की जाती हैं।

Response

response.choices[0].message.content

Usage counts आपकी खुद की monitoring के लिए return होती हैं; इन्हें कभी bill नहीं किया जाता।

Streaming

"stream": true के साथ reply OpenAI chunk format में server-sent events के रूप में आती है, data: [DONE] पर समाप्त होती है। choices[0].delta.content से text पढ़ें।

Images

हर model images को image_url parts के रूप में accept करता है जो base64 data URL (data:image/png;base64,..., JPEG या WebP) hold करते हैं। URL से image links fetch नहीं होते और 400 return करते हैं।

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

Tool calling

OpenAI API की तरह tools pass करें। जब model एक tool call करता है, reply में finish_reason: "tool_calls" और message.tool_calls होता है; tool run करें, उसके result और matching tool_call_id के साथ एक tool message append करें, और फिर से call करें।

Reasoning

हर model जवाब देने से पहले reason करता है और reasoning_effort लेता है: हल्के reasoning के लिए low या कठिन problems के लिए high; GLM-5.3-Flash और DeepSeek V4.1 Flash 1017 में max भी है और default high है। Thinking अलग से reasoning_content में return होती है, कभी content में mix नहीं होती।

GLM-5.3-Flash हमेशा सोचता है: उसका reasoning बंद नहीं किया जा सकता, और ऐसा request करने पर 400 error के साथ refuse कर दिया जाता है। Qwen 3.8 Flash Next और DeepSeek V4.1 Flash 1017 सीधे भी जवाब दे सकते हैं: none भेजें, या "thinking": {"type": "disabled"} या "chat_template_kwargs": {"enable_thinking": false}।

Concurrency

आपका plan set करता है कि आपकी सभी keys पर एक साथ कितने requests run हो सकते हैं। उस limit से परे कोई request 429 तुरंत return करती है और queue नहीं होती; running requests प्रभावित नहीं होतीं।

Developer guide