模型

Qwen: Qwen3.8 Flash

Markdown · JSON

Qwen: Qwen3.8 Flash

用於程式代理與辦公任務的大型脈絡多模態模型。在 Ailoot 分析文字與圖片,並產生文字回應。

關於模型

此說明介紹模型的能力。Ailoot 可用的輸入、輸出與選項,依所選方法列於下方。

Qwen3.8-Flash 結合軟體開發、連續辦公流程及視覺素材理解。Alibaba 將其描述為供代理規劃動作、取得回饋,再調整後續步驟的模型。宣稱的用途包括建立與改良軟體工具、處理商務素材,以及解答取決於畫面或文件內容的任務。

架構包含 125 十億個參數,其中每個 Token 會啟用 6 十億個。混合注意力結合 GDN 與 QSA,用於維持長序列並擷取所需資訊。殘差連結機制將資訊流分成四個平行分支,N-gram Embedding 機制另增加 51 十億個參數;訓練使用 Muon 最佳化器。這些設計屬於模型內部架構。目前 Ailoot 卡片提供文字與圖片輸入,輸出為文字。Alibaba 也描述了影片的共同處理;影片輸入須另行支援,目前卡片的方法未提供。

工作流程中的視覺素材

模型可分析螢幕截圖、擷取文件文字,並在準備程式碼時以圖片為參考。Alibaba 描述的版本會逐一分析影片影格,可用來說明事件、擷取教學影片內容及檢查視覺細節。模型本身輸出文字,包括說明、程式碼、工具呼叫或結構化資訊。

支援由連接的應用程式執行函式。推理模式下,模型先決定需要哪些動作及如何利用結果,再繼續回應。保留先前推理有助於維持長時間的工具工作。結構化輸出適合擷取後續交由程式處理的資料,可指定所需結構及欄位型別。在模型開發商的規格中,嚴格結構描述適用於純文字請求。使用圖片及其他多模態資料時,json_schema 會自動替換為 json_object:結果是 JSON,但不套用指定結構描述的限制。這些設定是否可用,取決於選定的 Ailoot 方法。

兩種回應方式

Qwen3.8-Flash 支援推理與直接回應。模型開發商預設啟用推理,標準強度為 xhigh;設定支援取決於選定的方法。low 用於簡單問題及資訊擷取,medium 用於日常開發與文件準備,xhigh 用於複雜程式碼、數學證明及架構任務。選定深度會影響事前分析量。若選定的方法提供這些設定,模型開發商使用 reasoning_effort 或 thinking_budget 其中一項;同時傳入這兩個控制項會產生錯誤。停用推理時,模型會直接形成回應。

脈絡可容納 1 000 000 個 Token。輸入長度上限為 991 808 個 Token,推理模式下為 983 616。輸出上限為 131 072 個 Token,推理另有 262 144 的上限。Alibaba 視覺規格列出最多 16 百萬像素的圖片,以及最長兩小時、大小最多 2 GB 的影片。模型開發商提供每項請求最多 2048 張透過網址傳入的圖片,或最多 250 張 Base64 圖片,以及最多 64 段影片。這些上限須與共用脈絡一併遵守,並描述模型開發商版本;目前 Ailoot 方法公布的是文字與圖片輸入,而非影片輸入或上述數量上限。

可快取重複的脈絡部分,供後續請求使用。此機制處理輸入素材的共用開頭;有此功能不會改變任務內容,也不代表每項請求必定利用先前保存的脈絡。

實用任務

實用任務

英文技術範例

Reconcile a business table and note

Reconcile this table: Team A opened 30 cases and closed 24; Team B opened 20 and closed 25. Manager note: “Both backlogs fell.” Assume no transfers or other adjustments. Calculate each team’s backlog change, assess the note and draft a corrected two-sentence update. Keep calculations separate from proposed explanations.

預期結果

Two net-change calculations, an assessment of the note and a corrected short update.

檢查結果

Check the sign convention and avoid inventing a cause for either team’s change.
Ailoot · Anthropic Messages POST /v1/messages qwen3.8-flash

qwen3.8-flash

Alibaba /qwen3.8-flash
模型 ID
  • qwen3.8-flash
  • qwen-flash
  • qwen-flash-latest

入門

用於程式代理與辦公任務的大型脈絡多模態模型。在 Ailoot 分析文字與圖片,並產生文字回應。

接受的輸入
文字 · 圖片
結果
文字

Ailoot 可用 · 輸入與方法

Ailoot · Anthropic Messages POST /v1/messages
輸入
text, image
輸出
text
上下文
991,808 tokens
輸出上限
131,072 tokens
輸出格式
json 或 SSE
欄位類型要求值與限制預設值
欄位model類型string要求必填值與限制
qwen3.8-flash
預設值—
欄位messages類型message[]要求必填值與限制
項目數下限: 1
預設值—
欄位messages[].role類型string要求必填值與限制
user, assistant
預設值—
欄位messages[].content類型string|content_block[]要求必填值與限制預設值—
欄位system類型string|content_block[]要求選填值與限制預設值—
欄位max_tokens類型integer要求必填值與限制
最小值: 1
限制適用對象: 所選模型/卡片的確切上限
預設值—
欄位stream類型boolean要求選填值與限制預設值false
欄位temperature類型number要求選填值與限制
依模型而定
預設值—
欄位top_p類型number要求選填值與限制
依模型而定
預設值—
欄位stop_sequences類型string[]要求選填值與限制
依模型而定
預設值—
欄位tools類型tool[]要求選填值與限制
依模型而定
預設值—
欄位tools[].name類型string要求選填值與限制
適用條件: 已提供工具
預設值—
欄位tools[].description類型string要求選填值與限制預設值—
欄位tools[].input_schema類型JSON_schema要求選填值與限制預設值—
欄位tool_choice類型object要求選填值與限制
依模型而定
預設值—
欄位thinking.type類型string要求選填值與限制
依模型而定
預設值—
欄位thinking.budget_tokens類型integer要求選填值與限制
依模型而定
預設值—
欄位output_config.effort類型string要求選填值與限制
依模型而定
預設值—
欄位metadata類型object要求選填值與限制預設值—
欄位cache_control類型object要求選填值與限制
依模型而定
預設值—
輸入素材組合

文字 · UTF8 文字

messages[].content 或 type=text 區塊

文字 + 圖片

{type:image,source:{type:base64,media_type,data}} 或 type=url 的來源

方法參數與生命週期
參數規格
參數material_types規格text, image
參數required規格model, messages, max_tokens
參數optional_controls規格null
參數content_type規格application/json
參數text_file_material規格實際 UTF-8 內容以文字插入;檔案 ID/URLs 需要另有精確支援

生命週期: exact retained published method

方法結構與 ID 均為精確值;供應商能力與准入狀態分開。

方案

Ailoot 方法費率

Ailoot Anthropic MessagesPOST /v1/messages
輸入
US$0.00015 / 1K
輸出
US$0.00047 / 1K
讀取快取
US$0.000016 / 1K
寫入快取
US$0.0002 / 1K
寫入快取,5 分鐘
US$0.0002 / 1K tokens

Ailoot 會在請求前預留估算金額。取得結果後,依實測用量結算最終費用。串流結算採用最終用量紀錄。預留金額與結算的運作方式 →

參考費率詳情

模型層級的參考費率表不會變更方法選擇、報價或費用。實際計費採用所選 Ailoot 方法的費率。

模型參考費率表

各設定的價格

請逐一核對各項費用與所列條件。每組互為替代選項的設定只套用一種費率。

設定費率表上下文 Token 數大於上下文 Token 數小於或等於費用
設定OpenAI Chat · 基本 token 費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定OpenAI Chat · 請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定Anthropic Messages · 基本 token 費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定Anthropic Messages · 請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token

請求範例

Ailoot · Anthropic Messages

文字範例輸入,圖片Python SDKNode.js SDKPython 串流
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 source-material file}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "qwen3.8-flash", "max_tokens": 1024, "messages": []}')
f=Path(os.environ["AILOOT_TEXT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 source material")
text=f.read_text(encoding="utf-8")
if not text.strip():raise SystemExit("Source material must contain text")
p["messages"]=[{"role":"user","content":"Summarize this material and quote supporting source passages.\n\n"+text}]
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \
  -H "x-api-key: $AILOOT_API_KEY" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_FILE:?Set your actual PNG JPEG or WebP image}"
export AILOOT_IMAGE_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "qwen3.8-flash", "max_tokens": 1024, "messages": [{"role": "user", "content": [{"type": "text", "text": "Read labels and numbers in this image; flag unreadable text."}]}]}')
import base64
f=Path(os.environ["AILOOT_IMAGE_FILE"])
if not f.is_file():raise SystemExit("Choose an actual PNG JPEG or WebP image")
raw=f.read_bytes()
mime="image/png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "image/jpeg" if raw.startswith(b"\xff\xd8") else "image/webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else None
if not mime:raise SystemExit("Use PNG JPEG or WebP")
b64=base64.b64encode(raw).decode()
p["messages"][0]["content"].append({"type":"image","source":{"type":"base64","media_type":mime,"data":b64}})
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \
  -H "x-api-key: $AILOOT_API_KEY" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
import anthropic
import os

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client = anthropic.Anthropic(base_url="https://api.ailoot.ai", api_key=os.environ["AILOOT_API_KEY"], max_retries=0)
msg = client.messages.create(
    model="qwen3.8-flash",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Explain the difference between an observation and a hypothesis in three sentences."}],
)
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

save_result(msg.to_dict(mode="json"))
import Anthropic from "@anthropic-ai/sdk";

if (!process.env.AILOOT_API_KEY?.trim()) throw new Error("Set AILOOT_API_KEY before making a request");
const client = new Anthropic({ baseURL: "https://api.ailoot.ai", apiKey: process.env.AILOOT_API_KEY, maxRetries: 0 });
const msg = await client.messages.create({
  model: "qwen3.8-flash",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Explain the difference between an observation and a hypothesis in three sentences." }],
});
import { writeFileSync } from "node:fs";

function saveResult(data, stem = "result") {
  writeFileSync(stem + ".json", JSON.stringify(data, null, 2));
  console.log(JSON.stringify(data, null, 2));
  const saveBlob = (encoded, suffix, label) => {
    const raw = Buffer.from(encoded, "base64");
    const ext = raw.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10])) ? "png" : raw[0]===255 && raw[1]===216 ? "jpg" : raw.subarray(0,4).toString()==="RIFF" && raw.subarray(8,12).toString()==="WEBP" ? "webp" : suffix;
    const file = `${stem}-${label}.${ext}`;
    writeFileSync(file, raw); console.log("Saved", file);
  };
  for (const [i, block] of (data.content || []).entries()) console.log("Content", i, JSON.stringify(block));
  for (const choice of data.choices || []) console.log("Choice", choice.index, JSON.stringify(choice.message || choice.delta || {}));
  for (const [i, item] of (data.output || []).entries()) {
    console.log("Output", i, JSON.stringify(item));
    if (item.type === "image_generation_call" && item.result) saveBlob(item.result, item.output_format || "bin", `output-${i}`);
  }
  for (const [ci, candidate] of (data.candidates || []).entries()) {
    for (const [pi, part] of (candidate.content?.parts || []).entries()) {
      console.log("Candidate/part", ci, pi, JSON.stringify(part));
      const blob = part.inlineData || part.inline_data;
      if (blob?.data) {
        const mime = blob.mimeType || blob.mime_type;
        const suffix = ({"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"})[mime] || "bin";
        saveBlob(blob.data, suffix, `candidate-${ci}-part-${pi}`);
      }
    }
  }
}

saveResult(msg);
import anthropic,os
from pathlib import Path

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=anthropic.Anthropic(base_url="https://api.ailoot.ai",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

with client.messages.stream(model='qwen3.8-flash',max_tokens=1024,messages=[{"role":"user","content":"Explain observations and hypotheses in three sentences."}]) as stream:
    with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
        for event in stream:
            payload=event.to_dict(mode="json")
            log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
            print(json.dumps(payload,ensure_ascii=False))
    final=stream.get_final_message()
    save_result(final.to_dict(mode="json"),"stream-result")

接收並儲存結果

Ailoot · Anthropic Messages

json 或 SSE

保留所有已完成的結果

請保留所有完整傳回的回應、檔案與內容區塊。

保留所有內容區塊、思考簽章與實際工具使用 ID。組合所有 SSE 區塊增量;第一個文字區塊不是完整輸出。

需要檢查原始回應時

保留請求/回應 ID 與標頭。未提供通用的文字工作擷取 URL。

回應欄位
欄位類型
欄位id類型string
欄位model類型string
欄位content[]類型text|thinking|tool_use|other content block
欄位stop_reason類型string|null
欄位usage類型object
錯誤與後續步驟
回應條件下一步
回應400 · invalid_request_error條件必要欄位、素材表示方式或參數值無效下一步提出新的建立請求前,先修正指定欄位。

別名

模型別名

Ailoot qwen3.8-flash, qwen-flash, qwen-flash-latest
Ailoot Ultra qwen3.8-flash, qwen/qwen3.8-flash

方法路徑別名

/chat/completions

相關呼叫用 ID

qwen/qwen3.8-flash, qwen-flash, qwen-flash-latest, qwen3.8-flash, qwen3.8-flash

Ailoot · OpenAI Responses POST /v1/responses qwen3.8-flash

qwen3.8-flash

Alibaba /qwen3.8-flash
模型 ID
  • qwen3.8-flash
  • qwen-flash
  • qwen-flash-latest

入門

用於程式代理與辦公任務的大型脈絡多模態模型。在 Ailoot 分析文字與圖片,並產生文字回應。

接受的輸入
文字 · 圖片
結果
文字

Ailoot 可用 · 輸入與方法

Ailoot · OpenAI Responses POST /v1/responses
輸入
text, image
輸出
text
上下文
991,808 tokens
輸出上限
131,072 tokens
輸出格式
json 或 SSE
欄位類型要求值與限制預設值
欄位model類型string要求必填值與限制
qwen3.8-flash
預設值—
欄位input類型string|input_item[]要求必填值與限制預設值—
欄位instructions類型string要求選填值與限制預設值—
欄位input[].type類型string要求選填值與限制
message, reasoning, function_call, function_call_output
預設值—
欄位input[].content類型string|content_part[]要求選填值與限制預設值—
欄位input[].call_id類型string要求選填值與限制
適用條件: function_call_output;保留實際回傳的 call_id
預設值—
欄位input[].output類型string|content_part[]要求選填值與限制
適用條件: function_call_output
預設值—
欄位max_output_tokens類型integer要求選填值與限制
最小值: 1
依模型而定
預設值—
欄位stream類型boolean要求選填值與限制預設值false
欄位temperature類型number要求選填值與限制
依模型而定
預設值—
欄位top_p類型number要求選填值與限制
依模型而定
預設值—
欄位tools類型tool[]要求選填值與限制
依模型而定
預設值—
欄位tool_choice類型string|object要求選填值與限制
依模型而定
預設值—
欄位parallel_tool_calls類型boolean要求選填值與限制
依模型而定
預設值—
欄位reasoning.effort類型string要求選填值與限制
依模型而定
預設值—
欄位reasoning.summary類型string要求選填值與限制
依模型而定
預設值—
欄位text.format類型object要求選填值與限制
依模型而定
預設值—
欄位text.verbosity類型string要求選填值與限制
依模型而定
預設值—
欄位include類型string[]要求選填值與限制
依模型而定
預設值—
欄位store類型boolean要求選填值與限制
依模型而定
預設值—
欄位previous_response_id類型string要求選填值與限制
ID 要求: 僅限支援的延續流程實際回傳的回應 ID
依模型而定
預設值—
欄位service_tier類型string要求選填值與限制
依模型而定
預設值—
欄位prompt_cache_key類型string要求選填值與限制
依模型而定
預設值—
欄位prompt_cache_options類型object要求選填值與限制
依模型而定
預設值—
輸入素材組合

文字 · UTF8 文字

輸入文字或 input_text 部分

文字 + 圖片

{type:input_image,image_url}

方法參數與生命週期
參數規格
參數material_types規格text, image
參數required規格model, input
參數optional_controls規格null
參數content_type規格application/json
參數text_file_material規格實際 UTF-8 內容以文字插入;檔案 ID/URLs 需要另有精確支援

生命週期: exact retained published method

方法結構與 ID 均為精確值;供應商能力與准入狀態分開。

方案

Ailoot 方法費率

Ailoot OpenAI ResponsesPOST /v1/responses
文字輸入
US$0.00015 / 1K
文字輸出
US$0.00047 / 1K
輸入,圖片
US$0.00015 / 1K tokens
讀取快取
US$0.000016 / 1K
寫入快取
US$0.0002 / 1K
寫入快取,5 分鐘
US$0.0002 / 1K tokens

Ailoot 會在請求前預留估算金額。取得結果後,依實測用量結算最終費用。串流結算採用最終用量紀錄。預留金額與結算的運作方式 →

參考費率詳情

模型層級的參考費率表不會變更方法選擇、報價或費用。實際計費採用所選 Ailoot 方法的費率。

模型參考費率表

各設定的價格

請逐一核對各項費用與所列條件。每組互為替代選項的設定只套用一種費率。

設定費率表上下文 Token 數大於上下文 Token 數小於或等於費用
設定OpenAI Chat · 基本 token 費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定OpenAI Chat · 請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定Anthropic Messages · 基本 token 費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定Anthropic Messages · 請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token

請求範例

Ailoot · OpenAI Responses

文字範例輸入,圖片Python SDKNode.js SDKPython 串流
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 source-material file}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "qwen3.8-flash", "input": ""}')
f=Path(os.environ["AILOOT_TEXT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 source material")
text=f.read_text(encoding="utf-8")
if not text.strip():raise SystemExit("Source material must contain text")
p["input"]="Summarize this material and quote supporting source passages.\n\n"+text
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/responses \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

save_result(json.loads(Path("result.json").read_text(encoding="utf-8")))
PY_RESULT
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_FILE:?Set your actual PNG JPEG or WebP image}"
export AILOOT_IMAGE_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "qwen3.8-flash", "input": [{"role": "user", "content": [{"type": "input_text", "text": "Read labels and numbers in this image; flag unreadable text."}]}]}')
import base64
f=Path(os.environ["AILOOT_IMAGE_FILE"])
if not f.is_file():raise SystemExit("Choose an actual PNG JPEG or WebP image")
raw=f.read_bytes()
mime="image/png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "image/jpeg" if raw.startswith(b"\xff\xd8") else "image/webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else None
if not mime:raise SystemExit("Use PNG JPEG or WebP")
b64=base64.b64encode(raw).decode()
p["input"][0]["content"].append({"type":"input_image","image_url":"data:"+mime+";base64,"+b64})
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/responses \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

