Mifananidzo ne-files
Tumira mifananidzo ne-message: ma-model anoigamuchira, forms dzinogamuchirwa ne-limits dzadzo.
POST https://api.shannon-ai.com/v1/chat/completions
Mufananidzo unofamba mukati me-user message, sechikamu che-content yayo. Sample inoverenga local file ndokuitumira se-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
}
} Ma-model anogamuchira mifananidzo
| Ma-model | Inoverenga |
|---|---|
shannon-3, shannon-3-pro, shannon-3.1, shannon-3.1-pro | Mifananidzo, ne-documents: PDF, Word, PowerPoint, Excel ne-plain-text files. |
shannon-1.6-lite, shannon-1.6-pro | Mifananidzo. |
shannon-2-lite, shannon-2-pro | Mifananidzo, mu-requests dzinotumirawo tools kana response_format. |
Kimi-K3-3BIT-REAP, MiniMax-M3-3BIT-REAP, Kimi-K2.6-W4A16-AUTOROUND-REAP, inkling-W4A16-AUTOROUND-REAP, MiMo-V2.5-W8A16 | Mifananidzo. |
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 | Text. Request ine mufananidzo inopindurwa ne-status 400. |
shannon-coder-1 | Text. |
GET /v1/models inoratidza image input pa-id se-capabilities.vision. Ma-model nemitengo
- Shannon models dzinoverenga files dze-user message yekupedzisira. Isa mufananidzo mu-message inobvunza nezvawo.
- Mhuri ye-Shannon 3 inochengetawo mifananidzo mishoma ne-documents dze-user messages dzekare dzichiri kuonekwa kana dzakatumirwa inline, uye inoverenga huwandu hwakatarwa hwemifananidzo pa-request, kuverenga kuchibva pane yekutanga.
- Hosted open-weight models dzinoverenga mifananidzo ye-message imwe neimwe yehurukuro.
Forms dzinogamuchirwa
File inotumirwa nenzira mbiri: mukati me-request se-base64, kana se-address iyo API inotora. File imwe neimwe inofamba ne-request; API haina upload endpoint.
| Endpoint | Mu-request (base64) | Nge-address |
|---|---|---|
/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://…"}} |
User message imwechete mu-format imwe neimwe:
{
"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 ine form
data:<media type>;base64,<data>. Chikamu che-;base64chinodiwa. - Pa-
/v1/chat/completionsne-/v1/responses,image_urlinogona kuva string pachayo kana object{"url": "…"}. - File type inobva ku-data URL kana ku-
media_type. Pasina iyo, mufananidzo unoverengwa se-image/png. - Inline files dzinoverengwa mu-size ye-request body, inogona kusvika ku-32 MiB.
- Inogamuchirwa kuti zvienderane:
image_url.detail.
Limits dze-remote files
Kana ukatumira address, API inotora file model isati yamhanya, mukati me-limits idzi:
| Limit | Mutemo |
|---|---|
| Size | Kusvika ku-8 MiB pa-file imwe. |
| Nguva | Masekonzi 20 ekupindura. |
| Redirects | Zvisingapfuuri 5. |
| Address | http:// kana https://, pasina user name kana password mu-address, pa-host ine public address. |
| Mhinduro ye-host | Status iri mu-200 range uye body isina kusiya isina chinhu. File type inoverengwa kubva ku-Content-Type. |
| Inokumbirwa se | User-Agent: ShannonBot/1.0 (+https://shannon-ai.com) |
Kuti mifananidzo inoverengwa sei mu-tokens
Pa-hosted open-weight models mufananidzo unoverengwa se-token imwe pa-28 × 28 pixel patch imwe neimwe: upamhi hunogoverwa ne-28, hunokwidziridzwa, hunowanikwa nekureba kunogoverwa ne-28, kunokwidziridzwa. Mhedzisiro iri chikamu che-usage.prompt_tokens uye inobhadharwa se-input.
- 1024 × 1024
- 1,369 tokens
- 1920 × 1080
- 2,691 tokens
- 512 × 512
- 361 tokens
- Mufananidzo we-remote unotorwa kutanga, saka size yawo chaiyo ndiyo inoverengwa.
- Mufananidzo une size isingaverengeke unoverengwa se-1,024 tokens.
- Counting endpoints dzinoshandisa mutemo wakafanana we-data URLs. Hadzitore remote address uye dzinoiverenga se-1,024 tokens. Kuverenga tokens
- Pa-Shannon model, verenga kuti request ine mifananidzo yakadhura zvakadii kubva ku-
usagemumhinduro.
Documents nemamwe files
Mhuri ye-Shannon 3 (shannon-3, shannon-3-pro, shannon-3.1, shannon-3.1-pro) inoverengawo ma-documents. Text ye-document inobviswa ndokupiwa model pamwe chete ne-message yako.
| Document | Media type |
|---|---|
application/pdf | |
| Word | application/vnd.openxmlformats-officedocument.wordprocessingml.document |
| PowerPoint | application/vnd.openxmlformats-officedocument.presentationml.presentation |
| Excel | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
Document i-part ye-user message, semufananidzo:
| Endpoint | Mu-request (base64) | Nge-address |
|---|---|---|
/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."}
]
}
]
} - Ipa media type chaiyo ye-file. Pasina iyo, document inoverengwa se-
application/pdf. - Plain-text file, sa-CSV, inoverengwa se-text ndokubatanidzwa nenzira imwechete.
- Kana document isingaverengeke, kana file iri yemhando imwe, model inoudzwa izvozvo uye inogona kuzvitaura mumhinduro yayo. Status inoramba iri
200. - Pa-model imwe neimwe, document part inosiiwa pane zvinoverengwa ne-model, uye request inopindurwa kubva pane zvasara.
- Document inotumirwa nge-address inotorwa pasi pe-limits dze-remote files dziri pamusoro.
Errors
| Status | Mhando | Message | Rinhi |
|---|---|---|---|
400 | invalid_request_error | <id> does not accept image input | Mufananidzo watumirwa kune hosted open-weight model inogamuchira text chete. Hapana chinobviswa mu-balance yako. |
400 | invalid_request_error | audio and video input are not supported by any hosted model | Audio kana video part yatumirwa kune hosted open-weight model. |
413 | invalid_request_error | Failed to buffer the request body: … | Request body, pamwe ne-inline files dzayo, yakakura kupfuura 32 MiB. Error inotakura code: "request_too_large". |
Shannon model inopindura ne-status 200 chero files dzipi dzinotakurwa ne-request: part isingaverengwi inosiiwa. Zvikanganiso