Ipa ìrònú
TuntunModel tó ń ronú ń dá ọ̀rọ̀ ìrònú rẹ̀ padà lẹ́gbẹ̀ẹ́ ìdáhùn, nínú field tirẹ̀. Lórí àwọn model open-weight tí a gbàlejò, field ìbéèrè kan ń ṣètò bí model ṣe ń ronú jinlẹ̀ tó kí ó tó dáhùn.
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?"}
]
}' Èsì náà ń gbé ọ̀rọ̀ ìrònú nínú reasoning_content, ìdáhùn nínú content, àti àwọn token ìrònú nínú 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}
}
} Àwọn model tó ń ronú
| Model | Ó ń dá ọ̀rọ̀ ìrònú padà | Ó ń lo field effort |
|---|---|---|
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 | Bẹ́ẹ̀ ni | — |
| Gbogbo model open-weight tí a gbàlejò | Bẹ́ẹ̀ ni | Bẹ́ẹ̀ ni |
Wọ̀nyí ni àwọn flag capabilities.reasoning àti capabilities.reasoning_effort tí GET /v1/models ń ròyìn fún id kọ̀ọ̀kan. Èsì ń gbé ọ̀rọ̀ ìrònú nígbà tí model bá mú díẹ̀ jáde nìkan. Àwọn model àti iye owó
Ṣíṣètò effort
Endpoint kọ̀ọ̀kan ní ìkọ̀wé tirẹ̀ fún effort. Gbogbo wọn ń yan ọ̀kan nínú ipele mẹ́rin kan náà.
| Field | Irú | Default | Àpèjúwe | Ó ń ṣiṣẹ́ lórí |
|---|---|---|---|---|
reasoning_effort | string | high | /v1/chat/completions. Bí model ṣe ń ronú jinlẹ̀ tó kí ó tó dáhùn: off, low, medium tàbí high. | Àwọn model open-weight tí a gbàlejò |
reasoning | object | string | /v1/chat/completions. Iye kan náà bí {"effort": "low"} tàbí bí string lásán. Nígbà tí a bá fi àwọn field méjèèjì ránṣẹ́, reasoning_effort ni a ń kà. | Àwọn model open-weight tí a gbàlejò | |
reasoning.effort | string | high | /v1/responses. A kọ ọ́ bí object {"effort": "low"}. | Àwọn model open-weight tí a gbàlejò |
thinking | object | /v1/messages. {"type": "enabled", "budget_tokens": n} tàbí {"type": "disabled"}. Budget ń yan ọ̀kan nínú àwọn ipele; wo tábìlì tó wà ní ìsàlẹ̀. | Àwọn model open-weight tí a gbàlejò |
{
"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?"}]
} | Iye | A tún gbà | Ohun tó ń ṣe |
|---|---|---|
off | none, minimal | Kò sí ìrònú. Èsì kò gbé ọ̀rọ̀ ìrònú. |
low | Ìrònú kúkúrú. | |
medium | default | Jíjìn àárín. |
high | max | Ipele tó jinlẹ̀ jù. Èyí ni ipele ìbéèrè tí kò fi iye ránṣẹ́. |
- A ń ka àwọn iye láìbìkítà fún lẹ́tà ńlá tàbí kékeré.
- Iye
defaulttúmọ̀ símedium. Fífi field náà sílẹ̀ túmọ̀ síhigh. - Àwọn model Shannon (
shannon-*) ń ṣètò jíjìn tiwọn ní ìbéèrè kọ̀ọ̀kan;GET /v1/modelsń ròyìnreasoning_effort: falsefún wọn.
Budget Ríronú lórí /v1/messages
Lórí /v1/messages, field thinking ń yan ipele. budget_tokens ń yan ọ̀kan nínú àwọn ipele òkè; kì í ṣe ààlà token tirẹ̀. A ń ka adaptive bí enabled.
| O fi ránṣẹ́ | Ipele |
|---|---|
{"type": "disabled"} | off |
{"type": "enabled", "budget_tokens": n} pẹ̀lú n títí dé 2,048 | low |
n láti 2,049 dé 8,192 | medium |
n tó tóbi jù, tàbí enabled láìsí budget_tokens | high |
Kò sí field thinking | high |
Ibi tí ọ̀rọ̀ ìrònú ti ń dé
Ọ̀rọ̀ ìrònú máa ń yàtọ̀ sí ìdáhùn nígbà gbogbo. Ọ̀nà kọ̀ọ̀kan ní ibi tirẹ̀ fún un:
| Endpoint | Kì í ṣe streaming | Streaming |
|---|---|---|
/v1/chat/completions | choices[0].message.reasoning_content: string, tàbí null nígbà tí model kò mú nǹkankan jáde. | Àwọn chunk pẹ̀lú choices[0].delta.reasoning_content, ṣáájú àwọn chunk pẹ̀lú delta.content. |
/v1/responses | Ohun output {"type": "reasoning", "summary": [{"type": "summary_text", "text": "…"}]} ṣáájú ohun message. Kò sí ohun kankan nígbà tí kò bá sí ìrònú. | response.output_item.added pẹ̀lú ohun reasoning, lẹ́yìn náà àwọn event response.reasoning_summary_text.delta àti response.reasoning_summary_text.done kan. |
/v1/messages | Block àkóónú àkọ́kọ́ {"type": "thinking", "thinking": "…"}, lẹ́yìn náà block text. Kò sí block thinking nígbà tí kò bá sí ìrònú. | Block àkóónú thinking: content_block_start, àwọn event content_block_delta pẹ̀lú thinking_delta, content_block_stop. Block ọ̀rọ̀ tẹ̀lé e. |
{
"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
}
} Ibi tí a ó wò, fún model kọ̀ọ̀kan:
| Àwọn model | Ibi tí ọ̀rọ̀ náà ti ń dé |
|---|---|
| Àwọn model open-weight tí a gbàlejò | Lórí gbogbo endpoint, streaming tàbí kìí ṣe. Ìbéèrè pẹ̀lú effort off, tàbí pẹ̀lú response_format / text.format, ni a ń dáhùn láìsí ọ̀rọ̀ ìrònú. |
shannon-3, shannon-3-pro, shannon-3.1, shannon-3.1-pro | Lórí gbogbo endpoint, streaming tàbí kìí ṣe, nígbà gbogbo tí model bá mú ọ̀rọ̀ ìrònú jáde. |
shannon-2-lite, shannon-2-pro | /v1/chat/completions, kì í ṣe streaming: nínú message.reasoning_content. Streaming, nínú ìbéèrè láìsí tools tàbí response_format: stream ń gbé àwọn ìlà ọ̀rọ̀ ìṣàlàyé : thinking nígbà tí model ń ronú, lẹ́yìn náà àwọn chunk ìdáhùn. /v1/messages, streaming: block thinking ṣáájú block ọ̀rọ̀. |
shannon-1.6-pro, shannon-coder-1 | Nínú àwọn èsì streaming àti nínú àwọn èsì sí àwọn ìbéèrè tó gbé tools, nígbà gbogbo tí model bá mú ọ̀rọ̀ ìrònú jáde. |
Lórí /v1/responses, èsì tí kì í ṣe streaming ń gbé ohun reasoning fún ìdílé Shannon 3 àti àwọn model open-weight tí a gbàlejò.
Kíka stream
Nínú stream, ọ̀rọ̀ ìrònú ló kọ́kọ́ dé, nínú àwọn delta tirẹ̀, ìdáhùn sì tẹ̀lé e. Tẹ̀ tàbí fi àwọn méjèèjì pamọ́ lọ́tọ̀ọ̀tọ̀:
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?"}
]
}' Chunk àkọ́kọ́ ti model open-weight tí a gbàlejò, ìrònú tàbí ìdáhùn, tún ń gbé delta.role: "assistant". Sisanwọle
Àwọn token ìrònú àti ìsanwó
Lórí àwọn model open-weight tí a gbàlejò, àwọn token ìrònú jẹ́ token output: a ń gba owó wọn ní iye owó output ti model, ìkà output sì ti ní wọn nínú. usage ń fi ìpín ìrònú hàn níbí:
| Endpoint | Field | Àkíyèsí |
|---|---|---|
/v1/chat/completions | usage.completion_tokens_details.reasoning_tokens | Ó ti wà nínú completion_tokens tẹ́lẹ̀. |
/v1/responses | usage.output_tokens_details.reasoning_tokens | Ó ti wà nínú output_tokens tẹ́lẹ̀. |
/v1/messages | usage.output_tokens | Ìrònú àti ìdáhùn papọ̀. Ọ̀nà yìí kò ní ìkà tó yàtọ̀. |
- Lórí àwọn model open-weight tí a gbàlejò,
max_tokensń fi ààlà sí ọ̀rọ̀ ìdáhùn. A kò ka àwọn token ìrònú sínú rẹ̀. - Nítorí a ń gba owó ìrònú bí output, ipele effort tún jẹ́ ètò owó:
offkì í mú àwọn token ìrònú jáde. - Àwọn model Shannon ń ròyìn
prompt_tokens,completion_tokensàtitotal_tokens(input_tokensàtioutput_tokenslórí/v1/messages) láìsí ìpín ìrònú, wọ́n sì ń gba owó kan ṣoṣo fún token kọ̀ọ̀kan. Àwọn model àti iye owó
Ìrònú nínú ìbéèrè tó kàn
O kò nílò láti fi ìrònú ránṣẹ́ padà. A kì í fi block thinking tàbí ohun reasoning tó wà nínú ìjíròrò tí o fi ránṣẹ́ fún model, nítorí náà ìyípo assistant lè padà pẹ̀lú rẹ̀ tàbí láìsí i. Block thinking ní field méjì type àti thinking; kò ní signature.
Àwọn àṣìṣe
| Ipò | Irú | Ìfiránṣẹ́ | Nígbà wo |
|---|---|---|---|
400 | invalid_request_error | unknown reasoning effort '<value>'; expected off, low, medium or high | Model open-weight tí a gbàlejò gba iye tó wà lẹ́yìn àtòjọ, fún àpẹẹrẹ xhigh. A kò yọ nǹkankan láti balance rẹ. |
422 | invalid_request_error | Failed to deserialize the JSON body into the target type: … | reasoning_effort kì í ṣe string. |
Àwọn àṣìṣe authentication, balance àti server jẹ́ bákan náà fún gbogbo ìbéèrè. Mimu Aṣiṣe