save_result(json.loads(Path("result.json").read_text(encoding="utf-8")))
PY_RESULT
from openai import OpenAI
import os

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client = OpenAI(base_url="https://api.ailoot.ai/v1", api_key=os.environ["AILOOT_API_KEY"], max_retries=0)
resp = client.responses.create(model="qwen3.8-flash", input="Explain the difference between an observation and a hypothesis in three sentences.")
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

save_result(resp.to_dict(mode="json"))
import OpenAI from "openai";

if (!process.env.AILOOT_API_KEY?.trim()) throw new Error("Set AILOOT_API_KEY before making a request");
const client = new OpenAI({ baseURL: "https://api.ailoot.ai/v1", apiKey: process.env.AILOOT_API_KEY, maxRetries: 0 });
const resp = await client.responses.create({ model: "qwen3.8-flash", input: "Explain the difference between an observation and a hypothesis in three sentences." });
import { writeFileSync } from "node:fs";

function saveResult(data, stem = "result") {
  writeFileSync(stem + ".json", JSON.stringify(data, null, 2));
  console.log(JSON.stringify(data, null, 2));
  const saveBlob = (encoded, suffix, label) => {
    const raw = Buffer.from(encoded, "base64");
    const ext = raw.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10])) ? "png" : raw[0]===255 && raw[1]===216 ? "jpg" : raw.subarray(0,4).toString()==="RIFF" && raw.subarray(8,12).toString()==="WEBP" ? "webp" : suffix;
    const file = `${stem}-${label}.${ext}`;
    writeFileSync(file, raw); console.log("Saved", file);
  };
  for (const [i, block] of (data.content || []).entries()) console.log("Content", i, JSON.stringify(block));
  for (const choice of data.choices || []) console.log("Choice", choice.index, JSON.stringify(choice.message || choice.delta || {}));
  for (const [i, item] of (data.output || []).entries()) {
    console.log("Output", i, JSON.stringify(item));
    if (item.type === "image_generation_call" && item.result) saveBlob(item.result, item.output_format || "bin", `output-${i}`);
  }
  for (const [ci, candidate] of (data.candidates || []).entries()) {
    for (const [pi, part] of (candidate.content?.parts || []).entries()) {
      console.log("Candidate/part", ci, pi, JSON.stringify(part));
      const blob = part.inlineData || part.inline_data;
      if (blob?.data) {
        const mime = blob.mimeType || blob.mime_type;
        const suffix = ({"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"})[mime] || "bin";
        saveBlob(blob.data, suffix, `candidate-${ci}-part-${pi}`);
      }
    }
  }
}

saveResult(resp);
from openai import OpenAI
import os
from pathlib import Path
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
with client.responses.stream(model="qwen3.8-flash", input="Explain the difference between an observation and a hypothesis in three sentences.") as stream:
    with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
        for event in stream:
            payload=event.to_dict(mode="json")
            log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
            print(json.dumps(payload,ensure_ascii=False))
    final=stream.get_final_response()
    save_result(final.to_dict(mode="json"),"stream-result")

接收並儲存結果

Ailoot · OpenAI Responses

json 或 SSE

保留所有已完成的結果

請保留所有完整傳回的回應、檔案與內容區塊。

保留每個輸出項目與內容部分、實際函式 call_id、加密推理與用量。串流時保留完整事件/項目身分。

需要檢查原始回應時

保留請求/回應 ID 與標頭。未提供通用的文字工作擷取 URL。

回應欄位
欄位類型
欄位id類型string
欄位status類型string
欄位output[]類型message|reasoning|function_call|other item
欄位output[].content[]類型content part
欄位usage類型object
錯誤與後續步驟
回應條件下一步
回應400 · invalid_request_error條件必要欄位、素材表示方式或參數值無效下一步提出新的建立請求前,先修正指定欄位。

別名

模型別名

Ailoot qwen3.8-flash, qwen-flash, qwen-flash-latest
Ailoot Ultra qwen3.8-flash, qwen/qwen3.8-flash

方法路徑別名

/chat/completions

相關呼叫用 ID

qwen/qwen3.8-flash, qwen-flash, qwen-flash-latest, qwen3.8-flash, qwen3.8-flash

Ailoot · OpenAI Chat POST /v1/chat/completions qwen3.8-flash

qwen3.8-flash

Alibaba /qwen3.8-flash
模型 ID
  • qwen3.8-flash
  • qwen-flash
  • qwen-flash-latest

入門

用於程式代理與辦公任務的大型脈絡多模態模型。在 Ailoot 分析文字與圖片,並產生文字回應。

接受的輸入
文字 · 圖片
結果
文字

Ailoot 可用 · 輸入與方法

Ailoot · OpenAI Chat POST /v1/chat/completions
輸入
text, image
輸出
text
上下文
991,808 tokens
輸出上限
131,072 tokens
輸出格式
json 或 SSE
欄位類型要求值與限制預設值
欄位model類型string要求必填值與限制
qwen3.8-flash
預設值—
欄位messages類型message[]要求必填值與限制
項目數下限: 1
預設值—
欄位messages[].role類型string要求必填值與限制
範例:system, user, assistant, tool, function
條件: 這些角色由 原始碼中的相容型別明確表示;確切角色集合仍依模型而定。
依模型而定
預設值—
欄位messages[].content類型string|content_part[]|null要求選填值與限制預設值—
欄位messages[].tool_calls類型tool_call[]要求選填值與限制預設值—
欄位messages[].tool_call_id類型string要求選填值與限制
適用條件: role=tool;使用實際回傳的 ID
預設值—
欄位messages[].name類型string要求選填值與限制預設值—
欄位messages[].reasoning_content類型string要求選填值與限制
適用條件: 此模型使用推理內容時,將實際回傳的推理內容帶回後續請求
預設值—
欄位messages[].reasoning_details類型object|array要求選填值與限制
依模型而定
預設值—
欄位max_tokens類型integer要求選填值與限制
最小值: 1
依模型而定
預設值—
欄位max_completion_tokens類型integer要求選填值與限制
最小值: 1
依模型而定
預設值—
欄位stream類型boolean要求選填值與限制預設值false
欄位stream_options.include_usage類型boolean要求選填值與限制
依模型而定
預設值—
欄位temperature類型number要求選填值與限制
依模型而定
預設值—
欄位top_p類型number要求選填值與限制
依模型而定
預設值—
欄位stop類型string|string[]要求選填值與限制
依模型而定
預設值—
欄位tools類型function_tool[]要求選填值與限制
依模型而定
預設值—
欄位tools[].type類型string要求選填值與限制
依模型而定
預設值—
欄位tools[].function.name類型string要求必填值與限制
適用條件: 已提供函式工具
預設值—
欄位tools[].function.description類型string要求選填值與限制預設值—
欄位tools[].function.parameters類型JSON_schema要求選填值與限制預設值—
欄位tool_choice類型string|object要求選填值與限制
依模型而定
預設值—
欄位parallel_tool_calls類型boolean要求選填值與限制
依模型而定
預設值—
欄位response_format類型object要求選填值與限制
依模型而定
預設值—
欄位reasoning_effort類型string要求選填值與限制
依模型而定
預設值—
欄位reasoning類型object要求選填值與限制
依模型而定
預設值—
欄位service_tier類型string要求選填值與限制
依模型而定
預設值—
欄位instructions類型string要求選填值與限制
相容性欄位
預設值—
欄位functions類型function[]要求選填值與限制
依模型而定
預設值—
欄位function_call類型string|object要求選填值與限制
依模型而定
預設值—
欄位prompt_cache_options類型object要求選填值與限制
依模型而定
預設值—
輸入素材組合

文字 · UTF8 文字

messages[].content

文字 + 圖片

{type:image_url,image_url:{url,detail}}

方法參數與生命週期
參數規格
參數material_types規格text, image
參數required規格model, messages
參數optional_controls規格null
參數content_type規格application/json
參數text_file_material規格實際 UTF-8 內容以文字插入;檔案 ID/URLs 需要另有精確支援

生命週期: exact retained published method

方法結構與 ID 均為精確值;供應商能力與准入狀態分開。

方案

Ailoot 方法費率

Ailoot OpenAI ChatPOST /v1/chat/completions
文字輸入
US$0.00015 / 1K
文字輸出
US$0.00047 / 1K
輸入,圖片
US$0.00015 / 1K tokens
讀取快取
US$0.000016 / 1K
寫入快取
US$0.0002 / 1K
寫入快取,5 分鐘
US$0.0002 / 1K tokens

Ailoot 會在請求前預留估算金額。取得結果後,依實測用量結算最終費用。串流結算採用最終用量紀錄。預留金額與結算的運作方式 →

參考費率詳情

模型層級的參考費率表不會變更方法選擇、報價或費用。實際計費採用所選 Ailoot 方法的費率。

模型參考費率表

各設定的價格

請逐一核對各項費用與所列條件。每組互為替代選項的設定只套用一種費率。

設定費率表上下文 Token 數大於上下文 Token 數小於或等於費用
設定OpenAI Chat · 基本 token 費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定OpenAI Chat · 請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定Anthropic Messages · 基本 token 費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定Anthropic Messages · 請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token

請求範例

Ailoot · OpenAI Chat

文字範例輸入,圖片Python SDKNode.js SDKPython 串流
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 source-material file}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "qwen3.8-flash", "messages": []}')
f=Path(os.environ["AILOOT_TEXT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 source material")
text=f.read_text(encoding="utf-8")
if not text.strip():raise SystemExit("Source material must contain text")
p["messages"]=[{"role":"user","content":"Summarize this material and quote supporting source passages.\n\n"+text}]
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_FILE:?Set your actual PNG JPEG or WebP image}"
export AILOOT_IMAGE_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "qwen3.8-flash", "messages": [{"role": "user", "content": [{"type": "text", "text": "Read labels and numbers in this image; flag unreadable text."}]}]}')
import base64
f=Path(os.environ["AILOOT_IMAGE_FILE"])
if not f.is_file():raise SystemExit("Choose an actual PNG JPEG or WebP image")
raw=f.read_bytes()
mime="image/png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "image/jpeg" if raw.startswith(b"\xff\xd8") else "image/webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else None
if not mime:raise SystemExit("Use PNG JPEG or WebP")
b64=base64.b64encode(raw).decode()
p["messages"][0]["content"].append({"type":"image_url","image_url":{"url":"data:"+mime+";base64,"+b64}})
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
from openai import OpenAI
import os

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client = OpenAI(base_url="https://api.ailoot.ai/v1", api_key=os.environ["AILOOT_API_KEY"], max_retries=0)
resp = client.chat.completions.create(
    model="qwen3.8-flash",
    messages=[{"role": "user", "content": "Explain the difference between an observation and a hypothesis in three sentences."}],
)
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

save_result(resp.to_dict(mode="json"))
import OpenAI from "openai";

if (!process.env.AILOOT_API_KEY?.trim()) throw new Error("Set AILOOT_API_KEY before making a request");
const client = new OpenAI({ baseURL: "https://api.ailoot.ai/v1", apiKey: process.env.AILOOT_API_KEY, maxRetries: 0 });
const resp = await client.chat.completions.create({
  model: "qwen3.8-flash",
  messages: [{ role: "user", content: "Explain the difference between an observation and a hypothesis in three sentences." }],
});
import { writeFileSync } from "node:fs";

