Litšoantšo le lifaele
Romela litšoantšo le molaetsa: hore na ke li-model life tse li amohelang, mebopeho e amohelwang le meeli ea eona.
POST https://api.shannon-ai.com/v1/chat/completions
Setšoantšo se tsamaea ka hare ho molaetsa oa user, e le karolo e le 'ngoe ea content ea oona. Mohlala o bala faele ea lehae mme o e romela e le data URL.
import base64
from openai import OpenAI
client = OpenAI(api_key="YOUR_API_KEY", base_url="https://api.shannon-ai.com/v1")
with open("photo.jpg", "rb") as f:
image = base64.b64encode(f.read()).decode()
response = client.chat.completions.create(
model="shannon-3",
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "What is in this picture?"},
{"type": "image_url", "image_url": {"url": "data:image/jpeg;base64," + image}},
],
}],
)
print(response.choices[0].message.content) import fs from "node:fs";
import OpenAI from "openai";
const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://api.shannon-ai.com/v1" });
const image = fs.readFileSync("photo.jpg").toString("base64");
const response = await client.chat.completions.create({
model: "shannon-3",
messages: [{
role: "user",
content: [
{ type: "text", text: "What is in this picture?" },
{ type: "image_url", image_url: { url: "data:image/jpeg;base64," + image } },
],
}],
});
console.log(response.choices[0].message.content); # Linux: base64 -w0 photo.jpg macOS: base64 -i photo.jpg
IMAGE=$(base64 -w0 photo.jpg)
curl https://api.shannon-ai.com/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d @- <<EOF
{
"model": "shannon-3",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "What is in this picture?"},
{"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,${IMAGE}"}}
]
}]
}
EOF {
"id": "chatcmpl-8d1f3a5c7e9b4d2f6a8c0e2b4d6f8a1c",
"object": "chat.completion",
"created": 1791590400,
"model": "shannon-3",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "A grey cat asleep on a windowsill, with a potted fern beside it.",
"reasoning_content": null
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 286,
"completion_tokens": 19,
"total_tokens": 305
}
} Li-model life tse amohelang litšoantšo
| Li-model | E bala |
|---|---|
shannon-3, shannon-3-pro, shannon-3.1, shannon-3.1-pro | Litšoantšo, le litokomane: lifaele tsa PDF, Word, PowerPoint, Excel le mongolo o hlakileng. |
shannon-1.6-lite, shannon-1.6-pro | Litšoantšo. |
shannon-2-lite, shannon-2-pro | Litšoantšo, likopong tse boetseng li romela tools kapa response_format. |
Kimi-K3-3BIT-REAP, MiniMax-M3-3BIT-REAP, Kimi-K2.6-W4A16-AUTOROUND-REAP, inkling-W4A16-AUTOROUND-REAP, MiMo-V2.5-W8A16 | Litšoantšo. |
DeepSeek-V4-Pro-0813-3BIT-REAP, GLM-5.2-3BIT-REAP, Nemotron3Ultra-3BIT-REAP, DeepSeek-V4-Flash-0731-W4A16-AUTOROUND-REAP, Laguna-S-2.1-W4A16-AUTOROUND-REAP, MiMo-V2.5-Pro-W8A16, Hy3-W8A16 | Mongolo. Kopo e nang le setšoantšo e arajoa ka boemo ba 400. |
shannon-coder-1 | Mongolo. |
GET /v1/models e tlaleha input ea setšoantšo ka id e le capabilities.vision. Li-model le litheko
- Li-model tsa Shannon li bala lifaele tsa molaetsa oa ho qetela oa user. Behe setšoantšo molaetsing o botsang ka sona.
- Lelapa la Shannon 3 le boetse le boloka litšoantšo le litokomane tse 'ngoe tsa melaetsa e fetileng ea user ha li ne li romeloa inline, mme le bala palo e phahameng e behiloeng ea litšoantšo ka kopo, ho tloha ho ea pele.
- Li-model tse hosted tsa open-weight li bala litšoantšo tsa molaetsa o mong le o mong oa moqoqo.
Mebopeho e amohelwang
Faele e romeloa ka tsela e le 'ngoe ho tse peli: ka hare ho kopo e le base64, kapa e le aterese eo API e e fumanang. Faele e 'ngoe le e 'ngoe e tsamaea le kopo; API ha e na endpoint ea upload.
| Endpoint | Ka kopong (base64) | Ka aterese |
|---|---|---|
/v1/chat/completions | {"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,…"}} | {"type": "image_url", "image_url": {"url": "https://…"}} |
/v1/responses | {"type": "input_image", "image_url": "data:image/jpeg;base64,…"} | {"type": "input_image", "image_url": "https://…"} |
/v1/messages | {"type": "image", "source": {"type": "base64", "media_type": "image/jpeg", "data": "…"}} | {"type": "image", "source": {"type": "url", "url": "https://…"}} |
Molaetsa o tšoanang oa user sebopeho se seng le se seng:
{
"role": "user",
"content": [
{"type": "text", "text": "What is in this picture?"},
{
"type": "image_url",
"image_url": {
"url": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD…"
}
}
]
} {
"role": "user",
"content": [
{"type": "input_text", "text": "What is in this picture?"},
{
"type": "input_image",
"image_url": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD…"
}
]
} {
"role": "user",
"content": [
{"type": "text", "text": "What is in this picture?"},
{
"type": "image",
"source": {
"type": "base64",
"media_type": "image/jpeg",
"data": "/9j/4AAQSkZJRgABAQAAAQABAAD…"
}
}
]
} - Data URL e na le sebopeho
data:<media type>;base64,<data>. Karolo ea;base64e hlokahala. - Ho
/v1/chat/completionsle/v1/responses,image_urle ka ba string ka boeona kapa ntho{"url": "…"}. - Mofuta oa faele o tsoa ho data URL kapa ho
media_type. Ntle le oona, setšoantšo se baloa e leimage/png. - Lifaele tsa inline li bala ho boholo ba body ea kopo, e ka ba 32 MiB.
- E amohelwa bakeng sa compatibility:
image_url.detail.
Meeli ea lifaele tse hole
Ha u romela aterese, API e fumana faele pele model e sebetsa, kahare ho meeli ena:
| Moeli | Molao |
|---|---|
| Boholo | Ho fihlela ho 8 MiB ka faele. |
| Nako | Metsotsoana e 20 ea ho araba. |
| Li-redirect | Bonyane ba 5. |
| Aterese | http:// kapa https://, ntle le lebitso la user kapa password aterese-ng, ho host e nang le aterese ea sechaba. |
| Karabo ea host | Boemo ba mofuta oa 200 le body e seng ntle. Mofuta oa faele o baloa ho Content-Type. |
| E kopiloe e le | User-Agent: ShannonBot/1.0 (+https://shannon-ai.com) |
Hore na litšoantšo li baloa joang ka tokens
Ho li-model tse hosted tsa open-weight setšoantšo se bala token e le 'ngoe bakeng sa patch e 'ngoe le e 'ngoe ea pixel tsa 28 × 28: bophara bo arotsoe ka 28, bo hlatsoeng holimo, ho atolosoa ka bophahamo bo arotsoeng ka 28, bo hlatsoeng holimo. Sephetho ke karolo ea usage.prompt_tokens mme se lefisoa e le input.
- 1024 × 1024
- 1,369 tokens
- 1920 × 1080
- 2,691 tokens
- 512 × 512
- 361 tokens
- Setšoantšo se hole se fumanoa pele, kahoo boholo ba sona ba 'nete bo a baloa.
- Setšoantšo seo boholo ba sona bo sa balehe se bala tokens tse 1,024.
- Li-endpoint tsa ho bala li sebelisa molao o tšoanang bakeng sa li-data URL. Ha li fumane aterese e hole mme li e bala e le tokens tse 1,024. Ho bala tokens
- Bakeng sa model ea Shannon, bala hore na kopo e nang le litšoantšo e jele bokae ho
usagekarabong.
Litokomane le lifaele tse ling
Lelapa la Shannon 3 (shannon-3, shannon-3-pro, shannon-3.1, shannon-3.1-pro) le bala le litokomane. Mongolo oa tokomane oa ntšoa mme oa fuoa model hammoho le molaetsa oa hau.
| Tokomane | Mofuta oa media |
|---|---|
application/pdf | |
| Word | application/vnd.openxmlformats-officedocument.wordprocessingml.document |
| PowerPoint | application/vnd.openxmlformats-officedocument.presentationml.presentation |
| Excel | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
Tokomane ke karolo ea molaetsa oa user, joalo ka setšoantšo:
| Endpoint | Ka kopong (base64) | Ka aterese |
|---|---|---|
/v1/chat/completions, /v1/messages | {"type": "document", "source": {"type": "base64", "media_type": "application/pdf", "data": "…"}} | {"type": "document", "source": {"type": "url", "url": "https://…"}} |
/v1/responses | {"type": "input_file", "file_data": "data:application/pdf;base64,…"} | {"type": "input_file", "file_url": "https://…"} |
{
"model": "shannon-3",
"messages": [
{
"role": "user",
"content": [
{
"type": "document",
"source": {
"type": "base64",
"media_type": "application/pdf",
"data": "JVBERi0xLjcKJeLjz9MK…"
}
},
{"type": "text", "text": "Summarise this report in five points."}
]
}
]
} {
"model": "shannon-3",
"input": [
{
"role": "user",
"content": [
{
"type": "input_file",
"file_data": "data:application/pdf;base64,JVBERi0xLjcKJeLjz9MK…"
},
{
"type": "input_text",
"text": "Summarise this report in five points."
}
]
}
]
} {
"model": "shannon-3",
"messages": [
{
"role": "user",
"content": [
{
"type": "document",
"source": {
"type": "base64",
"media_type": "application/pdf",
"data": "JVBERi0xLjcKJeLjz9MK…"
}
},
{"type": "text", "text": "Summarise this report in five points."}
]
}
]
} - Fana ka mofuta oa 'nete oa media oa faele. Ntle le oona, tokomane e baloa e le
application/pdf. - Faele ea mongolo o hlakileng, e kang CSV, e baloa e le mongolo mme e kenngoa ka tsela e tšoanang.
- Ha tokomane e sa baloe, kapa faele e le ea mofuta o mong, model e bolelloa joalo mme e ka e bolela karabong ea eona. Boemo bo ntse bo le
200. - Ho model e 'ngoe le e 'ngoe karolo ea tokomane e siuoa ho seo model e se balang, mme kopo e arajoa ho latela se setseng.
- Tokomane e rometsoeng ka aterese e fumanoa tlasa meeli ea lifaele tse hole e ka holimo.
Liphoso
| Boemo | Mofuta | Molaetsa | Neng |
|---|---|---|---|
400 | invalid_request_error | <id> does not accept image input | Setšoantšo se rometsoe ho model e hosted ea open-weight e amohelang mongolo feela. Ha ho letho le nkoang ho balance ea hau. |
400 | invalid_request_error | audio and video input are not supported by any hosted model | Karolo ea audio kapa video e rometsoe ho model e hosted ea open-weight. |
413 | invalid_request_error | Failed to buffer the request body: … | Body ea kopo, hammoho le lifaele tsa eona tsa inline, e kholo ho feta 32 MiB. Phoso e na le code: "request_too_large". |
Model ea Shannon e araba ka boemo ba 200 ho sa tsotellehe hore na kopo e nka lifaele life: karolo eo e sa e balang e siuoa. Diphoso