Unquant

Opening your workspace…

Unquant

Chat completions

스트리밍, 이미지, 도구 호출, 추론 제어가 포함된 OpenAI 호환 채팅 완성.

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!"}]}'

요청 필드

핵심
modelstring필수

glm-5.3-flash 또는 qwen-3.8-flash-next 또는 deepseek-v4.1-flash-1017.

messagesarray필수

역할은 system, user, assistant, tool. 콘텐츠는 문자열 또는 text와 image_url 파트의 배열.

streamboolean

서버 전송 이벤트로 응답을 스트리밍합니다.

stream_optionsobject

{"include_usage": true}는 토큰 수가 포함된 최종 청크를 추가합니다.

길이
max_tokensinteger

응답 길이의 상한선.

max_completion_tokensinteger

max_tokens와 동일.

샘플링
temperaturenumber

샘플링의 무작위성.

top_pnumber

핵 샘플링.

top_kinteger

가장 가능성 높은 k개 토큰에서 샘플링.

min_pnumber

토큰의 최소 상대 확률.

seedinteger

반복 가능한 샘플링을 위한 시드.

stopstring or array

중지 시퀀스.

반복
frequency_penaltynumber

출현 빈도에 따라 토큰에 패널티 부여.

presence_penaltynumber

출현한 토큰에 패널티 부여.

repetition_penaltynumber

곱셈형 반복 패널티.

도구
toolsarray

모델이 호출할 수 있는 함수, OpenAI 형식으로.

tool_choicestring or object

auto, none, required 또는 명명된 함수.

parallel_tool_callsboolean

한 턴에 여러 도구 호출 허용.

출력
response_formatobject

JSON 출력.

logprobsboolean

토큰 로그 확률 반환.

top_logprobsinteger

토큰당 반환할 대안 수.

ninteger

반드시 1: 요청당 완성 하나.

추론
reasoning_effortstring

모든 모델: low 또는 high; GLM-5.3-Flash와 DeepSeek V4.1 Flash 1017은 max도 허용. Qwen 3.8 Flash Next와 DeepSeek V4.1 Flash 1017은 none도 허용 (추론 끄기); GLM-5.3-Flash는 항상 추론하며 이를 거부합니다.

chat_template_kwargsobject

{"enable_thinking": false}와 같은 템플릿 스위치 (Qwen 3.8 Flash Next와 DeepSeek V4.1 Flash 1017; GLM-5.3-Flash는 항상 추론).

캐싱
prompt_cache_keystring

대화당 하나의 안정적인 값을 사용하면 캐시된 프롬프트를 보유한 서버에 턴을 유지합니다. 없으면 대화는 시스템 프롬프트와 첫 번째 메시지로 인식되므로, 턴 간에 시스템 프롬프트가 변경되면 설정하십시오.

다른 필드는 무시됩니다.

응답

response.choices[0].message.content

사용량은 자체 모니터링을 위해 반환되며, 과금되지 않습니다.

스트리밍

"stream": true를 사용하면 응답이 OpenAI 청크 형식의 서버 전송 이벤트로 도착하며, data: [DONE]으로 종료됩니다. choices[0].delta.content에서 텍스트를 읽으십시오.

이미지

모든 모델이 base64 데이터 URL(data:image/png;base64,..., JPEG 또는 WebP)을 담은 image_url 파트로 이미지를 허용합니다. URL로 된 이미지 링크는 가져오지 않으며 400을 반환합니다.

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

도구 호출

OpenAI API에서처럼 tools를 전달하십시오. 모델이 도구를 호출하면 응답에 finish_reason: "tool_calls"와 message.tool_calls가 포함됩니다; 도구를 실행하고, 결과와 일치하는 tool_call_id를 담은 tool 메시지를 추가한 후 다시 호출하십시오.

추론

모든 모델이 답하기 전에 추론하며 reasoning_effort를 받습니다: 가벼운 추론은 low, 더 어려운 문제는 high; GLM-5.3-Flash와 DeepSeek V4.1 Flash 1017은 max도 있으며 기본값은 high입니다. 추론 내용은 reasoning_content에 별도로 반환되며, content에 혼합되지 않습니다.

GLM-5.3-Flash는 항상 추론합니다: 추론을 끄는 것이 불가능하며, 그런 요청은 400 오류로 거부됩니다. Qwen 3.8 Flash Next와 DeepSeek V4.1 Flash 1017은 직접 답변할 수도 있습니다: none을 보내거나, "thinking": {"type": "disabled"} 또는 "chat_template_kwargs": {"enable_thinking": false}를 사용하십시오.

동시성

플랜에서 모든 키에 걸쳐 동시에 실행할 수 있는 요청 수를 설정합니다. 그 한도를 초과하는 요청은 즉시 429를 반환하며 대기열에 넣지 않습니다; 실행 중인 요청은 영향을 받지 않습니다.

개발자 가이드