function saveResult(data, stem = "result") {
  writeFileSync(stem + ".json", JSON.stringify(data, null, 2));
  console.log(JSON.stringify(data, null, 2));
  const saveBlob = (encoded, suffix, label) => {
    const raw = Buffer.from(encoded, "base64");
    const ext = raw.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10])) ? "png" : raw[0]===255 && raw[1]===216 ? "jpg" : raw.subarray(0,4).toString()==="RIFF" && raw.subarray(8,12).toString()==="WEBP" ? "webp" : suffix;
    const file = `${stem}-${label}.${ext}`;
    writeFileSync(file, raw); console.log("Saved", file);
  };
  for (const [i, block] of (data.content || []).entries()) console.log("Content", i, JSON.stringify(block));
  for (const choice of data.choices || []) console.log("Choice", choice.index, JSON.stringify(choice.message || choice.delta || {}));
  for (const [i, item] of (data.output || []).entries()) {
    console.log("Output", i, JSON.stringify(item));
    if (item.type === "image_generation_call" && item.result) saveBlob(item.result, item.output_format || "bin", `output-${i}`);
  }
  for (const [ci, candidate] of (data.candidates || []).entries()) {
    for (const [pi, part] of (candidate.content?.parts || []).entries()) {
      console.log("Candidate/part", ci, pi, JSON.stringify(part));
      const blob = part.inlineData || part.inline_data;
      if (blob?.data) {
        const mime = blob.mimeType || blob.mime_type;
        const suffix = ({"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"})[mime] || "bin";
        saveBlob(blob.data, suffix, `candidate-${ci}-part-${pi}`);
      }
    }
  }
}

saveResult(resp);
from openai import OpenAI
import os
from pathlib import Path

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

with client.chat.completions.stream(model='qwen3.8-flash',messages=[{"role":"user","content":"Explain observations and hypotheses in three sentences."}]) as stream:
    with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
        for event in stream:
            payload=event.to_dict(mode="json")
            log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
            print(json.dumps(payload,ensure_ascii=False))
    final=stream.get_final_completion()
    save_result(final.to_dict(mode="json"),"stream-result")

接收並儲存結果

Ailoot · OpenAI Chat

json 或 SSE

保留所有已完成的結果

請保留所有完整傳回的回應、檔案與內容區塊。

保留每個候選項及其內容/工具呼叫/推理。SSE 中依候選項/工具索引組合增量,保留最終完成原因與用量。

需要檢查原始回應時

保留請求/回應 ID 與標頭。未提供通用的文字工作擷取 URL。

回應欄位
欄位類型
欄位choices[].index類型integer
欄位choices[].message.content類型string|null
欄位choices[].message.tool_calls類型tool_call[]
欄位choices[].message.reasoning_content類型string
欄位choices[].message.reasoning_details類型object|array
欄位choices[].finish_reason類型string|null
欄位usage類型object
錯誤與後續步驟
回應條件下一步
回應400 · invalid_request_error條件必要欄位、素材表示方式或參數值無效下一步提出新的建立請求前,先修正指定欄位。

別名

模型別名

Ailoot qwen3.8-flash, qwen-flash, qwen-flash-latest
Ailoot Ultra qwen3.8-flash, qwen/qwen3.8-flash

方法路徑別名

/chat/completions

相關呼叫用 ID

qwen/qwen3.8-flash, qwen-flash, qwen-flash-latest, qwen3.8-flash, qwen3.8-flash

Ailoot Ultra · OpenAI Chat POST /v1/chat/completions qwen3.8-flash

qwen3.8-flash

Alibaba /qwen3.8-flash
模型 ID
  • qwen3.8-flash
  • qwen/qwen3.8-flash

入門

用於程式代理與辦公任務的大型脈絡多模態模型。在 Ailoot 分析文字與圖片,並產生文字回應。

接受的輸入
文字
結果
文字

Ailoot 可用 · 輸入與方法

Ailoot Ultra · OpenAI Chat POST /v1/chat/completions
輸入
text
輸出
text
輸出格式
json 或 SSE
欄位類型要求值與限制預設值
欄位model類型string要求必填值與限制
qwen3.8-flash
預設值—
欄位messages類型message[]要求必填值與限制
項目數下限: 1
預設值—
欄位messages[].role類型string要求必填值與限制
依模型而定
預設值—
欄位messages[].content類型string要求選填值與限制
適用條件: 文字對話
預設值—
欄位stream類型boolean要求選填值與限制預設值false
輸入素材組合

文字 · UTF8 文字

messages[].content

方法參數與生命週期
參數規格
參數content_type規格application/json
參數required規格model, messages
參數material_types規格text
參數messages規格具有 role/content 結構的訊息陣列
參數file_material規格實際 UTF-8 文件以原文文字插入;不推定檔案 ID
參數optional_controls規格stream
參數control_scope規格文字對話;stream 是布林值,預設為 false。
參數output_modalities規格text
參數hosted_operations規格false
參數multimodal_input_binding規格null

方法別名: /chat/completions

生命週期: synchronous_or_streamed

將確切模型 ID 與 messages 一併送出。

上下文長度不是輸出上限。

文字檔案可提供原文文字;圖片/音訊/檔案物件輸入需要精確綁定。

方案

費率資訊不會增加請求選項。支援的參數列於所選方法中。

快速模式
標準費率 選取快速模式時
flex 模式
標準費率 選取 flex 模式時
最高推理強度
標準費率 最高推理強度採用 default 調整值時

Ailoot 費率

各設定的價格

請逐一核對各項費用與所列條件。每組互為替代選項的設定只套用一種費率。

設定費率表上下文 Token 數大於上下文 Token 數小於或等於費用
設定詞元基本費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token

Ailoot 會在請求前預留估算金額。取得結果後,依實測用量結算最終費用。串流結算採用最終用量紀錄。預留金額與結算的運作方式 →

請求範例

Ailoot Ultra · OpenAI Chat

curlPython SDK
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model":"qwen3.8-flash","messages":[{"role":"user","content":"hello"}],"stream":false}')

Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
r=json.loads(Path("result.json").read_text())
for x in r.get("choices",[]):
    if x.get("message",{}).get("content"): print(x["message"]["content"])
PY_RESULT
from openai import OpenAI
import os

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
result=client.chat.completions.create(model="qwen3.8-flash", messages=[{"role":"user","content":"hello"}], stream=False)
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

save_result(result.to_dict(mode="json"))

接收並儲存結果

Ailoot Ultra · OpenAI Chat

json 或 SSE

保留所有已完成的結果

請保留所有完整傳回的回應、檔案與內容區塊。

保留每個候選項及其內容/工具呼叫/推理。SSE 中依候選項/工具索引組合增量,保留最終完成原因與用量。

需要檢查原始回應時

保留請求/回應 ID 與標頭。未提供通用的文字工作擷取 URL。

回應欄位
欄位類型
欄位choices[].index類型integer
欄位choices[].message.content類型string|null
欄位choices[].message.tool_calls類型tool_call[]
欄位choices[].message.reasoning_content類型string
欄位choices[].message.reasoning_details類型object|array
欄位choices[].finish_reason類型string|null
欄位usage類型object
錯誤與後續步驟
回應條件下一步
回應400 · invalid_request_error條件必要欄位、素材表示方式或參數值無效下一步提出新的建立請求前,先修正指定欄位。

別名

模型別名

Ailoot qwen3.8-flash, qwen-flash, qwen-flash-latest
Ailoot Ultra qwen3.8-flash, qwen/qwen3.8-flash

方法路徑別名

/chat/completions

相關呼叫用 ID

qwen/qwen3.8-flash, qwen-flash, qwen-flash-latest, qwen3.8-flash, qwen3.8-flash

Ailoot Ultra · Anthropic Messages POST /v1/messages qwen3.8-flash

qwen3.8-flash

Alibaba /qwen3.8-flash
模型 ID
  • qwen3.8-flash
  • qwen/qwen3.8-flash

入門

用於程式代理與辦公任務的大型脈絡多模態模型。在 Ailoot 分析文字與圖片,並產生文字回應。

接受的輸入
文字
結果
json · sse

Ailoot 可用 · 輸入與方法

Ailoot Ultra · Anthropic Messages POST /v1/messages
輸入
text
輸出
json, sse
輸出格式
JSON 或 SSE
欄位類型要求值與限制預設值
欄位model類型string要求必填值與限制
qwen3.8-flash
預設值—
欄位messages類型message[]要求必填值與限制預設值—
欄位messages[].role類型string要求必填值與限制
user, assistant
預設值—
欄位messages[].content類型string要求必填值與限制預設值—
欄位max_tokens類型integer要求必填值與限制預設值—
欄位stream類型boolean要求選填值與限制預設值false
輸入素材組合

文字 · UTF-8 文字

messages[].content 字串

方法參數與生命週期
參數規格
參數content_type規格application/json
參數required規格model, messages, max_tokens
參數optional_controls規格stream
參數material_types規格text
參數text_file_material規格讀取實際 UTF-8 文件,將文字放入指定的 input 或訊息內容字串。

生命週期: synchronous_or_streamed

方案

費率資訊不會增加請求選項。支援的參數列於所選方法中。

快速模式
標準費率 選取快速模式時
flex 模式
標準費率 選取 flex 模式時
最高推理強度
標準費率 最高推理強度採用 default 調整值時

Ailoot 費率

各設定的價格

請逐一核對各項費用與所列條件。每組互為替代選項的設定只套用一種費率。

設定費率表上下文 Token 數大於上下文 Token 數小於或等於費用
設定詞元基本費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token

Ailoot 會在請求前預留估算金額。取得結果後,依實測用量結算最終費用。串流結算採用最終用量紀錄。預留金額與結算的運作方式 →

請求範例

Ailoot Ultra · Anthropic Messages

完整的最小 JSON 請求主體curl · 使用您的 UTF-8 文件Python · 儲存完整結果
{
  "model": "qwen3.8-flash",
  "max_tokens": 128,
  "messages": [
    {
      "role": "user",
      "content": "Summarize the incident report."
    }
  ],
  "stream": false
}
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 document}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json, os
from pathlib import Path

source_file = Path(os.environ['AILOOT_TEXT_FILE'])
if not source_file.is_file():
    raise SystemExit('Set AILOOT_TEXT_FILE to your actual UTF-8 document')
text = source_file.read_text(encoding='utf-8')
if not text.strip():
    raise SystemExit('Choose a document containing text')
payload = {'model': 'qwen3.8-flash', 'max_tokens': 128, 'messages': [{'role': 'user', 'content': 'Summarize the incident report.'}]}
payload['messages'][0]['content'] = 'Summarize this material and quote supporting source passages.\n\n' + text
Path('request.json').write_text(json.dumps(payload, ensure_ascii=False), encoding='utf-8')
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \
  -H "x-api-key: $AILOOT_API_KEY" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path

result = json.loads(Path('result.json').read_text(encoding='utf-8'))
print(json.dumps(result, ensure_ascii=False, indent=2))
PY_RESULT
import json, os
from pathlib import Path

source_file = Path(os.environ['AILOOT_TEXT_FILE'])
if not source_file.is_file():
    raise SystemExit('Set AILOOT_TEXT_FILE to your actual UTF-8 document')
text = source_file.read_text(encoding='utf-8')
if not text.strip():
    raise SystemExit('Choose a document containing text')
payload = {'model': 'qwen3.8-flash', 'max_tokens': 128, 'messages': [{'role': 'user', 'content': 'Summarize the incident report.'}]}
payload['messages'][0]['content'] = 'Summarize this material and quote supporting source passages.\n\n' + text
from urllib.request import Request, urlopen
from urllib.error import HTTPError

api_key = os.environ['AILOOT_API_KEY']
if not api_key.strip():
    raise SystemExit('Set AILOOT_API_KEY before making a request')
headers = {'x-api-key': 'PLACEHOLDER_KEY', 'anthropic-version': '2023-06-01', 'Content-Type': 'application/json'}
headers['x-api-key'] = api_key
request = Request('https://api.ailoot.ai/v1/messages', data=json.dumps(payload, ensure_ascii=False).encode('utf-8'), headers=headers, method='POST')
try:
    with urlopen(request, timeout=120) as response:
        raw = response.read()
        Path('response-headers.txt').write_text(str(response.headers), encoding='utf-8')
except HTTPError as error:
    Path('result.json').write_bytes(error.read())
    Path('response-headers.txt').write_text(str(error.headers), encoding='utf-8')
    raise
Path('result.json').write_bytes(raw)
import json
from pathlib import Path

result = json.loads(Path('result.json').read_text(encoding='utf-8'))
print(json.dumps(result, ensure_ascii=False, indent=2))

接收並儲存結果

Ailoot Ultra · Anthropic Messages

JSON 或 SSE

保留所有已完成的結果

請保留所有完整傳回的回應、檔案與內容區塊。

保留所有內容區塊、思考簽章與實際工具使用 ID。組合所有 SSE 區塊增量;第一個文字區塊不是完整輸出。

需要檢查原始回應時

保留請求/回應 ID 與標頭。未提供通用的文字工作擷取 URL。

回應欄位
欄位類型
欄位id類型string
欄位model類型string
欄位content[]類型text|thinking|tool_use|other content block
欄位stop_reason類型string|null
欄位usage類型object
錯誤與後續步驟
回應條件下一步
回應400 · invalid_request_error條件必要欄位、素材表示方式或參數值無效下一步提出新的建立請求前,先修正指定欄位。

別名

模型別名

Ailoot qwen3.8-flash, qwen-flash, qwen-flash-latest
Ailoot Ultra qwen3.8-flash, qwen/qwen3.8-flash

方法路徑別名

/chat/completions

相關呼叫用 ID

qwen/qwen3.8-flash, qwen-flash, qwen-flash-latest, qwen3.8-flash, qwen3.8-flash

Ailoot · Anthropic Messages POST /v1/messages qwen-flash

qwen-flash

Alibaba /qwen-flash
模型 ID
  • qwen3.8-flash
  • qwen-flash
  • qwen-flash-latest

入門

用於程式代理與辦公任務的大型脈絡多模態模型。在 Ailoot 分析文字與圖片,並產生文字回應。

接受的輸入
文字 · 圖片
結果
文字

Ailoot 可用 · 輸入與方法

Ailoot · Anthropic Messages POST /v1/messages
輸入
text, image
輸出
text
上下文
991,808 tokens
輸出上限
131,072 tokens
輸出格式
json 或 SSE
欄位類型要求值與限制預設值
欄位model類型string要求必填值與限制
qwen-flash
預設值—
欄位messages類型message[]要求必填值與限制
項目數下限: 1
預設值—
欄位messages[].role類型string要求必填值與限制
user, assistant
預設值—
欄位messages[].content類型string|content_block[]要求必填值與限制預設值—
欄位system類型string|content_block[]要求選填值與限制預設值—
欄位max_tokens類型integer要求必填值與限制
最小值: 1
限制適用對象: 所選模型/卡片的確切上限
預設值—
欄位stream類型boolean要求選填值與限制預設值false
欄位temperature類型number要求選填值與限制
依模型而定
預設值—
欄位top_p類型number要求選填值與限制
依模型而定
預設值—
欄位stop_sequences類型string[]要求選填值與限制
依模型而定
預設值—
欄位tools類型tool[]要求選填值與限制
依模型而定
預設值—
欄位tools[].name類型string要求選填值與限制
適用條件: 已提供工具
預設值—
欄位tools[].description類型string要求選填值與限制預設值—
欄位tools[].input_schema類型JSON_schema要求選填值與限制預設值—
欄位tool_choice類型object要求選填值與限制
依模型而定
預設值—
欄位thinking.type類型string要求選填值與限制
依模型而定
預設值—
欄位thinking.budget_tokens類型integer要求選填值與限制
依模型而定
預設值—
欄位output_config.effort類型string要求選填值與限制
依模型而定
預設值—
欄位metadata類型object要求選填值與限制預設值—
欄位cache_control類型object要求選填值與限制
依模型而定
預設值—
輸入素材組合

