qwen3.8-max
Qwen3.8-Max er en Qwen-model til tekstræsonnement og visuel forståelse. Udvikleren beskriver en kontekst på 1 million tokens, billed- og videoinput, værktøjsunderstøttede forløb og strukturerede tekstresultater.
- Ailoot · Anthropic Messages
POST /v1/messagesqwen3.8-max - Ailoot · OpenAI Responses
POST /v1/responsesqwen3.8-max - Ailoot · OpenAI Chat
POST /v1/chat/completionsqwen3.8-max - Ailoot Ultra · OpenAI Chat
POST /v1/chat/completionsqwen3.8-max - Ailoot Ultra · Anthropic Messages
POST /v1/messagesqwen3.8-max - Ailoot · Anthropic Messages
POST /v1/messagesqwen - Ailoot · OpenAI Responses
POST /v1/responsesqwen - Ailoot · OpenAI Chat
POST /v1/chat/completionsqwen - Ailoot · Anthropic Messages
POST /v1/messagesqwen-latest - Ailoot · OpenAI Responses
POST /v1/responsesqwen-latest - Ailoot · OpenAI Chat
POST /v1/chat/completionsqwen-latest - Ailoot · Anthropic Messages
POST /v1/messagesqwen-max - Ailoot · OpenAI Responses
POST /v1/responsesqwen-max - Ailoot · OpenAI Chat
POST /v1/chat/completionsqwen-max - Ailoot · Anthropic Messages
POST /v1/messagesqwen3.8-max-preview - Ailoot · OpenAI Responses
POST /v1/responsesqwen3.8-max-preview - Ailoot · OpenAI Chat
POST /v1/chat/completionsqwen3.8-max-preview
Om modellen
Denne beskrivelse dækker modellens funktioner. Tilgængelige input, output og indstillinger i Ailoot står nedenfor for den valgte metode.
Qwen3.8-Max er en Qwen-model til tekstræsonnement og visuel forståelse. Udviklerens vejledninger angiver den til krævende ræsonnementsarbejde og fortolkning af billeder og video. Tabellen over visuelle modeller angiver en kontekst på 1 million tokens, funktionskald, indbyggede værktøjer og struktureret output.
Analyser et spørgsmål og dets kildemateriale
Giv belæggene, betingelserne og det resultat, opgaven skal producere. Ved dokumentarbejde bevares afsnitsmærkninger, og det angives, hvilken reference der har forrang, hvis passager er uenige. Ved et visuelt spørgsmål gives et læsbart billede, det område der skal undersøges, og de oplysninger der er relevante for svaret. Bed svaret holde kildeobservationer adskilt fra fortolkning.
Brug en optaget sekvens til et defineret spørgsmål
Vælg det udsnit, der er relevant for opgaven, og bevar rækkefølgen. Bed om en beskrivelse af de synlige hændelser og belæggene bag hver observation. Hvis en talt forklaring er nødvendig, tilføjes dens transskription som tekst. Det ønskede resultat kan være en kronologisk note, en analytisk sammenligning eller en forklaring forankret i de givne enkeltbilleder.
Giv den omgivende applikation en tydelig rolle
Funktionskald lader en integration definere en handling og dens argumenter, udføre det kald, modellen vælger, og returnere det faktiske resultat. Udvikleren angiver også indbyggede værktøjer til modellen. Deres tilgængelighed afhænger af den grænseflade, som bruges til anmodningen. Ved struktureret output defineres feltnavne og håndtering af manglende værdier, hvorefter både svarformat og betydning kontrolleres.
Planlæg inden for de dokumenterede grænser
Tabellen over visuelle modeller angiver billeder på op til 16 millioner pixels, video på op til to timer og 2 GB samt filantalsgrænser på 2.048 billeder og 64 videoer. Disse grænser for udviklerens forløb er fortsat underlagt den fælles kontekst på 1 million tokens. De beskriver inputforberedelse, mens den valgte grænseflade fastlægger grænserne for den faktiske anmodning. Hold kildemærkninger og det ønskede svar samlet, så resultatet kan kontrolleres mod belæggene.
Praktisk opgave
Praktisk opgave
Teknisk eksempel på engelsk
Resolve a document-priority conflict
Use these requirements and source priority. Manual M: operators may restart the pump after a ten-minute wait. Safety bulletin S: after a leak alarm, only maintenance may authorise restart; S overrides M. Case: a leak alarm occurred 15 minutes ago. Write a short decision note with source references and state the evidence still needed before restart.Forventet resultat
A source-linked decision note applying the bulletin and naming maintenance authorisation as an unresolved condition.Kontrollér resultatet
Elapsed waiting time alone does not override the leak-alarm rule.Ailoot · Anthropic Messages POST /v1/messages qwen3.8-max
qwen3.8-maxqwen3.8-maxqwenqwen-latestqwen-maxqwen3.8-max-preview
Start
Qwen3.8-Max er en Qwen-model til tekstræsonnement og visuel forståelse. Udvikleren beskriver en kontekst på 1 million tokens, billed- og videoinput, værktøjsunderstøttede forløb og strukturerede tekstresultater.
- Accepterede input
- Tekst · Billeder
- Resultater
- Tekst
Tilgængelig i Ailoot · input og metoder
Ailoot · Anthropic Messages POST /v1/messages
- Inputtyper
text,image- Outputtyper
text- Kontekst
- 991.808 tokens
- Maksimalt output
- 131.072 tokens
- Outputformat
- json eller SSE
| Felt | Type | Krav | Værdier og grænser | Standard |
|---|---|---|---|---|
Feltmodel | Typestring | KravPåkrævet | Værdier og grænser qwen3.8-max | Standard— |
Feltmessages | Typemessage[] | KravPåkrævet | Værdier og grænser Minimumsantal elementer: 1 | Standard— |
Feltmessages[].role | Typestring | KravPåkrævet | Værdier og grænser user, assistant | Standard— |
Feltmessages[].content | Typestring|content_block[] | KravPåkrævet | Værdier og grænser | Standard— |
Feltsystem | Typestring|content_block[] | KravValgfrit | Værdier og grænser | Standard— |
Feltmax_tokens | Typeinteger | KravPåkrævet | Værdier og grænser Minimum: 1 Grænsen gælder for: den præcise øvre grænse for valgt model/modelkort | Standard— |
Feltstream | Typeboolean | KravValgfrit | Værdier og grænser | Standardfalse |
Felttemperature | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttop_p | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltstop_sequences | Typestring[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools | Typetool[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools[].name | Typestring | KravValgfrit | Værdier og grænser Gælder når: værktøj angivet | Standard— |
Felttools[].description | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Felttools[].input_schema | TypeJSON_schema | KravValgfrit | Værdier og grænser | Standard— |
Felttool_choice | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltthinking.type | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltthinking.budget_tokens | Typeinteger | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltoutput_config.effort | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltmetadata | Typeobject | KravValgfrit | Værdier og grænser | Standard— |
Feltcache_control | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Kombinationer af inputmaterialer
Tekst · UTF8-tekst
messages[].content eller en blok med type=text
Tekst + billede
{type:image,source:{type:base64,media_type,data}} eller kilde med type=url
Metodeparametre og livscyklus
| Parameter | Kontrakt |
|---|---|
Parametermaterial_types | Kontrakttext, image |
Parameterrequired | Kontraktmodel, messages, max_tokens |
Parameteroptional_controls | Kontraktnull |
Parametercontent_type | Kontraktapplication/json |
Parametertext_file_material | Kontraktfaktisk UTF-8-indhold indsat som tekst; fil-ID’er/URLs kræver særskilt præcis understøttelse |
Livscyklus: exact retained published method
Metodernes strukturer og ID’er er præcise; leverandørens muligheder er adskilt fra adgangstilladelse.
Priser
Ailoot-metodetakster
POST /v1/messages- Input
- 0,002 US$ / 1K
- Output
- 0,006 US$ / 1K
- Cachelæsning
- 0,00017 US$ / 1K
- Cacheskrivning
- 0,0025 US$ / 1K
- Cacheskrivning, 5 min.
- 0,0025 US$ / 1K tokens
Ailoot reserverer et estimeret beløb før en anmodning. Efter resultatet afregnes det endelige beløb ud fra det målte forbrug. Ved streaming bruges den endelige forbrugsregistrering til afregningen. Sådan fungerer reservation og afregning →
Detaljer om referencetariffen
Referenceplaner på modelniveau ændrer ikke metodevalg, prisoverslag eller opkrævninger. Ved den aktive afregning anvendes taksterne for den valgte Ailoot-metode.
Modellens referenceplaner
Priser efter konfiguration
Knyt hver omkostning til de viste betingelser. Brug én takst for hver gruppe af alternative konfigurationer.
| Konfiguration | Takstplan | Beløb |
|---|---|---|
| KonfigurationOpenAI Chat · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
| KonfigurationAnthropic Messages · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
Eksempelanmodninger
Ailoot · Anthropic Messages
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-max", "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-max", "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-max",
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-max",
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-max',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")
Hent og gem resultater
Ailoot · Anthropic Messages
json eller SSE
Behold alle færdige resultater
Gem hvert fuldstændigt returneret svar, hver fil og hver indholdsdel.
Bevar alle indholdsblokke, ræsonnementssignaturer og faktiske værktøjsbrugs-ID’er. Saml alle SSE-blokdeltaer; den første tekstblok er ikke hele outputtet.
Hvis det oprindelige svar skal kontrolleres
Bevar anmodnings-/svar-ID’er og headere. Der leveres ingen generel URL til at hente tekstjob.
Svarfelter
| Felt | Type |
|---|---|
Feltid | Typestring |
Feltmodel | Typestring |
Feltcontent[] | Typetext|thinking|tool_use|other content block |
Feltstop_reason | Typestring|null |
Feltusage | Typeobject |
Fejl og næste trin
| Svar | Betingelse | Næste trin |
|---|---|---|
Svar400 · invalid_request_error | BetingelseUgyldige obligatoriske felter, materialerepræsentation eller parameterværdi | Næste trinRet de angivne felter før en ny oprettelsesanmodning. |
Aliaser
Modelaliaser
Ailoot qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot Ultra qwen3.8-max
Aliaser for metodestier
Brug metodestierne vist ovenfor.
Relaterede kalder-ID’er
qwen3.8-max, qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot · OpenAI Responses POST /v1/responses qwen3.8-max
qwen3.8-maxqwen3.8-maxqwenqwen-latestqwen-maxqwen3.8-max-preview
Start
Qwen3.8-Max er en Qwen-model til tekstræsonnement og visuel forståelse. Udvikleren beskriver en kontekst på 1 million tokens, billed- og videoinput, værktøjsunderstøttede forløb og strukturerede tekstresultater.
- Accepterede input
- Tekst · Billeder
- Resultater
- Tekst
Tilgængelig i Ailoot · input og metoder
Ailoot · OpenAI Responses POST /v1/responses
- Inputtyper
text,image- Outputtyper
text- Kontekst
- 991.808 tokens
- Maksimalt output
- 131.072 tokens
- Outputformat
- json eller SSE
| Felt | Type | Krav | Værdier og grænser | Standard |
|---|---|---|---|---|
Feltmodel | Typestring | KravPåkrævet | Værdier og grænser qwen3.8-max | Standard— |
Feltinput | Typestring|input_item[] | KravPåkrævet | Værdier og grænser | Standard— |
Feltinstructions | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Feltinput[].type | Typestring | KravValgfrit | Værdier og grænser message, reasoning, function_call, function_call_output | Standard— |
Feltinput[].content | Typestring|content_part[] | KravValgfrit | Værdier og grænser | Standard— |
Feltinput[].call_id | Typestring | KravValgfrit | Værdier og grænser Gælder når: function_call_output; bevar det faktisk returnerede call_id | Standard— |
Feltinput[].output | Typestring|content_part[] | KravValgfrit | Værdier og grænser Gælder når: function_call_output | Standard— |
Feltmax_output_tokens | Typeinteger | KravValgfrit | Værdier og grænser Minimum: 1 Afhænger af modellen | Standard— |
Feltstream | Typeboolean | KravValgfrit | Værdier og grænser | Standardfalse |
Felttemperature | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttop_p | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools | Typetool[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttool_choice | Typestring|object | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltparallel_tool_calls | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning.effort | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning.summary | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttext.format | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttext.verbosity | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltinclude | Typestring[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltstore | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltprevious_response_id | Typestring | KravValgfrit | Værdier og grænser ID-krav: Kun et faktisk svar-ID fra en understøttet fortsættelse Afhænger af modellen | Standard— |
Feltservice_tier | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltprompt_cache_key | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltprompt_cache_options | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Kombinationer af inputmaterialer
Tekst · UTF8-tekst
inputtekst eller en input_text-del
Tekst + billede
{type:input_image,image_url}
Metodeparametre og livscyklus
| Parameter | Kontrakt |
|---|---|
Parametermaterial_types | Kontrakttext, image |
Parameterrequired | Kontraktmodel, input |
Parameteroptional_controls | Kontraktnull |
Parametercontent_type | Kontraktapplication/json |
Parametertext_file_material | Kontraktfaktisk UTF-8-indhold indsat som tekst; fil-ID’er/URLs kræver særskilt præcis understøttelse |
Livscyklus: exact retained published method
Metodernes strukturer og ID’er er præcise; leverandørens muligheder er adskilt fra adgangstilladelse.
Priser
Ailoot-metodetakster
POST /v1/responses- Input
- 0,002 US$ / 1K
- Output
- 0,006 US$ / 1K
- Cachelæsning
- 0,00025 US$ / 1K
- Cacheskrivning
- 0,0025 US$ / 1K
- Cacheskrivning, 5 min.
- 0,0025 US$ / 1K tokens
- code_interpreter_call
- 0,00 US$ pr. kald
- image_search_call
- 0,008 US$ pr. kald
- web_extractor_call
- 0,00 US$ pr. kald
- web_search_call
- 0,01 US$ pr. kald
- web_search_image_call
- 0,008 US$ pr. kald
- Maks. antal kald code_interpreter_call
- 8
- Maks. antal kald image_search_call
- 8
- Maks. antal kald web_extractor_call
- 8
- Maks. antal kald web_search_call
- 8
- Maks. antal kald web_search_image_call
- 8
Ailoot reserverer et estimeret beløb før en anmodning. Efter resultatet afregnes det endelige beløb ud fra det målte forbrug. Ved streaming bruges den endelige forbrugsregistrering til afregningen. Sådan fungerer reservation og afregning →
Detaljer om referencetariffen
Referenceplaner på modelniveau ændrer ikke metodevalg, prisoverslag eller opkrævninger. Ved den aktive afregning anvendes taksterne for den valgte Ailoot-metode.
Modellens referenceplaner
Priser efter konfiguration
Knyt hver omkostning til de viste betingelser. Brug én takst for hver gruppe af alternative konfigurationer.
| Konfiguration | Takstplan | Beløb |
|---|---|---|
| KonfigurationOpenAI Chat · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
| KonfigurationAnthropic Messages · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
Eksempelanmodninger
Ailoot · OpenAI Responses
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-max", "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-max", "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-max", 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-max", 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-max", 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")
Hent og gem resultater
Ailoot · OpenAI Responses
json eller SSE
Behold alle færdige resultater
Gem hvert fuldstændigt returneret svar, hver fil og hver indholdsdel.
Bevar hvert outputelement og hver indholdsdel, faktisk call_id for funktioner, krypteret ræsonnement og forbrugsoplysninger. Bevar ved streaming den fulde hændelses-/elementidentitet.
Hvis det oprindelige svar skal kontrolleres
Bevar anmodnings-/svar-ID’er og headere. Der leveres ingen generel URL til at hente tekstjob.
Svarfelter
| Felt | Type |
|---|---|
Feltid | Typestring |
Feltstatus | Typestring |
Feltoutput[] | Typemessage|reasoning|function_call|other item |
Feltoutput[].content[] | Typecontent part |
Feltusage | Typeobject |
Fejl og næste trin
| Svar | Betingelse | Næste trin |
|---|---|---|
Svar400 · invalid_request_error | BetingelseUgyldige obligatoriske felter, materialerepræsentation eller parameterværdi | Næste trinRet de angivne felter før en ny oprettelsesanmodning. |
Aliaser
Modelaliaser
Ailoot qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot Ultra qwen3.8-max
Aliaser for metodestier
Brug metodestierne vist ovenfor.
Relaterede kalder-ID’er
qwen3.8-max, qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot · OpenAI Chat POST /v1/chat/completions qwen3.8-max
qwen3.8-maxqwen3.8-maxqwenqwen-latestqwen-maxqwen3.8-max-preview
Start
Qwen3.8-Max er en Qwen-model til tekstræsonnement og visuel forståelse. Udvikleren beskriver en kontekst på 1 million tokens, billed- og videoinput, værktøjsunderstøttede forløb og strukturerede tekstresultater.
- Accepterede input
- Tekst · Billeder
- Resultater
- Tekst
Tilgængelig i Ailoot · input og metoder
Ailoot · OpenAI Chat POST /v1/chat/completions
- Inputtyper
text,image- Outputtyper
text- Kontekst
- 991.808 tokens
- Maksimalt output
- 131.072 tokens
- Outputformat
- json eller SSE
| Felt | Type | Krav | Værdier og grænser | Standard |
|---|---|---|---|---|
Feltmodel | Typestring | KravPåkrævet | Værdier og grænser qwen3.8-max | Standard— |
Feltmessages | Typemessage[] | KravPåkrævet | Værdier og grænser Minimumsantal elementer: 1 | Standard— |
Feltmessages[].role | Typestring | KravPåkrævet | Værdier og grænser Eksempler: system, user, assistant, tool, function Betingelser: Disse roller er eksplicit repræsenteret i kildekodens kompatibilitetstyper; modellens præcise rollesæt er fortsat modelspecifikt. Afhænger af modellen | Standard— |
Feltmessages[].content | Typestring|content_part[]|null | KravValgfrit | Værdier og grænser | Standard— |
Feltmessages[].tool_calls | Typetool_call[] | KravValgfrit | Værdier og grænser | Standard— |
Feltmessages[].tool_call_id | Typestring | KravValgfrit | Værdier og grænser Gælder når: role=tool; brug det faktisk returnerede ID | Standard— |
Feltmessages[].name | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Feltmessages[].reasoning_content | Typestring | KravValgfrit | Værdier og grænser Gælder når: Send det faktisk returnerede ræsonnement tilbage, når modellen bruger det | Standard— |
Feltmessages[].reasoning_details | Typeobject|array | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltmax_tokens | Typeinteger | KravValgfrit | Værdier og grænser Minimum: 1 Afhænger af modellen | Standard— |
Feltmax_completion_tokens | Typeinteger | KravValgfrit | Værdier og grænser Minimum: 1 Afhænger af modellen | Standard— |
Feltstream | Typeboolean | KravValgfrit | Værdier og grænser | Standardfalse |
Feltstream_options.include_usage | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttemperature | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttop_p | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltstop | Typestring|string[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools | Typefunction_tool[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools[].type | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools[].function.name | Typestring | KravPåkrævet | Værdier og grænser Gælder når: funktionsværktøj angivet | Standard— |
Felttools[].function.description | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Felttools[].function.parameters | TypeJSON_schema | KravValgfrit | Værdier og grænser | Standard— |
Felttool_choice | Typestring|object | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltparallel_tool_calls | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltresponse_format | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning_effort | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltservice_tier | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltinstructions | Typestring | KravValgfrit | Værdier og grænser Kompatibilitetsfelt | Standard— |
Feltfunctions | Typefunction[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltfunction_call | Typestring|object | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltprompt_cache_options | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Kombinationer af inputmaterialer
Tekst · UTF8-tekst
messages[].content
Tekst + billede
{type:image_url,image_url:{url,detail}}
Metodeparametre og livscyklus
| Parameter | Kontrakt |
|---|---|
Parametermaterial_types | Kontrakttext, image |
Parameterrequired | Kontraktmodel, messages |
Parameteroptional_controls | Kontraktnull |
Parametercontent_type | Kontraktapplication/json |
Parametertext_file_material | Kontraktfaktisk UTF-8-indhold indsat som tekst; fil-ID’er/URLs kræver særskilt præcis understøttelse |
Livscyklus: exact retained published method
Metodernes strukturer og ID’er er præcise; leverandørens muligheder er adskilt fra adgangstilladelse.
Priser
Ailoot-metodetakster
POST /v1/chat/completions- Input
- 0,002 US$ / 1K
- Output
- 0,006 US$ / 1K
- Cachelæsning
- 0,00025 US$ / 1K
- Cacheskrivning
- 0,0025 US$ / 1K
- Cacheskrivning, 5 min.
- 0,0025 US$ / 1K tokens
Ailoot reserverer et estimeret beløb før en anmodning. Efter resultatet afregnes det endelige beløb ud fra det målte forbrug. Ved streaming bruges den endelige forbrugsregistrering til afregningen. Sådan fungerer reservation og afregning →
Detaljer om referencetariffen
Referenceplaner på modelniveau ændrer ikke metodevalg, prisoverslag eller opkrævninger. Ved den aktive afregning anvendes taksterne for den valgte Ailoot-metode.
Modellens referenceplaner
Priser efter konfiguration
Knyt hver omkostning til de viste betingelser. Brug én takst for hver gruppe af alternative konfigurationer.
| Konfiguration | Takstplan | Beløb |
|---|---|---|
| KonfigurationOpenAI Chat · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
| KonfigurationAnthropic Messages · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
Eksempelanmodninger
Ailoot · OpenAI Chat
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-max", "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-max", "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-max",
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-max",
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-max',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")
Hent og gem resultater
Ailoot · OpenAI Chat
json eller SSE
Behold alle færdige resultater
Gem hvert fuldstændigt returneret svar, hver fil og hver indholdsdel.
Bevar hvert valg og dets indhold, værktøjskald og ræsonnement. Saml i SSE deltaer efter valg-/værktøjsindeks, og bevar den endelige afslutningsårsag og forbrugsoplysningerne.
Hvis det oprindelige svar skal kontrolleres
Bevar anmodnings-/svar-ID’er og headere. Der leveres ingen generel URL til at hente tekstjob.
Svarfelter
| Felt | Type |
|---|---|
Feltchoices[].index | Typeinteger |
Feltchoices[].message.content | Typestring|null |
Feltchoices[].message.tool_calls | Typetool_call[] |
Feltchoices[].message.reasoning_content | Typestring |
Feltchoices[].message.reasoning_details | Typeobject|array |
Feltchoices[].finish_reason | Typestring|null |
Feltusage | Typeobject |
Fejl og næste trin
| Svar | Betingelse | Næste trin |
|---|---|---|
Svar400 · invalid_request_error | BetingelseUgyldige obligatoriske felter, materialerepræsentation eller parameterværdi | Næste trinRet de angivne felter før en ny oprettelsesanmodning. |
Aliaser
Modelaliaser
Ailoot qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot Ultra qwen3.8-max
Aliaser for metodestier
Brug metodestierne vist ovenfor.
Relaterede kalder-ID’er
qwen3.8-max, qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot Ultra · OpenAI Chat POST /v1/chat/completions qwen3.8-max
qwen3.8-maxStart
Qwen3.8-Max er en Qwen-model til tekstræsonnement og visuel forståelse. Udvikleren beskriver en kontekst på 1 million tokens, billed- og videoinput, værktøjsunderstøttede forløb og strukturerede tekstresultater.
- Accepterede input
- Tekst
- Resultater
- Tekst
Tilgængelig i Ailoot · input og metoder
Ailoot Ultra · OpenAI Chat POST /v1/chat/completions
- Inputtyper
text- Outputtyper
text- Outputformat
- json eller SSE
| Felt | Type | Krav | Værdier og grænser | Standard |
|---|---|---|---|---|
Feltmodel | Typestring | KravPåkrævet | Værdier og grænser qwen3.8-max | Standard— |
Feltmessages | Typemessage[] | KravPåkrævet | Værdier og grænser Minimumsantal elementer: 1 | Standard— |
Feltmessages[].role | Typestring | KravPåkrævet | Værdier og grænser Eksempler: system, user, assistant, tool, function Betingelser: Disse roller er eksplicit repræsenteret i kildekodens kompatibilitetstyper; modellens præcise rollesæt er fortsat modelspecifikt. Afhænger af modellen | Standard— |
Feltmessages[].content | Typestring|content_part[]|null | KravValgfrit | Værdier og grænser | Standard— |
Feltmessages[].tool_calls | Typetool_call[] | KravValgfrit | Værdier og grænser | Standard— |
Feltmessages[].tool_call_id | Typestring | KravValgfrit | Værdier og grænser Gælder når: role=tool; brug det faktisk returnerede ID | Standard— |
Feltmessages[].name | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Feltmessages[].reasoning_content | Typestring | KravValgfrit | Værdier og grænser Gælder når: Send det faktisk returnerede ræsonnement tilbage, når modellen bruger det | Standard— |
Feltmessages[].reasoning_details | Typeobject|array | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltmax_tokens | Typeinteger | KravValgfrit | Værdier og grænser Minimum: 1 Afhænger af modellen | Standard— |
Feltmax_completion_tokens | Typeinteger | KravValgfrit | Værdier og grænser Minimum: 1 Afhænger af modellen | Standard— |
Feltstream | Typeboolean | KravValgfrit | Værdier og grænser | Standardfalse |
Feltstream_options.include_usage | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttemperature | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttop_p | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltstop | Typestring|string[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools | Typefunction_tool[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools[].type | Typestring | KravValgfrit | Værdier og grænser function Afhænger af modellen | Standard— |
Felttools[].function.name | Typestring | KravPåkrævet | Værdier og grænser Gælder når: funktionsværktøj angivet | Standard— |
Felttools[].function.description | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Felttools[].function.parameters | TypeJSON_schema | KravValgfrit | Værdier og grænser | Standard— |
Felttool_choice | Typestring|object | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltparallel_tool_calls | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltresponse_format | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning_effort | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltservice_tier | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltinstructions | Typestring | KravValgfrit | Værdier og grænser Kompatibilitetsfelt | Standard— |
Feltfunctions | Typefunction[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltfunction_call | Typestring|object | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltprompt_cache_options | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltmodalities | Typestring[] | KravValgfrit | Værdier og grænser text | Standard— |
Feltprovider | Typeobject | KravValgfrit | Værdier og grænser Betingelser: provider.options afvises på denne Ultra-tekstrute | Standard— |
Feltcache_control.ttl | Typestring | KravValgfrit | Værdier og grænser Betingelser: 1h afvises på de faktiske placeringer for promptcaching | Standard— |
Kombinationer af inputmaterialer
Tekst · UTF8-tekst
messages[].content
Metodeparametre og livscyklus
| Parameter | Kontrakt |
|---|---|
Parametercontent_type | Kontraktapplication/json |
Parameterrequired | Kontraktmodel, messages |
Parametermaterial_types | Kontrakttext |
Parametermessages | Kontraktbeskedarray med strukturen role/content |
Parameterfile_material | Kontraktfaktisk UTF-8-dokument indsat som bogstavelig tekst; intet fil-ID udledes |
Parameteroptional_controls | Kontraktstream, temperature, top_p, stop, max_tokens, max_completion_tokens, reasoning, response_format, tools, tool_choice |
Parametercontrol_scope | Kontraktmodelspecifikt; brugerens funktionsværktøjer er forskellige fra hostede værktøjer |
Parameteroutput_modalities | Kontrakttext |
Parameterhosted_operations | Kontraktfalse |
Parametermultimodal_input_binding | Kontraktnull |
Livscyklus: synchronous_or_streamed
Send det præcise model-ID med messages.
Kontekstlængde er ikke et outputloft.
En tekstfil kan levere bogstavelig tekst; billed-, lyd- og filobjektinput kræver en præcis binding.
Priser
Tarifoplysninger tilføjer ikke anmodningsmuligheder. Understøttede parametre står ved den valgte metode.
- Hurtig tilstand
- Ikke angivet Når hurtig tilstand er valgt
- flex-tilstand
- Ikke angivet Når flex-tilstanden er valgt
- Maksimal ræsonneringsindsats
- Ikke angivet Når default-justeringen anvendes ved maksimal ræsonneringsindsats
Ailoot-takster
Priser efter konfiguration
| Konfiguration | Takstplan | Beløb |
|---|---|---|
| KonfigurationGrundtakster for tokens | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
Ailoot reserverer et estimeret beløb før en anmodning. Efter resultatet afregnes det endelige beløb ud fra det målte forbrug. Ved streaming bruges den endelige forbrugsregistrering til afregningen. Sådan fungerer reservation og afregning →
Eksempelanmodninger
Ailoot Ultra · OpenAI Chat
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-max", "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='qwen3.8-max',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='qwen3.8-max',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")
Hent og gem resultater
Ailoot Ultra · OpenAI Chat
json eller SSE
Behold alle færdige resultater
Gem hvert fuldstændigt returneret svar, hver fil og hver indholdsdel.
Bevar hvert valg og dets indhold, værktøjskald og ræsonnement. Saml i SSE deltaer efter valg-/værktøjsindeks, og bevar den endelige afslutningsårsag og forbrugsoplysningerne.
Hvis det oprindelige svar skal kontrolleres
Bevar anmodnings-/svar-ID’er og headere. Der leveres ingen generel URL til at hente tekstjob.
Svarfelter
| Felt | Type |
|---|---|
Feltchoices[].index | Typeinteger |
Feltchoices[].message.content | Typestring|null |
Feltchoices[].message.tool_calls | Typetool_call[] |
Feltchoices[].message.reasoning_content | Typestring |
Feltchoices[].message.reasoning_details | Typeobject|array |
Feltchoices[].finish_reason | Typestring|null |
Feltusage | Typeobject |
Fejl og næste trin
| Svar | Betingelse | Næste trin |
|---|---|---|
Svar400 · invalid_request_error | BetingelseUgyldige obligatoriske felter, materialerepræsentation eller parameterværdi | Næste trinRet de angivne felter før en ny oprettelsesanmodning. |
Aliaser
Modelaliaser
Ailoot qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot Ultra qwen3.8-max
Aliaser for metodestier
Brug metodestierne vist ovenfor.
Relaterede kalder-ID’er
qwen3.8-max, qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot Ultra · Anthropic Messages POST /v1/messages qwen3.8-max
qwen3.8-maxStart
Qwen3.8-Max er en Qwen-model til tekstræsonnement og visuel forståelse. Udvikleren beskriver en kontekst på 1 million tokens, billed- og videoinput, værktøjsunderstøttede forløb og strukturerede tekstresultater.
- Accepterede input
- Tekst
- Resultater
- json · sse
Tilgængelig i Ailoot · input og metoder
Ailoot Ultra · Anthropic Messages POST /v1/messages
- Inputtyper
text- Outputtyper
json,sse- Outputformat
- JSON eller SSE
| Felt | Type | Krav | Værdier og grænser | Standard |
|---|---|---|---|---|
Feltmodel | Typestring | KravPåkrævet | Værdier og grænser qwen3.8-max | Standard— |
Feltmessages | Typemessage[] | KravPåkrævet | Værdier og grænser | Standard— |
Feltmessages[].role | Typestring | KravPåkrævet | Værdier og grænser user, assistant | Standard— |
Feltmessages[].content | Typestring | KravPåkrævet | Værdier og grænser | Standard— |
Feltmax_tokens | Typeinteger | KravPåkrævet | Værdier og grænser | Standard— |
Feltstream | Typeboolean | KravValgfrit | Værdier og grænser | Standardfalse |
Kombinationer af inputmaterialer
Tekst · UTF-8-tekst
messages[].content som streng
Metodeparametre og livscyklus
| Parameter | Kontrakt |
|---|---|
Parametercontent_type | Kontraktapplication/json |
Parameterrequired | Kontraktmodel, messages, max_tokens |
Parameteroptional_controls | Kontraktstream |
Parametermaterial_types | Kontrakttext |
Parametertext_file_material | KontraktLæs det faktiske UTF-8-dokument, og indsæt teksten i det angivne input eller beskedens indholdsstreng. |
Livscyklus: synchronous_or_streamed
Priser
Tarifoplysninger tilføjer ikke anmodningsmuligheder. Understøttede parametre står ved den valgte metode.
- Hurtig tilstand
- Ikke angivet Når hurtig tilstand er valgt
- flex-tilstand
- Ikke angivet Når flex-tilstanden er valgt
- Maksimal ræsonneringsindsats
- Ikke angivet Når default-justeringen anvendes ved maksimal ræsonneringsindsats
Ailoot-takster
Priser efter konfiguration
| Konfiguration | Takstplan | Beløb |
|---|---|---|
| KonfigurationGrundtakster for tokens | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
Ailoot reserverer et estimeret beløb før en anmodning. Efter resultatet afregnes det endelige beløb ud fra det målte forbrug. Ved streaming bruges den endelige forbrugsregistrering til afregningen. Sådan fungerer reservation og afregning →
Eksempelanmodninger
Ailoot Ultra · Anthropic Messages
{
"model": "qwen3.8-max",
"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-max', '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-max', '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))
Hent og gem resultater
Ailoot Ultra · Anthropic Messages
JSON eller SSE
Behold alle færdige resultater
Gem hvert fuldstændigt returneret svar, hver fil og hver indholdsdel.
Bevar alle indholdsblokke, ræsonnementssignaturer og faktiske værktøjsbrugs-ID’er. Saml alle SSE-blokdeltaer; den første tekstblok er ikke hele outputtet.
Hvis det oprindelige svar skal kontrolleres
Bevar anmodnings-/svar-ID’er og headere. Der leveres ingen generel URL til at hente tekstjob.
Svarfelter
| Felt | Type |
|---|---|
Feltid | Typestring |
Feltmodel | Typestring |
Feltcontent[] | Typetext|thinking|tool_use|other content block |
Feltstop_reason | Typestring|null |
Feltusage | Typeobject |
Fejl og næste trin
| Svar | Betingelse | Næste trin |
|---|---|---|
Svar400 · invalid_request_error | BetingelseUgyldige obligatoriske felter, materialerepræsentation eller parameterværdi | Næste trinRet de angivne felter før en ny oprettelsesanmodning. |
Aliaser
Modelaliaser
Ailoot qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot Ultra qwen3.8-max
Aliaser for metodestier
Brug metodestierne vist ovenfor.
Relaterede kalder-ID’er
qwen3.8-max, qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot · Anthropic Messages POST /v1/messages qwen
qwenqwen3.8-maxqwenqwen-latestqwen-maxqwen3.8-max-preview
Start
Qwen3.8-Max er en Qwen-model til tekstræsonnement og visuel forståelse. Udvikleren beskriver en kontekst på 1 million tokens, billed- og videoinput, værktøjsunderstøttede forløb og strukturerede tekstresultater.
- Accepterede input
- Tekst · Billeder
- Resultater
- Tekst
Tilgængelig i Ailoot · input og metoder
Ailoot · Anthropic Messages POST /v1/messages
- Inputtyper
text,image- Outputtyper
text- Kontekst
- 991.808 tokens
- Maksimalt output
- 131.072 tokens
- Outputformat
- json eller SSE
| Felt | Type | Krav | Værdier og grænser | Standard |
|---|---|---|---|---|
Feltmodel | Typestring | KravPåkrævet | Værdier og grænser qwen | Standard— |
Feltmessages | Typemessage[] | KravPåkrævet | Værdier og grænser Minimumsantal elementer: 1 | Standard— |
Feltmessages[].role | Typestring | KravPåkrævet | Værdier og grænser user, assistant | Standard— |
Feltmessages[].content | Typestring|content_block[] | KravPåkrævet | Værdier og grænser | Standard— |
Feltsystem | Typestring|content_block[] | KravValgfrit | Værdier og grænser | Standard— |
Feltmax_tokens | Typeinteger | KravPåkrævet | Værdier og grænser Minimum: 1 Grænsen gælder for: den præcise øvre grænse for valgt model/modelkort | Standard— |
Feltstream | Typeboolean | KravValgfrit | Værdier og grænser | Standardfalse |
Felttemperature | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttop_p | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltstop_sequences | Typestring[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools | Typetool[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools[].name | Typestring | KravValgfrit | Værdier og grænser Gælder når: værktøj angivet | Standard— |
Felttools[].description | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Felttools[].input_schema | TypeJSON_schema | KravValgfrit | Værdier og grænser | Standard— |
Felttool_choice | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltthinking.type | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltthinking.budget_tokens | Typeinteger | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltoutput_config.effort | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltmetadata | Typeobject | KravValgfrit | Værdier og grænser | Standard— |
Feltcache_control | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Kombinationer af inputmaterialer
Tekst · UTF8-tekst
messages[].content eller en blok med type=text
Tekst + billede
{type:image,source:{type:base64,media_type,data}} eller kilde med type=url
Metodeparametre og livscyklus
| Parameter | Kontrakt |
|---|---|
Parametermaterial_types | Kontrakttext, image |
Parameterrequired | Kontraktmodel, messages, max_tokens |
Parameteroptional_controls | Kontraktnull |
Parametercontent_type | Kontraktapplication/json |
Parametertext_file_material | Kontraktfaktisk UTF-8-indhold indsat som tekst; fil-ID’er/URLs kræver særskilt præcis understøttelse |
Livscyklus: exact retained published method
Metodernes strukturer og ID’er er præcise; leverandørens muligheder er adskilt fra adgangstilladelse.
Priser
Ailoot-metodetakster
POST /v1/messages- Input
- 0,002 US$ / 1K
- Output
- 0,006 US$ / 1K
- Cachelæsning
- 0,00017 US$ / 1K
- Cacheskrivning
- 0,0025 US$ / 1K
- Cacheskrivning, 5 min.
- 0,0025 US$ / 1K tokens
Ailoot reserverer et estimeret beløb før en anmodning. Efter resultatet afregnes det endelige beløb ud fra det målte forbrug. Ved streaming bruges den endelige forbrugsregistrering til afregningen. Sådan fungerer reservation og afregning →
Detaljer om referencetariffen
Referenceplaner på modelniveau ændrer ikke metodevalg, prisoverslag eller opkrævninger. Ved den aktive afregning anvendes taksterne for den valgte Ailoot-metode.
Modellens referenceplaner
Priser efter konfiguration
Knyt hver omkostning til de viste betingelser. Brug én takst for hver gruppe af alternative konfigurationer.
| Konfiguration | Takstplan | Beløb |
|---|---|---|
| KonfigurationOpenAI Chat · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
| KonfigurationAnthropic Messages · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
Eksempelanmodninger
Ailoot · Anthropic Messages
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", "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", "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",
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",
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',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")
Hent og gem resultater
Ailoot · Anthropic Messages
json eller SSE
Behold alle færdige resultater
Gem hvert fuldstændigt returneret svar, hver fil og hver indholdsdel.
Bevar alle indholdsblokke, ræsonnementssignaturer og faktiske værktøjsbrugs-ID’er. Saml alle SSE-blokdeltaer; den første tekstblok er ikke hele outputtet.
Hvis det oprindelige svar skal kontrolleres
Bevar anmodnings-/svar-ID’er og headere. Der leveres ingen generel URL til at hente tekstjob.
Svarfelter
| Felt | Type |
|---|---|
Feltid | Typestring |
Feltmodel | Typestring |
Feltcontent[] | Typetext|thinking|tool_use|other content block |
Feltstop_reason | Typestring|null |
Feltusage | Typeobject |
Fejl og næste trin
| Svar | Betingelse | Næste trin |
|---|---|---|
Svar400 · invalid_request_error | BetingelseUgyldige obligatoriske felter, materialerepræsentation eller parameterværdi | Næste trinRet de angivne felter før en ny oprettelsesanmodning. |
Aliaser
Modelaliaser
Ailoot qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot Ultra qwen3.8-max
Aliaser for metodestier
Brug metodestierne vist ovenfor.
Relaterede kalder-ID’er
qwen3.8-max, qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot · OpenAI Responses POST /v1/responses qwen
qwenqwen3.8-maxqwenqwen-latestqwen-maxqwen3.8-max-preview
Start
Qwen3.8-Max er en Qwen-model til tekstræsonnement og visuel forståelse. Udvikleren beskriver en kontekst på 1 million tokens, billed- og videoinput, værktøjsunderstøttede forløb og strukturerede tekstresultater.
- Accepterede input
- Tekst · Billeder
- Resultater
- Tekst
Tilgængelig i Ailoot · input og metoder
Ailoot · OpenAI Responses POST /v1/responses
- Inputtyper
text,image- Outputtyper
text- Kontekst
- 991.808 tokens
- Maksimalt output
- 131.072 tokens
- Outputformat
- json eller SSE
| Felt | Type | Krav | Værdier og grænser | Standard |
|---|---|---|---|---|
Feltmodel | Typestring | KravPåkrævet | Værdier og grænser qwen | Standard— |
Feltinput | Typestring|input_item[] | KravPåkrævet | Værdier og grænser | Standard— |
Feltinstructions | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Feltinput[].type | Typestring | KravValgfrit | Værdier og grænser message, reasoning, function_call, function_call_output | Standard— |
Feltinput[].content | Typestring|content_part[] | KravValgfrit | Værdier og grænser | Standard— |
Feltinput[].call_id | Typestring | KravValgfrit | Værdier og grænser Gælder når: function_call_output; bevar det faktisk returnerede call_id | Standard— |
Feltinput[].output | Typestring|content_part[] | KravValgfrit | Værdier og grænser Gælder når: function_call_output | Standard— |
Feltmax_output_tokens | Typeinteger | KravValgfrit | Værdier og grænser Minimum: 1 Afhænger af modellen | Standard— |
Feltstream | Typeboolean | KravValgfrit | Værdier og grænser | Standardfalse |
Felttemperature | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttop_p | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools | Typetool[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttool_choice | Typestring|object | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltparallel_tool_calls | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning.effort | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning.summary | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttext.format | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttext.verbosity | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltinclude | Typestring[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltstore | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltprevious_response_id | Typestring | KravValgfrit | Værdier og grænser ID-krav: Kun et faktisk svar-ID fra en understøttet fortsættelse Afhænger af modellen | Standard— |
Feltservice_tier | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltprompt_cache_key | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltprompt_cache_options | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Kombinationer af inputmaterialer
Tekst · UTF8-tekst
inputtekst eller en input_text-del
Tekst + billede
{type:input_image,image_url}
Metodeparametre og livscyklus
| Parameter | Kontrakt |
|---|---|
Parametermaterial_types | Kontrakttext, image |
Parameterrequired | Kontraktmodel, input |
Parameteroptional_controls | Kontraktnull |
Parametercontent_type | Kontraktapplication/json |
Parametertext_file_material | Kontraktfaktisk UTF-8-indhold indsat som tekst; fil-ID’er/URLs kræver særskilt præcis understøttelse |
Livscyklus: exact retained published method
Metodernes strukturer og ID’er er præcise; leverandørens muligheder er adskilt fra adgangstilladelse.
Priser
Ailoot-metodetakster
POST /v1/responses- Input
- 0,002 US$ / 1K
- Output
- 0,006 US$ / 1K
- Cachelæsning
- 0,00025 US$ / 1K
- Cacheskrivning
- 0,0025 US$ / 1K
- Cacheskrivning, 5 min.
- 0,0025 US$ / 1K tokens
- code_interpreter_call
- 0,00 US$ pr. kald
- image_search_call
- 0,008 US$ pr. kald
- web_extractor_call
- 0,00 US$ pr. kald
- web_search_call
- 0,01 US$ pr. kald
- web_search_image_call
- 0,008 US$ pr. kald
- Maks. antal kald code_interpreter_call
- 8
- Maks. antal kald image_search_call
- 8
- Maks. antal kald web_extractor_call
- 8
- Maks. antal kald web_search_call
- 8
- Maks. antal kald web_search_image_call
- 8
Ailoot reserverer et estimeret beløb før en anmodning. Efter resultatet afregnes det endelige beløb ud fra det målte forbrug. Ved streaming bruges den endelige forbrugsregistrering til afregningen. Sådan fungerer reservation og afregning →
Detaljer om referencetariffen
Referenceplaner på modelniveau ændrer ikke metodevalg, prisoverslag eller opkrævninger. Ved den aktive afregning anvendes taksterne for den valgte Ailoot-metode.
Modellens referenceplaner
Priser efter konfiguration
Knyt hver omkostning til de viste betingelser. Brug én takst for hver gruppe af alternative konfigurationer.
| Konfiguration | Takstplan | Beløb |
|---|---|---|
| KonfigurationOpenAI Chat · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
| KonfigurationAnthropic Messages · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
Eksempelanmodninger
Ailoot · OpenAI Responses
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", "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", "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", 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", 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", 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")
Hent og gem resultater
Ailoot · OpenAI Responses
json eller SSE
Behold alle færdige resultater
Gem hvert fuldstændigt returneret svar, hver fil og hver indholdsdel.
Bevar hvert outputelement og hver indholdsdel, faktisk call_id for funktioner, krypteret ræsonnement og forbrugsoplysninger. Bevar ved streaming den fulde hændelses-/elementidentitet.
Hvis det oprindelige svar skal kontrolleres
Bevar anmodnings-/svar-ID’er og headere. Der leveres ingen generel URL til at hente tekstjob.
Svarfelter
| Felt | Type |
|---|---|
Feltid | Typestring |
Feltstatus | Typestring |
Feltoutput[] | Typemessage|reasoning|function_call|other item |
Feltoutput[].content[] | Typecontent part |
Feltusage | Typeobject |
Fejl og næste trin
| Svar | Betingelse | Næste trin |
|---|---|---|
Svar400 · invalid_request_error | BetingelseUgyldige obligatoriske felter, materialerepræsentation eller parameterværdi | Næste trinRet de angivne felter før en ny oprettelsesanmodning. |
Aliaser
Modelaliaser
Ailoot qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot Ultra qwen3.8-max
Aliaser for metodestier
Brug metodestierne vist ovenfor.
Relaterede kalder-ID’er
qwen3.8-max, qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot · OpenAI Chat POST /v1/chat/completions qwen
qwenqwen3.8-maxqwenqwen-latestqwen-maxqwen3.8-max-preview
Start
Qwen3.8-Max er en Qwen-model til tekstræsonnement og visuel forståelse. Udvikleren beskriver en kontekst på 1 million tokens, billed- og videoinput, værktøjsunderstøttede forløb og strukturerede tekstresultater.
- Accepterede input
- Tekst · Billeder
- Resultater
- Tekst
Tilgængelig i Ailoot · input og metoder
Ailoot · OpenAI Chat POST /v1/chat/completions
- Inputtyper
text,image- Outputtyper
text- Kontekst
- 991.808 tokens
- Maksimalt output
- 131.072 tokens
- Outputformat
- json eller SSE
| Felt | Type | Krav | Værdier og grænser | Standard |
|---|---|---|---|---|
Feltmodel | Typestring | KravPåkrævet | Værdier og grænser qwen | Standard— |
Feltmessages | Typemessage[] | KravPåkrævet | Værdier og grænser Minimumsantal elementer: 1 | Standard— |
Feltmessages[].role | Typestring | KravPåkrævet | Værdier og grænser Eksempler: system, user, assistant, tool, function Betingelser: Disse roller er eksplicit repræsenteret i kildekodens kompatibilitetstyper; modellens præcise rollesæt er fortsat modelspecifikt. Afhænger af modellen | Standard— |
Feltmessages[].content | Typestring|content_part[]|null | KravValgfrit | Værdier og grænser | Standard— |
Feltmessages[].tool_calls | Typetool_call[] | KravValgfrit | Værdier og grænser | Standard— |
Feltmessages[].tool_call_id | Typestring | KravValgfrit | Værdier og grænser Gælder når: role=tool; brug det faktisk returnerede ID | Standard— |
Feltmessages[].name | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Feltmessages[].reasoning_content | Typestring | KravValgfrit | Værdier og grænser Gælder når: Send det faktisk returnerede ræsonnement tilbage, når modellen bruger det | Standard— |
Feltmessages[].reasoning_details | Typeobject|array | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltmax_tokens | Typeinteger | KravValgfrit | Værdier og grænser Minimum: 1 Afhænger af modellen | Standard— |
Feltmax_completion_tokens | Typeinteger | KravValgfrit | Værdier og grænser Minimum: 1 Afhænger af modellen | Standard— |
Feltstream | Typeboolean | KravValgfrit | Værdier og grænser | Standardfalse |
Feltstream_options.include_usage | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttemperature | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttop_p | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltstop | Typestring|string[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools | Typefunction_tool[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools[].type | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools[].function.name | Typestring | KravPåkrævet | Værdier og grænser Gælder når: funktionsværktøj angivet | Standard— |
Felttools[].function.description | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Felttools[].function.parameters | TypeJSON_schema | KravValgfrit | Værdier og grænser | Standard— |
Felttool_choice | Typestring|object | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltparallel_tool_calls | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltresponse_format | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning_effort | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltservice_tier | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltinstructions | Typestring | KravValgfrit | Værdier og grænser Kompatibilitetsfelt | Standard— |
Feltfunctions | Typefunction[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltfunction_call | Typestring|object | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltprompt_cache_options | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Kombinationer af inputmaterialer
Tekst · UTF8-tekst
messages[].content
Tekst + billede
{type:image_url,image_url:{url,detail}}
Metodeparametre og livscyklus
| Parameter | Kontrakt |
|---|---|
Parametermaterial_types | Kontrakttext, image |
Parameterrequired | Kontraktmodel, messages |
Parameteroptional_controls | Kontraktnull |
Parametercontent_type | Kontraktapplication/json |
Parametertext_file_material | Kontraktfaktisk UTF-8-indhold indsat som tekst; fil-ID’er/URLs kræver særskilt præcis understøttelse |
Livscyklus: exact retained published method
Metodernes strukturer og ID’er er præcise; leverandørens muligheder er adskilt fra adgangstilladelse.
Priser
Ailoot-metodetakster
POST /v1/chat/completions- Input
- 0,002 US$ / 1K
- Output
- 0,006 US$ / 1K
- Cachelæsning
- 0,00025 US$ / 1K
- Cacheskrivning
- 0,002 US$ / 1K
- Cacheskrivning, 5 min.
- 0,002 US$ / 1K tokens
Ailoot reserverer et estimeret beløb før en anmodning. Efter resultatet afregnes det endelige beløb ud fra det målte forbrug. Ved streaming bruges den endelige forbrugsregistrering til afregningen. Sådan fungerer reservation og afregning →
Detaljer om referencetariffen
Referenceplaner på modelniveau ændrer ikke metodevalg, prisoverslag eller opkrævninger. Ved den aktive afregning anvendes taksterne for den valgte Ailoot-metode.
Modellens referenceplaner
Priser efter konfiguration
Knyt hver omkostning til de viste betingelser. Brug én takst for hver gruppe af alternative konfigurationer.
| Konfiguration | Takstplan | Beløb |
|---|---|---|
| KonfigurationOpenAI Chat · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
| KonfigurationAnthropic Messages · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
Eksempelanmodninger
Ailoot · OpenAI Chat
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", "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", "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",
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",
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',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")
Hent og gem resultater
Ailoot · OpenAI Chat
json eller SSE
Behold alle færdige resultater
Gem hvert fuldstændigt returneret svar, hver fil og hver indholdsdel.
Bevar hvert valg og dets indhold, værktøjskald og ræsonnement. Saml i SSE deltaer efter valg-/værktøjsindeks, og bevar den endelige afslutningsårsag og forbrugsoplysningerne.
Hvis det oprindelige svar skal kontrolleres
Bevar anmodnings-/svar-ID’er og headere. Der leveres ingen generel URL til at hente tekstjob.
Svarfelter
| Felt | Type |
|---|---|
Feltchoices[].index | Typeinteger |
Feltchoices[].message.content | Typestring|null |
Feltchoices[].message.tool_calls | Typetool_call[] |
Feltchoices[].message.reasoning_content | Typestring |
Feltchoices[].message.reasoning_details | Typeobject|array |
Feltchoices[].finish_reason | Typestring|null |
Feltusage | Typeobject |
Fejl og næste trin
| Svar | Betingelse | Næste trin |
|---|---|---|
Svar400 · invalid_request_error | BetingelseUgyldige obligatoriske felter, materialerepræsentation eller parameterværdi | Næste trinRet de angivne felter før en ny oprettelsesanmodning. |
Aliaser
Modelaliaser
Ailoot qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot Ultra qwen3.8-max
Aliaser for metodestier
Brug metodestierne vist ovenfor.
Relaterede kalder-ID’er
qwen3.8-max, qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot · Anthropic Messages POST /v1/messages qwen-latest
qwen-latestqwen3.8-maxqwenqwen-latestqwen-maxqwen3.8-max-preview
Start
Qwen3.8-Max er en Qwen-model til tekstræsonnement og visuel forståelse. Udvikleren beskriver en kontekst på 1 million tokens, billed- og videoinput, værktøjsunderstøttede forløb og strukturerede tekstresultater.
- Accepterede input
- Tekst · Billeder
- Resultater
- Tekst
Tilgængelig i Ailoot · input og metoder
Ailoot · Anthropic Messages POST /v1/messages
- Inputtyper
text,image- Outputtyper
text- Kontekst
- 991.808 tokens
- Maksimalt output
- 131.072 tokens
- Outputformat
- json eller SSE
| Felt | Type | Krav | Værdier og grænser | Standard |
|---|---|---|---|---|
Feltmodel | Typestring | KravPåkrævet | Værdier og grænser qwen-latest | Standard— |
Feltmessages | Typemessage[] | KravPåkrævet | Værdier og grænser Minimumsantal elementer: 1 | Standard— |
Feltmessages[].role | Typestring | KravPåkrævet | Værdier og grænser user, assistant | Standard— |
Feltmessages[].content | Typestring|content_block[] | KravPåkrævet | Værdier og grænser | Standard— |
Feltsystem | Typestring|content_block[] | KravValgfrit | Værdier og grænser | Standard— |
Feltmax_tokens | Typeinteger | KravPåkrævet | Værdier og grænser Minimum: 1 Grænsen gælder for: den præcise øvre grænse for valgt model/modelkort | Standard— |
Feltstream | Typeboolean | KravValgfrit | Værdier og grænser | Standardfalse |
Felttemperature | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttop_p | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltstop_sequences | Typestring[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools | Typetool[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools[].name | Typestring | KravValgfrit | Værdier og grænser Gælder når: værktøj angivet | Standard— |
Felttools[].description | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Felttools[].input_schema | TypeJSON_schema | KravValgfrit | Værdier og grænser | Standard— |
Felttool_choice | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltthinking.type | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltthinking.budget_tokens | Typeinteger | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltoutput_config.effort | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltmetadata | Typeobject | KravValgfrit | Værdier og grænser | Standard— |
Feltcache_control | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Kombinationer af inputmaterialer
Tekst · UTF8-tekst
messages[].content eller en blok med type=text
Tekst + billede
{type:image,source:{type:base64,media_type,data}} eller kilde med type=url
Metodeparametre og livscyklus
| Parameter | Kontrakt |
|---|---|
Parametermaterial_types | Kontrakttext, image |
Parameterrequired | Kontraktmodel, messages, max_tokens |
Parameteroptional_controls | Kontraktnull |
Parametercontent_type | Kontraktapplication/json |
Parametertext_file_material | Kontraktfaktisk UTF-8-indhold indsat som tekst; fil-ID’er/URLs kræver særskilt præcis understøttelse |
Livscyklus: exact retained published method
Metodernes strukturer og ID’er er præcise; leverandørens muligheder er adskilt fra adgangstilladelse.
Priser
Ailoot-metodetakster
POST /v1/messages- Input
- 0,002 US$ / 1K
- Output
- 0,006 US$ / 1K
- Cachelæsning
- 0,00017 US$ / 1K
- Cacheskrivning
- 0,0025 US$ / 1K
- Cacheskrivning, 5 min.
- 0,0025 US$ / 1K tokens
Ailoot reserverer et estimeret beløb før en anmodning. Efter resultatet afregnes det endelige beløb ud fra det målte forbrug. Ved streaming bruges den endelige forbrugsregistrering til afregningen. Sådan fungerer reservation og afregning →
Detaljer om referencetariffen
Referenceplaner på modelniveau ændrer ikke metodevalg, prisoverslag eller opkrævninger. Ved den aktive afregning anvendes taksterne for den valgte Ailoot-metode.
Modellens referenceplaner
Priser efter konfiguration
Knyt hver omkostning til de viste betingelser. Brug én takst for hver gruppe af alternative konfigurationer.
| Konfiguration | Takstplan | Beløb |
|---|---|---|
| KonfigurationOpenAI Chat · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
| KonfigurationAnthropic Messages · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
Eksempelanmodninger
Ailoot · Anthropic Messages
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-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-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-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-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-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")
Hent og gem resultater
Ailoot · Anthropic Messages
json eller SSE
Behold alle færdige resultater
Gem hvert fuldstændigt returneret svar, hver fil og hver indholdsdel.
Bevar alle indholdsblokke, ræsonnementssignaturer og faktiske værktøjsbrugs-ID’er. Saml alle SSE-blokdeltaer; den første tekstblok er ikke hele outputtet.
Hvis det oprindelige svar skal kontrolleres
Bevar anmodnings-/svar-ID’er og headere. Der leveres ingen generel URL til at hente tekstjob.
Svarfelter
| Felt | Type |
|---|---|
Feltid | Typestring |
Feltmodel | Typestring |
Feltcontent[] | Typetext|thinking|tool_use|other content block |
Feltstop_reason | Typestring|null |
Feltusage | Typeobject |
Fejl og næste trin
| Svar | Betingelse | Næste trin |
|---|---|---|
Svar400 · invalid_request_error | BetingelseUgyldige obligatoriske felter, materialerepræsentation eller parameterværdi | Næste trinRet de angivne felter før en ny oprettelsesanmodning. |
Aliaser
Modelaliaser
Ailoot qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot Ultra qwen3.8-max
Aliaser for metodestier
Brug metodestierne vist ovenfor.
Relaterede kalder-ID’er
qwen3.8-max, qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot · OpenAI Responses POST /v1/responses qwen-latest
qwen-latestqwen3.8-maxqwenqwen-latestqwen-maxqwen3.8-max-preview
Start
Qwen3.8-Max er en Qwen-model til tekstræsonnement og visuel forståelse. Udvikleren beskriver en kontekst på 1 million tokens, billed- og videoinput, værktøjsunderstøttede forløb og strukturerede tekstresultater.
- Accepterede input
- Tekst · Billeder
- Resultater
- Tekst
Tilgængelig i Ailoot · input og metoder
Ailoot · OpenAI Responses POST /v1/responses
- Inputtyper
text,image- Outputtyper
text- Kontekst
- 991.808 tokens
- Maksimalt output
- 131.072 tokens
- Outputformat
- json eller SSE
| Felt | Type | Krav | Værdier og grænser | Standard |
|---|---|---|---|---|
Feltmodel | Typestring | KravPåkrævet | Værdier og grænser qwen-latest | Standard— |
Feltinput | Typestring|input_item[] | KravPåkrævet | Værdier og grænser | Standard— |
Feltinstructions | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Feltinput[].type | Typestring | KravValgfrit | Værdier og grænser message, reasoning, function_call, function_call_output | Standard— |
Feltinput[].content | Typestring|content_part[] | KravValgfrit | Værdier og grænser | Standard— |
Feltinput[].call_id | Typestring | KravValgfrit | Værdier og grænser Gælder når: function_call_output; bevar det faktisk returnerede call_id | Standard— |
Feltinput[].output | Typestring|content_part[] | KravValgfrit | Værdier og grænser Gælder når: function_call_output | Standard— |
Feltmax_output_tokens | Typeinteger | KravValgfrit | Værdier og grænser Minimum: 1 Afhænger af modellen | Standard— |
Feltstream | Typeboolean | KravValgfrit | Værdier og grænser | Standardfalse |
Felttemperature | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttop_p | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools | Typetool[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttool_choice | Typestring|object | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltparallel_tool_calls | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning.effort | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning.summary | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttext.format | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttext.verbosity | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltinclude | Typestring[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltstore | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltprevious_response_id | Typestring | KravValgfrit | Værdier og grænser ID-krav: Kun et faktisk svar-ID fra en understøttet fortsættelse Afhænger af modellen | Standard— |
Feltservice_tier | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltprompt_cache_key | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltprompt_cache_options | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Kombinationer af inputmaterialer
Tekst · UTF8-tekst
inputtekst eller en input_text-del
Tekst + billede
{type:input_image,image_url}
Metodeparametre og livscyklus
| Parameter | Kontrakt |
|---|---|
Parametermaterial_types | Kontrakttext, image |
Parameterrequired | Kontraktmodel, input |
Parameteroptional_controls | Kontraktnull |
Parametercontent_type | Kontraktapplication/json |
Parametertext_file_material | Kontraktfaktisk UTF-8-indhold indsat som tekst; fil-ID’er/URLs kræver særskilt præcis understøttelse |
Livscyklus: exact retained published method
Metodernes strukturer og ID’er er præcise; leverandørens muligheder er adskilt fra adgangstilladelse.
Priser
Ailoot-metodetakster
POST /v1/responses- Input
- 0,002 US$ / 1K
- Output
- 0,006 US$ / 1K
- Cachelæsning
- 0,00025 US$ / 1K
- Cacheskrivning
- 0,0025 US$ / 1K
- Cacheskrivning, 5 min.
- 0,0025 US$ / 1K tokens
- code_interpreter_call
- 0,00 US$ pr. kald
- image_search_call
- 0,008 US$ pr. kald
- web_extractor_call
- 0,00 US$ pr. kald
- web_search_call
- 0,01 US$ pr. kald
- web_search_image_call
- 0,008 US$ pr. kald
- Maks. antal kald code_interpreter_call
- 8
- Maks. antal kald image_search_call
- 8
- Maks. antal kald web_extractor_call
- 8
- Maks. antal kald web_search_call
- 8
- Maks. antal kald web_search_image_call
- 8
Ailoot reserverer et estimeret beløb før en anmodning. Efter resultatet afregnes det endelige beløb ud fra det målte forbrug. Ved streaming bruges den endelige forbrugsregistrering til afregningen. Sådan fungerer reservation og afregning →
Detaljer om referencetariffen
Referenceplaner på modelniveau ændrer ikke metodevalg, prisoverslag eller opkrævninger. Ved den aktive afregning anvendes taksterne for den valgte Ailoot-metode.
Modellens referenceplaner
Priser efter konfiguration
Knyt hver omkostning til de viste betingelser. Brug én takst for hver gruppe af alternative konfigurationer.
| Konfiguration | Takstplan | Beløb |
|---|---|---|
| KonfigurationOpenAI Chat · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
| KonfigurationAnthropic Messages · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
Eksempelanmodninger
Ailoot · OpenAI Responses
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-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-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-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-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-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")
Hent og gem resultater
Ailoot · OpenAI Responses
json eller SSE
Behold alle færdige resultater
Gem hvert fuldstændigt returneret svar, hver fil og hver indholdsdel.
Bevar hvert outputelement og hver indholdsdel, faktisk call_id for funktioner, krypteret ræsonnement og forbrugsoplysninger. Bevar ved streaming den fulde hændelses-/elementidentitet.
Hvis det oprindelige svar skal kontrolleres
Bevar anmodnings-/svar-ID’er og headere. Der leveres ingen generel URL til at hente tekstjob.
Svarfelter
| Felt | Type |
|---|---|
Feltid | Typestring |
Feltstatus | Typestring |
Feltoutput[] | Typemessage|reasoning|function_call|other item |
Feltoutput[].content[] | Typecontent part |
Feltusage | Typeobject |
Fejl og næste trin
| Svar | Betingelse | Næste trin |
|---|---|---|
Svar400 · invalid_request_error | BetingelseUgyldige obligatoriske felter, materialerepræsentation eller parameterværdi | Næste trinRet de angivne felter før en ny oprettelsesanmodning. |
Aliaser
Modelaliaser
Ailoot qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot Ultra qwen3.8-max
Aliaser for metodestier
Brug metodestierne vist ovenfor.
Relaterede kalder-ID’er
qwen3.8-max, qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot · OpenAI Chat POST /v1/chat/completions qwen-latest
qwen-latestqwen3.8-maxqwenqwen-latestqwen-maxqwen3.8-max-preview
Start
Qwen3.8-Max er en Qwen-model til tekstræsonnement og visuel forståelse. Udvikleren beskriver en kontekst på 1 million tokens, billed- og videoinput, værktøjsunderstøttede forløb og strukturerede tekstresultater.
- Accepterede input
- Tekst · Billeder
- Resultater
- Tekst
Tilgængelig i Ailoot · input og metoder
Ailoot · OpenAI Chat POST /v1/chat/completions
- Inputtyper
text,image- Outputtyper
text- Kontekst
- 991.808 tokens
- Maksimalt output
- 131.072 tokens
- Outputformat
- json eller SSE
| Felt | Type | Krav | Værdier og grænser | Standard |
|---|---|---|---|---|
Feltmodel | Typestring | KravPåkrævet | Værdier og grænser qwen-latest | Standard— |
Feltmessages | Typemessage[] | KravPåkrævet | Værdier og grænser Minimumsantal elementer: 1 | Standard— |
Feltmessages[].role | Typestring | KravPåkrævet | Værdier og grænser Eksempler: system, user, assistant, tool, function Betingelser: Disse roller er eksplicit repræsenteret i kildekodens kompatibilitetstyper; modellens præcise rollesæt er fortsat modelspecifikt. Afhænger af modellen | Standard— |
Feltmessages[].content | Typestring|content_part[]|null | KravValgfrit | Værdier og grænser | Standard— |
Feltmessages[].tool_calls | Typetool_call[] | KravValgfrit | Værdier og grænser | Standard— |
Feltmessages[].tool_call_id | Typestring | KravValgfrit | Værdier og grænser Gælder når: role=tool; brug det faktisk returnerede ID | Standard— |
Feltmessages[].name | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Feltmessages[].reasoning_content | Typestring | KravValgfrit | Værdier og grænser Gælder når: Send det faktisk returnerede ræsonnement tilbage, når modellen bruger det | Standard— |
Feltmessages[].reasoning_details | Typeobject|array | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltmax_tokens | Typeinteger | KravValgfrit | Værdier og grænser Minimum: 1 Afhænger af modellen | Standard— |
Feltmax_completion_tokens | Typeinteger | KravValgfrit | Værdier og grænser Minimum: 1 Afhænger af modellen | Standard— |
Feltstream | Typeboolean | KravValgfrit | Værdier og grænser | Standardfalse |
Feltstream_options.include_usage | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttemperature | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttop_p | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltstop | Typestring|string[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools | Typefunction_tool[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools[].type | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools[].function.name | Typestring | KravPåkrævet | Værdier og grænser Gælder når: funktionsværktøj angivet | Standard— |
Felttools[].function.description | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Felttools[].function.parameters | TypeJSON_schema | KravValgfrit | Værdier og grænser | Standard— |
Felttool_choice | Typestring|object | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltparallel_tool_calls | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltresponse_format | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning_effort | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltservice_tier | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltinstructions | Typestring | KravValgfrit | Værdier og grænser Kompatibilitetsfelt | Standard— |
Feltfunctions | Typefunction[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltfunction_call | Typestring|object | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltprompt_cache_options | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Kombinationer af inputmaterialer
Tekst · UTF8-tekst
messages[].content
Tekst + billede
{type:image_url,image_url:{url,detail}}
Metodeparametre og livscyklus
| Parameter | Kontrakt |
|---|---|
Parametermaterial_types | Kontrakttext, image |
Parameterrequired | Kontraktmodel, messages |
Parameteroptional_controls | Kontraktnull |
Parametercontent_type | Kontraktapplication/json |
Parametertext_file_material | Kontraktfaktisk UTF-8-indhold indsat som tekst; fil-ID’er/URLs kræver særskilt præcis understøttelse |
Livscyklus: exact retained published method
Metodernes strukturer og ID’er er præcise; leverandørens muligheder er adskilt fra adgangstilladelse.
Priser
Ailoot-metodetakster
POST /v1/chat/completions- Input
- 0,002 US$ / 1K
- Output
- 0,006 US$ / 1K
- Cachelæsning
- 0,00025 US$ / 1K
- Cacheskrivning
- 0,002 US$ / 1K
- Cacheskrivning, 5 min.
- 0,002 US$ / 1K tokens
Ailoot reserverer et estimeret beløb før en anmodning. Efter resultatet afregnes det endelige beløb ud fra det målte forbrug. Ved streaming bruges den endelige forbrugsregistrering til afregningen. Sådan fungerer reservation og afregning →
Detaljer om referencetariffen
Referenceplaner på modelniveau ændrer ikke metodevalg, prisoverslag eller opkrævninger. Ved den aktive afregning anvendes taksterne for den valgte Ailoot-metode.
Modellens referenceplaner
Priser efter konfiguration
Knyt hver omkostning til de viste betingelser. Brug én takst for hver gruppe af alternative konfigurationer.
| Konfiguration | Takstplan | Beløb |
|---|---|---|
| KonfigurationOpenAI Chat · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
| KonfigurationAnthropic Messages · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
Eksempelanmodninger
Ailoot · OpenAI Chat
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-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-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-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-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-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")
Hent og gem resultater
Ailoot · OpenAI Chat
json eller SSE
Behold alle færdige resultater
Gem hvert fuldstændigt returneret svar, hver fil og hver indholdsdel.
Bevar hvert valg og dets indhold, værktøjskald og ræsonnement. Saml i SSE deltaer efter valg-/værktøjsindeks, og bevar den endelige afslutningsårsag og forbrugsoplysningerne.
Hvis det oprindelige svar skal kontrolleres
Bevar anmodnings-/svar-ID’er og headere. Der leveres ingen generel URL til at hente tekstjob.
Svarfelter
| Felt | Type |
|---|---|
Feltchoices[].index | Typeinteger |
Feltchoices[].message.content | Typestring|null |
Feltchoices[].message.tool_calls | Typetool_call[] |
Feltchoices[].message.reasoning_content | Typestring |
Feltchoices[].message.reasoning_details | Typeobject|array |
Feltchoices[].finish_reason | Typestring|null |
Feltusage | Typeobject |
Fejl og næste trin
| Svar | Betingelse | Næste trin |
|---|---|---|
Svar400 · invalid_request_error | BetingelseUgyldige obligatoriske felter, materialerepræsentation eller parameterværdi | Næste trinRet de angivne felter før en ny oprettelsesanmodning. |
Aliaser
Modelaliaser
Ailoot qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot Ultra qwen3.8-max
Aliaser for metodestier
Brug metodestierne vist ovenfor.
Relaterede kalder-ID’er
qwen3.8-max, qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot · Anthropic Messages POST /v1/messages qwen-max
qwen-maxqwen3.8-maxqwenqwen-latestqwen-maxqwen3.8-max-preview
Start
Qwen3.8-Max er en Qwen-model til tekstræsonnement og visuel forståelse. Udvikleren beskriver en kontekst på 1 million tokens, billed- og videoinput, værktøjsunderstøttede forløb og strukturerede tekstresultater.
- Accepterede input
- Tekst · Billeder
- Resultater
- Tekst
Tilgængelig i Ailoot · input og metoder
Ailoot · Anthropic Messages POST /v1/messages
- Inputtyper
text,image- Outputtyper
text- Kontekst
- 991.808 tokens
- Maksimalt output
- 131.072 tokens
- Outputformat
- json eller SSE
| Felt | Type | Krav | Værdier og grænser | Standard |
|---|---|---|---|---|
Feltmodel | Typestring | KravPåkrævet | Værdier og grænser qwen-max | Standard— |
Feltmessages | Typemessage[] | KravPåkrævet | Værdier og grænser Minimumsantal elementer: 1 | Standard— |
Feltmessages[].role | Typestring | KravPåkrævet | Værdier og grænser user, assistant | Standard— |
Feltmessages[].content | Typestring|content_block[] | KravPåkrævet | Værdier og grænser | Standard— |
Feltsystem | Typestring|content_block[] | KravValgfrit | Værdier og grænser | Standard— |
Feltmax_tokens | Typeinteger | KravPåkrævet | Værdier og grænser Minimum: 1 Grænsen gælder for: den præcise øvre grænse for valgt model/modelkort | Standard— |
Feltstream | Typeboolean | KravValgfrit | Værdier og grænser | Standardfalse |
Felttemperature | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttop_p | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltstop_sequences | Typestring[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools | Typetool[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools[].name | Typestring | KravValgfrit | Værdier og grænser Gælder når: værktøj angivet | Standard— |
Felttools[].description | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Felttools[].input_schema | TypeJSON_schema | KravValgfrit | Værdier og grænser | Standard— |
Felttool_choice | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltthinking.type | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltthinking.budget_tokens | Typeinteger | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltoutput_config.effort | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltmetadata | Typeobject | KravValgfrit | Værdier og grænser | Standard— |
Feltcache_control | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Kombinationer af inputmaterialer
Tekst · UTF8-tekst
messages[].content eller en blok med type=text
Tekst + billede
{type:image,source:{type:base64,media_type,data}} eller kilde med type=url
Metodeparametre og livscyklus
| Parameter | Kontrakt |
|---|---|
Parametermaterial_types | Kontrakttext, image |
Parameterrequired | Kontraktmodel, messages, max_tokens |
Parameteroptional_controls | Kontraktnull |
Parametercontent_type | Kontraktapplication/json |
Parametertext_file_material | Kontraktfaktisk UTF-8-indhold indsat som tekst; fil-ID’er/URLs kræver særskilt præcis understøttelse |
Livscyklus: exact retained published method
Metodernes strukturer og ID’er er præcise; leverandørens muligheder er adskilt fra adgangstilladelse.
Priser
Ailoot-metodetakster
POST /v1/messages- Input
- 0,002 US$ / 1K
- Output
- 0,006 US$ / 1K
- Cachelæsning
- 0,00017 US$ / 1K
- Cacheskrivning
- 0,0025 US$ / 1K
- Cacheskrivning, 5 min.
- 0,0025 US$ / 1K tokens
Ailoot reserverer et estimeret beløb før en anmodning. Efter resultatet afregnes det endelige beløb ud fra det målte forbrug. Ved streaming bruges den endelige forbrugsregistrering til afregningen. Sådan fungerer reservation og afregning →
Detaljer om referencetariffen
Referenceplaner på modelniveau ændrer ikke metodevalg, prisoverslag eller opkrævninger. Ved den aktive afregning anvendes taksterne for den valgte Ailoot-metode.
Modellens referenceplaner
Priser efter konfiguration
Knyt hver omkostning til de viste betingelser. Brug én takst for hver gruppe af alternative konfigurationer.
| Konfiguration | Takstplan | Beløb |
|---|---|---|
| KonfigurationOpenAI Chat · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
| KonfigurationAnthropic Messages · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
Eksempelanmodninger
Ailoot · Anthropic Messages
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-max", "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-max", "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-max",
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-max",
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-max',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")
Hent og gem resultater
Ailoot · Anthropic Messages
json eller SSE
Behold alle færdige resultater
Gem hvert fuldstændigt returneret svar, hver fil og hver indholdsdel.
Bevar alle indholdsblokke, ræsonnementssignaturer og faktiske værktøjsbrugs-ID’er. Saml alle SSE-blokdeltaer; den første tekstblok er ikke hele outputtet.
Hvis det oprindelige svar skal kontrolleres
Bevar anmodnings-/svar-ID’er og headere. Der leveres ingen generel URL til at hente tekstjob.
Svarfelter
| Felt | Type |
|---|---|
Feltid | Typestring |
Feltmodel | Typestring |
Feltcontent[] | Typetext|thinking|tool_use|other content block |
Feltstop_reason | Typestring|null |
Feltusage | Typeobject |
Fejl og næste trin
| Svar | Betingelse | Næste trin |
|---|---|---|
Svar400 · invalid_request_error | BetingelseUgyldige obligatoriske felter, materialerepræsentation eller parameterværdi | Næste trinRet de angivne felter før en ny oprettelsesanmodning. |
Aliaser
Modelaliaser
Ailoot qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot Ultra qwen3.8-max
Aliaser for metodestier
Brug metodestierne vist ovenfor.
Relaterede kalder-ID’er
qwen3.8-max, qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot · OpenAI Responses POST /v1/responses qwen-max
qwen-maxqwen3.8-maxqwenqwen-latestqwen-maxqwen3.8-max-preview
Start
Qwen3.8-Max er en Qwen-model til tekstræsonnement og visuel forståelse. Udvikleren beskriver en kontekst på 1 million tokens, billed- og videoinput, værktøjsunderstøttede forløb og strukturerede tekstresultater.
- Accepterede input
- Tekst · Billeder
- Resultater
- Tekst
Tilgængelig i Ailoot · input og metoder
Ailoot · OpenAI Responses POST /v1/responses
- Inputtyper
text,image- Outputtyper
text- Kontekst
- 991.808 tokens
- Maksimalt output
- 131.072 tokens
- Outputformat
- json eller SSE
| Felt | Type | Krav | Værdier og grænser | Standard |
|---|---|---|---|---|
Feltmodel | Typestring | KravPåkrævet | Værdier og grænser qwen-max | Standard— |
Feltinput | Typestring|input_item[] | KravPåkrævet | Værdier og grænser | Standard— |
Feltinstructions | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Feltinput[].type | Typestring | KravValgfrit | Værdier og grænser message, reasoning, function_call, function_call_output | Standard— |
Feltinput[].content | Typestring|content_part[] | KravValgfrit | Værdier og grænser | Standard— |
Feltinput[].call_id | Typestring | KravValgfrit | Værdier og grænser Gælder når: function_call_output; bevar det faktisk returnerede call_id | Standard— |
Feltinput[].output | Typestring|content_part[] | KravValgfrit | Værdier og grænser Gælder når: function_call_output | Standard— |
Feltmax_output_tokens | Typeinteger | KravValgfrit | Værdier og grænser Minimum: 1 Afhænger af modellen | Standard— |
Feltstream | Typeboolean | KravValgfrit | Værdier og grænser | Standardfalse |
Felttemperature | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttop_p | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools | Typetool[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttool_choice | Typestring|object | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltparallel_tool_calls | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning.effort | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning.summary | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttext.format | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttext.verbosity | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltinclude | Typestring[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltstore | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltprevious_response_id | Typestring | KravValgfrit | Værdier og grænser ID-krav: Kun et faktisk svar-ID fra en understøttet fortsættelse Afhænger af modellen | Standard— |
Feltservice_tier | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltprompt_cache_key | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltprompt_cache_options | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Kombinationer af inputmaterialer
Tekst · UTF8-tekst
inputtekst eller en input_text-del
Tekst + billede
{type:input_image,image_url}
Metodeparametre og livscyklus
| Parameter | Kontrakt |
|---|---|
Parametermaterial_types | Kontrakttext, image |
Parameterrequired | Kontraktmodel, input |
Parameteroptional_controls | Kontraktnull |
Parametercontent_type | Kontraktapplication/json |
Parametertext_file_material | Kontraktfaktisk UTF-8-indhold indsat som tekst; fil-ID’er/URLs kræver særskilt præcis understøttelse |
Livscyklus: exact retained published method
Metodernes strukturer og ID’er er præcise; leverandørens muligheder er adskilt fra adgangstilladelse.
Priser
Ailoot-metodetakster
POST /v1/responses- Input
- 0,002 US$ / 1K
- Output
- 0,006 US$ / 1K
- Cachelæsning
- 0,00025 US$ / 1K
- Cacheskrivning
- 0,0025 US$ / 1K
- Cacheskrivning, 5 min.
- 0,0025 US$ / 1K tokens
- code_interpreter_call
- 0,00 US$ pr. kald
- image_search_call
- 0,008 US$ pr. kald
- web_extractor_call
- 0,00 US$ pr. kald
- web_search_call
- 0,01 US$ pr. kald
- web_search_image_call
- 0,008 US$ pr. kald
- Maks. antal kald code_interpreter_call
- 8
- Maks. antal kald image_search_call
- 8
- Maks. antal kald web_extractor_call
- 8
- Maks. antal kald web_search_call
- 8
- Maks. antal kald web_search_image_call
- 8
Ailoot reserverer et estimeret beløb før en anmodning. Efter resultatet afregnes det endelige beløb ud fra det målte forbrug. Ved streaming bruges den endelige forbrugsregistrering til afregningen. Sådan fungerer reservation og afregning →
Detaljer om referencetariffen
Referenceplaner på modelniveau ændrer ikke metodevalg, prisoverslag eller opkrævninger. Ved den aktive afregning anvendes taksterne for den valgte Ailoot-metode.
Modellens referenceplaner
Priser efter konfiguration
Knyt hver omkostning til de viste betingelser. Brug én takst for hver gruppe af alternative konfigurationer.
| Konfiguration | Takstplan | Beløb |
|---|---|---|
| KonfigurationOpenAI Chat · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
| KonfigurationAnthropic Messages · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
Eksempelanmodninger
Ailoot · OpenAI Responses
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-max", "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-max", "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-max", 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-max", 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-max", 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")
Hent og gem resultater
Ailoot · OpenAI Responses
json eller SSE
Behold alle færdige resultater
Gem hvert fuldstændigt returneret svar, hver fil og hver indholdsdel.
Bevar hvert outputelement og hver indholdsdel, faktisk call_id for funktioner, krypteret ræsonnement og forbrugsoplysninger. Bevar ved streaming den fulde hændelses-/elementidentitet.
Hvis det oprindelige svar skal kontrolleres
Bevar anmodnings-/svar-ID’er og headere. Der leveres ingen generel URL til at hente tekstjob.
Svarfelter
| Felt | Type |
|---|---|
Feltid | Typestring |
Feltstatus | Typestring |
Feltoutput[] | Typemessage|reasoning|function_call|other item |
Feltoutput[].content[] | Typecontent part |
Feltusage | Typeobject |
Fejl og næste trin
| Svar | Betingelse | Næste trin |
|---|---|---|
Svar400 · invalid_request_error | BetingelseUgyldige obligatoriske felter, materialerepræsentation eller parameterværdi | Næste trinRet de angivne felter før en ny oprettelsesanmodning. |
Aliaser
Modelaliaser
Ailoot qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot Ultra qwen3.8-max
Aliaser for metodestier
Brug metodestierne vist ovenfor.
Relaterede kalder-ID’er
qwen3.8-max, qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot · OpenAI Chat POST /v1/chat/completions qwen-max
qwen-maxqwen3.8-maxqwenqwen-latestqwen-maxqwen3.8-max-preview
Start
Qwen3.8-Max er en Qwen-model til tekstræsonnement og visuel forståelse. Udvikleren beskriver en kontekst på 1 million tokens, billed- og videoinput, værktøjsunderstøttede forløb og strukturerede tekstresultater.
- Accepterede input
- Tekst · Billeder
- Resultater
- Tekst
Tilgængelig i Ailoot · input og metoder
Ailoot · OpenAI Chat POST /v1/chat/completions
- Inputtyper
text,image- Outputtyper
text- Kontekst
- 991.808 tokens
- Maksimalt output
- 131.072 tokens
- Outputformat
- json eller SSE
| Felt | Type | Krav | Værdier og grænser | Standard |
|---|---|---|---|---|
Feltmodel | Typestring | KravPåkrævet | Værdier og grænser qwen-max | Standard— |
Feltmessages | Typemessage[] | KravPåkrævet | Værdier og grænser Minimumsantal elementer: 1 | Standard— |
Feltmessages[].role | Typestring | KravPåkrævet | Værdier og grænser Eksempler: system, user, assistant, tool, function Betingelser: Disse roller er eksplicit repræsenteret i kildekodens kompatibilitetstyper; modellens præcise rollesæt er fortsat modelspecifikt. Afhænger af modellen | Standard— |
Feltmessages[].content | Typestring|content_part[]|null | KravValgfrit | Værdier og grænser | Standard— |
Feltmessages[].tool_calls | Typetool_call[] | KravValgfrit | Værdier og grænser | Standard— |
Feltmessages[].tool_call_id | Typestring | KravValgfrit | Værdier og grænser Gælder når: role=tool; brug det faktisk returnerede ID | Standard— |
Feltmessages[].name | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Feltmessages[].reasoning_content | Typestring | KravValgfrit | Værdier og grænser Gælder når: Send det faktisk returnerede ræsonnement tilbage, når modellen bruger det | Standard— |
Feltmessages[].reasoning_details | Typeobject|array | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltmax_tokens | Typeinteger | KravValgfrit | Værdier og grænser Minimum: 1 Afhænger af modellen | Standard— |
Feltmax_completion_tokens | Typeinteger | KravValgfrit | Værdier og grænser Minimum: 1 Afhænger af modellen | Standard— |
Feltstream | Typeboolean | KravValgfrit | Værdier og grænser | Standardfalse |
Feltstream_options.include_usage | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttemperature | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttop_p | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltstop | Typestring|string[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools | Typefunction_tool[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools[].type | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools[].function.name | Typestring | KravPåkrævet | Værdier og grænser Gælder når: funktionsværktøj angivet | Standard— |
Felttools[].function.description | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Felttools[].function.parameters | TypeJSON_schema | KravValgfrit | Værdier og grænser | Standard— |
Felttool_choice | Typestring|object | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltparallel_tool_calls | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltresponse_format | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning_effort | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltservice_tier | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltinstructions | Typestring | KravValgfrit | Værdier og grænser Kompatibilitetsfelt | Standard— |
Feltfunctions | Typefunction[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltfunction_call | Typestring|object | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltprompt_cache_options | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Kombinationer af inputmaterialer
Tekst · UTF8-tekst
messages[].content
Tekst + billede
{type:image_url,image_url:{url,detail}}
Metodeparametre og livscyklus
| Parameter | Kontrakt |
|---|---|
Parametermaterial_types | Kontrakttext, image |
Parameterrequired | Kontraktmodel, messages |
Parameteroptional_controls | Kontraktnull |
Parametercontent_type | Kontraktapplication/json |
Parametertext_file_material | Kontraktfaktisk UTF-8-indhold indsat som tekst; fil-ID’er/URLs kræver særskilt præcis understøttelse |
Livscyklus: exact retained published method
Metodernes strukturer og ID’er er præcise; leverandørens muligheder er adskilt fra adgangstilladelse.
Priser
Ailoot-metodetakster
POST /v1/chat/completions- Input
- 0,002 US$ / 1K
- Output
- 0,006 US$ / 1K
- Cachelæsning
- 0,00025 US$ / 1K
- Cacheskrivning
- 0,0025 US$ / 1K
- Cacheskrivning, 5 min.
- 0,0025 US$ / 1K tokens
Ailoot reserverer et estimeret beløb før en anmodning. Efter resultatet afregnes det endelige beløb ud fra det målte forbrug. Ved streaming bruges den endelige forbrugsregistrering til afregningen. Sådan fungerer reservation og afregning →
Detaljer om referencetariffen
Referenceplaner på modelniveau ændrer ikke metodevalg, prisoverslag eller opkrævninger. Ved den aktive afregning anvendes taksterne for den valgte Ailoot-metode.
Modellens referenceplaner
Priser efter konfiguration
Knyt hver omkostning til de viste betingelser. Brug én takst for hver gruppe af alternative konfigurationer.
| Konfiguration | Takstplan | Beløb |
|---|---|---|
| KonfigurationOpenAI Chat · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
| KonfigurationAnthropic Messages · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
Eksempelanmodninger
Ailoot · OpenAI Chat
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-max", "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-max", "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-max",
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-max",
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-max',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")
Hent og gem resultater
Ailoot · OpenAI Chat
json eller SSE
Behold alle færdige resultater
Gem hvert fuldstændigt returneret svar, hver fil og hver indholdsdel.
Bevar hvert valg og dets indhold, værktøjskald og ræsonnement. Saml i SSE deltaer efter valg-/værktøjsindeks, og bevar den endelige afslutningsårsag og forbrugsoplysningerne.
Hvis det oprindelige svar skal kontrolleres
Bevar anmodnings-/svar-ID’er og headere. Der leveres ingen generel URL til at hente tekstjob.
Svarfelter
| Felt | Type |
|---|---|
Feltchoices[].index | Typeinteger |
Feltchoices[].message.content | Typestring|null |
Feltchoices[].message.tool_calls | Typetool_call[] |
Feltchoices[].message.reasoning_content | Typestring |
Feltchoices[].message.reasoning_details | Typeobject|array |
Feltchoices[].finish_reason | Typestring|null |
Feltusage | Typeobject |
Fejl og næste trin
| Svar | Betingelse | Næste trin |
|---|---|---|
Svar400 · invalid_request_error | BetingelseUgyldige obligatoriske felter, materialerepræsentation eller parameterværdi | Næste trinRet de angivne felter før en ny oprettelsesanmodning. |
Aliaser
Modelaliaser
Ailoot qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot Ultra qwen3.8-max
Aliaser for metodestier
Brug metodestierne vist ovenfor.
Relaterede kalder-ID’er
qwen3.8-max, qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot · Anthropic Messages POST /v1/messages qwen3.8-max-preview
qwen3.8-max-previewqwen3.8-maxqwenqwen-latestqwen-maxqwen3.8-max-preview
Start
Qwen3.8-Max er en Qwen-model til tekstræsonnement og visuel forståelse. Udvikleren beskriver en kontekst på 1 million tokens, billed- og videoinput, værktøjsunderstøttede forløb og strukturerede tekstresultater.
- Accepterede input
- Tekst · Billeder
- Resultater
- Tekst
Tilgængelig i Ailoot · input og metoder
Ailoot · Anthropic Messages POST /v1/messages
- Inputtyper
text,image- Outputtyper
text- Kontekst
- 991.808 tokens
- Maksimalt output
- 131.072 tokens
- Outputformat
- json eller SSE
| Felt | Type | Krav | Værdier og grænser | Standard |
|---|---|---|---|---|
Feltmodel | Typestring | KravPåkrævet | Værdier og grænser qwen3.8-max-preview | Standard— |
Feltmessages | Typemessage[] | KravPåkrævet | Værdier og grænser Minimumsantal elementer: 1 | Standard— |
Feltmessages[].role | Typestring | KravPåkrævet | Værdier og grænser user, assistant | Standard— |
Feltmessages[].content | Typestring|content_block[] | KravPåkrævet | Værdier og grænser | Standard— |
Feltsystem | Typestring|content_block[] | KravValgfrit | Værdier og grænser | Standard— |
Feltmax_tokens | Typeinteger | KravPåkrævet | Værdier og grænser Minimum: 1 Grænsen gælder for: den præcise øvre grænse for valgt model/modelkort | Standard— |
Feltstream | Typeboolean | KravValgfrit | Værdier og grænser | Standardfalse |
Felttemperature | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttop_p | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltstop_sequences | Typestring[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools | Typetool[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools[].name | Typestring | KravValgfrit | Værdier og grænser Gælder når: værktøj angivet | Standard— |
Felttools[].description | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Felttools[].input_schema | TypeJSON_schema | KravValgfrit | Værdier og grænser | Standard— |
Felttool_choice | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltthinking.type | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltthinking.budget_tokens | Typeinteger | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltoutput_config.effort | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltmetadata | Typeobject | KravValgfrit | Værdier og grænser | Standard— |
Feltcache_control | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Kombinationer af inputmaterialer
Tekst · UTF8-tekst
messages[].content eller en blok med type=text
Tekst + billede
{type:image,source:{type:base64,media_type,data}} eller kilde med type=url
Metodeparametre og livscyklus
| Parameter | Kontrakt |
|---|---|
Parametermaterial_types | Kontrakttext, image |
Parameterrequired | Kontraktmodel, messages, max_tokens |
Parameteroptional_controls | Kontraktnull |
Parametercontent_type | Kontraktapplication/json |
Parametertext_file_material | Kontraktfaktisk UTF-8-indhold indsat som tekst; fil-ID’er/URLs kræver særskilt præcis understøttelse |
Livscyklus: exact retained published method
Metodernes strukturer og ID’er er præcise; leverandørens muligheder er adskilt fra adgangstilladelse.
Priser
Ailoot-metodetakster
POST /v1/messages- Input
- 0,002 US$ / 1K
- Output
- 0,006 US$ / 1K
- Cachelæsning
- 0,00017 US$ / 1K
- Cacheskrivning
- 0,0025 US$ / 1K
- Cacheskrivning, 5 min.
- 0,0025 US$ / 1K tokens
Ailoot reserverer et estimeret beløb før en anmodning. Efter resultatet afregnes det endelige beløb ud fra det målte forbrug. Ved streaming bruges den endelige forbrugsregistrering til afregningen. Sådan fungerer reservation og afregning →
Detaljer om referencetariffen
Referenceplaner på modelniveau ændrer ikke metodevalg, prisoverslag eller opkrævninger. Ved den aktive afregning anvendes taksterne for den valgte Ailoot-metode.
Modellens referenceplaner
Priser efter konfiguration
Knyt hver omkostning til de viste betingelser. Brug én takst for hver gruppe af alternative konfigurationer.
| Konfiguration | Takstplan | Beløb |
|---|---|---|
| KonfigurationOpenAI Chat · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
| KonfigurationAnthropic Messages · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
Eksempelanmodninger
Ailoot · Anthropic Messages
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-max-preview", "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-max-preview", "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-max-preview",
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-max-preview",
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-max-preview',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")
Hent og gem resultater
Ailoot · Anthropic Messages
json eller SSE
Behold alle færdige resultater
Gem hvert fuldstændigt returneret svar, hver fil og hver indholdsdel.
Bevar alle indholdsblokke, ræsonnementssignaturer og faktiske værktøjsbrugs-ID’er. Saml alle SSE-blokdeltaer; den første tekstblok er ikke hele outputtet.
Hvis det oprindelige svar skal kontrolleres
Bevar anmodnings-/svar-ID’er og headere. Der leveres ingen generel URL til at hente tekstjob.
Svarfelter
| Felt | Type |
|---|---|
Feltid | Typestring |
Feltmodel | Typestring |
Feltcontent[] | Typetext|thinking|tool_use|other content block |
Feltstop_reason | Typestring|null |
Feltusage | Typeobject |
Fejl og næste trin
| Svar | Betingelse | Næste trin |
|---|---|---|
Svar400 · invalid_request_error | BetingelseUgyldige obligatoriske felter, materialerepræsentation eller parameterværdi | Næste trinRet de angivne felter før en ny oprettelsesanmodning. |
Aliaser
Modelaliaser
Ailoot qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot Ultra qwen3.8-max
Aliaser for metodestier
Brug metodestierne vist ovenfor.
Relaterede kalder-ID’er
qwen3.8-max, qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot · OpenAI Responses POST /v1/responses qwen3.8-max-preview
qwen3.8-max-previewqwen3.8-maxqwenqwen-latestqwen-maxqwen3.8-max-preview
Start
Qwen3.8-Max er en Qwen-model til tekstræsonnement og visuel forståelse. Udvikleren beskriver en kontekst på 1 million tokens, billed- og videoinput, værktøjsunderstøttede forløb og strukturerede tekstresultater.
- Accepterede input
- Tekst · Billeder
- Resultater
- Tekst
Tilgængelig i Ailoot · input og metoder
Ailoot · OpenAI Responses POST /v1/responses
- Inputtyper
text,image- Outputtyper
text- Kontekst
- 991.808 tokens
- Maksimalt output
- 131.072 tokens
- Outputformat
- json eller SSE
| Felt | Type | Krav | Værdier og grænser | Standard |
|---|---|---|---|---|
Feltmodel | Typestring | KravPåkrævet | Værdier og grænser qwen3.8-max-preview | Standard— |
Feltinput | Typestring|input_item[] | KravPåkrævet | Værdier og grænser | Standard— |
Feltinstructions | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Feltinput[].type | Typestring | KravValgfrit | Værdier og grænser message, reasoning, function_call, function_call_output | Standard— |
Feltinput[].content | Typestring|content_part[] | KravValgfrit | Værdier og grænser | Standard— |
Feltinput[].call_id | Typestring | KravValgfrit | Værdier og grænser Gælder når: function_call_output; bevar det faktisk returnerede call_id | Standard— |
Feltinput[].output | Typestring|content_part[] | KravValgfrit | Værdier og grænser Gælder når: function_call_output | Standard— |
Feltmax_output_tokens | Typeinteger | KravValgfrit | Værdier og grænser Minimum: 1 Afhænger af modellen | Standard— |
Feltstream | Typeboolean | KravValgfrit | Værdier og grænser | Standardfalse |
Felttemperature | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttop_p | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools | Typetool[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttool_choice | Typestring|object | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltparallel_tool_calls | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning.effort | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning.summary | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttext.format | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttext.verbosity | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltinclude | Typestring[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltstore | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltprevious_response_id | Typestring | KravValgfrit | Værdier og grænser ID-krav: Kun et faktisk svar-ID fra en understøttet fortsættelse Afhænger af modellen | Standard— |
Feltservice_tier | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltprompt_cache_key | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltprompt_cache_options | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Kombinationer af inputmaterialer
Tekst · UTF8-tekst
inputtekst eller en input_text-del
Tekst + billede
{type:input_image,image_url}
Metodeparametre og livscyklus
| Parameter | Kontrakt |
|---|---|
Parametermaterial_types | Kontrakttext, image |
Parameterrequired | Kontraktmodel, input |
Parameteroptional_controls | Kontraktnull |
Parametercontent_type | Kontraktapplication/json |
Parametertext_file_material | Kontraktfaktisk UTF-8-indhold indsat som tekst; fil-ID’er/URLs kræver særskilt præcis understøttelse |
Livscyklus: exact retained published method
Metodernes strukturer og ID’er er præcise; leverandørens muligheder er adskilt fra adgangstilladelse.
Priser
Ailoot-metodetakster
POST /v1/responses- Input
- 0,002 US$ / 1K
- Output
- 0,006 US$ / 1K
- Cachelæsning
- 0,00025 US$ / 1K
- Cacheskrivning
- 0,0025 US$ / 1K
- Cacheskrivning, 5 min.
- 0,0025 US$ / 1K tokens
- code_interpreter_call
- 0,00 US$ pr. kald
- image_search_call
- 0,008 US$ pr. kald
- web_extractor_call
- 0,00 US$ pr. kald
- web_search_call
- 0,01 US$ pr. kald
- web_search_image_call
- 0,008 US$ pr. kald
- Maks. antal kald code_interpreter_call
- 8
- Maks. antal kald image_search_call
- 8
- Maks. antal kald web_extractor_call
- 8
- Maks. antal kald web_search_call
- 8
- Maks. antal kald web_search_image_call
- 8
Ailoot reserverer et estimeret beløb før en anmodning. Efter resultatet afregnes det endelige beløb ud fra det målte forbrug. Ved streaming bruges den endelige forbrugsregistrering til afregningen. Sådan fungerer reservation og afregning →
Detaljer om referencetariffen
Referenceplaner på modelniveau ændrer ikke metodevalg, prisoverslag eller opkrævninger. Ved den aktive afregning anvendes taksterne for den valgte Ailoot-metode.
Modellens referenceplaner
Priser efter konfiguration
Knyt hver omkostning til de viste betingelser. Brug én takst for hver gruppe af alternative konfigurationer.
| Konfiguration | Takstplan | Beløb |
|---|---|---|
| KonfigurationOpenAI Chat · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
| KonfigurationAnthropic Messages · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
Eksempelanmodninger
Ailoot · OpenAI Responses
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-max-preview", "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-max-preview", "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-max-preview", 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-max-preview", 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-max-preview", 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")
Hent og gem resultater
Ailoot · OpenAI Responses
json eller SSE
Behold alle færdige resultater
Gem hvert fuldstændigt returneret svar, hver fil og hver indholdsdel.
Bevar hvert outputelement og hver indholdsdel, faktisk call_id for funktioner, krypteret ræsonnement og forbrugsoplysninger. Bevar ved streaming den fulde hændelses-/elementidentitet.
Hvis det oprindelige svar skal kontrolleres
Bevar anmodnings-/svar-ID’er og headere. Der leveres ingen generel URL til at hente tekstjob.
Svarfelter
| Felt | Type |
|---|---|
Feltid | Typestring |
Feltstatus | Typestring |
Feltoutput[] | Typemessage|reasoning|function_call|other item |
Feltoutput[].content[] | Typecontent part |
Feltusage | Typeobject |
Fejl og næste trin
| Svar | Betingelse | Næste trin |
|---|---|---|
Svar400 · invalid_request_error | BetingelseUgyldige obligatoriske felter, materialerepræsentation eller parameterværdi | Næste trinRet de angivne felter før en ny oprettelsesanmodning. |
Aliaser
Modelaliaser
Ailoot qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot Ultra qwen3.8-max
Aliaser for metodestier
Brug metodestierne vist ovenfor.
Relaterede kalder-ID’er
qwen3.8-max, qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot · OpenAI Chat POST /v1/chat/completions qwen3.8-max-preview
qwen3.8-max-previewqwen3.8-maxqwenqwen-latestqwen-maxqwen3.8-max-preview
Start
Qwen3.8-Max er en Qwen-model til tekstræsonnement og visuel forståelse. Udvikleren beskriver en kontekst på 1 million tokens, billed- og videoinput, værktøjsunderstøttede forløb og strukturerede tekstresultater.
- Accepterede input
- Tekst · Billeder
- Resultater
- Tekst
Tilgængelig i Ailoot · input og metoder
Ailoot · OpenAI Chat POST /v1/chat/completions
- Inputtyper
text,image- Outputtyper
text- Kontekst
- 991.808 tokens
- Maksimalt output
- 131.072 tokens
- Outputformat
- json eller SSE
| Felt | Type | Krav | Værdier og grænser | Standard |
|---|---|---|---|---|
Feltmodel | Typestring | KravPåkrævet | Værdier og grænser qwen3.8-max-preview | Standard— |
Feltmessages | Typemessage[] | KravPåkrævet | Værdier og grænser Minimumsantal elementer: 1 | Standard— |
Feltmessages[].role | Typestring | KravPåkrævet | Værdier og grænser Eksempler: system, user, assistant, tool, function Betingelser: Disse roller er eksplicit repræsenteret i kildekodens kompatibilitetstyper; modellens præcise rollesæt er fortsat modelspecifikt. Afhænger af modellen | Standard— |
Feltmessages[].content | Typestring|content_part[]|null | KravValgfrit | Værdier og grænser | Standard— |
Feltmessages[].tool_calls | Typetool_call[] | KravValgfrit | Værdier og grænser | Standard— |
Feltmessages[].tool_call_id | Typestring | KravValgfrit | Værdier og grænser Gælder når: role=tool; brug det faktisk returnerede ID | Standard— |
Feltmessages[].name | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Feltmessages[].reasoning_content | Typestring | KravValgfrit | Værdier og grænser Gælder når: Send det faktisk returnerede ræsonnement tilbage, når modellen bruger det | Standard— |
Feltmessages[].reasoning_details | Typeobject|array | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltmax_tokens | Typeinteger | KravValgfrit | Værdier og grænser Minimum: 1 Afhænger af modellen | Standard— |
Feltmax_completion_tokens | Typeinteger | KravValgfrit | Værdier og grænser Minimum: 1 Afhænger af modellen | Standard— |
Feltstream | Typeboolean | KravValgfrit | Værdier og grænser | Standardfalse |
Feltstream_options.include_usage | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttemperature | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttop_p | Typenumber | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltstop | Typestring|string[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools | Typefunction_tool[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools[].type | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Felttools[].function.name | Typestring | KravPåkrævet | Værdier og grænser Gælder når: funktionsværktøj angivet | Standard— |
Felttools[].function.description | Typestring | KravValgfrit | Værdier og grænser | Standard— |
Felttools[].function.parameters | TypeJSON_schema | KravValgfrit | Værdier og grænser | Standard— |
Felttool_choice | Typestring|object | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltparallel_tool_calls | Typeboolean | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltresponse_format | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning_effort | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltreasoning | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltservice_tier | Typestring | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltinstructions | Typestring | KravValgfrit | Værdier og grænser Kompatibilitetsfelt | Standard— |
Feltfunctions | Typefunction[] | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltfunction_call | Typestring|object | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Feltprompt_cache_options | Typeobject | KravValgfrit | Værdier og grænser Afhænger af modellen | Standard— |
Kombinationer af inputmaterialer
Tekst · UTF8-tekst
messages[].content
Tekst + billede
{type:image_url,image_url:{url,detail}}
Metodeparametre og livscyklus
| Parameter | Kontrakt |
|---|---|
Parametermaterial_types | Kontrakttext, image |
Parameterrequired | Kontraktmodel, messages |
Parameteroptional_controls | Kontraktnull |
Parametercontent_type | Kontraktapplication/json |
Parametertext_file_material | Kontraktfaktisk UTF-8-indhold indsat som tekst; fil-ID’er/URLs kræver særskilt præcis understøttelse |
Livscyklus: exact retained published method
Metodernes strukturer og ID’er er præcise; leverandørens muligheder er adskilt fra adgangstilladelse.
Priser
Ailoot-metodetakster
POST /v1/chat/completions- Input
- 0,002 US$ / 1K
- Output
- 0,006 US$ / 1K
- Cachelæsning
- 0,00025 US$ / 1K
- Cacheskrivning
- 0,0025 US$ / 1K
- Cacheskrivning, 5 min.
- 0,0025 US$ / 1K tokens
Ailoot reserverer et estimeret beløb før en anmodning. Efter resultatet afregnes det endelige beløb ud fra det målte forbrug. Ved streaming bruges den endelige forbrugsregistrering til afregningen. Sådan fungerer reservation og afregning →
Detaljer om referencetariffen
Referenceplaner på modelniveau ændrer ikke metodevalg, prisoverslag eller opkrævninger. Ved den aktive afregning anvendes taksterne for den valgte Ailoot-metode.
Modellens referenceplaner
Priser efter konfiguration
Knyt hver omkostning til de viste betingelser. Brug én takst for hver gruppe af alternative konfigurationer.
| Konfiguration | Takstplan | Beløb |
|---|---|---|
| KonfigurationOpenAI Chat · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
| KonfigurationAnthropic Messages · Grundtakster pr. token | TakstplanGrundtakst | Beløb Input · Inputtokens $0.00432 / 1K tokens Output · Outputtokens $0.01272 / 1K tokens Input · Cachelæsning $0.000336 / 1K tokens Input · Cacheskrivning $0.00516 / 1K tokens Input · Cacheskrivning, 1 time — / 1K tokens |
Eksempelanmodninger
Ailoot · OpenAI Chat
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-max-preview", "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-max-preview", "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-max-preview",
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-max-preview",
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-max-preview',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")
Hent og gem resultater
Ailoot · OpenAI Chat
json eller SSE
Behold alle færdige resultater
Gem hvert fuldstændigt returneret svar, hver fil og hver indholdsdel.
Bevar hvert valg og dets indhold, værktøjskald og ræsonnement. Saml i SSE deltaer efter valg-/værktøjsindeks, og bevar den endelige afslutningsårsag og forbrugsoplysningerne.
Hvis det oprindelige svar skal kontrolleres
Bevar anmodnings-/svar-ID’er og headere. Der leveres ingen generel URL til at hente tekstjob.
Svarfelter
| Felt | Type |
|---|---|
Feltchoices[].index | Typeinteger |
Feltchoices[].message.content | Typestring|null |
Feltchoices[].message.tool_calls | Typetool_call[] |
Feltchoices[].message.reasoning_content | Typestring |
Feltchoices[].message.reasoning_details | Typeobject|array |
Feltchoices[].finish_reason | Typestring|null |
Feltusage | Typeobject |
Fejl og næste trin
| Svar | Betingelse | Næste trin |
|---|---|---|
Svar400 · invalid_request_error | BetingelseUgyldige obligatoriske felter, materialerepræsentation eller parameterværdi | Næste trinRet de angivne felter før en ny oprettelsesanmodning. |
Aliaser
Modelaliaser
Ailoot qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
Ailoot Ultra qwen3.8-max
Aliaser for metodestier
Brug metodestierne vist ovenfor.
Relaterede kalder-ID’er
qwen3.8-max, qwen3.8-max, qwen, qwen-latest, qwen-max, qwen3.8-max-preview
FAQ · qwen3.8-max
- Hvilke input og resultater er tilgængelige?
POST /v1/messages·qwen3.8-max:text,image→textPOST /v1/responses·qwen3.8-max:text,image→textPOST /v1/chat/completions·qwen3.8-max:text,image→textPOST /v1/chat/completions·qwen3.8-max:text→textPOST /v1/messages·qwen3.8-max:text→json,ssePOST /v1/messages·qwen:text,image→textPOST /v1/responses·qwen:text,image→textPOST /v1/chat/completions·qwen:text,image→textPOST /v1/messages·qwen-latest:text,image→textPOST /v1/responses·qwen-latest:text,image→textPOST /v1/chat/completions·qwen-latest:text,image→textPOST /v1/messages·qwen-max:text,image→textPOST /v1/responses·qwen-max:text,image→textPOST /v1/chat/completions·qwen-max:text,image→textPOST /v1/messages·qwen3.8-max-preview:text,image→textPOST /v1/responses·qwen3.8-max-preview:text,image→textPOST /v1/chat/completions·qwen3.8-max-preview:text,image→text- Hvilke felter bruger anmodningen?
POST /v1/messages·qwen3.8-max:model,messages,system,max_tokens,stream,metadataPOST /v1/responses·qwen3.8-max:model,input,instructions,streamPOST /v1/chat/completions·qwen3.8-max:model,messages,streamPOST /v1/chat/completions·qwen3.8-max:model,messages,stream,modalities,providerPOST /v1/messages·qwen3.8-max:model,messages,max_tokens,streamPOST /v1/messages·qwen:model,messages,system,max_tokens,stream,metadataPOST /v1/responses·qwen:model,input,instructions,streamPOST /v1/chat/completions·qwen:model,messages,streamPOST /v1/messages·qwen-latest:model,messages,system,max_tokens,stream,metadataPOST /v1/responses·qwen-latest:model,input,instructions,streamPOST /v1/chat/completions·qwen-latest:model,messages,streamPOST /v1/messages·qwen-max:model,messages,system,max_tokens,stream,metadataPOST /v1/responses·qwen-max:model,input,instructions,streamPOST /v1/chat/completions·qwen-max:model,messages,streamPOST /v1/messages·qwen3.8-max-preview:model,messages,system,max_tokens,stream,metadataPOST /v1/responses·qwen3.8-max-preview:model,input,instructions,streamPOST /v1/chat/completions·qwen3.8-max-preview:model,messages,stream- Hvilke grænser gælder?
POST /v1/messages·qwen3.8-max:ctx:991808;max_out:131072;messages.min_items:1;max_tokens.minimum:1POST /v1/responses·qwen3.8-max:ctx:991808;max_out:131072POST /v1/chat/completions·qwen3.8-max:ctx:991808;max_out:131072;messages.min_items:1POST /v1/chat/completions·qwen3.8-max:messages.min_items:1POST /v1/messages·qwen:ctx:991808;max_out:131072;messages.min_items:1;max_tokens.minimum:1POST /v1/responses·qwen:ctx:991808;max_out:131072POST /v1/chat/completions·qwen:ctx:991808;max_out:131072;messages.min_items:1POST /v1/messages·qwen-latest:ctx:991808;max_out:131072;messages.min_items:1;max_tokens.minimum:1POST /v1/responses·qwen-latest:ctx:991808;max_out:131072POST /v1/chat/completions·qwen-latest:ctx:991808;max_out:131072;messages.min_items:1POST /v1/messages·qwen-max:ctx:991808;max_out:131072;messages.min_items:1;max_tokens.minimum:1POST /v1/responses·qwen-max:ctx:991808;max_out:131072POST /v1/chat/completions·qwen-max:ctx:991808;max_out:131072;messages.min_items:1POST /v1/messages·qwen3.8-max-preview:ctx:991808;max_out:131072;messages.min_items:1;max_tokens.minimum:1POST /v1/responses·qwen3.8-max-preview:ctx:991808;max_out:131072POST /v1/chat/completions·qwen3.8-max-preview:ctx:991808;max_out:131072;messages.min_items:1