I-effort yokuqiqa
EntshaImodeli eqiqa ibuyisa umbhalo wayo wokuqiqa ecaleni kwempendulo, kwintsimi yayo. Kwiimodeli ze-open-weight ezisingathiweyo intsimi enye yesicelo imisela ukuba imodeli iqiqa nzulu kangakanani phambi kokuphendula.
POST https://api.shannon-ai.com/v1/chat/completions
from openai import OpenAI
client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.shannon-ai.com/v1")
response = client.chat.completions.create(
model="Kimi-K3-3BIT-REAP",
reasoning_effort="low",
messages=[{"role": "user", "content": "Is 221 a prime number?"}],
)
message = response.choices[0].message
print("Reasoning:", getattr(message, "reasoning_content", None))
print("Answer:", message.content)
print("Reasoning tokens:", response.usage.completion_tokens_details.reasoning_tokens) import OpenAI from "openai";
const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.shannon-ai.com/v1" });
const response = await client.chat.completions.create({
model: "Kimi-K3-3BIT-REAP",
reasoning_effort: "low",
messages: [{ role: "user", content: "Is 221 a prime number?" }],
});
const message = response.choices[0].message;
console.log("Reasoning:", message.reasoning_content);
console.log("Answer:", message.content);
console.log("Reasoning tokens:", response.usage.completion_tokens_details.reasoning_tokens); curl https://api.shannon-ai.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "Kimi-K3-3BIT-REAP",
"reasoning_effort": "low",
"messages": [
{"role": "user", "content": "Is 221 a prime number?"}
]
}' Impendulo ithwala umbhalo wokuqiqa kwi-reasoning_content, impendulo kwi-content, kunye nee-token zokuqiqa kwi-usage:
{
"id": "chatcmpl-2a6c8e0b4d1f4a3c9e7b5d3f1a8c6e4b",
"object": "chat.completion",
"created": 1791590400,
"model": "Kimi-K3-3BIT-REAP",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "No. 221 = 13 x 17, so it is not prime.",
"reasoning_content": "Try small primes. 221 / 13 = 17, so 221 = 13 x 17."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 14,
"completion_tokens": 43,
"total_tokens": 57,
"prompt_tokens_details": {"cached_tokens": 0},
"completion_tokens_details": {"reasoning_tokens": 27}
}
} Zeziphi iimodeli eziqiqayo
| Imodeli | Ibuyisa umbhalo wokuqiqa | Isebenzisa intsimi yobunzulu |
|---|---|---|
shannon-1.6-lite | — | — |
shannon-1.6-pro, shannon-2-lite, shannon-2-pro, shannon-3, shannon-3-pro, shannon-3.1, shannon-3.1-pro, shannon-coder-1 | Ewe | — |
| Yonke imodeli ye-open-weight esingathiweyo | Ewe | Ewe |
Le yimiqondiso capabilities.reasoning kunye ne-capabilities.reasoning_effort ebikwa yi-GET /v1/models kwi-id nganye. Impendulo ithwala umbhalo wokuqiqa kuphela xa imodeli ivelise omnye. Iimodeli namaxabiso
Ukumisela ubunzulu
I-endpoint nganye inendlela yayo yokubhala ubunzulu. Zonke zikhetha elinye lamanqanaba amane afanayo.
| Intsimi | Uhlobo | Okuqhelekileyo | Inkcazelo | Isebenza kwi |
|---|---|---|---|---|
reasoning_effort | string | high | /v1/chat/completions. Imodeli iqiqa nzulu kangakanani phambi kokuphendula: off, low, medium okanye high. | Iimodeli ze-open-weight ezisingathiweyo |
reasoning | object | string | /v1/chat/completions. Ixabiso elifanayo njenge-{"effort": "low"} okanye njengomtya nje. Xa zombini iintsimi zithunyelwe, i-reasoning_effort iyabalwa. | Iimodeli ze-open-weight ezisingathiweyo | |
reasoning.effort | string | high | /v1/responses. Ibhalwe njenge-object {"effort": "low"}. | Iimodeli ze-open-weight ezisingathiweyo |
thinking | object | /v1/messages. {"type": "enabled", "budget_tokens": n} okanye {"type": "disabled"}. Ibhajethi ikhetha elinye lamanqanaba; jonga itheyibhile engezantsi. | Iimodeli ze-open-weight ezisingathiweyo |
{
"model": "Kimi-K3-3BIT-REAP",
"reasoning_effort": "low",
"messages": [{"role": "user", "content": "Is 221 a prime number?"}]
} {
"model": "Kimi-K3-3BIT-REAP",
"reasoning": {"effort": "low"},
"input": "Is 221 a prime number?"
} {
"model": "Kimi-K3-3BIT-REAP",
"max_tokens": 1024,
"thinking": {"type": "enabled", "budget_tokens": 2048},
"messages": [{"role": "user", "content": "Is 221 a prime number?"}]
} | Ixabiso | Kwamkelwa nokuba | Isiphumo |
|---|---|---|
off | none, minimal | Akukho kuqiqa. Impendulo ayithwali mbhalo wokuqiqa. |
low | Ukuqiqa okufutshane. | |
medium | default | Ubunzulu obuphakathi. |
high | max | Inqanaba elinzulu kakhulu. Eli linqanaba lesicelo esingathumeli ixabiso. |
- Amaxabiso afundwa ngaphandle kokuhlonipha oonobumba abakhulu okanye abancinci.
- Ixabiso
defaultlithethamedium. Ukushiya intsimi ngaphandle kuthethahigh. - Iimodeli zeShannon (
shannon-*) zizimisela ubunzulu bazo kwisicelo ngasinye; i-GET /v1/modelsibika i-reasoning_effort: falsekuzo.
Ibhajethi ye-thinking kwi-/v1/messages
Kwi-/v1/messages intsimi ye-thinking ikhetha inqanaba. I-budget_tokens ikhetha elinye lamanqanaba angasentla; ayisosithintelo see-token sayo. I-adaptive ifundwa njenge-enabled.
| Uthumela | Inqanaba |
|---|---|
{"type": "disabled"} | off |
{"type": "enabled", "budget_tokens": n} kunye ne-n ukuya kuthi ga kwi-2,048 | low |
I-n ukusuka kwi-2,049 ukuya kwi-8,192 | medium |
I-n enkulu, okanye i-enabled ngaphandle kwe-budget_tokens | high |
Akukho ntsimi ye-thinking | high |
Apho umbhalo wokuqiqa ufika khona
Umbhalo wokuqiqa uhlala wahlukile kwimpendulo. Ifomathi nganye inendawo yayo yawo:
| Endpoint | Ngaphandle kwe-stream | Nge-stream |
|---|---|---|
/v1/chat/completions | choices[0].message.reasoning_content: umtya, okanye i-null xa imodeli ingavelisanga nto. | Ii-chunk ezine-choices[0].delta.reasoning_content, phambi kwee-chunk ezine-delta.content. |
/v1/responses | Into ye-output {"type": "reasoning", "summary": [{"type": "summary_text", "text": "…"}]} phambi kwento ye-message. Akukho nto xa kungekho kuqiqa. | I-response.output_item.added kunye nento ye-reasoning, emva koko imisitho ye-response.reasoning_summary_text.delta kunye ne-response.reasoning_summary_text.done enye. |
/v1/messages | Ibhloko yokuqala yomxholo {"type": "thinking", "thinking": "…"}, emva koko ibhloko ye-text. Akukho bhloko ye-thinking xa kungekho kuqiqa. | Ibhloko yomxholo ye-thinking: imisitho ye-content_block_start, i-content_block_delta kunye ne-thinking_delta, i-content_block_stop. Ibhloko yombhalo iyalandela. |
{
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "No. 221 = 13 x 17, so it is not prime.",
"reasoning_content": "Try small primes. 221 / 13 = 17, so 221 = 13 x 17."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 14,
"completion_tokens": 43,
"total_tokens": 57,
"prompt_tokens_details": {"cached_tokens": 0},
"completion_tokens_details": {"reasoning_tokens": 27}
}
} {
"output": [
{
"id": "rs_6f0a2c4e8b1d4f3a9c7e5b3d1f8a6c4e",
"type": "reasoning",
"summary": [
{
"type": "summary_text",
"text": "Try small primes. 221 / 13 = 17, so 221 = 13 x 17."
}
]
},
{
"id": "msg_1b3d5f7a9c2e4b6d8f0a2c4e6b8d0f1a",
"type": "message",
"role": "assistant",
"status": "completed",
"content": [
{
"type": "output_text",
"text": "No. 221 = 13 x 17, so it is not prime.",
"annotations": []
}
]
}
],
"usage": {
"input_tokens": 14,
"input_tokens_details": {"cached_tokens": 0},
"output_tokens": 43,
"output_tokens_details": {"reasoning_tokens": 27},
"total_tokens": 57
}
} {
"content": [
{
"type": "thinking",
"thinking": "Try small primes. 221 / 13 = 17, so 221 = 13 x 17."
},
{"type": "text", "text": "No. 221 = 13 x 17, so it is not prime."}
],
"stop_reason": "end_turn",
"usage": {
"input_tokens": 14,
"cache_read_input_tokens": 0,
"cache_creation_input_tokens": 0,
"output_tokens": 43
}
} Apho kufuneka ujonge khona, ngemodeli nganye:
| Iimodeli | Apho umbhalo ufika khona |
|---|---|
| Iimodeli ze-open-weight ezisingathiweyo | Kuyo yonke i-endpoint, nge-stream okanye ngaphandle kwayo. Isicelo esinobunzulu off, okanye esine-response_format / text.format, siphendulwa ngaphandle kombhalo wokuqiqa. |
shannon-3, shannon-3-pro, shannon-3.1, shannon-3.1-pro | Kuyo yonke i-endpoint, nge-stream okanye ngaphandle kwayo, nanini na imodeli ivelise umbhalo wokuqiqa. |
shannon-2-lite, shannon-2-pro | /v1/chat/completions, ngaphandle kwe-stream: kwi-message.reasoning_content. Nge-stream, kwisicelo esingenayo i-tools okanye i-response_format: i-stream ithwala imigca yengcaciso : thinking ngoxa imodeli iqiqa, emva koko ii-chunk zempendulo. /v1/messages, nge-stream: ibhloko ye-thinking phambi kwebhloko yombhalo. |
shannon-1.6-pro, shannon-coder-1 | Kwiimpendulo ze-stream nakwiimpendulo zezicelo ezithwala i-tools, nanini na imodeli ivelise umbhalo wokuqiqa. |
Kwi-/v1/responses, impendulo engekho nge-stream ithwala into ye-reasoning kwintsapho yeShannon 3 nakwiimodeli ze-open-weight ezisingathiweyo.
Ukufunda i-stream
Kwi-stream umbhalo wokuqiqa uza kuqala, kwii-delta zawo, kwaye impendulo iyalandela. Printa okanye gcina ezi zimbini ngokwahlukeneyo:
from openai import OpenAI
client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.shannon-ai.com/v1")
stream = client.chat.completions.create(
model="Kimi-K3-3BIT-REAP",
reasoning_effort="medium",
stream=True,
messages=[{"role": "user", "content": "Is 221 a prime number?"}],
)
for chunk in stream:
if not chunk.choices:
continue
delta = chunk.choices[0].delta
reasoning = getattr(delta, "reasoning_content", None)
if reasoning:
print(reasoning, end="", flush=True) # the reasoning text comes first
if delta.content:
print(delta.content, end="", flush=True) # then the answer import OpenAI from "openai";
const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.shannon-ai.com/v1" });
const stream = await client.chat.completions.create({
model: "Kimi-K3-3BIT-REAP",
reasoning_effort: "medium",
stream: true,
messages: [{ role: "user", content: "Is 221 a prime number?" }],
});
for await (const chunk of stream) {
const delta = chunk.choices[0]?.delta ?? {};
if (delta.reasoning_content) process.stdout.write(delta.reasoning_content); // the reasoning text comes first
if (delta.content) process.stdout.write(delta.content); // then the answer
} curl -N https://api.shannon-ai.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "Kimi-K3-3BIT-REAP",
"reasoning_effort": "medium",
"stream": true,
"messages": [
{"role": "user", "content": "Is 221 a prime number?"}
]
}' I-chunk yokuqala yemodeli ye-open-weight esingathiweyo, ukuqiqa okanye impendulo, ikwathwala i-delta.role: "assistant". Umsinga
Ii-token zokuqiqa kunye nokuhlawula
Kwiimodeli ze-open-weight ezisingathiweyo, ii-token zokuqiqa zii-token zokuphuma: zihlawulwa ngexabiso lokuphuma lemodeli, kwaye inani lokuphuma sele libandakanya. I-usage ibonisa isahlulo sokuqiqa apha:
| Endpoint | Intsimi | Inqaku |
|---|---|---|
/v1/chat/completions | usage.completion_tokens_details.reasoning_tokens | Sele ibandakanyiwe kwi-completion_tokens. |
/v1/responses | usage.output_tokens_details.reasoning_tokens | Sele ibandakanyiwe kwi-output_tokens. |
/v1/messages | usage.output_tokens | Ukuqiqa nempendulo kunye. Le fomathi ayinalo inani elahlukileyo. |
- Kwiimodeli ze-open-weight ezisingathiweyo i-
max_tokensilinganisa umbhalo wempendulo. Ii-token zokuqiqa azibalwa kuyo. - Ngenxa yokuba ukuqiqa kuhlawulwa njengokuphuma, inqanaba lobunzulu liseto lendleko: i-
offayivelisi ii-token zokuqiqa. - Iimodeli zeShannon zibika i-
prompt_tokens, i-completion_tokenskunye ne-total_tokens(i-input_tokenskunye ne-output_tokenskwi-/v1/messages) ngaphandle kwesahlulo sokuqiqa, kwaye zihlawula ixabiso elinye elifanayo nge-token nganye. Iimodeli namaxabiso
Ukuqiqa kwisicelo esilandelayo
Akunyanzelekanga ukuba uthumele ukuqiqa emva. Ibhloko ye-thinking okanye into ye-reasoning kwincoko oyithumelayo ayidluliselwa kwimodeli, ngoko umjikelo wesincedisi unokubuya nayo okanye ngaphandle kwayo. Ibhloko ye-thinking inentsimi ezimbini type kunye ne-thinking; ayinayo i-signature.
Iimpazamo
| Isimo | Uhlobo | Umyalezo | Xa |
|---|---|---|---|
400 | invalid_request_error | unknown reasoning effort '<value>'; expected off, low, medium or high | Imodeli ye-open-weight esingathiweyo ifumene ixabiso elingaphandle koluhlu, umzekelo xhigh. Akukho nto ithathwa kwibhalansi yakho. |
422 | invalid_request_error | Failed to deserialize the JSON body into the target type: … | I-reasoning_effort ayingomtya. |
Iimpazamo zokuqinisekisa, zebhalansi nezeserver zifana nakwisicelo ngasinye. Ukuphatha imposiso