文字 · UTF8 文字

messages[].content 或 type=text 區塊

文字 + 圖片

{type:image,source:{type:base64,media_type,data}} 或 type=url 的來源

方法參數與生命週期
參數規格
參數material_types規格text, image
參數required規格model, messages, max_tokens
參數optional_controls規格null
參數content_type規格application/json
參數text_file_material規格實際 UTF-8 內容以文字插入;檔案 ID/URLs 需要另有精確支援

生命週期: exact retained published method

方法結構與 ID 均為精確值;供應商能力與准入狀態分開。

方案

Ailoot 方法費率

Ailoot Anthropic MessagesPOST /v1/messages
輸入
US$0.00015 / 1K
輸出
US$0.00047 / 1K
讀取快取
US$0.000016 / 1K
寫入快取
US$0.0002 / 1K
寫入快取,5 分鐘
US$0.0002 / 1K tokens

Ailoot 會在請求前預留估算金額。取得結果後,依實測用量結算最終費用。串流結算採用最終用量紀錄。預留金額與結算的運作方式 →

參考費率詳情

模型層級的參考費率表不會變更方法選擇、報價或費用。實際計費採用所選 Ailoot 方法的費率。

模型參考費率表

各設定的價格

請逐一核對各項費用與所列條件。每組互為替代選項的設定只套用一種費率。

設定費率表上下文 Token 數大於上下文 Token 數小於或等於費用
設定OpenAI Chat · 基本 token 費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定OpenAI Chat · 請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定Anthropic Messages · 基本 token 費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定Anthropic Messages · 請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token

請求範例

Ailoot · Anthropic Messages

文字範例輸入,圖片Python SDKNode.js SDKPython 串流
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 source-material file}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "qwen-flash", "max_tokens": 1024, "messages": []}')
f=Path(os.environ["AILOOT_TEXT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 source material")
text=f.read_text(encoding="utf-8")
if not text.strip():raise SystemExit("Source material must contain text")
p["messages"]=[{"role":"user","content":"Summarize this material and quote supporting source passages.\n\n"+text}]
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \
  -H "x-api-key: $AILOOT_API_KEY" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_FILE:?Set your actual PNG JPEG or WebP image}"
export AILOOT_IMAGE_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "qwen-flash", "max_tokens": 1024, "messages": [{"role": "user", "content": [{"type": "text", "text": "Read labels and numbers in this image; flag unreadable text."}]}]}')
import base64
f=Path(os.environ["AILOOT_IMAGE_FILE"])
if not f.is_file():raise SystemExit("Choose an actual PNG JPEG or WebP image")
raw=f.read_bytes()
mime="image/png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "image/jpeg" if raw.startswith(b"\xff\xd8") else "image/webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else None
if not mime:raise SystemExit("Use PNG JPEG or WebP")
b64=base64.b64encode(raw).decode()
p["messages"][0]["content"].append({"type":"image","source":{"type":"base64","media_type":mime,"data":b64}})
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \
  -H "x-api-key: $AILOOT_API_KEY" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
import anthropic
import os

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client = anthropic.Anthropic(base_url="https://api.ailoot.ai", api_key=os.environ["AILOOT_API_KEY"], max_retries=0)
msg = client.messages.create(
    model="qwen-flash",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Explain the difference between an observation and a hypothesis in three sentences."}],
)
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

save_result(msg.to_dict(mode="json"))
import Anthropic from "@anthropic-ai/sdk";

if (!process.env.AILOOT_API_KEY?.trim()) throw new Error("Set AILOOT_API_KEY before making a request");
const client = new Anthropic({ baseURL: "https://api.ailoot.ai", apiKey: process.env.AILOOT_API_KEY, maxRetries: 0 });
const msg = await client.messages.create({
  model: "qwen-flash",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Explain the difference between an observation and a hypothesis in three sentences." }],
});
import { writeFileSync } from "node:fs";

function saveResult(data, stem = "result") {
  writeFileSync(stem + ".json", JSON.stringify(data, null, 2));
  console.log(JSON.stringify(data, null, 2));
  const saveBlob = (encoded, suffix, label) => {
    const raw = Buffer.from(encoded, "base64");
    const ext = raw.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10])) ? "png" : raw[0]===255 && raw[1]===216 ? "jpg" : raw.subarray(0,4).toString()==="RIFF" && raw.subarray(8,12).toString()==="WEBP" ? "webp" : suffix;
    const file = `${stem}-${label}.${ext}`;
    writeFileSync(file, raw); console.log("Saved", file);
  };
  for (const [i, block] of (data.content || []).entries()) console.log("Content", i, JSON.stringify(block));
  for (const choice of data.choices || []) console.log("Choice", choice.index, JSON.stringify(choice.message || choice.delta || {}));
  for (const [i, item] of (data.output || []).entries()) {
    console.log("Output", i, JSON.stringify(item));
    if (item.type === "image_generation_call" && item.result) saveBlob(item.result, item.output_format || "bin", `output-${i}`);
  }
  for (const [ci, candidate] of (data.candidates || []).entries()) {
    for (const [pi, part] of (candidate.content?.parts || []).entries()) {
      console.log("Candidate/part", ci, pi, JSON.stringify(part));
      const blob = part.inlineData || part.inline_data;
      if (blob?.data) {
        const mime = blob.mimeType || blob.mime_type;
        const suffix = ({"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"})[mime] || "bin";
        saveBlob(blob.data, suffix, `candidate-${ci}-part-${pi}`);
      }
    }
  }
}

saveResult(msg);
import anthropic,os
from pathlib import Path

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=anthropic.Anthropic(base_url="https://api.ailoot.ai",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

with client.messages.stream(model='qwen-flash',max_tokens=1024,messages=[{"role":"user","content":"Explain observations and hypotheses in three sentences."}]) as stream:
    with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
        for event in stream:
            payload=event.to_dict(mode="json")
            log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
            print(json.dumps(payload,ensure_ascii=False))
    final=stream.get_final_message()
    save_result(final.to_dict(mode="json"),"stream-result")

接收並儲存結果

Ailoot · Anthropic Messages

json 或 SSE

保留所有已完成的結果

請保留所有完整傳回的回應、檔案與內容區塊。

保留所有內容區塊、思考簽章與實際工具使用 ID。組合所有 SSE 區塊增量;第一個文字區塊不是完整輸出。

需要檢查原始回應時

保留請求/回應 ID 與標頭。未提供通用的文字工作擷取 URL。

回應欄位
欄位類型
欄位id類型string
欄位model類型string
欄位content[]類型text|thinking|tool_use|other content block
欄位stop_reason類型string|null
欄位usage類型object
錯誤與後續步驟
回應條件下一步
回應400 · invalid_request_error條件必要欄位、素材表示方式或參數值無效下一步提出新的建立請求前,先修正指定欄位。

別名

模型別名

Ailoot qwen3.8-flash, qwen-flash, qwen-flash-latest
Ailoot Ultra qwen3.8-flash, qwen/qwen3.8-flash

方法路徑別名

/chat/completions

相關呼叫用 ID

qwen/qwen3.8-flash, qwen-flash, qwen-flash-latest, qwen3.8-flash, qwen3.8-flash

Ailoot · OpenAI Responses POST /v1/responses qwen-flash

qwen-flash

Alibaba /qwen-flash
模型 ID
  • qwen3.8-flash
  • qwen-flash
  • qwen-flash-latest

入門

用於程式代理與辦公任務的大型脈絡多模態模型。在 Ailoot 分析文字與圖片,並產生文字回應。

接受的輸入
文字 · 圖片
結果
文字

Ailoot 可用 · 輸入與方法

Ailoot · OpenAI Responses POST /v1/responses
輸入
text, image
輸出
text
上下文
991,808 tokens
輸出上限
131,072 tokens
輸出格式
json 或 SSE
欄位類型要求值與限制預設值
欄位model類型string要求必填值與限制
qwen-flash
預設值—
欄位input類型string|input_item[]要求必填值與限制預設值—
欄位instructions類型string要求選填值與限制預設值—
欄位input[].type類型string要求選填值與限制
message, reasoning, function_call, function_call_output
預設值—
欄位input[].content類型string|content_part[]要求選填值與限制預設值—
欄位input[].call_id類型string要求選填值與限制
適用條件: function_call_output;保留實際回傳的 call_id
預設值—
欄位input[].output類型string|content_part[]要求選填值與限制
適用條件: function_call_output
預設值—
欄位max_output_tokens類型integer要求選填值與限制
最小值: 1
依模型而定
預設值—
欄位stream類型boolean要求選填值與限制預設值false
欄位temperature類型number要求選填值與限制
依模型而定
預設值—
欄位top_p類型number要求選填值與限制
依模型而定
預設值—
欄位tools類型tool[]要求選填值與限制
依模型而定
預設值—
欄位tool_choice類型string|object要求選填值與限制
依模型而定
預設值—
欄位parallel_tool_calls類型boolean要求選填值與限制
依模型而定
預設值—
欄位reasoning.effort類型string要求選填值與限制
依模型而定
預設值—
欄位reasoning.summary類型string要求選填值與限制
依模型而定
預設值—
欄位text.format類型object要求選填值與限制
依模型而定
預設值—
欄位text.verbosity類型string要求選填值與限制
依模型而定
預設值—
欄位include類型string[]要求選填值與限制
依模型而定
預設值—
欄位store類型boolean要求選填值與限制
依模型而定
預設值—
欄位previous_response_id類型string要求選填值與限制
ID 要求: 僅限支援的延續流程實際回傳的回應 ID
依模型而定
預設值—
欄位service_tier類型string要求選填值與限制
依模型而定
預設值—
欄位prompt_cache_key類型string要求選填值與限制
依模型而定
預設值—
欄位prompt_cache_options類型object要求選填值與限制
依模型而定
預設值—
輸入素材組合

文字 · UTF8 文字

輸入文字或 input_text 部分

文字 + 圖片

{type:input_image,image_url}

方法參數與生命週期
參數規格
參數material_types規格text, image
參數required規格model, input
參數optional_controls規格null
參數content_type規格application/json
參數text_file_material規格實際 UTF-8 內容以文字插入;檔案 ID/URLs 需要另有精確支援

生命週期: exact retained published method

方法結構與 ID 均為精確值;供應商能力與准入狀態分開。

方案

Ailoot 方法費率

Ailoot OpenAI ResponsesPOST /v1/responses
文字輸入
US$0.00015 / 1K
文字輸出
US$0.00047 / 1K
輸入,圖片
US$0.00015 / 1K tokens
讀取快取
US$0.000016 / 1K
寫入快取
US$0.0002 / 1K
寫入快取,5 分鐘
US$0.0002 / 1K tokens

Ailoot 會在請求前預留估算金額。取得結果後,依實測用量結算最終費用。串流結算採用最終用量紀錄。預留金額與結算的運作方式 →

參考費率詳情

模型層級的參考費率表不會變更方法選擇、報價或費用。實際計費採用所選 Ailoot 方法的費率。

模型參考費率表

各設定的價格

請逐一核對各項費用與所列條件。每組互為替代選項的設定只套用一種費率。

設定費率表上下文 Token 數大於上下文 Token 數小於或等於費用
設定OpenAI Chat · 基本 token 費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定OpenAI Chat · 請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定Anthropic Messages · 基本 token 費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定Anthropic Messages · 請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token

請求範例

Ailoot · OpenAI Responses

文字範例輸入,圖片Python SDKNode.js SDKPython 串流
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 source-material file}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "qwen-flash", "input": ""}')
f=Path(os.environ["AILOOT_TEXT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 source material")
text=f.read_text(encoding="utf-8")
if not text.strip():raise SystemExit("Source material must contain text")
p["input"]="Summarize this material and quote supporting source passages.\n\n"+text
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/responses \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

save_result(json.loads(Path("result.json").read_text(encoding="utf-8")))
PY_RESULT
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_FILE:?Set your actual PNG JPEG or WebP image}"
export AILOOT_IMAGE_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "qwen-flash", "input": [{"role": "user", "content": [{"type": "input_text", "text": "Read labels and numbers in this image; flag unreadable text."}]}]}')
import base64
f=Path(os.environ["AILOOT_IMAGE_FILE"])
if not f.is_file():raise SystemExit("Choose an actual PNG JPEG or WebP image")
raw=f.read_bytes()
mime="image/png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "image/jpeg" if raw.startswith(b"\xff\xd8") else "image/webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else None
if not mime:raise SystemExit("Use PNG JPEG or WebP")
b64=base64.b64encode(raw).decode()
p["input"][0]["content"].append({"type":"input_image","image_url":"data:"+mime+";base64,"+b64})
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/responses \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

save_result(json.loads(Path("result.json").read_text(encoding="utf-8")))
PY_RESULT
from openai import OpenAI
import os

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client = OpenAI(base_url="https://api.ailoot.ai/v1", api_key=os.environ["AILOOT_API_KEY"], max_retries=0)
resp = client.responses.create(model="qwen-flash", input="Explain the difference between an observation and a hypothesis in three sentences.")
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

save_result(resp.to_dict(mode="json"))
import OpenAI from "openai";

if (!process.env.AILOOT_API_KEY?.trim()) throw new Error("Set AILOOT_API_KEY before making a request");
const client = new OpenAI({ baseURL: "https://api.ailoot.ai/v1", apiKey: process.env.AILOOT_API_KEY, maxRetries: 0 });
const resp = await client.responses.create({ model: "qwen-flash", input: "Explain the difference between an observation and a hypothesis in three sentences." });
import { writeFileSync } from "node:fs";

function saveResult(data, stem = "result") {
  writeFileSync(stem + ".json", JSON.stringify(data, null, 2));
  console.log(JSON.stringify(data, null, 2));
  const saveBlob = (encoded, suffix, label) => {
    const raw = Buffer.from(encoded, "base64");
    const ext = raw.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10])) ? "png" : raw[0]===255 && raw[1]===216 ? "jpg" : raw.subarray(0,4).toString()==="RIFF" && raw.subarray(8,12).toString()==="WEBP" ? "webp" : suffix;
    const file = `${stem}-${label}.${ext}`;
    writeFileSync(file, raw); console.log("Saved", file);
  };
  for (const [i, block] of (data.content || []).entries()) console.log("Content", i, JSON.stringify(block));
  for (const choice of data.choices || []) console.log("Choice", choice.index, JSON.stringify(choice.message || choice.delta || {}));
  for (const [i, item] of (data.output || []).entries()) {
    console.log("Output", i, JSON.stringify(item));
    if (item.type === "image_generation_call" && item.result) saveBlob(item.result, item.output_format || "bin", `output-${i}`);
  }
  for (const [ci, candidate] of (data.candidates || []).entries()) {
    for (const [pi, part] of (candidate.content?.parts || []).entries()) {
      console.log("Candidate/part", ci, pi, JSON.stringify(part));
      const blob = part.inlineData || part.inline_data;
      if (blob?.data) {
        const mime = blob.mimeType || blob.mime_type;
        const suffix = ({"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"})[mime] || "bin";
        saveBlob(blob.data, suffix, `candidate-${ci}-part-${pi}`);
      }
    }
  }
}

saveResult(resp);
from openai import OpenAI
import os
from pathlib import Path
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
with client.responses.stream(model="qwen-flash", input="Explain the difference between an observation and a hypothesis in three sentences.") as stream:
    with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
        for event in stream:
            payload=event.to_dict(mode="json")
            log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
            print(json.dumps(payload,ensure_ascii=False))
    final=stream.get_final_response()
    save_result(final.to_dict(mode="json"),"stream-result")

接收並儲存結果

Ailoot · OpenAI Responses

json 或 SSE

保留所有已完成的結果

請保留所有完整傳回的回應、檔案與內容區塊。

保留每個輸出項目與內容部分、實際函式 call_id、加密推理與用量。串流時保留完整事件/項目身分。

需要檢查原始回應時

保留請求/回應 ID 與標頭。未提供通用的文字工作擷取 URL。

回應欄位
欄位類型
欄位id類型string
欄位status類型string
欄位output[]類型message|reasoning|function_call|other item
欄位output[].content[]類型content part
欄位usage類型object
錯誤與後續步驟
回應條件下一步
回應400 · invalid_request_error條件必要欄位、素材表示方式或參數值無效下一步提出新的建立請求前,先修正指定欄位。

別名

模型別名

Ailoot qwen3.8-flash, qwen-flash, qwen-flash-latest
Ailoot Ultra qwen3.8-flash, qwen/qwen3.8-flash

方法路徑別名

/chat/completions

相關呼叫用 ID

qwen/qwen3.8-flash, qwen-flash, qwen-flash-latest, qwen3.8-flash, qwen3.8-flash

Ailoot · OpenAI Chat POST /v1/chat/completions qwen-flash

qwen-flash

Alibaba /qwen-flash
模型 ID
  • qwen3.8-flash
  • qwen-flash
  • qwen-flash-latest

入門

用於程式代理與辦公任務的大型脈絡多模態模型。在 Ailoot 分析文字與圖片,並產生文字回應。

接受的輸入
文字 · 圖片
結果
文字

Ailoot 可用 · 輸入與方法

Ailoot · OpenAI Chat POST /v1/chat/completions
輸入
text, image
輸出
text
上下文
991,808 tokens
輸出上限
131,072 tokens
輸出格式
json 或 SSE
欄位類型要求值與限制預設值
欄位model類型string要求必填值與限制
qwen-flash
預設值—
欄位messages類型message[]要求必填值與限制
項目數下限: 1
預設值—
欄位messages[].role類型string要求必填值與限制
範例:system, user, assistant, tool, function
條件: 這些角色由 原始碼中的相容型別明確表示;確切角色集合仍依模型而定。
依模型而定
預設值—
欄位messages[].content類型string|content_part[]|null要求選填值與限制預設值—
欄位messages[].tool_calls類型tool_call[]要求選填值與限制預設值—
欄位messages[].tool_call_id類型string要求選填值與限制
適用條件: role=tool;使用實際回傳的 ID
預設值—
欄位messages[].name類型string要求選填值與限制預設值—
欄位messages[].reasoning_content類型string要求選填值與限制
適用條件: 此模型使用推理內容時,將實際回傳的推理內容帶回後續請求
預設值—
欄位messages[].reasoning_details類型object|array要求選填值與限制
依模型而定
預設值—
欄位max_tokens類型integer要求選填值與限制
最小值: 1
依模型而定
預設值—
欄位max_completion_tokens類型integer要求選填值與限制
最小值: 1
依模型而定
預設值—
欄位stream類型boolean要求選填值與限制預設值false
欄位stream_options.include_usage類型boolean要求選填值與限制
依模型而定
預設值—
欄位temperature類型number要求選填值與限制
依模型而定
預設值—
欄位top_p類型number要求選填值與限制
依模型而定
預設值—
欄位stop類型string|string[]要求選填值與限制
依模型而定
預設值—
欄位tools類型function_tool[]要求選填值與限制
依模型而定
預設值—
欄位tools[].type類型string要求選填值與限制
依模型而定
預設值—
欄位tools[].function.name類型string要求必填值與限制
適用條件: 已提供函式工具
預設值—
欄位tools[].function.description類型string要求選填值與限制預設值—
欄位tools[].function.parameters類型JSON_schema要求選填值與限制預設值—
欄位tool_choice類型string|object要求選填值與限制
依模型而定
預設值—
欄位parallel_tool_calls類型boolean要求選填值與限制
依模型而定
預設值—
欄位response_format類型object要求選填值與限制
依模型而定
預設值—
欄位reasoning_effort類型string要求選填值與限制
依模型而定
預設值—
欄位reasoning類型object要求選填值與限制
依模型而定
預設值—
欄位service_tier類型string要求選填值與限制
依模型而定
預設值—
欄位instructions類型string要求選填值與限制
相容性欄位
預設值—
欄位functions類型function[]要求選填值與限制
依模型而定
預設值—
欄位function_call類型string|object要求選填值與限制
依模型而定
預設值—
欄位prompt_cache_options類型object要求選填值與限制
依模型而定
預設值—
輸入素材組合

文字 · UTF8 文字

messages[].content

文字 + 圖片

{type:image_url,image_url:{url,detail}}

方法參數與生命週期
參數規格
參數material_types規格text, image
參數required規格model, messages
參數optional_controls規格null
參數content_type規格application/json
參數text_file_material規格實際 UTF-8 內容以文字插入;檔案 ID/URLs 需要另有精確支援

生命週期: exact retained published method

方法結構與 ID 均為精確值;供應商能力與准入狀態分開。

方案

Ailoot 方法費率

Ailoot OpenAI ChatPOST /v1/chat/completions
文字輸入
US$0.00015 / 1K
文字輸出
US$0.00047 / 1K
輸入,圖片
US$0.00015 / 1K tokens
讀取快取
US$0.000016 / 1K
寫入快取
US$0.0002 / 1K
寫入快取,5 分鐘
US$0.0002 / 1K tokens

Ailoot 會在請求前預留估算金額。取得結果後,依實測用量結算最終費用。串流結算採用最終用量紀錄。預留金額與結算的運作方式 →

參考費率詳情

模型層級的參考費率表不會變更方法選擇、報價或費用。實際計費採用所選 Ailoot 方法的費率。

模型參考費率表

各設定的價格

請逐一核對各項費用與所列條件。每組互為替代選項的設定只套用一種費率。

設定費率表上下文 Token 數大於上下文 Token 數小於或等於費用
設定OpenAI Chat · 基本 token 費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定OpenAI Chat · 請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定Anthropic Messages · 基本 token 費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定Anthropic Messages · 請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token

請求範例

Ailoot · OpenAI Chat

文字範例輸入,圖片Python SDKNode.js SDKPython 串流
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 source-material file}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "qwen-flash", "messages": []}')
f=Path(os.environ["AILOOT_TEXT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 source material")
text=f.read_text(encoding="utf-8")
if not text.strip():raise SystemExit("Source material must contain text")
p["messages"]=[{"role":"user","content":"Summarize this material and quote supporting source passages.\n\n"+text}]
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_FILE:?Set your actual PNG JPEG or WebP image}"
export AILOOT_IMAGE_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "qwen-flash", "messages": [{"role": "user", "content": [{"type": "text", "text": "Read labels and numbers in this image; flag unreadable text."}]}]}')
import base64
f=Path(os.environ["AILOOT_IMAGE_FILE"])
if not f.is_file():raise SystemExit("Choose an actual PNG JPEG or WebP image")
raw=f.read_bytes()
mime="image/png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "image/jpeg" if raw.startswith(b"\xff\xd8") else "image/webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else None
if not mime:raise SystemExit("Use PNG JPEG or WebP")
b64=base64.b64encode(raw).decode()
p["messages"][0]["content"].append({"type":"image_url","image_url":{"url":"data:"+mime+";base64,"+b64}})
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
from openai import OpenAI
import os

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client = OpenAI(base_url="https://api.ailoot.ai/v1", api_key=os.environ["AILOOT_API_KEY"], max_retries=0)
resp = client.chat.completions.create(
    model="qwen-flash",
    messages=[{"role": "user", "content": "Explain the difference between an observation and a hypothesis in three sentences."}],
)
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

save_result(resp.to_dict(mode="json"))
import OpenAI from "openai";

if (!process.env.AILOOT_API_KEY?.trim()) throw new Error("Set AILOOT_API_KEY before making a request");
const client = new OpenAI({ baseURL: "https://api.ailoot.ai/v1", apiKey: process.env.AILOOT_API_KEY, maxRetries: 0 });
const resp = await client.chat.completions.create({
  model: "qwen-flash",
  messages: [{ role: "user", content: "Explain the difference between an observation and a hypothesis in three sentences." }],
});
import { writeFileSync } from "node:fs";

function saveResult(data, stem = "result") {
  writeFileSync(stem + ".json", JSON.stringify(data, null, 2));
  console.log(JSON.stringify(data, null, 2));
  const saveBlob = (encoded, suffix, label) => {
    const raw = Buffer.from(encoded, "base64");
    const ext = raw.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10])) ? "png" : raw[0]===255 && raw[1]===216 ? "jpg" : raw.subarray(0,4).toString()==="RIFF" && raw.subarray(8,12).toString()==="WEBP" ? "webp" : suffix;
    const file = `${stem}-${label}.${ext}`;
    writeFileSync(file, raw); console.log("Saved", file);
  };
  for (const [i, block] of (data.content || []).entries()) console.log("Content", i, JSON.stringify(block));
  for (const choice of data.choices || []) console.log("Choice", choice.index, JSON.stringify(choice.message || choice.delta || {}));
  for (const [i, item] of (data.output || []).entries()) {
    console.log("Output", i, JSON.stringify(item));
    if (item.type === "image_generation_call" && item.result) saveBlob(item.result, item.output_format || "bin", `output-${i}`);
  }
  for (const [ci, candidate] of (data.candidates || []).entries()) {
    for (const [pi, part] of (candidate.content?.parts || []).entries()) {
      console.log("Candidate/part", ci, pi, JSON.stringify(part));
      const blob = part.inlineData || part.inline_data;
      if (blob?.data) {
        const mime = blob.mimeType || blob.mime_type;
        const suffix = ({"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"})[mime] || "bin";
        saveBlob(blob.data, suffix, `candidate-${ci}-part-${pi}`);
      }
    }
  }
}

saveResult(resp);
from openai import OpenAI
import os
from pathlib import Path

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

with client.chat.completions.stream(model='qwen-flash',messages=[{"role":"user","content":"Explain observations and hypotheses in three sentences."}]) as stream:
    with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
        for event in stream:
            payload=event.to_dict(mode="json")
            log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
            print(json.dumps(payload,ensure_ascii=False))
    final=stream.get_final_completion()
    save_result(final.to_dict(mode="json"),"stream-result")

接收並儲存結果

Ailoot · OpenAI Chat

json 或 SSE

保留所有已完成的結果

請保留所有完整傳回的回應、檔案與內容區塊。

保留每個候選項及其內容/工具呼叫/推理。SSE 中依候選項/工具索引組合增量,保留最終完成原因與用量。

需要檢查原始回應時

保留請求/回應 ID 與標頭。未提供通用的文字工作擷取 URL。

回應欄位
欄位類型
欄位choices[].index類型integer
欄位choices[].message.content類型string|null
欄位choices[].message.tool_calls類型tool_call[]
欄位choices[].message.reasoning_content類型string
欄位choices[].message.reasoning_details類型object|array
欄位choices[].finish_reason類型string|null
欄位usage類型object
錯誤與後續步驟
回應條件下一步
回應400 · invalid_request_error條件必要欄位、素材表示方式或參數值無效下一步提出新的建立請求前,先修正指定欄位。

別名

模型別名

Ailoot qwen3.8-flash, qwen-flash, qwen-flash-latest
Ailoot Ultra qwen3.8-flash, qwen/qwen3.8-flash

方法路徑別名

/chat/completions

相關呼叫用 ID

qwen/qwen3.8-flash, qwen-flash, qwen-flash-latest, qwen3.8-flash, qwen3.8-flash

Ailoot · Anthropic Messages POST /v1/messages qwen-flash-latest

qwen-flash-latest

Alibaba /qwen-flash-latest
模型 ID
  • qwen3.8-flash
  • qwen-flash
  • qwen-flash-latest

入門

用於程式代理與辦公任務的大型脈絡多模態模型。在 Ailoot 分析文字與圖片,並產生文字回應。

接受的輸入
文字 · 圖片
結果
文字

Ailoot 可用 · 輸入與方法

Ailoot · Anthropic Messages POST /v1/messages
輸入
text, image
輸出
text
上下文
991,808 tokens
輸出上限
131,072 tokens
輸出格式
json 或 SSE
欄位類型要求值與限制預設值
欄位model類型string要求必填值與限制
qwen-flash-latest
預設值—
欄位messages類型message[]要求必填值與限制
項目數下限: 1
預設值—
欄位messages[].role類型string要求必填值與限制
user, assistant
預設值—
欄位messages[].content類型string|content_block[]要求必填值與限制預設值—
欄位system類型string|content_block[]要求選填值與限制預設值—
欄位max_tokens類型integer要求必填值與限制
最小值: 1
限制適用對象: 所選模型/卡片的確切上限
預設值—
欄位stream類型boolean要求選填值與限制預設值false
欄位temperature類型number要求選填值與限制
依模型而定
預設值—
欄位top_p類型number要求選填值與限制
依模型而定
預設值—
欄位stop_sequences類型string[]要求選填值與限制
依模型而定
預設值—
欄位tools類型tool[]要求選填值與限制
依模型而定
預設值—
欄位tools[].name類型string要求選填值與限制
適用條件: 已提供工具
預設值—
欄位tools[].description類型string要求選填值與限制預設值—
欄位tools[].input_schema類型JSON_schema要求選填值與限制預設值—
欄位tool_choice類型object要求選填值與限制
依模型而定
預設值—
欄位thinking.type類型string要求選填值與限制
依模型而定
預設值—
欄位thinking.budget_tokens類型integer要求選填值與限制
依模型而定
預設值—
欄位output_config.effort類型string要求選填值與限制
依模型而定
預設值—
欄位metadata類型object要求選填值與限制預設值—
欄位cache_control類型object要求選填值與限制
依模型而定
預設值—
輸入素材組合

文字 · UTF8 文字

messages[].content 或 type=text 區塊

文字 + 圖片

{type:image,source:{type:base64,media_type,data}} 或 type=url 的來源

方法參數與生命週期
參數規格
參數material_types規格text, image
參數required規格model, messages, max_tokens
參數optional_controls規格null
參數content_type規格application/json
參數text_file_material規格實際 UTF-8 內容以文字插入;檔案 ID/URLs 需要另有精確支援

生命週期: exact retained published method

方法結構與 ID 均為精確值;供應商能力與准入狀態分開。

方案

Ailoot 方法費率

Ailoot Anthropic MessagesPOST /v1/messages
輸入
US$0.00015 / 1K
輸出
US$0.00047 / 1K
讀取快取
US$0.000016 / 1K
寫入快取
US$0.0002 / 1K
寫入快取,5 分鐘
US$0.0002 / 1K tokens

Ailoot 會在請求前預留估算金額。取得結果後,依實測用量結算最終費用。串流結算採用最終用量紀錄。預留金額與結算的運作方式 →

參考費率詳情

模型層級的參考費率表不會變更方法選擇、報價或費用。實際計費採用所選 Ailoot 方法的費率。

模型參考費率表

各設定的價格

請逐一核對各項費用與所列條件。每組互為替代選項的設定只套用一種費率。

設定費率表上下文 Token 數大於上下文 Token 數小於或等於費用
設定OpenAI Chat · 基本 token 費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定OpenAI Chat · 請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定Anthropic Messages · 基本 token 費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定Anthropic Messages · 請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token

請求範例

Ailoot · Anthropic Messages

文字範例輸入,圖片Python SDKNode.js SDKPython 串流
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 source-material file}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "qwen-flash-latest", "max_tokens": 1024, "messages": []}')
f=Path(os.environ["AILOOT_TEXT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 source material")
text=f.read_text(encoding="utf-8")
if not text.strip():raise SystemExit("Source material must contain text")
p["messages"]=[{"role":"user","content":"Summarize this material and quote supporting source passages.\n\n"+text}]
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \
  -H "x-api-key: $AILOOT_API_KEY" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_FILE:?Set your actual PNG JPEG or WebP image}"
export AILOOT_IMAGE_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "qwen-flash-latest", "max_tokens": 1024, "messages": [{"role": "user", "content": [{"type": "text", "text": "Read labels and numbers in this image; flag unreadable text."}]}]}')
import base64
f=Path(os.environ["AILOOT_IMAGE_FILE"])
if not f.is_file():raise SystemExit("Choose an actual PNG JPEG or WebP image")
raw=f.read_bytes()
mime="image/png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "image/jpeg" if raw.startswith(b"\xff\xd8") else "image/webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else None
if not mime:raise SystemExit("Use PNG JPEG or WebP")
b64=base64.b64encode(raw).decode()
p["messages"][0]["content"].append({"type":"image","source":{"type":"base64","media_type":mime,"data":b64}})
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \
  -H "x-api-key: $AILOOT_API_KEY" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
import anthropic
import os

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client = anthropic.Anthropic(base_url="https://api.ailoot.ai", api_key=os.environ["AILOOT_API_KEY"], max_retries=0)
msg = client.messages.create(
    model="qwen-flash-latest",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Explain the difference between an observation and a hypothesis in three sentences."}],
)
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

save_result(msg.to_dict(mode="json"))
import Anthropic from "@anthropic-ai/sdk";

if (!process.env.AILOOT_API_KEY?.trim()) throw new Error("Set AILOOT_API_KEY before making a request");
const client = new Anthropic({ baseURL: "https://api.ailoot.ai", apiKey: process.env.AILOOT_API_KEY, maxRetries: 0 });
const msg = await client.messages.create({
  model: "qwen-flash-latest",
  max_tokens: 1024,
  messages: [{ role: "user", content: "Explain the difference between an observation and a hypothesis in three sentences." }],
});
import { writeFileSync } from "node:fs";

function saveResult(data, stem = "result") {
  writeFileSync(stem + ".json", JSON.stringify(data, null, 2));
  console.log(JSON.stringify(data, null, 2));
  const saveBlob = (encoded, suffix, label) => {
    const raw = Buffer.from(encoded, "base64");
    const ext = raw.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10])) ? "png" : raw[0]===255 && raw[1]===216 ? "jpg" : raw.subarray(0,4).toString()==="RIFF" && raw.subarray(8,12).toString()==="WEBP" ? "webp" : suffix;
    const file = `${stem}-${label}.${ext}`;
    writeFileSync(file, raw); console.log("Saved", file);
  };
  for (const [i, block] of (data.content || []).entries()) console.log("Content", i, JSON.stringify(block));
  for (const choice of data.choices || []) console.log("Choice", choice.index, JSON.stringify(choice.message || choice.delta || {}));
  for (const [i, item] of (data.output || []).entries()) {
    console.log("Output", i, JSON.stringify(item));
    if (item.type === "image_generation_call" && item.result) saveBlob(item.result, item.output_format || "bin", `output-${i}`);
  }
  for (const [ci, candidate] of (data.candidates || []).entries()) {
    for (const [pi, part] of (candidate.content?.parts || []).entries()) {
      console.log("Candidate/part", ci, pi, JSON.stringify(part));
      const blob = part.inlineData || part.inline_data;
      if (blob?.data) {
        const mime = blob.mimeType || blob.mime_type;
        const suffix = ({"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"})[mime] || "bin";
        saveBlob(blob.data, suffix, `candidate-${ci}-part-${pi}`);
      }
    }
  }
}

saveResult(msg);
import anthropic,os
from pathlib import Path

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=anthropic.Anthropic(base_url="https://api.ailoot.ai",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

with client.messages.stream(model='qwen-flash-latest',max_tokens=1024,messages=[{"role":"user","content":"Explain observations and hypotheses in three sentences."}]) as stream:
    with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
        for event in stream:
            payload=event.to_dict(mode="json")
            log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
            print(json.dumps(payload,ensure_ascii=False))
    final=stream.get_final_message()
    save_result(final.to_dict(mode="json"),"stream-result")

接收並儲存結果

Ailoot · Anthropic Messages

json 或 SSE

保留所有已完成的結果

請保留所有完整傳回的回應、檔案與內容區塊。

保留所有內容區塊、思考簽章與實際工具使用 ID。組合所有 SSE 區塊增量;第一個文字區塊不是完整輸出。

需要檢查原始回應時

保留請求/回應 ID 與標頭。未提供通用的文字工作擷取 URL。

回應欄位
欄位類型
欄位id類型string
欄位model類型string
欄位content[]類型text|thinking|tool_use|other content block
欄位stop_reason類型string|null
欄位usage類型object
錯誤與後續步驟
回應條件下一步
回應400 · invalid_request_error條件必要欄位、素材表示方式或參數值無效下一步提出新的建立請求前,先修正指定欄位。

別名

模型別名

Ailoot qwen3.8-flash, qwen-flash, qwen-flash-latest
Ailoot Ultra qwen3.8-flash, qwen/qwen3.8-flash

方法路徑別名

/chat/completions

相關呼叫用 ID

qwen/qwen3.8-flash, qwen-flash, qwen-flash-latest, qwen3.8-flash, qwen3.8-flash

Ailoot · OpenAI Responses POST /v1/responses qwen-flash-latest

qwen-flash-latest

Alibaba /qwen-flash-latest
模型 ID
  • qwen3.8-flash
  • qwen-flash
  • qwen-flash-latest

入門

用於程式代理與辦公任務的大型脈絡多模態模型。在 Ailoot 分析文字與圖片,並產生文字回應。

接受的輸入
文字 · 圖片
結果
文字

Ailoot 可用 · 輸入與方法

Ailoot · OpenAI Responses POST /v1/responses
輸入
text, image
輸出
text
上下文
991,808 tokens
輸出上限
131,072 tokens
輸出格式
json 或 SSE
欄位類型要求值與限制預設值
欄位model類型string要求必填值與限制
qwen-flash-latest
預設值—
欄位input類型string|input_item[]要求必填值與限制預設值—
欄位instructions類型string要求選填值與限制預設值—
欄位input[].type類型string要求選填值與限制
message, reasoning, function_call, function_call_output
預設值—
欄位input[].content類型string|content_part[]要求選填值與限制預設值—
欄位input[].call_id類型string要求選填值與限制
適用條件: function_call_output;保留實際回傳的 call_id
預設值—
欄位input[].output類型string|content_part[]要求選填值與限制
適用條件: function_call_output
預設值—
欄位max_output_tokens類型integer要求選填值與限制
最小值: 1
依模型而定
預設值—
欄位stream類型boolean要求選填值與限制預設值false
欄位temperature類型number要求選填值與限制
依模型而定
預設值—
欄位top_p類型number要求選填值與限制
依模型而定
預設值—
欄位tools類型tool[]要求選填值與限制
依模型而定
預設值—
欄位tool_choice類型string|object要求選填值與限制
依模型而定
預設值—
欄位parallel_tool_calls類型boolean要求選填值與限制
依模型而定
預設值—
欄位reasoning.effort類型string要求選填值與限制
依模型而定
預設值—
欄位reasoning.summary類型string要求選填值與限制
依模型而定
預設值—
欄位text.format類型object要求選填值與限制
依模型而定
預設值—
欄位text.verbosity類型string要求選填值與限制
依模型而定
預設值—
欄位include類型string[]要求選填值與限制
依模型而定
預設值—
欄位store類型boolean要求選填值與限制
依模型而定
預設值—
欄位previous_response_id類型string要求選填值與限制
ID 要求: 僅限支援的延續流程實際回傳的回應 ID
依模型而定
預設值—
欄位service_tier類型string要求選填值與限制
依模型而定
預設值—
欄位prompt_cache_key類型string要求選填值與限制
依模型而定
預設值—
欄位prompt_cache_options類型object要求選填值與限制
依模型而定
預設值—
輸入素材組合

文字 · UTF8 文字

輸入文字或 input_text 部分

文字 + 圖片

{type:input_image,image_url}

方法參數與生命週期
參數規格
參數material_types規格text, image
參數required規格model, input
參數optional_controls規格null
參數content_type規格application/json
參數text_file_material規格實際 UTF-8 內容以文字插入;檔案 ID/URLs 需要另有精確支援

生命週期: exact retained published method

方法結構與 ID 均為精確值;供應商能力與准入狀態分開。

方案

Ailoot 方法費率

Ailoot OpenAI ResponsesPOST /v1/responses
文字輸入
US$0.00015 / 1K
文字輸出
US$0.00047 / 1K
輸入,圖片
US$0.00015 / 1K tokens
讀取快取
US$0.000016 / 1K
寫入快取
US$0.0002 / 1K
寫入快取,5 分鐘
US$0.0002 / 1K tokens

Ailoot 會在請求前預留估算金額。取得結果後,依實測用量結算最終費用。串流結算採用最終用量紀錄。預留金額與結算的運作方式 →

參考費率詳情

模型層級的參考費率表不會變更方法選擇、報價或費用。實際計費採用所選 Ailoot 方法的費率。

模型參考費率表

各設定的價格

請逐一核對各項費用與所列條件。每組互為替代選項的設定只套用一種費率。

設定費率表上下文 Token 數大於上下文 Token 數小於或等於費用
設定OpenAI Chat · 基本 token 費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定OpenAI Chat · 請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定Anthropic Messages · 基本 token 費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定Anthropic Messages · 請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token

請求範例

Ailoot · OpenAI Responses

文字範例輸入,圖片Python SDKNode.js SDKPython 串流
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 source-material file}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "qwen-flash-latest", "input": ""}')
f=Path(os.environ["AILOOT_TEXT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 source material")
text=f.read_text(encoding="utf-8")
if not text.strip():raise SystemExit("Source material must contain text")
p["input"]="Summarize this material and quote supporting source passages.\n\n"+text
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/responses \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

save_result(json.loads(Path("result.json").read_text(encoding="utf-8")))
PY_RESULT
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_FILE:?Set your actual PNG JPEG or WebP image}"
export AILOOT_IMAGE_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "qwen-flash-latest", "input": [{"role": "user", "content": [{"type": "input_text", "text": "Read labels and numbers in this image; flag unreadable text."}]}]}')
import base64
f=Path(os.environ["AILOOT_IMAGE_FILE"])
if not f.is_file():raise SystemExit("Choose an actual PNG JPEG or WebP image")
raw=f.read_bytes()
mime="image/png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "image/jpeg" if raw.startswith(b"\xff\xd8") else "image/webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else None
if not mime:raise SystemExit("Use PNG JPEG or WebP")
b64=base64.b64encode(raw).decode()
p["input"][0]["content"].append({"type":"input_image","image_url":"data:"+mime+";base64,"+b64})
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/responses \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

save_result(json.loads(Path("result.json").read_text(encoding="utf-8")))
PY_RESULT
from openai import OpenAI
import os

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client = OpenAI(base_url="https://api.ailoot.ai/v1", api_key=os.environ["AILOOT_API_KEY"], max_retries=0)
resp = client.responses.create(model="qwen-flash-latest", input="Explain the difference between an observation and a hypothesis in three sentences.")
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

save_result(resp.to_dict(mode="json"))
import OpenAI from "openai";

if (!process.env.AILOOT_API_KEY?.trim()) throw new Error("Set AILOOT_API_KEY before making a request");
const client = new OpenAI({ baseURL: "https://api.ailoot.ai/v1", apiKey: process.env.AILOOT_API_KEY, maxRetries: 0 });
const resp = await client.responses.create({ model: "qwen-flash-latest", input: "Explain the difference between an observation and a hypothesis in three sentences." });
import { writeFileSync } from "node:fs";

function saveResult(data, stem = "result") {
  writeFileSync(stem + ".json", JSON.stringify(data, null, 2));
  console.log(JSON.stringify(data, null, 2));
  const saveBlob = (encoded, suffix, label) => {
    const raw = Buffer.from(encoded, "base64");
    const ext = raw.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10])) ? "png" : raw[0]===255 && raw[1]===216 ? "jpg" : raw.subarray(0,4).toString()==="RIFF" && raw.subarray(8,12).toString()==="WEBP" ? "webp" : suffix;
    const file = `${stem}-${label}.${ext}`;
    writeFileSync(file, raw); console.log("Saved", file);
  };
  for (const [i, block] of (data.content || []).entries()) console.log("Content", i, JSON.stringify(block));
  for (const choice of data.choices || []) console.log("Choice", choice.index, JSON.stringify(choice.message || choice.delta || {}));
  for (const [i, item] of (data.output || []).entries()) {
    console.log("Output", i, JSON.stringify(item));
    if (item.type === "image_generation_call" && item.result) saveBlob(item.result, item.output_format || "bin", `output-${i}`);
  }
  for (const [ci, candidate] of (data.candidates || []).entries()) {
    for (const [pi, part] of (candidate.content?.parts || []).entries()) {
      console.log("Candidate/part", ci, pi, JSON.stringify(part));
      const blob = part.inlineData || part.inline_data;
      if (blob?.data) {
        const mime = blob.mimeType || blob.mime_type;
        const suffix = ({"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"})[mime] || "bin";
        saveBlob(blob.data, suffix, `candidate-${ci}-part-${pi}`);
      }
    }
  }
}

saveResult(resp);
from openai import OpenAI
import os
from pathlib import Path
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
with client.responses.stream(model="qwen-flash-latest", input="Explain the difference between an observation and a hypothesis in three sentences.") as stream:
    with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
        for event in stream:
            payload=event.to_dict(mode="json")
            log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
            print(json.dumps(payload,ensure_ascii=False))
    final=stream.get_final_response()
    save_result(final.to_dict(mode="json"),"stream-result")

接收並儲存結果

Ailoot · OpenAI Responses

json 或 SSE

保留所有已完成的結果

請保留所有完整傳回的回應、檔案與內容區塊。

保留每個輸出項目與內容部分、實際函式 call_id、加密推理與用量。串流時保留完整事件/項目身分。

需要檢查原始回應時

保留請求/回應 ID 與標頭。未提供通用的文字工作擷取 URL。

回應欄位
欄位類型
欄位id類型string
欄位status類型string
欄位output[]類型message|reasoning|function_call|other item
欄位output[].content[]類型content part
欄位usage類型object
錯誤與後續步驟
回應條件下一步
回應400 · invalid_request_error條件必要欄位、素材表示方式或參數值無效下一步提出新的建立請求前,先修正指定欄位。

別名

模型別名

Ailoot qwen3.8-flash, qwen-flash, qwen-flash-latest
Ailoot Ultra qwen3.8-flash, qwen/qwen3.8-flash

方法路徑別名

/chat/completions

相關呼叫用 ID

qwen/qwen3.8-flash, qwen-flash, qwen-flash-latest, qwen3.8-flash, qwen3.8-flash

Ailoot · OpenAI Chat POST /v1/chat/completions qwen-flash-latest

qwen-flash-latest

Alibaba /qwen-flash-latest
模型 ID
  • qwen3.8-flash
  • qwen-flash
  • qwen-flash-latest

入門

用於程式代理與辦公任務的大型脈絡多模態模型。在 Ailoot 分析文字與圖片,並產生文字回應。

接受的輸入
文字 · 圖片
結果
文字

Ailoot 可用 · 輸入與方法

Ailoot · OpenAI Chat POST /v1/chat/completions
輸入
text, image
輸出
text
上下文
991,808 tokens
輸出上限
131,072 tokens
輸出格式
json 或 SSE
欄位類型要求值與限制預設值
欄位model類型string要求必填值與限制
qwen-flash-latest
預設值—
欄位messages類型message[]要求必填值與限制
項目數下限: 1
預設值—
欄位messages[].role類型string要求必填值與限制
範例:system, user, assistant, tool, function
條件: 這些角色由 原始碼中的相容型別明確表示;確切角色集合仍依模型而定。
依模型而定
預設值—
欄位messages[].content類型string|content_part[]|null要求選填值與限制預設值—
欄位messages[].tool_calls類型tool_call[]要求選填值與限制預設值—
欄位messages[].tool_call_id類型string要求選填值與限制
適用條件: role=tool;使用實際回傳的 ID
預設值—
欄位messages[].name類型string要求選填值與限制預設值—
欄位messages[].reasoning_content類型string要求選填值與限制
適用條件: 此模型使用推理內容時,將實際回傳的推理內容帶回後續請求
預設值—
欄位messages[].reasoning_details類型object|array要求選填值與限制
依模型而定
預設值—
欄位max_tokens類型integer要求選填值與限制
最小值: 1
依模型而定
預設值—
欄位max_completion_tokens類型integer要求選填值與限制
最小值: 1
依模型而定
預設值—
欄位stream類型boolean要求選填值與限制預設值false
欄位stream_options.include_usage類型boolean要求選填值與限制
依模型而定
預設值—
欄位temperature類型number要求選填值與限制
依模型而定
預設值—
欄位top_p類型number要求選填值與限制
依模型而定
預設值—
欄位stop類型string|string[]要求選填值與限制
依模型而定
預設值—
欄位tools類型function_tool[]要求選填值與限制
依模型而定
預設值—
欄位tools[].type類型string要求選填值與限制
依模型而定
預設值—
欄位tools[].function.name類型string要求必填值與限制
適用條件: 已提供函式工具
預設值—
欄位tools[].function.description類型string要求選填值與限制預設值—
欄位tools[].function.parameters類型JSON_schema要求選填值與限制預設值—
欄位tool_choice類型string|object要求選填值與限制
依模型而定
預設值—
欄位parallel_tool_calls類型boolean要求選填值與限制
依模型而定
預設值—
欄位response_format類型object要求選填值與限制
依模型而定
預設值—
欄位reasoning_effort類型string要求選填值與限制
依模型而定
預設值—
欄位reasoning類型object要求選填值與限制
依模型而定
預設值—
欄位service_tier類型string要求選填值與限制
依模型而定
預設值—
欄位instructions類型string要求選填值與限制
相容性欄位
預設值—
欄位functions類型function[]要求選填值與限制
依模型而定
預設值—
欄位function_call類型string|object要求選填值與限制
依模型而定
預設值—
欄位prompt_cache_options類型object要求選填值與限制
依模型而定
預設值—
輸入素材組合

文字 · UTF8 文字

messages[].content

文字 + 圖片

{type:image_url,image_url:{url,detail}}

方法參數與生命週期
參數規格
參數material_types規格text, image
參數required規格model, messages
參數optional_controls規格null
參數content_type規格application/json
參數text_file_material規格實際 UTF-8 內容以文字插入;檔案 ID/URLs 需要另有精確支援

生命週期: exact retained published method

方法結構與 ID 均為精確值;供應商能力與准入狀態分開。

方案

Ailoot 方法費率

Ailoot OpenAI ChatPOST /v1/chat/completions
文字輸入
US$0.00015 / 1K
文字輸出
US$0.00047 / 1K
輸入,圖片
US$0.00015 / 1K tokens
讀取快取
US$0.000016 / 1K
寫入快取
US$0.0002 / 1K
寫入快取,5 分鐘
US$0.0002 / 1K tokens

Ailoot 會在請求前預留估算金額。取得結果後,依實測用量結算最終費用。串流結算採用最終用量紀錄。預留金額與結算的運作方式 →

參考費率詳情

模型層級的參考費率表不會變更方法選擇、報價或費用。實際計費採用所選 Ailoot 方法的費率。

模型參考費率表

各設定的價格

請逐一核對各項費用與所列條件。每組互為替代選項的設定只套用一種費率。

設定費率表上下文 Token 數大於上下文 Token 數小於或等於費用
設定OpenAI Chat · 基本 token 費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定OpenAI Chat · 請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定Anthropic Messages · 基本 token 費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定Anthropic Messages · 請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token

請求範例

Ailoot · OpenAI Chat

文字範例輸入,圖片Python SDKNode.js SDKPython 串流
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 source-material file}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "qwen-flash-latest", "messages": []}')
f=Path(os.environ["AILOOT_TEXT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 source material")
text=f.read_text(encoding="utf-8")
if not text.strip():raise SystemExit("Source material must contain text")
p["messages"]=[{"role":"user","content":"Summarize this material and quote supporting source passages.\n\n"+text}]
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_FILE:?Set your actual PNG JPEG or WebP image}"
export AILOOT_IMAGE_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "qwen-flash-latest", "messages": [{"role": "user", "content": [{"type": "text", "text": "Read labels and numbers in this image; flag unreadable text."}]}]}')
import base64
f=Path(os.environ["AILOOT_IMAGE_FILE"])
if not f.is_file():raise SystemExit("Choose an actual PNG JPEG or WebP image")
raw=f.read_bytes()
mime="image/png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "image/jpeg" if raw.startswith(b"\xff\xd8") else "image/webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else None
if not mime:raise SystemExit("Use PNG JPEG or WebP")
b64=base64.b64encode(raw).decode()
p["messages"][0]["content"].append({"type":"image_url","image_url":{"url":"data:"+mime+";base64,"+b64}})
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
from openai import OpenAI
import os

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client = OpenAI(base_url="https://api.ailoot.ai/v1", api_key=os.environ["AILOOT_API_KEY"], max_retries=0)
resp = client.chat.completions.create(
    model="qwen-flash-latest",
    messages=[{"role": "user", "content": "Explain the difference between an observation and a hypothesis in three sentences."}],
)
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

save_result(resp.to_dict(mode="json"))
import OpenAI from "openai";

if (!process.env.AILOOT_API_KEY?.trim()) throw new Error("Set AILOOT_API_KEY before making a request");
const client = new OpenAI({ baseURL: "https://api.ailoot.ai/v1", apiKey: process.env.AILOOT_API_KEY, maxRetries: 0 });
const resp = await client.chat.completions.create({
  model: "qwen-flash-latest",
  messages: [{ role: "user", content: "Explain the difference between an observation and a hypothesis in three sentences." }],
});
import { writeFileSync } from "node:fs";

function saveResult(data, stem = "result") {
  writeFileSync(stem + ".json", JSON.stringify(data, null, 2));
  console.log(JSON.stringify(data, null, 2));
  const saveBlob = (encoded, suffix, label) => {
    const raw = Buffer.from(encoded, "base64");
    const ext = raw.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10])) ? "png" : raw[0]===255 && raw[1]===216 ? "jpg" : raw.subarray(0,4).toString()==="RIFF" && raw.subarray(8,12).toString()==="WEBP" ? "webp" : suffix;
    const file = `${stem}-${label}.${ext}`;
    writeFileSync(file, raw); console.log("Saved", file);
  };
  for (const [i, block] of (data.content || []).entries()) console.log("Content", i, JSON.stringify(block));
  for (const choice of data.choices || []) console.log("Choice", choice.index, JSON.stringify(choice.message || choice.delta || {}));
  for (const [i, item] of (data.output || []).entries()) {
    console.log("Output", i, JSON.stringify(item));
    if (item.type === "image_generation_call" && item.result) saveBlob(item.result, item.output_format || "bin", `output-${i}`);
  }
  for (const [ci, candidate] of (data.candidates || []).entries()) {
    for (const [pi, part] of (candidate.content?.parts || []).entries()) {
      console.log("Candidate/part", ci, pi, JSON.stringify(part));
      const blob = part.inlineData || part.inline_data;
      if (blob?.data) {
        const mime = blob.mimeType || blob.mime_type;
        const suffix = ({"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"})[mime] || "bin";
        saveBlob(blob.data, suffix, `candidate-${ci}-part-${pi}`);
      }
    }
  }
}

saveResult(resp);
from openai import OpenAI
import os
from pathlib import Path

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

with client.chat.completions.stream(model='qwen-flash-latest',messages=[{"role":"user","content":"Explain observations and hypotheses in three sentences."}]) as stream:
    with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
        for event in stream:
            payload=event.to_dict(mode="json")
            log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
            print(json.dumps(payload,ensure_ascii=False))
    final=stream.get_final_completion()
    save_result(final.to_dict(mode="json"),"stream-result")

接收並儲存結果

Ailoot · OpenAI Chat

json 或 SSE

保留所有已完成的結果

請保留所有完整傳回的回應、檔案與內容區塊。

保留每個候選項及其內容/工具呼叫/推理。SSE 中依候選項/工具索引組合增量,保留最終完成原因與用量。

需要檢查原始回應時

保留請求/回應 ID 與標頭。未提供通用的文字工作擷取 URL。

回應欄位
欄位類型
欄位choices[].index類型integer
欄位choices[].message.content類型string|null
欄位choices[].message.tool_calls類型tool_call[]
欄位choices[].message.reasoning_content類型string
欄位choices[].message.reasoning_details類型object|array
欄位choices[].finish_reason類型string|null
欄位usage類型object
錯誤與後續步驟
回應條件下一步
回應400 · invalid_request_error條件必要欄位、素材表示方式或參數值無效下一步提出新的建立請求前,先修正指定欄位。

別名

模型別名

Ailoot qwen3.8-flash, qwen-flash, qwen-flash-latest
Ailoot Ultra qwen3.8-flash, qwen/qwen3.8-flash

方法路徑別名

/chat/completions

相關呼叫用 ID

qwen/qwen3.8-flash, qwen-flash, qwen-flash-latest, qwen3.8-flash, qwen3.8-flash

Ailoot Ultra · OpenAI Chat POST /v1/chat/completions qwen/qwen3.8-flash

qwen/qwen3.8-flash

Alibaba /qwen/qwen3.8-flash
模型 ID
  • qwen3.8-flash
  • qwen/qwen3.8-flash

入門

用於程式代理與辦公任務的大型脈絡多模態模型。在 Ailoot 分析文字與圖片,並產生文字回應。

接受的輸入
文字
結果
文字

Ailoot 可用 · 輸入與方法

Ailoot Ultra · OpenAI Chat POST /v1/chat/completions
輸入
text
輸出
text
輸出格式
json 或 SSE
欄位類型要求值與限制預設值
欄位model類型string要求必填值與限制
qwen/qwen3.8-flash
預設值—
欄位messages類型message[]要求必填值與限制
項目數下限: 1
預設值—
欄位messages[].role類型string要求必填值與限制
範例:system, user, assistant, tool, function
條件: 這些角色由 原始碼中的相容型別明確表示;確切角色集合仍依模型而定。
依模型而定
預設值—
欄位messages[].content類型string|content_part[]|null要求選填值與限制預設值—
欄位messages[].tool_calls類型tool_call[]要求選填值與限制預設值—
欄位messages[].tool_call_id類型string要求選填值與限制
適用條件: role=tool;使用實際回傳的 ID
預設值—
欄位messages[].name類型string要求選填值與限制預設值—
欄位messages[].reasoning_content類型string要求選填值與限制
適用條件: 此模型使用推理內容時,將實際回傳的推理內容帶回後續請求
預設值—
欄位messages[].reasoning_details類型object|array要求選填值與限制
依模型而定
預設值—
欄位max_tokens類型integer要求選填值與限制
最小值: 1
依模型而定
預設值—
欄位max_completion_tokens類型integer要求選填值與限制
最小值: 1
依模型而定
預設值—
欄位stream類型boolean要求選填值與限制預設值false
欄位stream_options.include_usage類型boolean要求選填值與限制
依模型而定
預設值—
欄位temperature類型number要求選填值與限制
依模型而定
預設值—
欄位top_p類型number要求選填值與限制
依模型而定
預設值—
欄位stop類型string|string[]要求選填值與限制
依模型而定
預設值—
欄位tools類型function_tool[]要求選填值與限制
依模型而定
預設值—
欄位tools[].type類型string要求選填值與限制
function
依模型而定
預設值—
欄位tools[].function.name類型string要求必填值與限制
適用條件: 已提供函式工具
預設值—
欄位tools[].function.description類型string要求選填值與限制預設值—
欄位tools[].function.parameters類型JSON_schema要求選填值與限制預設值—
欄位tool_choice類型string|object要求選填值與限制
依模型而定
預設值—
欄位parallel_tool_calls類型boolean要求選填值與限制
依模型而定
預設值—
欄位response_format類型object要求選填值與限制
依模型而定
預設值—
欄位reasoning_effort類型string要求選填值與限制
依模型而定
預設值—
欄位reasoning類型object要求選填值與限制
依模型而定
預設值—
欄位service_tier類型string要求選填值與限制
依模型而定
預設值—
欄位instructions類型string要求選填值與限制
相容性欄位
預設值—
欄位functions類型function[]要求選填值與限制
依模型而定
預設值—
欄位function_call類型string|object要求選填值與限制
依模型而定
預設值—
欄位prompt_cache_options類型object要求選填值與限制
依模型而定
預設值—
欄位modalities類型string[]要求選填值與限制
text
預設值—
欄位provider類型object要求選填值與限制
條件: 此 Ultra 文字路由拒絕 provider.options
預設值—
欄位cache_control.ttl類型string要求選填值與限制
條件: 實際提示詞快取位置拒絕 1h
預設值—
輸入素材組合

文字 · UTF8 文字

messages[].content

方法參數與生命週期
參數規格
參數content_type規格application/json
參數required規格model, messages
參數material_types規格text
參數messages規格具有 role/content 結構的訊息陣列
參數file_material規格實際 UTF-8 文件以原文文字插入;不推定檔案 ID
參數optional_controls規格stream, temperature, top_p, stop, max_tokens, max_completion_tokens, reasoning, response_format, tools, tool_choice
參數control_scope規格依模型而定;使用者函式工具與託管工具不同
參數output_modalities規格text
參數hosted_operations規格false
參數multimodal_input_binding規格null

生命週期: synchronous_or_streamed

將確切模型 ID 與 messages 一併送出。

上下文長度不是輸出上限。

文字檔案可提供原文文字;圖片/音訊/檔案物件輸入需要精確綁定。

方案

費率資訊不會增加請求選項。支援的參數列於所選方法中。

快速模式
標準費率 選取快速模式時
flex 模式
標準費率 選取 flex 模式時
最高推理強度
標準費率 最高推理強度採用 default 調整值時

Ailoot 費率

各設定的價格

請逐一核對各項費用與所列條件。每組互為替代選項的設定只套用一種費率。

設定費率表上下文 Token 數大於上下文 Token 數小於或等於費用
設定詞元基本費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token

Ailoot 會在請求前預留估算金額。取得結果後,依實測用量結算最終費用。串流結算採用最終用量紀錄。預留金額與結算的運作方式 →

請求範例

Ailoot Ultra · OpenAI Chat

curlPython SDKPython 串流
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "qwen/qwen3.8-flash", "messages": [{"role": "user", "content": "Explain the difference between an observation and a hypothesis in three sentences."}]}')

Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \
  -H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
r=json.loads(Path("result.json").read_text())
for x in r.get("choices",[]):
    if x.get("message",{}).get("content"): print(x["message"]["content"])
PY_RESULT
from openai import OpenAI
import os

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
result=client.chat.completions.create(model='qwen/qwen3.8-flash',messages=[{"role":"user","content":"Explain observations and hypotheses in three sentences."}])
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

save_result(result.to_dict(mode="json"))
from openai import OpenAI
import os
from pathlib import Path

if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
import base64, json
from pathlib import Path

def save_result(data, stem="result"):
    # Keep every field, including usage, IDs, reasoning and tool requests.
    Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
    print(json.dumps(data, ensure_ascii=False, indent=2))
    def save_blob(encoded, suffix, label):
        raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
        ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
        file = Path(stem + "-" + label + "." + ext)
        file.write_bytes(raw)
        print("Saved", file)
    for index, block in enumerate(data.get("content") or []):
        print("Content", index, json.dumps(block, ensure_ascii=False))
    for choice in data.get("choices") or []:
        print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
    for index, item in enumerate(data.get("output") or []):
        print("Output", index, json.dumps(item, ensure_ascii=False))
        if item.get("type") == "image_generation_call" and item.get("result"):
            save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
    for ci, candidate in enumerate(data.get("candidates") or []):
        for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
            print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
            blob = part.get("inlineData") or part.get("inline_data")
            if blob and blob.get("data"):
                mime = blob.get("mimeType") or blob.get("mime_type")
                suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
                save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))

with client.chat.completions.stream(model='qwen/qwen3.8-flash',messages=[{"role":"user","content":"Explain observations and hypotheses in three sentences."}]) as stream:
    with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
        for event in stream:
            payload=event.to_dict(mode="json")
            log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
            print(json.dumps(payload,ensure_ascii=False))
    final=stream.get_final_completion()
    save_result(final.to_dict(mode="json"),"stream-result")

接收並儲存結果

Ailoot Ultra · OpenAI Chat

json 或 SSE

保留所有已完成的結果

請保留所有完整傳回的回應、檔案與內容區塊。

保留每個候選項及其內容/工具呼叫/推理。SSE 中依候選項/工具索引組合增量,保留最終完成原因與用量。

需要檢查原始回應時

保留請求/回應 ID 與標頭。未提供通用的文字工作擷取 URL。

回應欄位
欄位類型
欄位choices[].index類型integer
欄位choices[].message.content類型string|null
欄位choices[].message.tool_calls類型tool_call[]
欄位choices[].message.reasoning_content類型string
欄位choices[].message.reasoning_details類型object|array
欄位choices[].finish_reason類型string|null
欄位usage類型object
錯誤與後續步驟
回應條件下一步
回應400 · invalid_request_error條件必要欄位、素材表示方式或參數值無效下一步提出新的建立請求前,先修正指定欄位。

別名

模型別名

Ailoot qwen3.8-flash, qwen-flash, qwen-flash-latest
Ailoot Ultra qwen3.8-flash, qwen/qwen3.8-flash

方法路徑別名

/chat/completions

相關呼叫用 ID

qwen/qwen3.8-flash, qwen-flash, qwen-flash-latest, qwen3.8-flash, qwen3.8-flash

Ailoot Ultra · Anthropic Messages POST /v1/messages qwen/qwen3.8-flash

qwen/qwen3.8-flash

Alibaba /qwen/qwen3.8-flash
模型 ID
  • qwen3.8-flash
  • qwen/qwen3.8-flash

入門

用於程式代理與辦公任務的大型脈絡多模態模型。在 Ailoot 分析文字與圖片,並產生文字回應。

接受的輸入
文字
結果
json · sse

Ailoot 可用 · 輸入與方法

Ailoot Ultra · Anthropic Messages POST /v1/messages
輸入
text
輸出
json, sse
輸出格式
JSON 或 SSE
欄位類型要求值與限制預設值
欄位model類型string要求必填值與限制
qwen/qwen3.8-flash
預設值—
欄位messages類型message[]要求必填值與限制預設值—
欄位messages[].role類型string要求必填值與限制
user, assistant
預設值—
欄位messages[].content類型string要求必填值與限制預設值—
欄位max_tokens類型integer要求必填值與限制預設值—
欄位stream類型boolean要求選填值與限制預設值false
輸入素材組合

文字 · UTF-8 文字

messages[].content 字串

方法參數與生命週期
參數規格
參數content_type規格application/json
參數required規格model, messages, max_tokens
參數optional_controls規格stream
參數material_types規格text
參數text_file_material規格讀取實際 UTF-8 文件,將文字放入指定的 input 或訊息內容字串。

生命週期: synchronous_or_streamed

方案

費率資訊不會增加請求選項。支援的參數列於所選方法中。

快速模式
標準費率 選取快速模式時
flex 模式
標準費率 選取 flex 模式時
最高推理強度
標準費率 最高推理強度採用 default 調整值時

Ailoot 費率

各設定的價格

請逐一核對各項費用與所列條件。每組互為替代選項的設定只套用一種費率。

設定費率表上下文 Token 數大於上下文 Token 數小於或等於費用
設定詞元基本費率費率表基本費率上下文 Token 數大於—上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token
設定請求長度級距 1費率表—上下文 Token 數大於0上下文 Token 數小於或等於無上限費用
輸入 · 輸入 Token $0.0003 / 1K Token
輸出 · 輸出 Token $0.00094 / 1K Token
輸入 · 讀取快取 $0.000032 / 1K Token
輸入 · 寫入快取 $0.0004 / 1K Token
輸入 · 寫入快取,1 小時 — / 1K Token

Ailoot 會在請求前預留估算金額。取得結果後,依實測用量結算最終費用。串流結算採用最終用量紀錄。預留金額與結算的運作方式 →

請求範例

Ailoot Ultra · Anthropic Messages

完整的最小 JSON 請求主體curl · 使用您的 UTF-8 文件Python · 儲存完整結果
{
  "model": "qwen/qwen3.8-flash",
  "max_tokens": 128,
  "messages": [
    {
      "role": "user",
      "content": "Summarize the incident report."
    }
  ],
  "stream": false
}
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 document}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json, os
from pathlib import Path

source_file = Path(os.environ['AILOOT_TEXT_FILE'])
if not source_file.is_file():
    raise SystemExit('Set AILOOT_TEXT_FILE to your actual UTF-8 document')
text = source_file.read_text(encoding='utf-8')
if not text.strip():
    raise SystemExit('Choose a document containing text')
payload = {'model': 'qwen/qwen3.8-flash', 'max_tokens': 128, 'messages': [{'role': 'user', 'content': 'Summarize the incident report.'}]}
payload['messages'][0]['content'] = 'Summarize this material and quote supporting source passages.\n\n' + text
Path('request.json').write_text(json.dumps(payload, ensure_ascii=False), encoding='utf-8')
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \
  -H "x-api-key: $AILOOT_API_KEY" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \
  --data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path

result = json.loads(Path('result.json').read_text(encoding='utf-8'))
print(json.dumps(result, ensure_ascii=False, indent=2))
PY_RESULT
import json, os
from pathlib import Path

source_file = Path(os.environ['AILOOT_TEXT_FILE'])
if not source_file.is_file():
    raise SystemExit('Set AILOOT_TEXT_FILE to your actual UTF-8 document')
text = source_file.read_text(encoding='utf-8')
if not text.strip():
    raise SystemExit('Choose a document containing text')
payload = {'model': 'qwen/qwen3.8-flash', 'max_tokens': 128, 'messages': [{'role': 'user', 'content': 'Summarize the incident report.'}]}
payload['messages'][0]['content'] = 'Summarize this material and quote supporting source passages.\n\n' + text
from urllib.request import Request, urlopen
from urllib.error import HTTPError

api_key = os.environ['AILOOT_API_KEY']
if not api_key.strip():
    raise SystemExit('Set AILOOT_API_KEY before making a request')
headers = {'x-api-key': 'PLACEHOLDER_KEY', 'anthropic-version': '2023-06-01', 'Content-Type': 'application/json'}
headers['x-api-key'] = api_key
request = Request('https://api.ailoot.ai/v1/messages', data=json.dumps(payload, ensure_ascii=False).encode('utf-8'), headers=headers, method='POST')
try:
    with urlopen(request, timeout=120) as response:
        raw = response.read()
        Path('response-headers.txt').write_text(str(response.headers), encoding='utf-8')
except HTTPError as error:
    Path('result.json').write_bytes(error.read())
    Path('response-headers.txt').write_text(str(error.headers), encoding='utf-8')
    raise
Path('result.json').write_bytes(raw)
import json
from pathlib import Path

result = json.loads(Path('result.json').read_text(encoding='utf-8'))
print(json.dumps(result, ensure_ascii=False, indent=2))

接收並儲存結果

Ailoot Ultra · Anthropic Messages

JSON 或 SSE

保留所有已完成的結果

請保留所有完整傳回的回應、檔案與內容區塊。

保留所有內容區塊、思考簽章與實際工具使用 ID。組合所有 SSE 區塊增量;第一個文字區塊不是完整輸出。

需要檢查原始回應時

保留請求/回應 ID 與標頭。未提供通用的文字工作擷取 URL。

回應欄位
欄位類型
欄位id類型string
欄位model類型string
欄位content[]類型text|thinking|tool_use|other content block
欄位stop_reason類型string|null
欄位usage類型object
錯誤與後續步驟
回應條件下一步
回應400 · invalid_request_error條件必要欄位、素材表示方式或參數值無效下一步提出新的建立請求前,先修正指定欄位。

別名

模型別名

Ailoot qwen3.8-flash, qwen-flash, qwen-flash-latest
Ailoot Ultra qwen3.8-flash, qwen/qwen3.8-flash

方法路徑別名

/chat/completions

相關呼叫用 ID

qwen/qwen3.8-flash, qwen-flash, qwen-flash-latest, qwen3.8-flash, qwen3.8-flash

FAQ · Qwen: Qwen3.8 Flash
可以使用哪些輸入與結果?

POST /v1/messages · qwen3.8-flash: text, image → text

POST /v1/responses · qwen3.8-flash: text, image → text

POST /v1/chat/completions · qwen3.8-flash: text, image → text

POST /v1/chat/completions · qwen3.8-flash: text → text

POST /v1/messages · qwen3.8-flash: text → json, sse

POST /v1/messages · qwen-flash: text, image → text

POST /v1/responses · qwen-flash: text, image → text

POST /v1/chat/completions · qwen-flash: text, image → text

POST /v1/messages · qwen-flash-latest: text, image → text

POST /v1/responses · qwen-flash-latest: text, image → text

POST /v1/chat/completions · qwen-flash-latest: text, image → text

POST /v1/chat/completions · qwen/qwen3.8-flash: text → text

POST /v1/messages · qwen/qwen3.8-flash: text → json, sse

請求使用哪些欄位?

POST /v1/messages · qwen3.8-flash: model, messages, system, max_tokens, stream, metadata

POST /v1/responses · qwen3.8-flash: model, input, instructions, stream

POST /v1/chat/completions · qwen3.8-flash: model, messages, stream

POST /v1/chat/completions · qwen3.8-flash: model, messages, stream

POST /v1/messages · qwen3.8-flash: model, messages, max_tokens, stream

POST /v1/messages · qwen-flash: model, messages, system, max_tokens, stream, metadata

POST /v1/responses · qwen-flash: model, input, instructions, stream

POST /v1/chat/completions · qwen-flash: model, messages, stream

POST /v1/messages · qwen-flash-latest: model, messages, system, max_tokens, stream, metadata

POST /v1/responses · qwen-flash-latest: model, input, instructions, stream

POST /v1/chat/completions · qwen-flash-latest: model, messages, stream

POST /v1/chat/completions · qwen/qwen3.8-flash: model, messages, stream, modalities, provider

POST /v1/messages · qwen/qwen3.8-flash: model, messages, max_tokens, stream

適用哪些限制?

POST /v1/messages · qwen3.8-flash: ctx: 991808; max_out: 131072; messages.min_items: 1; max_tokens.minimum: 1

POST /v1/responses · qwen3.8-flash: ctx: 991808; max_out: 131072

POST /v1/chat/completions · qwen3.8-flash: ctx: 991808; max_out: 131072; messages.min_items: 1

POST /v1/chat/completions · qwen3.8-flash: messages.min_items: 1

POST /v1/messages · qwen-flash: ctx: 991808; max_out: 131072; messages.min_items: 1; max_tokens.minimum: 1

POST /v1/responses · qwen-flash: ctx: 991808; max_out: 131072

POST /v1/chat/completions · qwen-flash: ctx: 991808; max_out: 131072; messages.min_items: 1

POST /v1/messages · qwen-flash-latest: ctx: 991808; max_out: 131072; messages.min_items: 1; max_tokens.minimum: 1

POST /v1/responses · qwen-flash-latest: ctx: 991808; max_out: 131072

POST /v1/chat/completions · qwen-flash-latest: ctx: 991808; max_out: 131072; messages.min_items: 1

POST /v1/chat/completions · qwen/qwen3.8-flash: messages.min_items: 1

更多詳情

將 Ailoot 串接 Claude Code、OpenCode、Hermes 或自己的應用程式。

公司及其專案組合

公司及其專案組合:數百萬客戶,每月銷售額達數十億。

優惠購買 token。

訂閱優惠適合持續工作,折扣碼購買 token 最高可折 50%。

訂閱
為定期請求選擇優惠方案。
最高 50% 折扣碼
購買時輸入代碼,價格依活動重算。
歷史中的費用
每次請求保存模型、token 與金額。

選擇訂閱 · 查看模型價格

將 API 加入 你銷售的產品。

依 Ailoot 正式服務條款與授權合約串接 SaaS、應用程式與機器人;轉售請申請經銷授權。

商用應用程式
在付費功能加入文字、圖片、影片與聲音生成。
經銷授權
提供專案說明與存取方式,要求書面使用和轉售條件。
網站文件
串接前可閱讀正式服務條款、授權合約與資料處理政策。

申請經銷授權 · 正式服務條款與授權合約