Source: https://ailoot.ai/models/sv/qwen3-8-max/
Canonical: https://ailoot.ai/models/sv/qwen3-8-max/
Language: sv

# qwen3.8-max

[Markdown](https://ailoot.ai/models/sv/qwen3-8-max/index.md) · [JSON](https://ailoot.ai/models/sv/qwen3-8-max/facts.json)

## [qwen3.8-max](https://ailoot.ai/models/sv/qwen3-8-max/)

Qwen3.8-Max är en Qwen-modell för textbaserat resonemang och visuell förståelse. Tillverkaren beskriver en kontext på 1 miljon token, bild- och videoindata, verktygsstödda arbetsflöden och strukturerade textresultat.

- [**Ailoot · Anthropic Messages** `POST /v1/messages` `qwen3.8-max`](https://ailoot.ai/models/sv/qwen3-8-max/#method-0)
- [**Ailoot · OpenAI Responses** `POST /v1/responses` `qwen3.8-max`](https://ailoot.ai/models/sv/qwen3-8-max/#method-1)
- [**Ailoot · OpenAI Chat** `POST /v1/chat/completions` `qwen3.8-max`](https://ailoot.ai/models/sv/qwen3-8-max/#method-2)
- [**Ailoot Ultra · OpenAI Chat** `POST /v1/chat/completions` `qwen3.8-max`](https://ailoot.ai/models/sv/qwen3-8-max/#method-3)
- [**Ailoot Ultra · Anthropic Messages** `POST /v1/messages` `qwen3.8-max`](https://ailoot.ai/models/sv/qwen3-8-max/#method-4)
- [**Ailoot · Anthropic Messages** `POST /v1/messages` `qwen`](https://ailoot.ai/models/sv/qwen3-8-max/#method-5)
- [**Ailoot · OpenAI Responses** `POST /v1/responses` `qwen`](https://ailoot.ai/models/sv/qwen3-8-max/#method-6)
- [**Ailoot · OpenAI Chat** `POST /v1/chat/completions` `qwen`](https://ailoot.ai/models/sv/qwen3-8-max/#method-7)
- [**Ailoot · Anthropic Messages** `POST /v1/messages` `qwen-latest`](https://ailoot.ai/models/sv/qwen3-8-max/#method-8)
- [**Ailoot · OpenAI Responses** `POST /v1/responses` `qwen-latest`](https://ailoot.ai/models/sv/qwen3-8-max/#method-9)
- [**Ailoot · OpenAI Chat** `POST /v1/chat/completions` `qwen-latest`](https://ailoot.ai/models/sv/qwen3-8-max/#method-10)
- [**Ailoot · Anthropic Messages** `POST /v1/messages` `qwen-max`](https://ailoot.ai/models/sv/qwen3-8-max/#method-11)
- [**Ailoot · OpenAI Responses** `POST /v1/responses` `qwen-max`](https://ailoot.ai/models/sv/qwen3-8-max/#method-12)
- [**Ailoot · OpenAI Chat** `POST /v1/chat/completions` `qwen-max`](https://ailoot.ai/models/sv/qwen3-8-max/#method-13)
- [**Ailoot · Anthropic Messages** `POST /v1/messages` `qwen3.8-max-preview`](https://ailoot.ai/models/sv/qwen3-8-max/#method-14)
- [**Ailoot · OpenAI Responses** `POST /v1/responses` `qwen3.8-max-preview`](https://ailoot.ai/models/sv/qwen3-8-max/#method-15)
- [**Ailoot · OpenAI Chat** `POST /v1/chat/completions` `qwen3.8-max-preview`](https://ailoot.ai/models/sv/qwen3-8-max/#method-16)

Om modellen

Den här beskrivningen omfattar modellens förmågor. Tillgängliga indata, utdata och alternativ i Ailoot anges nedan för den valda metoden.

Qwen3.8-Max är en Qwen-modell för textbaserat resonemang och visuell förståelse. Tillverkarens guider beskriver den som avsedd för krävande resonemangsuppgifter och tolkning av bilder och video. Tabellen över visuella modeller anger en kontext på 1 miljon token, funktionsanrop, inbyggda verktyg och strukturerad utdata.

#### Analysera en fråga och dess källmaterial

Ange underlaget, villkoren och det resultat uppgiften ska ge. Vid dokumentarbete ska avsnittens beteckningar bevaras och det ska framgå vilken referens som har företräde om textavsnitt motsäger varandra. För en visuell fråga anger du en läsbar bild, området som ska granskas och den information som är relevant för svaret. Be om ett svar som skiljer observationer i källmaterialet från tolkningar.

#### Använd en inspelad sekvens för en avgränsad fråga

Välj det avsnitt som är relevant för uppgiften och bevara dess ordningsföljd. Begär en beskrivning av de synliga händelserna och det underlag som stöder varje slutsats. Om en muntlig förklaring behövs lägger du till dess transkription som text. Det önskade resultatet kan vara en kronologisk anteckning, en analytisk jämförelse eller en förklaring förankrad i de bifogade bildrutorna.

#### Ge den omgivande applikationen en tydlig roll

Funktionsanrop låter en integration definiera en åtgärd och dess argument, utföra det anrop modellen väljer och returnera det faktiska resultatet. Tillverkaren anger också inbyggda verktyg för modellen. Vilka av dem som exponeras beror på gränssnittet som används för begäran. För strukturerad utdata definierar du fältnamn och hur saknade värden ska hanteras och kontrollerar sedan både svarets format och innebörd.

#### Planera inom de dokumenterade gränserna

Tabellen över visuella modeller anger bilder på upp till 16 miljoner pixlar, video på upp till två timmar och 2 GB samt högst 2 048 bilder och 64 videor. Dessa gränser för tillverkarens arbetsflöden omfattas fortfarande av den gemensamma kontexten på 1 miljon token. De beskriver hur indata förbereds, medan det valda gränssnittet bestämmer gränserna för den faktiska begäran. Håll källornas beteckningar och det begärda svaret samman så att resultatet kan granskas mot sitt underlag.

Praktisk uppgift

### Praktisk uppgift

Tekniskt exempel på engelska

```
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.
```

#### Förväntat resultat

```
A source-linked decision note applying the bulletin and naming maintenance authorisation as an unresolved condition.
```

#### Kontrollera resultatet

```
Elapsed waiting time alone does not override the leak-alarm rule.
```

**Ailoot · Anthropic Messages** `POST /v1/messages` `qwen3.8-max`

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=messages)

Alibaba /`qwen3.8-max`

Modell-ID

- `qwen3.8-max`
- `qwen`
- `qwen-latest`
- `qwen-max`
- `qwen3.8-max-preview`

### Start

Qwen3.8-Max är en Qwen-modell för textbaserat resonemang och visuell förståelse. Tillverkaren beskriver en kontext på 1 miljon token, bild- och videoindata, verktygsstödda arbetsflöden och strukturerade textresultat.

Godkända indata

Text · Bilder

Resultat

Text

### Tillgängligt i Ailoot · indata & metoder

**Ailoot · Anthropic Messages** `POST /v1/messages`

Indatatyper

`text`, `image`

Utdatatyper

`text`

Kontext

991 808 tokens

Maximala utdata

131 072 tokens

Utdataformat

json eller SSE

| Fält | Typ | Krav | Värden & gränser | Standard |
| --- | --- | --- | --- | --- |
| Fält`model` | Typ`string` | KravObligatoriskt | Värden & gränser qwen3.8-max | Standard— |
| Fält`messages` | Typ`message[]` | KravObligatoriskt | Värden & gränser Minsta antal objekt: 1 | Standard— |
| Fält`messages[].role` | Typ`string` | KravObligatoriskt | Värden & gränser user, assistant | Standard— |
| Fält`messages[].content` | Typ`string\|content_block[]` | KravObligatoriskt | Värden & gränser | Standard— |
| Fält`system` | Typ`string\|content_block[]` | KravValfritt | Värden & gränser | Standard— |
| Fält`max_tokens` | Typ`integer` | KravObligatoriskt | Värden & gränser Minimum: 1 Gränsen gäller för: den exakta gränsen för den valda modellen/det valda kortet | Standard— |
| Fält`stream` | Typ`boolean` | KravValfritt | Värden & gränser | Standardfalse |
| Fält`temperature` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`top_p` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`stop_sequences` | Typ`string[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools` | Typ`tool[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools[].name` | Typ`string` | KravValfritt | Värden & gränser Gäller när: verktyg har tillhandahållits | Standard— |
| Fält`tools[].description` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`tools[].input_schema` | Typ`JSON_schema` | KravValfritt | Värden & gränser | Standard— |
| Fält`tool_choice` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`thinking.type` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`thinking.budget_tokens` | Typ`integer` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`output_config.effort` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`metadata` | Typ`object` | KravValfritt | Värden & gränser | Standard— |
| Fält`cache_control` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |

Kombinationer av indatamaterial

**Text** · UTF8-text

`messages[].content eller ett type=text-block`

**Text + bild**

`{type:image,source:{type:base64,media_type,data}} eller källa type=url`

Metodparametrar och livscykel

| Parameter | Avtal |
| --- | --- |
| Parameter`material_types` | Avtaltext, image |
| Parameter`required` | Avtalmodel, messages, max\_tokens |
| Parameter`optional_controls` | Avtalnull |
| Parameter`content_type` | Avtalapplication/json |
| Parameter`text_file_material` | Avtalfaktiskt UTF-8-innehåll infogat som text; fil-ID:n/URLs kräver separat, exakt definierat stöd |

Livscykel: `exact retained published method`

Metodernas strukturer och ID:n är exakta; leverantörens funktioner är åtskilda från att begäran tillåts.

### Priser

#### Priser för Ailoot-metoder

Indata

0,002 US$ */ 1K*

Utdata

0,006 US$ */ 1K*

Cacheläsning

0,00017 US$ */ 1K*

Skrivning till cache

0,0025 US$ */ 1K*

Skrivning till cache, 5 min

0,0025 US$ */ 1K tokens*

Ailoot reserverar ett uppskattat belopp före en begäran. Efter resultatet slutregleras avgiften utifrån uppmätt förbrukning. Slutreglering för strömning använder den slutliga förbrukningsposten. [Så fungerar reservation och slutreglering →](https://ailoot.ai/docs/sv/billing/reserve/)

#### Detaljer om referenstariffen

Referensprislistor på modellnivå ändrar inte metodval, prisuppgifter eller avgifter. Aktiva avgifter använder priserna för den valda Ailoot-metoden.

Modellens referensprislistor

#### Priser efter konfiguration

Matcha varje avgift mot de visade villkoren. Använd ett pris för varje uppsättning alternativa konfigurationer.

| Konfiguration | Prislista | Avgift |
| --- | --- | --- |
| KonfigurationOpenAI Chat · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |

### Exempelbegäranden

#### Ailoot · Anthropic Messages

TextexempelIndata, bildPython SDKNode.js SDKPython-strömning

```bash
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
```

```bash
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
```

```python
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"))
```

```js
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);
```

```python
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")
```

### Ta emot och spara resultat

#### Ailoot · Anthropic Messages

json eller SSE

##### Behåll alla färdiga resultat

Behåll varje fullständigt returnerat svar, fil och innehållsdel.

Behåll alla innehållsblock, resonemangssignaturer och faktiska ID:n för verktygsanvändning. Sätt samman alla SSE-deltauppdateringar för blocken; ett första textblock är inte hela utdata.

##### Om det ursprungliga svaret behöver kontrolleras

Behåll begärans/svarets ID:n och huvuden. Ingen generell URL för hämtning av textjobb tillhandahålls.

Svarsfält

| Fält | Typ |
| --- | --- |
| Fält`id` | Typstring |
| Fält`model` | Typstring |
| Fält`content[]` | Typtext\|thinking\|tool\_use\|other content block |
| Fält`stop_reason` | Typstring\|null |
| Fält`usage` | Typobject |

Fel och nästa steg

| Svar | Villkor | Nästa steg |
| --- | --- | --- |
| Svar400 · `invalid_request_error` | VillkorOgiltiga obligatoriska fält, ogiltig representation av underlaget eller ogiltigt parametervärde | Nästa stegKorrigera de angivna fälten före en ny begäran om att skapa. |

### Alias

#### Modellalias

<strong>Ailoot</strong> [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=messages), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=messages), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=messages), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=messages), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=messages)
**Ailoot Ultra** [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=messages)

#### Alias för metodsökvägar

Använd metodsökvägarna som visas ovan.

#### Relaterade anropar-ID:n

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=messages), [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=messages), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=messages), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=messages), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=messages), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=messages)

**Ailoot · OpenAI Responses** `POST /v1/responses` `qwen3.8-max`

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=responses)

Alibaba /`qwen3.8-max`

Modell-ID

- `qwen3.8-max`
- `qwen`
- `qwen-latest`
- `qwen-max`
- `qwen3.8-max-preview`

### Start

Qwen3.8-Max är en Qwen-modell för textbaserat resonemang och visuell förståelse. Tillverkaren beskriver en kontext på 1 miljon token, bild- och videoindata, verktygsstödda arbetsflöden och strukturerade textresultat.

Godkända indata

Text · Bilder

Resultat

Text

### Tillgängligt i Ailoot · indata & metoder

**Ailoot · OpenAI Responses** `POST /v1/responses`

Indatatyper

`text`, `image`

Utdatatyper

`text`

Kontext

991 808 tokens

Maximala utdata

131 072 tokens

Utdataformat

json eller SSE

| Fält | Typ | Krav | Värden & gränser | Standard |
| --- | --- | --- | --- | --- |
| Fält`model` | Typ`string` | KravObligatoriskt | Värden & gränser qwen3.8-max | Standard— |
| Fält`input` | Typ`string\|input_item[]` | KravObligatoriskt | Värden & gränser | Standard— |
| Fält`instructions` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`input[].type` | Typ`string` | KravValfritt | Värden & gränser message, reasoning, function\_call, function\_call\_output | Standard— |
| Fält`input[].content` | Typ`string\|content_part[]` | KravValfritt | Värden & gränser | Standard— |
| Fält`input[].call_id` | Typ`string` | KravValfritt | Värden & gränser Gäller när: function\_call\_output; behåll det faktiska returnerade call\_id | Standard— |
| Fält`input[].output` | Typ`string\|content_part[]` | KravValfritt | Värden & gränser Gäller när: function\_call\_output | Standard— |
| Fält`max_output_tokens` | Typ`integer` | KravValfritt | Värden & gränser Minimum: 1 Beror på modellen | Standard— |
| Fält`stream` | Typ`boolean` | KravValfritt | Värden & gränser | Standardfalse |
| Fält`temperature` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`top_p` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools` | Typ`tool[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tool_choice` | Typ`string\|object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`parallel_tool_calls` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning.effort` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning.summary` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`text.format` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`text.verbosity` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`include` | Typ`string[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`store` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`previous_response_id` | Typ`string` | KravValfritt | Värden & gränser ID-krav: Endast ett faktiskt svars-ID från en fortsättning som stöds Beror på modellen | Standard— |
| Fält`service_tier` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`prompt_cache_key` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`prompt_cache_options` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |

Kombinationer av indatamaterial

**Text** · UTF8-text

`indatatext eller en input_text-del`

**Text + bild**

`{type:input_image,image_url}`

Metodparametrar och livscykel

| Parameter | Avtal |
| --- | --- |
| Parameter`material_types` | Avtaltext, image |
| Parameter`required` | Avtalmodel, input |
| Parameter`optional_controls` | Avtalnull |
| Parameter`content_type` | Avtalapplication/json |
| Parameter`text_file_material` | Avtalfaktiskt UTF-8-innehåll infogat som text; fil-ID:n/URLs kräver separat, exakt definierat stöd |

Livscykel: `exact retained published method`

Metodernas strukturer och ID:n är exakta; leverantörens funktioner är åtskilda från att begäran tillåts.

### Priser

#### Priser för Ailoot-metoder

Indata

0,002 US$ */ 1K*

Utdata

0,006 US$ */ 1K*

Cacheläsning

0,00025 US$ */ 1K*

Skrivning till cache

0,0025 US$ */ 1K*

Skrivning till cache, 5 min

0,0025 US$ */ 1K tokens*

code\_interpreter\_call

0,00 US$ *per anrop*

image\_search\_call

0,008 US$ *per anrop*

web\_extractor\_call

0,00 US$ *per anrop*

web\_search\_call

0,01 US$ *per anrop*

web\_search\_image\_call

0,008 US$ *per anrop*

Max. anrop code\_interpreter\_call

8

Max. anrop image\_search\_call

8

Max. anrop web\_extractor\_call

8

Max. anrop web\_search\_call

8

Max. anrop web\_search\_image\_call

8

Ailoot reserverar ett uppskattat belopp före en begäran. Efter resultatet slutregleras avgiften utifrån uppmätt förbrukning. Slutreglering för strömning använder den slutliga förbrukningsposten. [Så fungerar reservation och slutreglering →](https://ailoot.ai/docs/sv/billing/reserve/)

#### Detaljer om referenstariffen

Referensprislistor på modellnivå ändrar inte metodval, prisuppgifter eller avgifter. Aktiva avgifter använder priserna för den valda Ailoot-metoden.

Modellens referensprislistor

#### Priser efter konfiguration

Matcha varje avgift mot de visade villkoren. Använd ett pris för varje uppsättning alternativa konfigurationer.

| Konfiguration | Prislista | Avgift |
| --- | --- | --- |
| KonfigurationOpenAI Chat · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |

### Exempelbegäranden

#### Ailoot · OpenAI Responses

TextexempelIndata, bildPython SDKNode.js SDKPython-strömning

```bash
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
```

```bash
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
```

```python
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"))
```

```js
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);
```

```python
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")
```

### Ta emot och spara resultat

#### Ailoot · OpenAI Responses

json eller SSE

##### Behåll alla färdiga resultat

Behåll varje fullständigt returnerat svar, fil och innehållsdel.

Behåll varje utdatapost och innehållsdel, det faktiska call\_id för funktionen, krypterat resonemang och användningsuppgifter. Bevara vid strömning den fullständiga identiteten för händelsen/posten.

##### Om det ursprungliga svaret behöver kontrolleras

Behåll begärans/svarets ID:n och huvuden. Ingen generell URL för hämtning av textjobb tillhandahålls.

Svarsfält

| Fält | Typ |
| --- | --- |
| Fält`id` | Typstring |
| Fält`status` | Typstring |
| Fält`output[]` | Typmessage\|reasoning\|function\_call\|other item |
| Fält`output[].content[]` | Typcontent part |
| Fält`usage` | Typobject |

Fel och nästa steg

| Svar | Villkor | Nästa steg |
| --- | --- | --- |
| Svar400 · `invalid_request_error` | VillkorOgiltiga obligatoriska fält, ogiltig representation av underlaget eller ogiltigt parametervärde | Nästa stegKorrigera de angivna fälten före en ny begäran om att skapa. |

### Alias

#### Modellalias

<strong>Ailoot</strong> [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=responses), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=responses), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=responses), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=responses), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=responses)
**Ailoot Ultra** [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max)

#### Alias för metodsökvägar

Använd metodsökvägarna som visas ovan.

#### Relaterade anropar-ID:n

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=responses), [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=responses), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=responses), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=responses), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=responses)

**Ailoot · OpenAI Chat** `POST /v1/chat/completions` `qwen3.8-max`

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=chat)

Alibaba /`qwen3.8-max`

Modell-ID

- `qwen3.8-max`
- `qwen`
- `qwen-latest`
- `qwen-max`
- `qwen3.8-max-preview`

### Start

Qwen3.8-Max är en Qwen-modell för textbaserat resonemang och visuell förståelse. Tillverkaren beskriver en kontext på 1 miljon token, bild- och videoindata, verktygsstödda arbetsflöden och strukturerade textresultat.

Godkända indata

Text · Bilder

Resultat

Text

### Tillgängligt i Ailoot · indata & metoder

**Ailoot · OpenAI Chat** `POST /v1/chat/completions`

Indatatyper

`text`, `image`

Utdatatyper

`text`

Kontext

991 808 tokens

Maximala utdata

131 072 tokens

Utdataformat

json eller SSE

| Fält | Typ | Krav | Värden & gränser | Standard |
| --- | --- | --- | --- | --- |
| Fält`model` | Typ`string` | KravObligatoriskt | Värden & gränser qwen3.8-max | Standard— |
| Fält`messages` | Typ`message[]` | KravObligatoriskt | Värden & gränser Minsta antal objekt: 1 | Standard— |
| Fält`messages[].role` | Typ`string` | KravObligatoriskt | Värden & gränser Exempel: system, user, assistant, tool, function Villkor: Dessa roller representeras uttryckligen av källkodens kompatibilitetstyper; den exakta rolluppsättningen är fortfarande modellspecifik. Beror på modellen | Standard— |
| Fält`messages[].content` | Typ`string\|content_part[]\|null` | KravValfritt | Värden & gränser | Standard— |
| Fält`messages[].tool_calls` | Typ`tool_call[]` | KravValfritt | Värden & gränser | Standard— |
| Fält`messages[].tool_call_id` | Typ`string` | KravValfritt | Värden & gränser Gäller när: role=tool; använd det faktiska returnerade ID:t | Standard— |
| Fält`messages[].name` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`messages[].reasoning_content` | Typ`string` | KravValfritt | Värden & gränser Gäller när: Skicka tillbaka det faktiska returnerade resonemanget när modellen använder det | Standard— |
| Fält`messages[].reasoning_details` | Typ`object\|array` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`max_tokens` | Typ`integer` | KravValfritt | Värden & gränser Minimum: 1 Beror på modellen | Standard— |
| Fält`max_completion_tokens` | Typ`integer` | KravValfritt | Värden & gränser Minimum: 1 Beror på modellen | Standard— |
| Fält`stream` | Typ`boolean` | KravValfritt | Värden & gränser | Standardfalse |
| Fält`stream_options.include_usage` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`temperature` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`top_p` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`stop` | Typ`string\|string[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools` | Typ`function_tool[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools[].type` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools[].function.name` | Typ`string` | KravObligatoriskt | Värden & gränser Gäller när: verktyg av typen funktion har tillhandahållits | Standard— |
| Fält`tools[].function.description` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`tools[].function.parameters` | Typ`JSON_schema` | KravValfritt | Värden & gränser | Standard— |
| Fält`tool_choice` | Typ`string\|object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`parallel_tool_calls` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`response_format` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning_effort` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`service_tier` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`instructions` | Typ`string` | KravValfritt | Värden & gränser Kompatibilitetsfält | Standard— |
| Fält`functions` | Typ`function[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`function_call` | Typ`string\|object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`prompt_cache_options` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |

Kombinationer av indatamaterial

**Text** · UTF8-text

`messages[].content`

**Text + bild**

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

Metodparametrar och livscykel

| Parameter | Avtal |
| --- | --- |
| Parameter`material_types` | Avtaltext, image |
| Parameter`required` | Avtalmodel, messages |
| Parameter`optional_controls` | Avtalnull |
| Parameter`content_type` | Avtalapplication/json |
| Parameter`text_file_material` | Avtalfaktiskt UTF-8-innehåll infogat som text; fil-ID:n/URLs kräver separat, exakt definierat stöd |

Livscykel: `exact retained published method`

Metodernas strukturer och ID:n är exakta; leverantörens funktioner är åtskilda från att begäran tillåts.

### Priser

#### Priser för Ailoot-metoder

Indata

0,002 US$ */ 1K*

Utdata

0,006 US$ */ 1K*

Cacheläsning

0,00025 US$ */ 1K*

Skrivning till cache

0,0025 US$ */ 1K*

Skrivning till cache, 5 min

0,0025 US$ */ 1K tokens*

Ailoot reserverar ett uppskattat belopp före en begäran. Efter resultatet slutregleras avgiften utifrån uppmätt förbrukning. Slutreglering för strömning använder den slutliga förbrukningsposten. [Så fungerar reservation och slutreglering →](https://ailoot.ai/docs/sv/billing/reserve/)

#### Detaljer om referenstariffen

Referensprislistor på modellnivå ändrar inte metodval, prisuppgifter eller avgifter. Aktiva avgifter använder priserna för den valda Ailoot-metoden.

Modellens referensprislistor

#### Priser efter konfiguration

Matcha varje avgift mot de visade villkoren. Använd ett pris för varje uppsättning alternativa konfigurationer.

| Konfiguration | Prislista | Avgift |
| --- | --- | --- |
| KonfigurationOpenAI Chat · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |

### Exempelbegäranden

#### Ailoot · OpenAI Chat

TextexempelIndata, bildPython SDKNode.js SDKPython-strömning

```bash
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
```

```bash
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
```

```python
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"))
```

```js
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);
```

```python
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")
```

### Ta emot och spara resultat

#### Ailoot · OpenAI Chat

json eller SSE

##### Behåll alla färdiga resultat

Behåll varje fullständigt returnerat svar, fil och innehållsdel.

Behåll varje svarsalternativ och dess innehåll/verktygsanrop/resonemang. Sätt i SSE samman deltauppdateringar efter svarsalternativets/verktygets index och behåll den slutliga avslutsorsaken och användningsuppgifterna.

##### Om det ursprungliga svaret behöver kontrolleras

Behåll begärans/svarets ID:n och huvuden. Ingen generell URL för hämtning av textjobb tillhandahålls.

Svarsfält

| Fält | Typ |
| --- | --- |
| Fält`choices[].index` | Typinteger |
| Fält`choices[].message.content` | Typstring\|null |
| Fält`choices[].message.tool_calls` | Typtool\_call\[\] |
| Fält`choices[].message.reasoning_content` | Typstring |
| Fält`choices[].message.reasoning_details` | Typobject\|array |
| Fält`choices[].finish_reason` | Typstring\|null |
| Fält`usage` | Typobject |

Fel och nästa steg

| Svar | Villkor | Nästa steg |
| --- | --- | --- |
| Svar400 · `invalid_request_error` | VillkorOgiltiga obligatoriska fält, ogiltig representation av underlaget eller ogiltigt parametervärde | Nästa stegKorrigera de angivna fälten före en ny begäran om att skapa. |

### Alias

#### Modellalias

<strong>Ailoot</strong> [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=chat), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=chat), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=chat), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=chat), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=chat)
**Ailoot Ultra** [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=chat)

#### Alias för metodsökvägar

Använd metodsökvägarna som visas ovan.

#### Relaterade anropar-ID:n

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=chat), [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=chat), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=chat), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=chat), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=chat), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=chat)

**Ailoot Ultra · OpenAI Chat** `POST /v1/chat/completions` `qwen3.8-max`

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=chat)

Alibaba /`qwen3.8-max`

### Start

Qwen3.8-Max är en Qwen-modell för textbaserat resonemang och visuell förståelse. Tillverkaren beskriver en kontext på 1 miljon token, bild- och videoindata, verktygsstödda arbetsflöden och strukturerade textresultat.

Godkända indata

Text

Resultat

Text

### Tillgängligt i Ailoot · indata & metoder

**Ailoot Ultra · OpenAI Chat** `POST /v1/chat/completions`

Indatatyper

`text`

Utdatatyper

`text`

Utdataformat

json eller SSE

| Fält | Typ | Krav | Värden & gränser | Standard |
| --- | --- | --- | --- | --- |
| Fält`model` | Typ`string` | KravObligatoriskt | Värden & gränser qwen3.8-max | Standard— |
| Fält`messages` | Typ`message[]` | KravObligatoriskt | Värden & gränser Minsta antal objekt: 1 | Standard— |
| Fält`messages[].role` | Typ`string` | KravObligatoriskt | Värden & gränser Exempel: system, user, assistant, tool, function Villkor: Dessa roller representeras uttryckligen av källkodens kompatibilitetstyper; den exakta rolluppsättningen är fortfarande modellspecifik. Beror på modellen | Standard— |
| Fält`messages[].content` | Typ`string\|content_part[]\|null` | KravValfritt | Värden & gränser | Standard— |
| Fält`messages[].tool_calls` | Typ`tool_call[]` | KravValfritt | Värden & gränser | Standard— |
| Fält`messages[].tool_call_id` | Typ`string` | KravValfritt | Värden & gränser Gäller när: role=tool; använd det faktiska returnerade ID:t | Standard— |
| Fält`messages[].name` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`messages[].reasoning_content` | Typ`string` | KravValfritt | Värden & gränser Gäller när: Skicka tillbaka det faktiska returnerade resonemanget när modellen använder det | Standard— |
| Fält`messages[].reasoning_details` | Typ`object\|array` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`max_tokens` | Typ`integer` | KravValfritt | Värden & gränser Minimum: 1 Beror på modellen | Standard— |
| Fält`max_completion_tokens` | Typ`integer` | KravValfritt | Värden & gränser Minimum: 1 Beror på modellen | Standard— |
| Fält`stream` | Typ`boolean` | KravValfritt | Värden & gränser | Standardfalse |
| Fält`stream_options.include_usage` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`temperature` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`top_p` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`stop` | Typ`string\|string[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools` | Typ`function_tool[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools[].type` | Typ`string` | KravValfritt | Värden & gränser function Beror på modellen | Standard— |
| Fält`tools[].function.name` | Typ`string` | KravObligatoriskt | Värden & gränser Gäller när: verktyg av typen funktion har tillhandahållits | Standard— |
| Fält`tools[].function.description` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`tools[].function.parameters` | Typ`JSON_schema` | KravValfritt | Värden & gränser | Standard— |
| Fält`tool_choice` | Typ`string\|object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`parallel_tool_calls` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`response_format` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning_effort` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`service_tier` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`instructions` | Typ`string` | KravValfritt | Värden & gränser Kompatibilitetsfält | Standard— |
| Fält`functions` | Typ`function[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`function_call` | Typ`string\|object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`prompt_cache_options` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`modalities` | Typ`string[]` | KravValfritt | Värden & gränser text | Standard— |
| Fält`provider` | Typ`object` | KravValfritt | Värden & gränser Villkor: provider.options avvisas på denna Ultra-textrutt | Standard— |
| Fält`cache_control.ttl` | Typ`string` | KravValfritt | Värden & gränser Villkor: 1h avvisas på de faktiska platserna för promptcache | Standard— |

Kombinationer av indatamaterial

**Text** · UTF8-text

`messages[].content`

Metodparametrar och livscykel

| Parameter | Avtal |
| --- | --- |
| Parameter`content_type` | Avtalapplication/json |
| Parameter`required` | Avtalmodel, messages |
| Parameter`material_types` | Avtaltext |
| Parameter`messages` | Avtalmeddelandearray med strukturen role/content |
| Parameter`file_material` | Avtaldet faktiska UTF-8-dokumentet infogat som bokstavlig text; inget fil-ID härleds |
| Parameter`optional_controls` | Avtalstream, temperature, top\_p, stop, max\_tokens, max\_completion\_tokens, reasoning, response\_format, tools, tool\_choice |
| Parameter`control_scope` | Avtalmodellspecifikt; användarens funktionsverktyg skiljer sig från värdbaserade verktyg |
| Parameter`output_modalities` | Avtaltext |
| Parameter`hosted_operations` | Avtalfalse |
| Parameter`multimodal_input_binding` | Avtalnull |

Livscykel: `synchronous_or_streamed`

Skicka det exakta modell-ID:t tillsammans med messages.

Kontextlängden är inte en utdatagräns.

En textfil kan tillhandahålla bokstavlig text; bild-/ljud-/filobjektsindata kräver exakt bindning.

### Priser

Tariffuppgifter lägger inte till begäransalternativ. Parametrar som stöds anges för den valda metoden.

Snabbt läge

Ej angivet När snabbt läge är valt

Flex-läge

Ej angivet När läget flex är valt

Högsta resonemangsnivå

Ej angivet När den högsta resonemangsnivån använder standardjusteringen (default)

#### Ailoot-priser

#### Priser efter konfiguration

| Konfiguration | Prislista | Avgift |
| --- | --- | --- |
| KonfigurationGrundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |

Ailoot reserverar ett uppskattat belopp före en begäran. Efter resultatet slutregleras avgiften utifrån uppmätt förbrukning. Slutreglering för strömning använder den slutliga förbrukningsposten. [Så fungerar reservation och slutreglering →](https://ailoot.ai/docs/sv/billing/reserve/)

### Exempelbegäranden

#### Ailoot Ultra · OpenAI Chat

curlPython SDKPython-strömning

```bash
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
```

```python
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"))
```

```python
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")
```

### Ta emot och spara resultat

#### Ailoot Ultra · OpenAI Chat

json eller SSE

##### Behåll alla färdiga resultat

Behåll varje fullständigt returnerat svar, fil och innehållsdel.

Behåll varje svarsalternativ och dess innehåll/verktygsanrop/resonemang. Sätt i SSE samman deltauppdateringar efter svarsalternativets/verktygets index och behåll den slutliga avslutsorsaken och användningsuppgifterna.

##### Om det ursprungliga svaret behöver kontrolleras

Behåll begärans/svarets ID:n och huvuden. Ingen generell URL för hämtning av textjobb tillhandahålls.

Svarsfält

| Fält | Typ |
| --- | --- |
| Fält`choices[].index` | Typinteger |
| Fält`choices[].message.content` | Typstring\|null |
| Fält`choices[].message.tool_calls` | Typtool\_call\[\] |
| Fält`choices[].message.reasoning_content` | Typstring |
| Fält`choices[].message.reasoning_details` | Typobject\|array |
| Fält`choices[].finish_reason` | Typstring\|null |
| Fält`usage` | Typobject |

Fel och nästa steg

| Svar | Villkor | Nästa steg |
| --- | --- | --- |
| Svar400 · `invalid_request_error` | VillkorOgiltiga obligatoriska fält, ogiltig representation av underlaget eller ogiltigt parametervärde | Nästa stegKorrigera de angivna fälten före en ny begäran om att skapa. |

### Alias

#### Modellalias

<strong>Ailoot</strong> [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=chat), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=chat), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=chat), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=chat), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=chat)
**Ailoot Ultra** [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=chat)

#### Alias för metodsökvägar

Använd metodsökvägarna som visas ovan.

#### Relaterade anropar-ID:n

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=chat), [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=chat), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=chat), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=chat), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=chat), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=chat)

**Ailoot Ultra · Anthropic Messages** `POST /v1/messages` `qwen3.8-max`

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=messages)

Alibaba /`qwen3.8-max`

### Start

Qwen3.8-Max är en Qwen-modell för textbaserat resonemang och visuell förståelse. Tillverkaren beskriver en kontext på 1 miljon token, bild- och videoindata, verktygsstödda arbetsflöden och strukturerade textresultat.

Godkända indata

Text

Resultat

json · sse

### Tillgängligt i Ailoot · indata & metoder

**Ailoot Ultra · Anthropic Messages** `POST /v1/messages`

Indatatyper

`text`

Utdatatyper

`json`, `sse`

Utdataformat

JSON eller SSE

| Fält | Typ | Krav | Värden & gränser | Standard |
| --- | --- | --- | --- | --- |
| Fält`model` | Typ`string` | KravObligatoriskt | Värden & gränser qwen3.8-max | Standard— |
| Fält`messages` | Typ`message[]` | KravObligatoriskt | Värden & gränser | Standard— |
| Fält`messages[].role` | Typ`string` | KravObligatoriskt | Värden & gränser user, assistant | Standard— |
| Fält`messages[].content` | Typ`string` | KravObligatoriskt | Värden & gränser | Standard— |
| Fält`max_tokens` | Typ`integer` | KravObligatoriskt | Värden & gränser | Standard— |
| Fält`stream` | Typ`boolean` | KravValfritt | Värden & gränser | Standardfalse |

Kombinationer av indatamaterial

**Text** · UTF-8-text

`sträng i messages[].content`

Metodparametrar och livscykel

| Parameter | Avtal |
| --- | --- |
| Parameter`content_type` | Avtalapplication/json |
| Parameter`required` | Avtalmodel, messages, max\_tokens |
| Parameter`optional_controls` | Avtalstream |
| Parameter`material_types` | Avtaltext |
| Parameter`text_file_material` | AvtalLäs det faktiska UTF-8-dokumentet och placera texten i det angivna input-fältet eller i strängen för meddelandets innehåll. |

Livscykel: `synchronous_or_streamed`

### Priser

Tariffuppgifter lägger inte till begäransalternativ. Parametrar som stöds anges för den valda metoden.

Snabbt läge

Ej angivet När snabbt läge är valt

Flex-läge

Ej angivet När läget flex är valt

Högsta resonemangsnivå

Ej angivet När den högsta resonemangsnivån använder standardjusteringen (default)

#### Ailoot-priser

#### Priser efter konfiguration

| Konfiguration | Prislista | Avgift |
| --- | --- | --- |
| KonfigurationGrundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |

Ailoot reserverar ett uppskattat belopp före en begäran. Efter resultatet slutregleras avgiften utifrån uppmätt förbrukning. Slutreglering för strömning använder den slutliga förbrukningsposten. [Så fungerar reservation och slutreglering →](https://ailoot.ai/docs/sv/billing/reserve/)

### Exempelbegäranden

#### Ailoot Ultra · Anthropic Messages

Komplett minimal JSON-kroppcurl · använd ditt UTF-8-dokumentPython · spara hela resultatet

```json
{
  "model": "qwen3.8-max",
  "max_tokens": 128,
  "messages": [
    {
      "role": "user",
      "content": "Summarize the incident report."
    }
  ],
  "stream": false
}
```

```bash
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
```

```python
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))
```

### Ta emot och spara resultat

#### Ailoot Ultra · Anthropic Messages

JSON eller SSE

##### Behåll alla färdiga resultat

Behåll varje fullständigt returnerat svar, fil och innehållsdel.

Behåll alla innehållsblock, resonemangssignaturer och faktiska ID:n för verktygsanvändning. Sätt samman alla SSE-deltauppdateringar för blocken; ett första textblock är inte hela utdata.

##### Om det ursprungliga svaret behöver kontrolleras

Behåll begärans/svarets ID:n och huvuden. Ingen generell URL för hämtning av textjobb tillhandahålls.

Svarsfält

| Fält | Typ |
| --- | --- |
| Fält`id` | Typstring |
| Fält`model` | Typstring |
| Fält`content[]` | Typtext\|thinking\|tool\_use\|other content block |
| Fält`stop_reason` | Typstring\|null |
| Fält`usage` | Typobject |

Fel och nästa steg

| Svar | Villkor | Nästa steg |
| --- | --- | --- |
| Svar400 · `invalid_request_error` | VillkorOgiltiga obligatoriska fält, ogiltig representation av underlaget eller ogiltigt parametervärde | Nästa stegKorrigera de angivna fälten före en ny begäran om att skapa. |

### Alias

#### Modellalias

<strong>Ailoot</strong> [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=messages), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=messages), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=messages), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=messages), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=messages)
**Ailoot Ultra** [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=messages)

#### Alias för metodsökvägar

Använd metodsökvägarna som visas ovan.

#### Relaterade anropar-ID:n

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=messages), [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=messages), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=messages), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=messages), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=messages), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=messages)

**Ailoot · Anthropic Messages** `POST /v1/messages` `qwen`

[`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=messages)

Alibaba /`qwen`

Modell-ID

- `qwen3.8-max`
- `qwen`
- `qwen-latest`
- `qwen-max`
- `qwen3.8-max-preview`

### Start

Qwen3.8-Max är en Qwen-modell för textbaserat resonemang och visuell förståelse. Tillverkaren beskriver en kontext på 1 miljon token, bild- och videoindata, verktygsstödda arbetsflöden och strukturerade textresultat.

Godkända indata

Text · Bilder

Resultat

Text

### Tillgängligt i Ailoot · indata & metoder

**Ailoot · Anthropic Messages** `POST /v1/messages`

Indatatyper

`text`, `image`

Utdatatyper

`text`

Kontext

991 808 tokens

Maximala utdata

131 072 tokens

Utdataformat

json eller SSE

| Fält | Typ | Krav | Värden & gränser | Standard |
| --- | --- | --- | --- | --- |
| Fält`model` | Typ`string` | KravObligatoriskt | Värden & gränser qwen | Standard— |
| Fält`messages` | Typ`message[]` | KravObligatoriskt | Värden & gränser Minsta antal objekt: 1 | Standard— |
| Fält`messages[].role` | Typ`string` | KravObligatoriskt | Värden & gränser user, assistant | Standard— |
| Fält`messages[].content` | Typ`string\|content_block[]` | KravObligatoriskt | Värden & gränser | Standard— |
| Fält`system` | Typ`string\|content_block[]` | KravValfritt | Värden & gränser | Standard— |
| Fält`max_tokens` | Typ`integer` | KravObligatoriskt | Värden & gränser Minimum: 1 Gränsen gäller för: den exakta gränsen för den valda modellen/det valda kortet | Standard— |
| Fält`stream` | Typ`boolean` | KravValfritt | Värden & gränser | Standardfalse |
| Fält`temperature` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`top_p` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`stop_sequences` | Typ`string[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools` | Typ`tool[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools[].name` | Typ`string` | KravValfritt | Värden & gränser Gäller när: verktyg har tillhandahållits | Standard— |
| Fält`tools[].description` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`tools[].input_schema` | Typ`JSON_schema` | KravValfritt | Värden & gränser | Standard— |
| Fält`tool_choice` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`thinking.type` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`thinking.budget_tokens` | Typ`integer` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`output_config.effort` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`metadata` | Typ`object` | KravValfritt | Värden & gränser | Standard— |
| Fält`cache_control` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |

Kombinationer av indatamaterial

**Text** · UTF8-text

`messages[].content eller ett type=text-block`

**Text + bild**

`{type:image,source:{type:base64,media_type,data}} eller källa type=url`

Metodparametrar och livscykel

| Parameter | Avtal |
| --- | --- |
| Parameter`material_types` | Avtaltext, image |
| Parameter`required` | Avtalmodel, messages, max\_tokens |
| Parameter`optional_controls` | Avtalnull |
| Parameter`content_type` | Avtalapplication/json |
| Parameter`text_file_material` | Avtalfaktiskt UTF-8-innehåll infogat som text; fil-ID:n/URLs kräver separat, exakt definierat stöd |

Livscykel: `exact retained published method`

Metodernas strukturer och ID:n är exakta; leverantörens funktioner är åtskilda från att begäran tillåts.

### Priser

#### Priser för Ailoot-metoder

Indata

0,002 US$ */ 1K*

Utdata

0,006 US$ */ 1K*

Cacheläsning

0,00017 US$ */ 1K*

Skrivning till cache

0,0025 US$ */ 1K*

Skrivning till cache, 5 min

0,0025 US$ */ 1K tokens*

Ailoot reserverar ett uppskattat belopp före en begäran. Efter resultatet slutregleras avgiften utifrån uppmätt förbrukning. Slutreglering för strömning använder den slutliga förbrukningsposten. [Så fungerar reservation och slutreglering →](https://ailoot.ai/docs/sv/billing/reserve/)

#### Detaljer om referenstariffen

Referensprislistor på modellnivå ändrar inte metodval, prisuppgifter eller avgifter. Aktiva avgifter använder priserna för den valda Ailoot-metoden.

Modellens referensprislistor

#### Priser efter konfiguration

Matcha varje avgift mot de visade villkoren. Använd ett pris för varje uppsättning alternativa konfigurationer.

| Konfiguration | Prislista | Avgift |
| --- | --- | --- |
| KonfigurationOpenAI Chat · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |

### Exempelbegäranden

#### Ailoot · Anthropic Messages

TextexempelIndata, bildPython SDKNode.js SDKPython-strömning

```bash
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
```

```bash
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
```

```python
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"))
```

```js
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);
```

```python
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")
```

### Ta emot och spara resultat

#### Ailoot · Anthropic Messages

json eller SSE

##### Behåll alla färdiga resultat

Behåll varje fullständigt returnerat svar, fil och innehållsdel.

Behåll alla innehållsblock, resonemangssignaturer och faktiska ID:n för verktygsanvändning. Sätt samman alla SSE-deltauppdateringar för blocken; ett första textblock är inte hela utdata.

##### Om det ursprungliga svaret behöver kontrolleras

Behåll begärans/svarets ID:n och huvuden. Ingen generell URL för hämtning av textjobb tillhandahålls.

Svarsfält

| Fält | Typ |
| --- | --- |
| Fält`id` | Typstring |
| Fält`model` | Typstring |
| Fält`content[]` | Typtext\|thinking\|tool\_use\|other content block |
| Fält`stop_reason` | Typstring\|null |
| Fält`usage` | Typobject |

Fel och nästa steg

| Svar | Villkor | Nästa steg |
| --- | --- | --- |
| Svar400 · `invalid_request_error` | VillkorOgiltiga obligatoriska fält, ogiltig representation av underlaget eller ogiltigt parametervärde | Nästa stegKorrigera de angivna fälten före en ny begäran om att skapa. |

### Alias

#### Modellalias

<strong>Ailoot</strong> [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=messages), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=messages), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=messages), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=messages), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=messages)
**Ailoot Ultra** [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=messages)

#### Alias för metodsökvägar

Använd metodsökvägarna som visas ovan.

#### Relaterade anropar-ID:n

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=messages), [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=messages), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=messages), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=messages), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=messages), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=messages)

**Ailoot · OpenAI Responses** `POST /v1/responses` `qwen`

[`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=responses)

Alibaba /`qwen`

Modell-ID

- `qwen3.8-max`
- `qwen`
- `qwen-latest`
- `qwen-max`
- `qwen3.8-max-preview`

### Start

Qwen3.8-Max är en Qwen-modell för textbaserat resonemang och visuell förståelse. Tillverkaren beskriver en kontext på 1 miljon token, bild- och videoindata, verktygsstödda arbetsflöden och strukturerade textresultat.

Godkända indata

Text · Bilder

Resultat

Text

### Tillgängligt i Ailoot · indata & metoder

**Ailoot · OpenAI Responses** `POST /v1/responses`

Indatatyper

`text`, `image`

Utdatatyper

`text`

Kontext

991 808 tokens

Maximala utdata

131 072 tokens

Utdataformat

json eller SSE

| Fält | Typ | Krav | Värden & gränser | Standard |
| --- | --- | --- | --- | --- |
| Fält`model` | Typ`string` | KravObligatoriskt | Värden & gränser qwen | Standard— |
| Fält`input` | Typ`string\|input_item[]` | KravObligatoriskt | Värden & gränser | Standard— |
| Fält`instructions` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`input[].type` | Typ`string` | KravValfritt | Värden & gränser message, reasoning, function\_call, function\_call\_output | Standard— |
| Fält`input[].content` | Typ`string\|content_part[]` | KravValfritt | Värden & gränser | Standard— |
| Fält`input[].call_id` | Typ`string` | KravValfritt | Värden & gränser Gäller när: function\_call\_output; behåll det faktiska returnerade call\_id | Standard— |
| Fält`input[].output` | Typ`string\|content_part[]` | KravValfritt | Värden & gränser Gäller när: function\_call\_output | Standard— |
| Fält`max_output_tokens` | Typ`integer` | KravValfritt | Värden & gränser Minimum: 1 Beror på modellen | Standard— |
| Fält`stream` | Typ`boolean` | KravValfritt | Värden & gränser | Standardfalse |
| Fält`temperature` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`top_p` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools` | Typ`tool[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tool_choice` | Typ`string\|object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`parallel_tool_calls` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning.effort` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning.summary` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`text.format` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`text.verbosity` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`include` | Typ`string[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`store` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`previous_response_id` | Typ`string` | KravValfritt | Värden & gränser ID-krav: Endast ett faktiskt svars-ID från en fortsättning som stöds Beror på modellen | Standard— |
| Fält`service_tier` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`prompt_cache_key` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`prompt_cache_options` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |

Kombinationer av indatamaterial

**Text** · UTF8-text

`indatatext eller en input_text-del`

**Text + bild**

`{type:input_image,image_url}`

Metodparametrar och livscykel

| Parameter | Avtal |
| --- | --- |
| Parameter`material_types` | Avtaltext, image |
| Parameter`required` | Avtalmodel, input |
| Parameter`optional_controls` | Avtalnull |
| Parameter`content_type` | Avtalapplication/json |
| Parameter`text_file_material` | Avtalfaktiskt UTF-8-innehåll infogat som text; fil-ID:n/URLs kräver separat, exakt definierat stöd |

Livscykel: `exact retained published method`

Metodernas strukturer och ID:n är exakta; leverantörens funktioner är åtskilda från att begäran tillåts.

### Priser

#### Priser för Ailoot-metoder

Indata

0,002 US$ */ 1K*

Utdata

0,006 US$ */ 1K*

Cacheläsning

0,00025 US$ */ 1K*

Skrivning till cache

0,0025 US$ */ 1K*

Skrivning till cache, 5 min

0,0025 US$ */ 1K tokens*

code\_interpreter\_call

0,00 US$ *per anrop*

image\_search\_call

0,008 US$ *per anrop*

web\_extractor\_call

0,00 US$ *per anrop*

web\_search\_call

0,01 US$ *per anrop*

web\_search\_image\_call

0,008 US$ *per anrop*

Max. anrop code\_interpreter\_call

8

Max. anrop image\_search\_call

8

Max. anrop web\_extractor\_call

8

Max. anrop web\_search\_call

8

Max. anrop web\_search\_image\_call

8

Ailoot reserverar ett uppskattat belopp före en begäran. Efter resultatet slutregleras avgiften utifrån uppmätt förbrukning. Slutreglering för strömning använder den slutliga förbrukningsposten. [Så fungerar reservation och slutreglering →](https://ailoot.ai/docs/sv/billing/reserve/)

#### Detaljer om referenstariffen

Referensprislistor på modellnivå ändrar inte metodval, prisuppgifter eller avgifter. Aktiva avgifter använder priserna för den valda Ailoot-metoden.

Modellens referensprislistor

#### Priser efter konfiguration

Matcha varje avgift mot de visade villkoren. Använd ett pris för varje uppsättning alternativa konfigurationer.

| Konfiguration | Prislista | Avgift |
| --- | --- | --- |
| KonfigurationOpenAI Chat · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |

### Exempelbegäranden

#### Ailoot · OpenAI Responses

TextexempelIndata, bildPython SDKNode.js SDKPython-strömning

```bash
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
```

```bash
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
```

```python
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"))
```

```js
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);
```

```python
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")
```

### Ta emot och spara resultat

#### Ailoot · OpenAI Responses

json eller SSE

##### Behåll alla färdiga resultat

Behåll varje fullständigt returnerat svar, fil och innehållsdel.

Behåll varje utdatapost och innehållsdel, det faktiska call\_id för funktionen, krypterat resonemang och användningsuppgifter. Bevara vid strömning den fullständiga identiteten för händelsen/posten.

##### Om det ursprungliga svaret behöver kontrolleras

Behåll begärans/svarets ID:n och huvuden. Ingen generell URL för hämtning av textjobb tillhandahålls.

Svarsfält

| Fält | Typ |
| --- | --- |
| Fält`id` | Typstring |
| Fält`status` | Typstring |
| Fält`output[]` | Typmessage\|reasoning\|function\_call\|other item |
| Fält`output[].content[]` | Typcontent part |
| Fält`usage` | Typobject |

Fel och nästa steg

| Svar | Villkor | Nästa steg |
| --- | --- | --- |
| Svar400 · `invalid_request_error` | VillkorOgiltiga obligatoriska fält, ogiltig representation av underlaget eller ogiltigt parametervärde | Nästa stegKorrigera de angivna fälten före en ny begäran om att skapa. |

### Alias

#### Modellalias

<strong>Ailoot</strong> [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=responses), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=responses), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=responses), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=responses), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=responses)
**Ailoot Ultra** [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max)

#### Alias för metodsökvägar

Använd metodsökvägarna som visas ovan.

#### Relaterade anropar-ID:n

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=responses), [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=responses), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=responses), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=responses), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=responses)

**Ailoot · OpenAI Chat** `POST /v1/chat/completions` `qwen`

[`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=chat)

Alibaba /`qwen`

Modell-ID

- `qwen3.8-max`
- `qwen`
- `qwen-latest`
- `qwen-max`
- `qwen3.8-max-preview`

### Start

Qwen3.8-Max är en Qwen-modell för textbaserat resonemang och visuell förståelse. Tillverkaren beskriver en kontext på 1 miljon token, bild- och videoindata, verktygsstödda arbetsflöden och strukturerade textresultat.

Godkända indata

Text · Bilder

Resultat

Text

### Tillgängligt i Ailoot · indata & metoder

**Ailoot · OpenAI Chat** `POST /v1/chat/completions`

Indatatyper

`text`, `image`

Utdatatyper

`text`

Kontext

991 808 tokens

Maximala utdata

131 072 tokens

Utdataformat

json eller SSE

| Fält | Typ | Krav | Värden & gränser | Standard |
| --- | --- | --- | --- | --- |
| Fält`model` | Typ`string` | KravObligatoriskt | Värden & gränser qwen | Standard— |
| Fält`messages` | Typ`message[]` | KravObligatoriskt | Värden & gränser Minsta antal objekt: 1 | Standard— |
| Fält`messages[].role` | Typ`string` | KravObligatoriskt | Värden & gränser Exempel: system, user, assistant, tool, function Villkor: Dessa roller representeras uttryckligen av källkodens kompatibilitetstyper; den exakta rolluppsättningen är fortfarande modellspecifik. Beror på modellen | Standard— |
| Fält`messages[].content` | Typ`string\|content_part[]\|null` | KravValfritt | Värden & gränser | Standard— |
| Fält`messages[].tool_calls` | Typ`tool_call[]` | KravValfritt | Värden & gränser | Standard— |
| Fält`messages[].tool_call_id` | Typ`string` | KravValfritt | Värden & gränser Gäller när: role=tool; använd det faktiska returnerade ID:t | Standard— |
| Fält`messages[].name` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`messages[].reasoning_content` | Typ`string` | KravValfritt | Värden & gränser Gäller när: Skicka tillbaka det faktiska returnerade resonemanget när modellen använder det | Standard— |
| Fält`messages[].reasoning_details` | Typ`object\|array` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`max_tokens` | Typ`integer` | KravValfritt | Värden & gränser Minimum: 1 Beror på modellen | Standard— |
| Fält`max_completion_tokens` | Typ`integer` | KravValfritt | Värden & gränser Minimum: 1 Beror på modellen | Standard— |
| Fält`stream` | Typ`boolean` | KravValfritt | Värden & gränser | Standardfalse |
| Fält`stream_options.include_usage` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`temperature` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`top_p` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`stop` | Typ`string\|string[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools` | Typ`function_tool[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools[].type` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools[].function.name` | Typ`string` | KravObligatoriskt | Värden & gränser Gäller när: verktyg av typen funktion har tillhandahållits | Standard— |
| Fält`tools[].function.description` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`tools[].function.parameters` | Typ`JSON_schema` | KravValfritt | Värden & gränser | Standard— |
| Fält`tool_choice` | Typ`string\|object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`parallel_tool_calls` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`response_format` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning_effort` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`service_tier` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`instructions` | Typ`string` | KravValfritt | Värden & gränser Kompatibilitetsfält | Standard— |
| Fält`functions` | Typ`function[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`function_call` | Typ`string\|object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`prompt_cache_options` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |

Kombinationer av indatamaterial

**Text** · UTF8-text

`messages[].content`

**Text + bild**

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

Metodparametrar och livscykel

| Parameter | Avtal |
| --- | --- |
| Parameter`material_types` | Avtaltext, image |
| Parameter`required` | Avtalmodel, messages |
| Parameter`optional_controls` | Avtalnull |
| Parameter`content_type` | Avtalapplication/json |
| Parameter`text_file_material` | Avtalfaktiskt UTF-8-innehåll infogat som text; fil-ID:n/URLs kräver separat, exakt definierat stöd |

Livscykel: `exact retained published method`

Metodernas strukturer och ID:n är exakta; leverantörens funktioner är åtskilda från att begäran tillåts.

### Priser

#### Priser för Ailoot-metoder

Indata

0,002 US$ */ 1K*

Utdata

0,006 US$ */ 1K*

Cacheläsning

0,00025 US$ */ 1K*

Skrivning till cache

0,002 US$ */ 1K*

Skrivning till cache, 5 min

0,002 US$ */ 1K tokens*

Ailoot reserverar ett uppskattat belopp före en begäran. Efter resultatet slutregleras avgiften utifrån uppmätt förbrukning. Slutreglering för strömning använder den slutliga förbrukningsposten. [Så fungerar reservation och slutreglering →](https://ailoot.ai/docs/sv/billing/reserve/)

#### Detaljer om referenstariffen

Referensprislistor på modellnivå ändrar inte metodval, prisuppgifter eller avgifter. Aktiva avgifter använder priserna för den valda Ailoot-metoden.

Modellens referensprislistor

#### Priser efter konfiguration

Matcha varje avgift mot de visade villkoren. Använd ett pris för varje uppsättning alternativa konfigurationer.

| Konfiguration | Prislista | Avgift |
| --- | --- | --- |
| KonfigurationOpenAI Chat · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |

### Exempelbegäranden

#### Ailoot · OpenAI Chat

TextexempelIndata, bildPython SDKNode.js SDKPython-strömning

```bash
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
```

```bash
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
```

```python
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"))
```

```js
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);
```

```python
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")
```

### Ta emot och spara resultat

#### Ailoot · OpenAI Chat

json eller SSE

##### Behåll alla färdiga resultat

Behåll varje fullständigt returnerat svar, fil och innehållsdel.

Behåll varje svarsalternativ och dess innehåll/verktygsanrop/resonemang. Sätt i SSE samman deltauppdateringar efter svarsalternativets/verktygets index och behåll den slutliga avslutsorsaken och användningsuppgifterna.

##### Om det ursprungliga svaret behöver kontrolleras

Behåll begärans/svarets ID:n och huvuden. Ingen generell URL för hämtning av textjobb tillhandahålls.

Svarsfält

| Fält | Typ |
| --- | --- |
| Fält`choices[].index` | Typinteger |
| Fält`choices[].message.content` | Typstring\|null |
| Fält`choices[].message.tool_calls` | Typtool\_call\[\] |
| Fält`choices[].message.reasoning_content` | Typstring |
| Fält`choices[].message.reasoning_details` | Typobject\|array |
| Fält`choices[].finish_reason` | Typstring\|null |
| Fält`usage` | Typobject |

Fel och nästa steg

| Svar | Villkor | Nästa steg |
| --- | --- | --- |
| Svar400 · `invalid_request_error` | VillkorOgiltiga obligatoriska fält, ogiltig representation av underlaget eller ogiltigt parametervärde | Nästa stegKorrigera de angivna fälten före en ny begäran om att skapa. |

### Alias

#### Modellalias

<strong>Ailoot</strong> [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=chat), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=chat), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=chat), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=chat), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=chat)
**Ailoot Ultra** [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=chat)

#### Alias för metodsökvägar

Använd metodsökvägarna som visas ovan.

#### Relaterade anropar-ID:n

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=chat), [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=chat), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=chat), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=chat), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=chat), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=chat)

**Ailoot · Anthropic Messages** `POST /v1/messages` `qwen-latest`

[`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=messages)

Alibaba /`qwen-latest`

Modell-ID

- `qwen3.8-max`
- `qwen`
- `qwen-latest`
- `qwen-max`
- `qwen3.8-max-preview`

### Start

Qwen3.8-Max är en Qwen-modell för textbaserat resonemang och visuell förståelse. Tillverkaren beskriver en kontext på 1 miljon token, bild- och videoindata, verktygsstödda arbetsflöden och strukturerade textresultat.

Godkända indata

Text · Bilder

Resultat

Text

### Tillgängligt i Ailoot · indata & metoder

**Ailoot · Anthropic Messages** `POST /v1/messages`

Indatatyper

`text`, `image`

Utdatatyper

`text`

Kontext

991 808 tokens

Maximala utdata

131 072 tokens

Utdataformat

json eller SSE

| Fält | Typ | Krav | Värden & gränser | Standard |
| --- | --- | --- | --- | --- |
| Fält`model` | Typ`string` | KravObligatoriskt | Värden & gränser qwen-latest | Standard— |
| Fält`messages` | Typ`message[]` | KravObligatoriskt | Värden & gränser Minsta antal objekt: 1 | Standard— |
| Fält`messages[].role` | Typ`string` | KravObligatoriskt | Värden & gränser user, assistant | Standard— |
| Fält`messages[].content` | Typ`string\|content_block[]` | KravObligatoriskt | Värden & gränser | Standard— |
| Fält`system` | Typ`string\|content_block[]` | KravValfritt | Värden & gränser | Standard— |
| Fält`max_tokens` | Typ`integer` | KravObligatoriskt | Värden & gränser Minimum: 1 Gränsen gäller för: den exakta gränsen för den valda modellen/det valda kortet | Standard— |
| Fält`stream` | Typ`boolean` | KravValfritt | Värden & gränser | Standardfalse |
| Fält`temperature` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`top_p` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`stop_sequences` | Typ`string[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools` | Typ`tool[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools[].name` | Typ`string` | KravValfritt | Värden & gränser Gäller när: verktyg har tillhandahållits | Standard— |
| Fält`tools[].description` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`tools[].input_schema` | Typ`JSON_schema` | KravValfritt | Värden & gränser | Standard— |
| Fält`tool_choice` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`thinking.type` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`thinking.budget_tokens` | Typ`integer` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`output_config.effort` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`metadata` | Typ`object` | KravValfritt | Värden & gränser | Standard— |
| Fält`cache_control` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |

Kombinationer av indatamaterial

**Text** · UTF8-text

`messages[].content eller ett type=text-block`

**Text + bild**

`{type:image,source:{type:base64,media_type,data}} eller källa type=url`

Metodparametrar och livscykel

| Parameter | Avtal |
| --- | --- |
| Parameter`material_types` | Avtaltext, image |
| Parameter`required` | Avtalmodel, messages, max\_tokens |
| Parameter`optional_controls` | Avtalnull |
| Parameter`content_type` | Avtalapplication/json |
| Parameter`text_file_material` | Avtalfaktiskt UTF-8-innehåll infogat som text; fil-ID:n/URLs kräver separat, exakt definierat stöd |

Livscykel: `exact retained published method`

Metodernas strukturer och ID:n är exakta; leverantörens funktioner är åtskilda från att begäran tillåts.

### Priser

#### Priser för Ailoot-metoder

Indata

0,002 US$ */ 1K*

Utdata

0,006 US$ */ 1K*

Cacheläsning

0,00017 US$ */ 1K*

Skrivning till cache

0,0025 US$ */ 1K*

Skrivning till cache, 5 min

0,0025 US$ */ 1K tokens*

Ailoot reserverar ett uppskattat belopp före en begäran. Efter resultatet slutregleras avgiften utifrån uppmätt förbrukning. Slutreglering för strömning använder den slutliga förbrukningsposten. [Så fungerar reservation och slutreglering →](https://ailoot.ai/docs/sv/billing/reserve/)

#### Detaljer om referenstariffen

Referensprislistor på modellnivå ändrar inte metodval, prisuppgifter eller avgifter. Aktiva avgifter använder priserna för den valda Ailoot-metoden.

Modellens referensprislistor

#### Priser efter konfiguration

Matcha varje avgift mot de visade villkoren. Använd ett pris för varje uppsättning alternativa konfigurationer.

| Konfiguration | Prislista | Avgift |
| --- | --- | --- |
| KonfigurationOpenAI Chat · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |

### Exempelbegäranden

#### Ailoot · Anthropic Messages

TextexempelIndata, bildPython SDKNode.js SDKPython-strömning

```bash
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
```

```bash
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
```

```python
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"))
```

```js
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);
```

```python
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")
```

### Ta emot och spara resultat

#### Ailoot · Anthropic Messages

json eller SSE

##### Behåll alla färdiga resultat

Behåll varje fullständigt returnerat svar, fil och innehållsdel.

Behåll alla innehållsblock, resonemangssignaturer och faktiska ID:n för verktygsanvändning. Sätt samman alla SSE-deltauppdateringar för blocken; ett första textblock är inte hela utdata.

##### Om det ursprungliga svaret behöver kontrolleras

Behåll begärans/svarets ID:n och huvuden. Ingen generell URL för hämtning av textjobb tillhandahålls.

Svarsfält

| Fält | Typ |
| --- | --- |
| Fält`id` | Typstring |
| Fält`model` | Typstring |
| Fält`content[]` | Typtext\|thinking\|tool\_use\|other content block |
| Fält`stop_reason` | Typstring\|null |
| Fält`usage` | Typobject |

Fel och nästa steg

| Svar | Villkor | Nästa steg |
| --- | --- | --- |
| Svar400 · `invalid_request_error` | VillkorOgiltiga obligatoriska fält, ogiltig representation av underlaget eller ogiltigt parametervärde | Nästa stegKorrigera de angivna fälten före en ny begäran om att skapa. |

### Alias

#### Modellalias

<strong>Ailoot</strong> [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=messages), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=messages), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=messages), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=messages), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=messages)
**Ailoot Ultra** [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=messages)

#### Alias för metodsökvägar

Använd metodsökvägarna som visas ovan.

#### Relaterade anropar-ID:n

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=messages), [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=messages), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=messages), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=messages), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=messages), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=messages)

**Ailoot · OpenAI Responses** `POST /v1/responses` `qwen-latest`

[`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=responses)

Alibaba /`qwen-latest`

Modell-ID

- `qwen3.8-max`
- `qwen`
- `qwen-latest`
- `qwen-max`
- `qwen3.8-max-preview`

### Start

Qwen3.8-Max är en Qwen-modell för textbaserat resonemang och visuell förståelse. Tillverkaren beskriver en kontext på 1 miljon token, bild- och videoindata, verktygsstödda arbetsflöden och strukturerade textresultat.

Godkända indata

Text · Bilder

Resultat

Text

### Tillgängligt i Ailoot · indata & metoder

**Ailoot · OpenAI Responses** `POST /v1/responses`

Indatatyper

`text`, `image`

Utdatatyper

`text`

Kontext

991 808 tokens

Maximala utdata

131 072 tokens

Utdataformat

json eller SSE

| Fält | Typ | Krav | Värden & gränser | Standard |
| --- | --- | --- | --- | --- |
| Fält`model` | Typ`string` | KravObligatoriskt | Värden & gränser qwen-latest | Standard— |
| Fält`input` | Typ`string\|input_item[]` | KravObligatoriskt | Värden & gränser | Standard— |
| Fält`instructions` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`input[].type` | Typ`string` | KravValfritt | Värden & gränser message, reasoning, function\_call, function\_call\_output | Standard— |
| Fält`input[].content` | Typ`string\|content_part[]` | KravValfritt | Värden & gränser | Standard— |
| Fält`input[].call_id` | Typ`string` | KravValfritt | Värden & gränser Gäller när: function\_call\_output; behåll det faktiska returnerade call\_id | Standard— |
| Fält`input[].output` | Typ`string\|content_part[]` | KravValfritt | Värden & gränser Gäller när: function\_call\_output | Standard— |
| Fält`max_output_tokens` | Typ`integer` | KravValfritt | Värden & gränser Minimum: 1 Beror på modellen | Standard— |
| Fält`stream` | Typ`boolean` | KravValfritt | Värden & gränser | Standardfalse |
| Fält`temperature` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`top_p` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools` | Typ`tool[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tool_choice` | Typ`string\|object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`parallel_tool_calls` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning.effort` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning.summary` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`text.format` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`text.verbosity` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`include` | Typ`string[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`store` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`previous_response_id` | Typ`string` | KravValfritt | Värden & gränser ID-krav: Endast ett faktiskt svars-ID från en fortsättning som stöds Beror på modellen | Standard— |
| Fält`service_tier` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`prompt_cache_key` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`prompt_cache_options` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |

Kombinationer av indatamaterial

**Text** · UTF8-text

`indatatext eller en input_text-del`

**Text + bild**

`{type:input_image,image_url}`

Metodparametrar och livscykel

| Parameter | Avtal |
| --- | --- |
| Parameter`material_types` | Avtaltext, image |
| Parameter`required` | Avtalmodel, input |
| Parameter`optional_controls` | Avtalnull |
| Parameter`content_type` | Avtalapplication/json |
| Parameter`text_file_material` | Avtalfaktiskt UTF-8-innehåll infogat som text; fil-ID:n/URLs kräver separat, exakt definierat stöd |

Livscykel: `exact retained published method`

Metodernas strukturer och ID:n är exakta; leverantörens funktioner är åtskilda från att begäran tillåts.

### Priser

#### Priser för Ailoot-metoder

Indata

0,002 US$ */ 1K*

Utdata

0,006 US$ */ 1K*

Cacheläsning

0,00025 US$ */ 1K*

Skrivning till cache

0,0025 US$ */ 1K*

Skrivning till cache, 5 min

0,0025 US$ */ 1K tokens*

code\_interpreter\_call

0,00 US$ *per anrop*

image\_search\_call

0,008 US$ *per anrop*

web\_extractor\_call

0,00 US$ *per anrop*

web\_search\_call

0,01 US$ *per anrop*

web\_search\_image\_call

0,008 US$ *per anrop*

Max. anrop code\_interpreter\_call

8

Max. anrop image\_search\_call

8

Max. anrop web\_extractor\_call

8

Max. anrop web\_search\_call

8

Max. anrop web\_search\_image\_call

8

Ailoot reserverar ett uppskattat belopp före en begäran. Efter resultatet slutregleras avgiften utifrån uppmätt förbrukning. Slutreglering för strömning använder den slutliga förbrukningsposten. [Så fungerar reservation och slutreglering →](https://ailoot.ai/docs/sv/billing/reserve/)

#### Detaljer om referenstariffen

Referensprislistor på modellnivå ändrar inte metodval, prisuppgifter eller avgifter. Aktiva avgifter använder priserna för den valda Ailoot-metoden.

Modellens referensprislistor

#### Priser efter konfiguration

Matcha varje avgift mot de visade villkoren. Använd ett pris för varje uppsättning alternativa konfigurationer.

| Konfiguration | Prislista | Avgift |
| --- | --- | --- |
| KonfigurationOpenAI Chat · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |

### Exempelbegäranden

#### Ailoot · OpenAI Responses

TextexempelIndata, bildPython SDKNode.js SDKPython-strömning

```bash
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
```

```bash
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
```

```python
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"))
```

```js
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);
```

```python
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")
```

### Ta emot och spara resultat

#### Ailoot · OpenAI Responses

json eller SSE

##### Behåll alla färdiga resultat

Behåll varje fullständigt returnerat svar, fil och innehållsdel.

Behåll varje utdatapost och innehållsdel, det faktiska call\_id för funktionen, krypterat resonemang och användningsuppgifter. Bevara vid strömning den fullständiga identiteten för händelsen/posten.

##### Om det ursprungliga svaret behöver kontrolleras

Behåll begärans/svarets ID:n och huvuden. Ingen generell URL för hämtning av textjobb tillhandahålls.

Svarsfält

| Fält | Typ |
| --- | --- |
| Fält`id` | Typstring |
| Fält`status` | Typstring |
| Fält`output[]` | Typmessage\|reasoning\|function\_call\|other item |
| Fält`output[].content[]` | Typcontent part |
| Fält`usage` | Typobject |

Fel och nästa steg

| Svar | Villkor | Nästa steg |
| --- | --- | --- |
| Svar400 · `invalid_request_error` | VillkorOgiltiga obligatoriska fält, ogiltig representation av underlaget eller ogiltigt parametervärde | Nästa stegKorrigera de angivna fälten före en ny begäran om att skapa. |

### Alias

#### Modellalias

<strong>Ailoot</strong> [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=responses), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=responses), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=responses), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=responses), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=responses)
**Ailoot Ultra** [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max)

#### Alias för metodsökvägar

Använd metodsökvägarna som visas ovan.

#### Relaterade anropar-ID:n

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=responses), [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=responses), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=responses), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=responses), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=responses)

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

[`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=chat)

Alibaba /`qwen-latest`

Modell-ID

- `qwen3.8-max`
- `qwen`
- `qwen-latest`
- `qwen-max`
- `qwen3.8-max-preview`

### Start

Qwen3.8-Max är en Qwen-modell för textbaserat resonemang och visuell förståelse. Tillverkaren beskriver en kontext på 1 miljon token, bild- och videoindata, verktygsstödda arbetsflöden och strukturerade textresultat.

Godkända indata

Text · Bilder

Resultat

Text

### Tillgängligt i Ailoot · indata & metoder

**Ailoot · OpenAI Chat** `POST /v1/chat/completions`

Indatatyper

`text`, `image`

Utdatatyper

`text`

Kontext

991 808 tokens

Maximala utdata

131 072 tokens

Utdataformat

json eller SSE

| Fält | Typ | Krav | Värden & gränser | Standard |
| --- | --- | --- | --- | --- |
| Fält`model` | Typ`string` | KravObligatoriskt | Värden & gränser qwen-latest | Standard— |
| Fält`messages` | Typ`message[]` | KravObligatoriskt | Värden & gränser Minsta antal objekt: 1 | Standard— |
| Fält`messages[].role` | Typ`string` | KravObligatoriskt | Värden & gränser Exempel: system, user, assistant, tool, function Villkor: Dessa roller representeras uttryckligen av källkodens kompatibilitetstyper; den exakta rolluppsättningen är fortfarande modellspecifik. Beror på modellen | Standard— |
| Fält`messages[].content` | Typ`string\|content_part[]\|null` | KravValfritt | Värden & gränser | Standard— |
| Fält`messages[].tool_calls` | Typ`tool_call[]` | KravValfritt | Värden & gränser | Standard— |
| Fält`messages[].tool_call_id` | Typ`string` | KravValfritt | Värden & gränser Gäller när: role=tool; använd det faktiska returnerade ID:t | Standard— |
| Fält`messages[].name` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`messages[].reasoning_content` | Typ`string` | KravValfritt | Värden & gränser Gäller när: Skicka tillbaka det faktiska returnerade resonemanget när modellen använder det | Standard— |
| Fält`messages[].reasoning_details` | Typ`object\|array` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`max_tokens` | Typ`integer` | KravValfritt | Värden & gränser Minimum: 1 Beror på modellen | Standard— |
| Fält`max_completion_tokens` | Typ`integer` | KravValfritt | Värden & gränser Minimum: 1 Beror på modellen | Standard— |
| Fält`stream` | Typ`boolean` | KravValfritt | Värden & gränser | Standardfalse |
| Fält`stream_options.include_usage` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`temperature` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`top_p` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`stop` | Typ`string\|string[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools` | Typ`function_tool[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools[].type` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools[].function.name` | Typ`string` | KravObligatoriskt | Värden & gränser Gäller när: verktyg av typen funktion har tillhandahållits | Standard— |
| Fält`tools[].function.description` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`tools[].function.parameters` | Typ`JSON_schema` | KravValfritt | Värden & gränser | Standard— |
| Fält`tool_choice` | Typ`string\|object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`parallel_tool_calls` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`response_format` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning_effort` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`service_tier` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`instructions` | Typ`string` | KravValfritt | Värden & gränser Kompatibilitetsfält | Standard— |
| Fält`functions` | Typ`function[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`function_call` | Typ`string\|object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`prompt_cache_options` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |

Kombinationer av indatamaterial

**Text** · UTF8-text

`messages[].content`

**Text + bild**

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

Metodparametrar och livscykel

| Parameter | Avtal |
| --- | --- |
| Parameter`material_types` | Avtaltext, image |
| Parameter`required` | Avtalmodel, messages |
| Parameter`optional_controls` | Avtalnull |
| Parameter`content_type` | Avtalapplication/json |
| Parameter`text_file_material` | Avtalfaktiskt UTF-8-innehåll infogat som text; fil-ID:n/URLs kräver separat, exakt definierat stöd |

Livscykel: `exact retained published method`

Metodernas strukturer och ID:n är exakta; leverantörens funktioner är åtskilda från att begäran tillåts.

### Priser

#### Priser för Ailoot-metoder

Indata

0,002 US$ */ 1K*

Utdata

0,006 US$ */ 1K*

Cacheläsning

0,00025 US$ */ 1K*

Skrivning till cache

0,002 US$ */ 1K*

Skrivning till cache, 5 min

0,002 US$ */ 1K tokens*

Ailoot reserverar ett uppskattat belopp före en begäran. Efter resultatet slutregleras avgiften utifrån uppmätt förbrukning. Slutreglering för strömning använder den slutliga förbrukningsposten. [Så fungerar reservation och slutreglering →](https://ailoot.ai/docs/sv/billing/reserve/)

#### Detaljer om referenstariffen

Referensprislistor på modellnivå ändrar inte metodval, prisuppgifter eller avgifter. Aktiva avgifter använder priserna för den valda Ailoot-metoden.

Modellens referensprislistor

#### Priser efter konfiguration

Matcha varje avgift mot de visade villkoren. Använd ett pris för varje uppsättning alternativa konfigurationer.

| Konfiguration | Prislista | Avgift |
| --- | --- | --- |
| KonfigurationOpenAI Chat · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |

### Exempelbegäranden

#### Ailoot · OpenAI Chat

TextexempelIndata, bildPython SDKNode.js SDKPython-strömning

```bash
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
```

```bash
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
```

```python
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"))
```

```js
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);
```

```python
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")
```

### Ta emot och spara resultat

#### Ailoot · OpenAI Chat

json eller SSE

##### Behåll alla färdiga resultat

Behåll varje fullständigt returnerat svar, fil och innehållsdel.

Behåll varje svarsalternativ och dess innehåll/verktygsanrop/resonemang. Sätt i SSE samman deltauppdateringar efter svarsalternativets/verktygets index och behåll den slutliga avslutsorsaken och användningsuppgifterna.

##### Om det ursprungliga svaret behöver kontrolleras

Behåll begärans/svarets ID:n och huvuden. Ingen generell URL för hämtning av textjobb tillhandahålls.

Svarsfält

| Fält | Typ |
| --- | --- |
| Fält`choices[].index` | Typinteger |
| Fält`choices[].message.content` | Typstring\|null |
| Fält`choices[].message.tool_calls` | Typtool\_call\[\] |
| Fält`choices[].message.reasoning_content` | Typstring |
| Fält`choices[].message.reasoning_details` | Typobject\|array |
| Fält`choices[].finish_reason` | Typstring\|null |
| Fält`usage` | Typobject |

Fel och nästa steg

| Svar | Villkor | Nästa steg |
| --- | --- | --- |
| Svar400 · `invalid_request_error` | VillkorOgiltiga obligatoriska fält, ogiltig representation av underlaget eller ogiltigt parametervärde | Nästa stegKorrigera de angivna fälten före en ny begäran om att skapa. |

### Alias

#### Modellalias

<strong>Ailoot</strong> [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=chat), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=chat), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=chat), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=chat), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=chat)
**Ailoot Ultra** [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=chat)

#### Alias för metodsökvägar

Använd metodsökvägarna som visas ovan.

#### Relaterade anropar-ID:n

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=chat), [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=chat), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=chat), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=chat), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=chat), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=chat)

**Ailoot · Anthropic Messages** `POST /v1/messages` `qwen-max`

[`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=messages)

Alibaba /`qwen-max`

Modell-ID

- `qwen3.8-max`
- `qwen`
- `qwen-latest`
- `qwen-max`
- `qwen3.8-max-preview`

### Start

Qwen3.8-Max är en Qwen-modell för textbaserat resonemang och visuell förståelse. Tillverkaren beskriver en kontext på 1 miljon token, bild- och videoindata, verktygsstödda arbetsflöden och strukturerade textresultat.

Godkända indata

Text · Bilder

Resultat

Text

### Tillgängligt i Ailoot · indata & metoder

**Ailoot · Anthropic Messages** `POST /v1/messages`

Indatatyper

`text`, `image`

Utdatatyper

`text`

Kontext

991 808 tokens

Maximala utdata

131 072 tokens

Utdataformat

json eller SSE

| Fält | Typ | Krav | Värden & gränser | Standard |
| --- | --- | --- | --- | --- |
| Fält`model` | Typ`string` | KravObligatoriskt | Värden & gränser qwen-max | Standard— |
| Fält`messages` | Typ`message[]` | KravObligatoriskt | Värden & gränser Minsta antal objekt: 1 | Standard— |
| Fält`messages[].role` | Typ`string` | KravObligatoriskt | Värden & gränser user, assistant | Standard— |
| Fält`messages[].content` | Typ`string\|content_block[]` | KravObligatoriskt | Värden & gränser | Standard— |
| Fält`system` | Typ`string\|content_block[]` | KravValfritt | Värden & gränser | Standard— |
| Fält`max_tokens` | Typ`integer` | KravObligatoriskt | Värden & gränser Minimum: 1 Gränsen gäller för: den exakta gränsen för den valda modellen/det valda kortet | Standard— |
| Fält`stream` | Typ`boolean` | KravValfritt | Värden & gränser | Standardfalse |
| Fält`temperature` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`top_p` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`stop_sequences` | Typ`string[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools` | Typ`tool[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools[].name` | Typ`string` | KravValfritt | Värden & gränser Gäller när: verktyg har tillhandahållits | Standard— |
| Fält`tools[].description` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`tools[].input_schema` | Typ`JSON_schema` | KravValfritt | Värden & gränser | Standard— |
| Fält`tool_choice` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`thinking.type` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`thinking.budget_tokens` | Typ`integer` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`output_config.effort` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`metadata` | Typ`object` | KravValfritt | Värden & gränser | Standard— |
| Fält`cache_control` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |

Kombinationer av indatamaterial

**Text** · UTF8-text

`messages[].content eller ett type=text-block`

**Text + bild**

`{type:image,source:{type:base64,media_type,data}} eller källa type=url`

Metodparametrar och livscykel

| Parameter | Avtal |
| --- | --- |
| Parameter`material_types` | Avtaltext, image |
| Parameter`required` | Avtalmodel, messages, max\_tokens |
| Parameter`optional_controls` | Avtalnull |
| Parameter`content_type` | Avtalapplication/json |
| Parameter`text_file_material` | Avtalfaktiskt UTF-8-innehåll infogat som text; fil-ID:n/URLs kräver separat, exakt definierat stöd |

Livscykel: `exact retained published method`

Metodernas strukturer och ID:n är exakta; leverantörens funktioner är åtskilda från att begäran tillåts.

### Priser

#### Priser för Ailoot-metoder

Indata

0,002 US$ */ 1K*

Utdata

0,006 US$ */ 1K*

Cacheläsning

0,00017 US$ */ 1K*

Skrivning till cache

0,0025 US$ */ 1K*

Skrivning till cache, 5 min

0,0025 US$ */ 1K tokens*

Ailoot reserverar ett uppskattat belopp före en begäran. Efter resultatet slutregleras avgiften utifrån uppmätt förbrukning. Slutreglering för strömning använder den slutliga förbrukningsposten. [Så fungerar reservation och slutreglering →](https://ailoot.ai/docs/sv/billing/reserve/)

#### Detaljer om referenstariffen

Referensprislistor på modellnivå ändrar inte metodval, prisuppgifter eller avgifter. Aktiva avgifter använder priserna för den valda Ailoot-metoden.

Modellens referensprislistor

#### Priser efter konfiguration

Matcha varje avgift mot de visade villkoren. Använd ett pris för varje uppsättning alternativa konfigurationer.

| Konfiguration | Prislista | Avgift |
| --- | --- | --- |
| KonfigurationOpenAI Chat · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |

### Exempelbegäranden

#### Ailoot · Anthropic Messages

TextexempelIndata, bildPython SDKNode.js SDKPython-strömning

```bash
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
```

```bash
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
```

```python
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"))
```

```js
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);
```

```python
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")
```

### Ta emot och spara resultat

#### Ailoot · Anthropic Messages

json eller SSE

##### Behåll alla färdiga resultat

Behåll varje fullständigt returnerat svar, fil och innehållsdel.

Behåll alla innehållsblock, resonemangssignaturer och faktiska ID:n för verktygsanvändning. Sätt samman alla SSE-deltauppdateringar för blocken; ett första textblock är inte hela utdata.

##### Om det ursprungliga svaret behöver kontrolleras

Behåll begärans/svarets ID:n och huvuden. Ingen generell URL för hämtning av textjobb tillhandahålls.

Svarsfält

| Fält | Typ |
| --- | --- |
| Fält`id` | Typstring |
| Fält`model` | Typstring |
| Fält`content[]` | Typtext\|thinking\|tool\_use\|other content block |
| Fält`stop_reason` | Typstring\|null |
| Fält`usage` | Typobject |

Fel och nästa steg

| Svar | Villkor | Nästa steg |
| --- | --- | --- |
| Svar400 · `invalid_request_error` | VillkorOgiltiga obligatoriska fält, ogiltig representation av underlaget eller ogiltigt parametervärde | Nästa stegKorrigera de angivna fälten före en ny begäran om att skapa. |

### Alias

#### Modellalias

<strong>Ailoot</strong> [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=messages), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=messages), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=messages), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=messages), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=messages)
**Ailoot Ultra** [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=messages)

#### Alias för metodsökvägar

Använd metodsökvägarna som visas ovan.

#### Relaterade anropar-ID:n

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=messages), [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=messages), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=messages), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=messages), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=messages), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=messages)

**Ailoot · OpenAI Responses** `POST /v1/responses` `qwen-max`

[`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=responses)

Alibaba /`qwen-max`

Modell-ID

- `qwen3.8-max`
- `qwen`
- `qwen-latest`
- `qwen-max`
- `qwen3.8-max-preview`

### Start

Qwen3.8-Max är en Qwen-modell för textbaserat resonemang och visuell förståelse. Tillverkaren beskriver en kontext på 1 miljon token, bild- och videoindata, verktygsstödda arbetsflöden och strukturerade textresultat.

Godkända indata

Text · Bilder

Resultat

Text

### Tillgängligt i Ailoot · indata & metoder

**Ailoot · OpenAI Responses** `POST /v1/responses`

Indatatyper

`text`, `image`

Utdatatyper

`text`

Kontext

991 808 tokens

Maximala utdata

131 072 tokens

Utdataformat

json eller SSE

| Fält | Typ | Krav | Värden & gränser | Standard |
| --- | --- | --- | --- | --- |
| Fält`model` | Typ`string` | KravObligatoriskt | Värden & gränser qwen-max | Standard— |
| Fält`input` | Typ`string\|input_item[]` | KravObligatoriskt | Värden & gränser | Standard— |
| Fält`instructions` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`input[].type` | Typ`string` | KravValfritt | Värden & gränser message, reasoning, function\_call, function\_call\_output | Standard— |
| Fält`input[].content` | Typ`string\|content_part[]` | KravValfritt | Värden & gränser | Standard— |
| Fält`input[].call_id` | Typ`string` | KravValfritt | Värden & gränser Gäller när: function\_call\_output; behåll det faktiska returnerade call\_id | Standard— |
| Fält`input[].output` | Typ`string\|content_part[]` | KravValfritt | Värden & gränser Gäller när: function\_call\_output | Standard— |
| Fält`max_output_tokens` | Typ`integer` | KravValfritt | Värden & gränser Minimum: 1 Beror på modellen | Standard— |
| Fält`stream` | Typ`boolean` | KravValfritt | Värden & gränser | Standardfalse |
| Fält`temperature` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`top_p` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools` | Typ`tool[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tool_choice` | Typ`string\|object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`parallel_tool_calls` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning.effort` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning.summary` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`text.format` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`text.verbosity` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`include` | Typ`string[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`store` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`previous_response_id` | Typ`string` | KravValfritt | Värden & gränser ID-krav: Endast ett faktiskt svars-ID från en fortsättning som stöds Beror på modellen | Standard— |
| Fält`service_tier` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`prompt_cache_key` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`prompt_cache_options` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |

Kombinationer av indatamaterial

**Text** · UTF8-text

`indatatext eller en input_text-del`

**Text + bild**

`{type:input_image,image_url}`

Metodparametrar och livscykel

| Parameter | Avtal |
| --- | --- |
| Parameter`material_types` | Avtaltext, image |
| Parameter`required` | Avtalmodel, input |
| Parameter`optional_controls` | Avtalnull |
| Parameter`content_type` | Avtalapplication/json |
| Parameter`text_file_material` | Avtalfaktiskt UTF-8-innehåll infogat som text; fil-ID:n/URLs kräver separat, exakt definierat stöd |

Livscykel: `exact retained published method`

Metodernas strukturer och ID:n är exakta; leverantörens funktioner är åtskilda från att begäran tillåts.

### Priser

#### Priser för Ailoot-metoder

Indata

0,002 US$ */ 1K*

Utdata

0,006 US$ */ 1K*

Cacheläsning

0,00025 US$ */ 1K*

Skrivning till cache

0,0025 US$ */ 1K*

Skrivning till cache, 5 min

0,0025 US$ */ 1K tokens*

code\_interpreter\_call

0,00 US$ *per anrop*

image\_search\_call

0,008 US$ *per anrop*

web\_extractor\_call

0,00 US$ *per anrop*

web\_search\_call

0,01 US$ *per anrop*

web\_search\_image\_call

0,008 US$ *per anrop*

Max. anrop code\_interpreter\_call

8

Max. anrop image\_search\_call

8

Max. anrop web\_extractor\_call

8

Max. anrop web\_search\_call

8

Max. anrop web\_search\_image\_call

8

Ailoot reserverar ett uppskattat belopp före en begäran. Efter resultatet slutregleras avgiften utifrån uppmätt förbrukning. Slutreglering för strömning använder den slutliga förbrukningsposten. [Så fungerar reservation och slutreglering →](https://ailoot.ai/docs/sv/billing/reserve/)

#### Detaljer om referenstariffen

Referensprislistor på modellnivå ändrar inte metodval, prisuppgifter eller avgifter. Aktiva avgifter använder priserna för den valda Ailoot-metoden.

Modellens referensprislistor

#### Priser efter konfiguration

Matcha varje avgift mot de visade villkoren. Använd ett pris för varje uppsättning alternativa konfigurationer.

| Konfiguration | Prislista | Avgift |
| --- | --- | --- |
| KonfigurationOpenAI Chat · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |

### Exempelbegäranden

#### Ailoot · OpenAI Responses

TextexempelIndata, bildPython SDKNode.js SDKPython-strömning

```bash
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
```

```bash
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
```

```python
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"))
```

```js
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);
```

```python
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")
```

### Ta emot och spara resultat

#### Ailoot · OpenAI Responses

json eller SSE

##### Behåll alla färdiga resultat

Behåll varje fullständigt returnerat svar, fil och innehållsdel.

Behåll varje utdatapost och innehållsdel, det faktiska call\_id för funktionen, krypterat resonemang och användningsuppgifter. Bevara vid strömning den fullständiga identiteten för händelsen/posten.

##### Om det ursprungliga svaret behöver kontrolleras

Behåll begärans/svarets ID:n och huvuden. Ingen generell URL för hämtning av textjobb tillhandahålls.

Svarsfält

| Fält | Typ |
| --- | --- |
| Fält`id` | Typstring |
| Fält`status` | Typstring |
| Fält`output[]` | Typmessage\|reasoning\|function\_call\|other item |
| Fält`output[].content[]` | Typcontent part |
| Fält`usage` | Typobject |

Fel och nästa steg

| Svar | Villkor | Nästa steg |
| --- | --- | --- |
| Svar400 · `invalid_request_error` | VillkorOgiltiga obligatoriska fält, ogiltig representation av underlaget eller ogiltigt parametervärde | Nästa stegKorrigera de angivna fälten före en ny begäran om att skapa. |

### Alias

#### Modellalias

<strong>Ailoot</strong> [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=responses), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=responses), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=responses), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=responses), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=responses)
**Ailoot Ultra** [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max)

#### Alias för metodsökvägar

Använd metodsökvägarna som visas ovan.

#### Relaterade anropar-ID:n

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=responses), [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=responses), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=responses), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=responses), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=responses)

**Ailoot · OpenAI Chat** `POST /v1/chat/completions` `qwen-max`

[`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=chat)

Alibaba /`qwen-max`

Modell-ID

- `qwen3.8-max`
- `qwen`
- `qwen-latest`
- `qwen-max`
- `qwen3.8-max-preview`

### Start

Qwen3.8-Max är en Qwen-modell för textbaserat resonemang och visuell förståelse. Tillverkaren beskriver en kontext på 1 miljon token, bild- och videoindata, verktygsstödda arbetsflöden och strukturerade textresultat.

Godkända indata

Text · Bilder

Resultat

Text

### Tillgängligt i Ailoot · indata & metoder

**Ailoot · OpenAI Chat** `POST /v1/chat/completions`

Indatatyper

`text`, `image`

Utdatatyper

`text`

Kontext

991 808 tokens

Maximala utdata

131 072 tokens

Utdataformat

json eller SSE

| Fält | Typ | Krav | Värden & gränser | Standard |
| --- | --- | --- | --- | --- |
| Fält`model` | Typ`string` | KravObligatoriskt | Värden & gränser qwen-max | Standard— |
| Fält`messages` | Typ`message[]` | KravObligatoriskt | Värden & gränser Minsta antal objekt: 1 | Standard— |
| Fält`messages[].role` | Typ`string` | KravObligatoriskt | Värden & gränser Exempel: system, user, assistant, tool, function Villkor: Dessa roller representeras uttryckligen av källkodens kompatibilitetstyper; den exakta rolluppsättningen är fortfarande modellspecifik. Beror på modellen | Standard— |
| Fält`messages[].content` | Typ`string\|content_part[]\|null` | KravValfritt | Värden & gränser | Standard— |
| Fält`messages[].tool_calls` | Typ`tool_call[]` | KravValfritt | Värden & gränser | Standard— |
| Fält`messages[].tool_call_id` | Typ`string` | KravValfritt | Värden & gränser Gäller när: role=tool; använd det faktiska returnerade ID:t | Standard— |
| Fält`messages[].name` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`messages[].reasoning_content` | Typ`string` | KravValfritt | Värden & gränser Gäller när: Skicka tillbaka det faktiska returnerade resonemanget när modellen använder det | Standard— |
| Fält`messages[].reasoning_details` | Typ`object\|array` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`max_tokens` | Typ`integer` | KravValfritt | Värden & gränser Minimum: 1 Beror på modellen | Standard— |
| Fält`max_completion_tokens` | Typ`integer` | KravValfritt | Värden & gränser Minimum: 1 Beror på modellen | Standard— |
| Fält`stream` | Typ`boolean` | KravValfritt | Värden & gränser | Standardfalse |
| Fält`stream_options.include_usage` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`temperature` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`top_p` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`stop` | Typ`string\|string[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools` | Typ`function_tool[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools[].type` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools[].function.name` | Typ`string` | KravObligatoriskt | Värden & gränser Gäller när: verktyg av typen funktion har tillhandahållits | Standard— |
| Fält`tools[].function.description` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`tools[].function.parameters` | Typ`JSON_schema` | KravValfritt | Värden & gränser | Standard— |
| Fält`tool_choice` | Typ`string\|object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`parallel_tool_calls` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`response_format` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning_effort` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`service_tier` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`instructions` | Typ`string` | KravValfritt | Värden & gränser Kompatibilitetsfält | Standard— |
| Fält`functions` | Typ`function[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`function_call` | Typ`string\|object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`prompt_cache_options` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |

Kombinationer av indatamaterial

**Text** · UTF8-text

`messages[].content`

**Text + bild**

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

Metodparametrar och livscykel

| Parameter | Avtal |
| --- | --- |
| Parameter`material_types` | Avtaltext, image |
| Parameter`required` | Avtalmodel, messages |
| Parameter`optional_controls` | Avtalnull |
| Parameter`content_type` | Avtalapplication/json |
| Parameter`text_file_material` | Avtalfaktiskt UTF-8-innehåll infogat som text; fil-ID:n/URLs kräver separat, exakt definierat stöd |

Livscykel: `exact retained published method`

Metodernas strukturer och ID:n är exakta; leverantörens funktioner är åtskilda från att begäran tillåts.

### Priser

#### Priser för Ailoot-metoder

Indata

0,002 US$ */ 1K*

Utdata

0,006 US$ */ 1K*

Cacheläsning

0,00025 US$ */ 1K*

Skrivning till cache

0,0025 US$ */ 1K*

Skrivning till cache, 5 min

0,0025 US$ */ 1K tokens*

Ailoot reserverar ett uppskattat belopp före en begäran. Efter resultatet slutregleras avgiften utifrån uppmätt förbrukning. Slutreglering för strömning använder den slutliga förbrukningsposten. [Så fungerar reservation och slutreglering →](https://ailoot.ai/docs/sv/billing/reserve/)

#### Detaljer om referenstariffen

Referensprislistor på modellnivå ändrar inte metodval, prisuppgifter eller avgifter. Aktiva avgifter använder priserna för den valda Ailoot-metoden.

Modellens referensprislistor

#### Priser efter konfiguration

Matcha varje avgift mot de visade villkoren. Använd ett pris för varje uppsättning alternativa konfigurationer.

| Konfiguration | Prislista | Avgift |
| --- | --- | --- |
| KonfigurationOpenAI Chat · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |

### Exempelbegäranden

#### Ailoot · OpenAI Chat

TextexempelIndata, bildPython SDKNode.js SDKPython-strömning

```bash
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
```

```bash
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
```

```python
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"))
```

```js
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);
```

```python
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")
```

### Ta emot och spara resultat

#### Ailoot · OpenAI Chat

json eller SSE

##### Behåll alla färdiga resultat

Behåll varje fullständigt returnerat svar, fil och innehållsdel.

Behåll varje svarsalternativ och dess innehåll/verktygsanrop/resonemang. Sätt i SSE samman deltauppdateringar efter svarsalternativets/verktygets index och behåll den slutliga avslutsorsaken och användningsuppgifterna.

##### Om det ursprungliga svaret behöver kontrolleras

Behåll begärans/svarets ID:n och huvuden. Ingen generell URL för hämtning av textjobb tillhandahålls.

Svarsfält

| Fält | Typ |
| --- | --- |
| Fält`choices[].index` | Typinteger |
| Fält`choices[].message.content` | Typstring\|null |
| Fält`choices[].message.tool_calls` | Typtool\_call\[\] |
| Fält`choices[].message.reasoning_content` | Typstring |
| Fält`choices[].message.reasoning_details` | Typobject\|array |
| Fält`choices[].finish_reason` | Typstring\|null |
| Fält`usage` | Typobject |

Fel och nästa steg

| Svar | Villkor | Nästa steg |
| --- | --- | --- |
| Svar400 · `invalid_request_error` | VillkorOgiltiga obligatoriska fält, ogiltig representation av underlaget eller ogiltigt parametervärde | Nästa stegKorrigera de angivna fälten före en ny begäran om att skapa. |

### Alias

#### Modellalias

<strong>Ailoot</strong> [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=chat), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=chat), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=chat), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=chat), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=chat)
**Ailoot Ultra** [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=chat)

#### Alias för metodsökvägar

Använd metodsökvägarna som visas ovan.

#### Relaterade anropar-ID:n

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=chat), [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=chat), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=chat), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=chat), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=chat), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=chat)

**Ailoot · Anthropic Messages** `POST /v1/messages` `qwen3.8-max-preview`

[`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=messages)

Alibaba /`qwen3.8-max-preview`

Modell-ID

- `qwen3.8-max`
- `qwen`
- `qwen-latest`
- `qwen-max`
- `qwen3.8-max-preview`

### Start

Qwen3.8-Max är en Qwen-modell för textbaserat resonemang och visuell förståelse. Tillverkaren beskriver en kontext på 1 miljon token, bild- och videoindata, verktygsstödda arbetsflöden och strukturerade textresultat.

Godkända indata

Text · Bilder

Resultat

Text

### Tillgängligt i Ailoot · indata & metoder

**Ailoot · Anthropic Messages** `POST /v1/messages`

Indatatyper

`text`, `image`

Utdatatyper

`text`

Kontext

991 808 tokens

Maximala utdata

131 072 tokens

Utdataformat

json eller SSE

| Fält | Typ | Krav | Värden & gränser | Standard |
| --- | --- | --- | --- | --- |
| Fält`model` | Typ`string` | KravObligatoriskt | Värden & gränser qwen3.8-max-preview | Standard— |
| Fält`messages` | Typ`message[]` | KravObligatoriskt | Värden & gränser Minsta antal objekt: 1 | Standard— |
| Fält`messages[].role` | Typ`string` | KravObligatoriskt | Värden & gränser user, assistant | Standard— |
| Fält`messages[].content` | Typ`string\|content_block[]` | KravObligatoriskt | Värden & gränser | Standard— |
| Fält`system` | Typ`string\|content_block[]` | KravValfritt | Värden & gränser | Standard— |
| Fält`max_tokens` | Typ`integer` | KravObligatoriskt | Värden & gränser Minimum: 1 Gränsen gäller för: den exakta gränsen för den valda modellen/det valda kortet | Standard— |
| Fält`stream` | Typ`boolean` | KravValfritt | Värden & gränser | Standardfalse |
| Fält`temperature` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`top_p` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`stop_sequences` | Typ`string[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools` | Typ`tool[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools[].name` | Typ`string` | KravValfritt | Värden & gränser Gäller när: verktyg har tillhandahållits | Standard— |
| Fält`tools[].description` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`tools[].input_schema` | Typ`JSON_schema` | KravValfritt | Värden & gränser | Standard— |
| Fält`tool_choice` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`thinking.type` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`thinking.budget_tokens` | Typ`integer` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`output_config.effort` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`metadata` | Typ`object` | KravValfritt | Värden & gränser | Standard— |
| Fält`cache_control` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |

Kombinationer av indatamaterial

**Text** · UTF8-text

`messages[].content eller ett type=text-block`

**Text + bild**

`{type:image,source:{type:base64,media_type,data}} eller källa type=url`

Metodparametrar och livscykel

| Parameter | Avtal |
| --- | --- |
| Parameter`material_types` | Avtaltext, image |
| Parameter`required` | Avtalmodel, messages, max\_tokens |
| Parameter`optional_controls` | Avtalnull |
| Parameter`content_type` | Avtalapplication/json |
| Parameter`text_file_material` | Avtalfaktiskt UTF-8-innehåll infogat som text; fil-ID:n/URLs kräver separat, exakt definierat stöd |

Livscykel: `exact retained published method`

Metodernas strukturer och ID:n är exakta; leverantörens funktioner är åtskilda från att begäran tillåts.

### Priser

#### Priser för Ailoot-metoder

Indata

0,002 US$ */ 1K*

Utdata

0,006 US$ */ 1K*

Cacheläsning

0,00017 US$ */ 1K*

Skrivning till cache

0,0025 US$ */ 1K*

Skrivning till cache, 5 min

0,0025 US$ */ 1K tokens*

Ailoot reserverar ett uppskattat belopp före en begäran. Efter resultatet slutregleras avgiften utifrån uppmätt förbrukning. Slutreglering för strömning använder den slutliga förbrukningsposten. [Så fungerar reservation och slutreglering →](https://ailoot.ai/docs/sv/billing/reserve/)

#### Detaljer om referenstariffen

Referensprislistor på modellnivå ändrar inte metodval, prisuppgifter eller avgifter. Aktiva avgifter använder priserna för den valda Ailoot-metoden.

Modellens referensprislistor

#### Priser efter konfiguration

Matcha varje avgift mot de visade villkoren. Använd ett pris för varje uppsättning alternativa konfigurationer.

| Konfiguration | Prislista | Avgift |
| --- | --- | --- |
| KonfigurationOpenAI Chat · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |

### Exempelbegäranden

#### Ailoot · Anthropic Messages

TextexempelIndata, bildPython SDKNode.js SDKPython-strömning

```bash
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
```

```bash
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
```

```python
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"))
```

```js
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);
```

```python
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")
```

### Ta emot och spara resultat

#### Ailoot · Anthropic Messages

json eller SSE

##### Behåll alla färdiga resultat

Behåll varje fullständigt returnerat svar, fil och innehållsdel.

Behåll alla innehållsblock, resonemangssignaturer och faktiska ID:n för verktygsanvändning. Sätt samman alla SSE-deltauppdateringar för blocken; ett första textblock är inte hela utdata.

##### Om det ursprungliga svaret behöver kontrolleras

Behåll begärans/svarets ID:n och huvuden. Ingen generell URL för hämtning av textjobb tillhandahålls.

Svarsfält

| Fält | Typ |
| --- | --- |
| Fält`id` | Typstring |
| Fält`model` | Typstring |
| Fält`content[]` | Typtext\|thinking\|tool\_use\|other content block |
| Fält`stop_reason` | Typstring\|null |
| Fält`usage` | Typobject |

Fel och nästa steg

| Svar | Villkor | Nästa steg |
| --- | --- | --- |
| Svar400 · `invalid_request_error` | VillkorOgiltiga obligatoriska fält, ogiltig representation av underlaget eller ogiltigt parametervärde | Nästa stegKorrigera de angivna fälten före en ny begäran om att skapa. |

### Alias

#### Modellalias

<strong>Ailoot</strong> [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=messages), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=messages), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=messages), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=messages), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=messages)
**Ailoot Ultra** [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=messages)

#### Alias för metodsökvägar

Använd metodsökvägarna som visas ovan.

#### Relaterade anropar-ID:n

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=messages), [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=messages), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=messages), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=messages), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=messages), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=messages)

**Ailoot · OpenAI Responses** `POST /v1/responses` `qwen3.8-max-preview`

[`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=responses)

Alibaba /`qwen3.8-max-preview`

Modell-ID

- `qwen3.8-max`
- `qwen`
- `qwen-latest`
- `qwen-max`
- `qwen3.8-max-preview`

### Start

Qwen3.8-Max är en Qwen-modell för textbaserat resonemang och visuell förståelse. Tillverkaren beskriver en kontext på 1 miljon token, bild- och videoindata, verktygsstödda arbetsflöden och strukturerade textresultat.

Godkända indata

Text · Bilder

Resultat

Text

### Tillgängligt i Ailoot · indata & metoder

**Ailoot · OpenAI Responses** `POST /v1/responses`

Indatatyper

`text`, `image`

Utdatatyper

`text`

Kontext

991 808 tokens

Maximala utdata

131 072 tokens

Utdataformat

json eller SSE

| Fält | Typ | Krav | Värden & gränser | Standard |
| --- | --- | --- | --- | --- |
| Fält`model` | Typ`string` | KravObligatoriskt | Värden & gränser qwen3.8-max-preview | Standard— |
| Fält`input` | Typ`string\|input_item[]` | KravObligatoriskt | Värden & gränser | Standard— |
| Fält`instructions` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`input[].type` | Typ`string` | KravValfritt | Värden & gränser message, reasoning, function\_call, function\_call\_output | Standard— |
| Fält`input[].content` | Typ`string\|content_part[]` | KravValfritt | Värden & gränser | Standard— |
| Fält`input[].call_id` | Typ`string` | KravValfritt | Värden & gränser Gäller när: function\_call\_output; behåll det faktiska returnerade call\_id | Standard— |
| Fält`input[].output` | Typ`string\|content_part[]` | KravValfritt | Värden & gränser Gäller när: function\_call\_output | Standard— |
| Fält`max_output_tokens` | Typ`integer` | KravValfritt | Värden & gränser Minimum: 1 Beror på modellen | Standard— |
| Fält`stream` | Typ`boolean` | KravValfritt | Värden & gränser | Standardfalse |
| Fält`temperature` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`top_p` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools` | Typ`tool[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tool_choice` | Typ`string\|object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`parallel_tool_calls` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning.effort` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning.summary` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`text.format` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`text.verbosity` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`include` | Typ`string[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`store` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`previous_response_id` | Typ`string` | KravValfritt | Värden & gränser ID-krav: Endast ett faktiskt svars-ID från en fortsättning som stöds Beror på modellen | Standard— |
| Fält`service_tier` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`prompt_cache_key` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`prompt_cache_options` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |

Kombinationer av indatamaterial

**Text** · UTF8-text

`indatatext eller en input_text-del`

**Text + bild**

`{type:input_image,image_url}`

Metodparametrar och livscykel

| Parameter | Avtal |
| --- | --- |
| Parameter`material_types` | Avtaltext, image |
| Parameter`required` | Avtalmodel, input |
| Parameter`optional_controls` | Avtalnull |
| Parameter`content_type` | Avtalapplication/json |
| Parameter`text_file_material` | Avtalfaktiskt UTF-8-innehåll infogat som text; fil-ID:n/URLs kräver separat, exakt definierat stöd |

Livscykel: `exact retained published method`

Metodernas strukturer och ID:n är exakta; leverantörens funktioner är åtskilda från att begäran tillåts.

### Priser

#### Priser för Ailoot-metoder

Indata

0,002 US$ */ 1K*

Utdata

0,006 US$ */ 1K*

Cacheläsning

0,00025 US$ */ 1K*

Skrivning till cache

0,0025 US$ */ 1K*

Skrivning till cache, 5 min

0,0025 US$ */ 1K tokens*

code\_interpreter\_call

0,00 US$ *per anrop*

image\_search\_call

0,008 US$ *per anrop*

web\_extractor\_call

0,00 US$ *per anrop*

web\_search\_call

0,01 US$ *per anrop*

web\_search\_image\_call

0,008 US$ *per anrop*

Max. anrop code\_interpreter\_call

8

Max. anrop image\_search\_call

8

Max. anrop web\_extractor\_call

8

Max. anrop web\_search\_call

8

Max. anrop web\_search\_image\_call

8

Ailoot reserverar ett uppskattat belopp före en begäran. Efter resultatet slutregleras avgiften utifrån uppmätt förbrukning. Slutreglering för strömning använder den slutliga förbrukningsposten. [Så fungerar reservation och slutreglering →](https://ailoot.ai/docs/sv/billing/reserve/)

#### Detaljer om referenstariffen

Referensprislistor på modellnivå ändrar inte metodval, prisuppgifter eller avgifter. Aktiva avgifter använder priserna för den valda Ailoot-metoden.

Modellens referensprislistor

#### Priser efter konfiguration

Matcha varje avgift mot de visade villkoren. Använd ett pris för varje uppsättning alternativa konfigurationer.

| Konfiguration | Prislista | Avgift |
| --- | --- | --- |
| KonfigurationOpenAI Chat · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |

### Exempelbegäranden

#### Ailoot · OpenAI Responses

TextexempelIndata, bildPython SDKNode.js SDKPython-strömning

```bash
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
```

```bash
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
```

```python
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"))
```

```js
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);
```

```python
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")
```

### Ta emot och spara resultat

#### Ailoot · OpenAI Responses

json eller SSE

##### Behåll alla färdiga resultat

Behåll varje fullständigt returnerat svar, fil och innehållsdel.

Behåll varje utdatapost och innehållsdel, det faktiska call\_id för funktionen, krypterat resonemang och användningsuppgifter. Bevara vid strömning den fullständiga identiteten för händelsen/posten.

##### Om det ursprungliga svaret behöver kontrolleras

Behåll begärans/svarets ID:n och huvuden. Ingen generell URL för hämtning av textjobb tillhandahålls.

Svarsfält

| Fält | Typ |
| --- | --- |
| Fält`id` | Typstring |
| Fält`status` | Typstring |
| Fält`output[]` | Typmessage\|reasoning\|function\_call\|other item |
| Fält`output[].content[]` | Typcontent part |
| Fält`usage` | Typobject |

Fel och nästa steg

| Svar | Villkor | Nästa steg |
| --- | --- | --- |
| Svar400 · `invalid_request_error` | VillkorOgiltiga obligatoriska fält, ogiltig representation av underlaget eller ogiltigt parametervärde | Nästa stegKorrigera de angivna fälten före en ny begäran om att skapa. |

### Alias

#### Modellalias

<strong>Ailoot</strong> [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=responses), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=responses), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=responses), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=responses), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=responses)
**Ailoot Ultra** [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max)

#### Alias för metodsökvägar

Använd metodsökvägarna som visas ovan.

#### Relaterade anropar-ID:n

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=responses), [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=responses), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=responses), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=responses), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=responses)

**Ailoot · OpenAI Chat** `POST /v1/chat/completions` `qwen3.8-max-preview`

[`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=chat)

Alibaba /`qwen3.8-max-preview`

Modell-ID

- `qwen3.8-max`
- `qwen`
- `qwen-latest`
- `qwen-max`
- `qwen3.8-max-preview`

### Start

Qwen3.8-Max är en Qwen-modell för textbaserat resonemang och visuell förståelse. Tillverkaren beskriver en kontext på 1 miljon token, bild- och videoindata, verktygsstödda arbetsflöden och strukturerade textresultat.

Godkända indata

Text · Bilder

Resultat

Text

### Tillgängligt i Ailoot · indata & metoder

**Ailoot · OpenAI Chat** `POST /v1/chat/completions`

Indatatyper

`text`, `image`

Utdatatyper

`text`

Kontext

991 808 tokens

Maximala utdata

131 072 tokens

Utdataformat

json eller SSE

| Fält | Typ | Krav | Värden & gränser | Standard |
| --- | --- | --- | --- | --- |
| Fält`model` | Typ`string` | KravObligatoriskt | Värden & gränser qwen3.8-max-preview | Standard— |
| Fält`messages` | Typ`message[]` | KravObligatoriskt | Värden & gränser Minsta antal objekt: 1 | Standard— |
| Fält`messages[].role` | Typ`string` | KravObligatoriskt | Värden & gränser Exempel: system, user, assistant, tool, function Villkor: Dessa roller representeras uttryckligen av källkodens kompatibilitetstyper; den exakta rolluppsättningen är fortfarande modellspecifik. Beror på modellen | Standard— |
| Fält`messages[].content` | Typ`string\|content_part[]\|null` | KravValfritt | Värden & gränser | Standard— |
| Fält`messages[].tool_calls` | Typ`tool_call[]` | KravValfritt | Värden & gränser | Standard— |
| Fält`messages[].tool_call_id` | Typ`string` | KravValfritt | Värden & gränser Gäller när: role=tool; använd det faktiska returnerade ID:t | Standard— |
| Fält`messages[].name` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`messages[].reasoning_content` | Typ`string` | KravValfritt | Värden & gränser Gäller när: Skicka tillbaka det faktiska returnerade resonemanget när modellen använder det | Standard— |
| Fält`messages[].reasoning_details` | Typ`object\|array` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`max_tokens` | Typ`integer` | KravValfritt | Värden & gränser Minimum: 1 Beror på modellen | Standard— |
| Fält`max_completion_tokens` | Typ`integer` | KravValfritt | Värden & gränser Minimum: 1 Beror på modellen | Standard— |
| Fält`stream` | Typ`boolean` | KravValfritt | Värden & gränser | Standardfalse |
| Fält`stream_options.include_usage` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`temperature` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`top_p` | Typ`number` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`stop` | Typ`string\|string[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools` | Typ`function_tool[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools[].type` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`tools[].function.name` | Typ`string` | KravObligatoriskt | Värden & gränser Gäller när: verktyg av typen funktion har tillhandahållits | Standard— |
| Fält`tools[].function.description` | Typ`string` | KravValfritt | Värden & gränser | Standard— |
| Fält`tools[].function.parameters` | Typ`JSON_schema` | KravValfritt | Värden & gränser | Standard— |
| Fält`tool_choice` | Typ`string\|object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`parallel_tool_calls` | Typ`boolean` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`response_format` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning_effort` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`reasoning` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`service_tier` | Typ`string` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`instructions` | Typ`string` | KravValfritt | Värden & gränser Kompatibilitetsfält | Standard— |
| Fält`functions` | Typ`function[]` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`function_call` | Typ`string\|object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |
| Fält`prompt_cache_options` | Typ`object` | KravValfritt | Värden & gränser Beror på modellen | Standard— |

Kombinationer av indatamaterial

**Text** · UTF8-text

`messages[].content`

**Text + bild**

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

Metodparametrar och livscykel

| Parameter | Avtal |
| --- | --- |
| Parameter`material_types` | Avtaltext, image |
| Parameter`required` | Avtalmodel, messages |
| Parameter`optional_controls` | Avtalnull |
| Parameter`content_type` | Avtalapplication/json |
| Parameter`text_file_material` | Avtalfaktiskt UTF-8-innehåll infogat som text; fil-ID:n/URLs kräver separat, exakt definierat stöd |

Livscykel: `exact retained published method`

Metodernas strukturer och ID:n är exakta; leverantörens funktioner är åtskilda från att begäran tillåts.

### Priser

#### Priser för Ailoot-metoder

Indata

0,002 US$ */ 1K*

Utdata

0,006 US$ */ 1K*

Cacheläsning

0,00025 US$ */ 1K*

Skrivning till cache

0,0025 US$ */ 1K*

Skrivning till cache, 5 min

0,0025 US$ */ 1K tokens*

Ailoot reserverar ett uppskattat belopp före en begäran. Efter resultatet slutregleras avgiften utifrån uppmätt förbrukning. Slutreglering för strömning använder den slutliga förbrukningsposten. [Så fungerar reservation och slutreglering →](https://ailoot.ai/docs/sv/billing/reserve/)

#### Detaljer om referenstariffen

Referensprislistor på modellnivå ändrar inte metodval, prisuppgifter eller avgifter. Aktiva avgifter använder priserna för den valda Ailoot-metoden.

Modellens referensprislistor

#### Priser efter konfiguration

Matcha varje avgift mot de visade villkoren. Använd ett pris för varje uppsättning alternativa konfigurationer.

| Konfiguration | Prislista | Avgift |
| --- | --- | --- |
| KonfigurationOpenAI Chat · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Grundpriser för token | PrislistaGrundpris | Avgift Indata · Indatatoken **$0.00432** / 1K token Utdata · Utdatatoken **$0.01272** / 1K token Indata · Cacheläsning **$0.000336** / 1K token Indata · Skrivning till cache **$0.00516** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |

### Exempelbegäranden

#### Ailoot · OpenAI Chat

TextexempelIndata, bildPython SDKNode.js SDKPython-strömning

```bash
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
```

```bash
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
```

```python
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"))
```

```js
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);
```

```python
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")
```

### Ta emot och spara resultat

#### Ailoot · OpenAI Chat

json eller SSE

##### Behåll alla färdiga resultat

Behåll varje fullständigt returnerat svar, fil och innehållsdel.

Behåll varje svarsalternativ och dess innehåll/verktygsanrop/resonemang. Sätt i SSE samman deltauppdateringar efter svarsalternativets/verktygets index och behåll den slutliga avslutsorsaken och användningsuppgifterna.

##### Om det ursprungliga svaret behöver kontrolleras

Behåll begärans/svarets ID:n och huvuden. Ingen generell URL för hämtning av textjobb tillhandahålls.

Svarsfält

| Fält | Typ |
| --- | --- |
| Fält`choices[].index` | Typinteger |
| Fält`choices[].message.content` | Typstring\|null |
| Fält`choices[].message.tool_calls` | Typtool\_call\[\] |
| Fält`choices[].message.reasoning_content` | Typstring |
| Fält`choices[].message.reasoning_details` | Typobject\|array |
| Fält`choices[].finish_reason` | Typstring\|null |
| Fält`usage` | Typobject |

Fel och nästa steg

| Svar | Villkor | Nästa steg |
| --- | --- | --- |
| Svar400 · `invalid_request_error` | VillkorOgiltiga obligatoriska fält, ogiltig representation av underlaget eller ogiltigt parametervärde | Nästa stegKorrigera de angivna fälten före en ny begäran om att skapa. |

### Alias

#### Modellalias

<strong>Ailoot</strong> [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=chat), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=chat), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=chat), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=chat), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=chat)
**Ailoot Ultra** [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=chat)

#### Alias för metodsökvägar

Använd metodsökvägarna som visas ovan.

#### Relaterade anropar-ID:n

[`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max&fmt=chat), [`qwen3.8-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Ultra&caller=qwen3.8-max&fmt=chat), [`qwen`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen&fmt=chat), [`qwen-latest`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-latest&fmt=chat), [`qwen-max`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen-max&fmt=chat), [`qwen3.8-max-preview`](https://ailoot.ai/models/sv/#m=qwen3.8-max&route=Core&caller=qwen3.8-max-preview&fmt=chat)

FAQ · qwen3.8-max

Vilka indata och resultat finns?

`POST /v1/messages` · `qwen3.8-max`: `text`, `image` → `text` `POST /v1/responses` · `qwen3.8-max`: `text`, `image` → `text` `POST /v1/chat/completions` · `qwen3.8-max`: `text`, `image` → `text` `POST /v1/chat/completions` · `qwen3.8-max`: `text` → `text` `POST /v1/messages` · `qwen3.8-max`: `text` → `json`, `sse` `POST /v1/messages` · `qwen`: `text`, `image` → `text` `POST /v1/responses` · `qwen`: `text`, `image` → `text` `POST /v1/chat/completions` · `qwen`: `text`, `image` → `text` `POST /v1/messages` · `qwen-latest`: `text`, `image` → `text` `POST /v1/responses` · `qwen-latest`: `text`, `image` → `text` `POST /v1/chat/completions` · `qwen-latest`: `text`, `image` → `text` `POST /v1/messages` · `qwen-max`: `text`, `image` → `text` `POST /v1/responses` · `qwen-max`: `text`, `image` → `text` `POST /v1/chat/completions` · `qwen-max`: `text`, `image` → `text` `POST /v1/messages` · `qwen3.8-max-preview`: `text`, `image` → `text` `POST /v1/responses` · `qwen3.8-max-preview`: `text`, `image` → `text` `POST /v1/chat/completions` · `qwen3.8-max-preview`: `text`, `image` → `text`

Vilka fält använder begäran?

`POST /v1/messages` · `qwen3.8-max`: `model`, `messages`, `system`, `max_tokens`, `stream`, `metadata` `POST /v1/responses` · `qwen3.8-max`: `model`, `input`, `instructions`, `stream` `POST /v1/chat/completions` · `qwen3.8-max`: `model`, `messages`, `stream` `POST /v1/chat/completions` · `qwen3.8-max`: `model`, `messages`, `stream`, `modalities`, `provider` `POST /v1/messages` · `qwen3.8-max`: `model`, `messages`, `max_tokens`, `stream` `POST /v1/messages` · `qwen`: `model`, `messages`, `system`, `max_tokens`, `stream`, `metadata` `POST /v1/responses` · `qwen`: `model`, `input`, `instructions`, `stream` `POST /v1/chat/completions` · `qwen`: `model`, `messages`, `stream` `POST /v1/messages` · `qwen-latest`: `model`, `messages`, `system`, `max_tokens`, `stream`, `metadata` `POST /v1/responses` · `qwen-latest`: `model`, `input`, `instructions`, `stream` `POST /v1/chat/completions` · `qwen-latest`: `model`, `messages`, `stream` `POST /v1/messages` · `qwen-max`: `model`, `messages`, `system`, `max_tokens`, `stream`, `metadata` `POST /v1/responses` · `qwen-max`: `model`, `input`, `instructions`, `stream` `POST /v1/chat/completions` · `qwen-max`: `model`, `messages`, `stream` `POST /v1/messages` · `qwen3.8-max-preview`: `model`, `messages`, `system`, `max_tokens`, `stream`, `metadata` `POST /v1/responses` · `qwen3.8-max-preview`: `model`, `input`, `instructions`, `stream` `POST /v1/chat/completions` · `qwen3.8-max-preview`: `model`, `messages`, `stream`

Vilka gränser gäller?

`POST /v1/messages` · `qwen3.8-max`: `ctx`: `991808`; `max_out`: `131072`; `messages.min_items`: `1`; `max_tokens.minimum`: `1` `POST /v1/responses` · `qwen3.8-max`: `ctx`: `991808`; `max_out`: `131072` `POST /v1/chat/completions` · `qwen3.8-max`: `ctx`: `991808`; `max_out`: `131072`; `messages.min_items`: `1` `POST /v1/chat/completions` · `qwen3.8-max`: `messages.min_items`: `1` `POST /v1/messages` · `qwen`: `ctx`: `991808`; `max_out`: `131072`; `messages.min_items`: `1`; `max_tokens.minimum`: `1` `POST /v1/responses` · `qwen`: `ctx`: `991808`; `max_out`: `131072` `POST /v1/chat/completions` · `qwen`: `ctx`: `991808`; `max_out`: `131072`; `messages.min_items`: `1` `POST /v1/messages` · `qwen-latest`: `ctx`: `991808`; `max_out`: `131072`; `messages.min_items`: `1`; `max_tokens.minimum`: `1` `POST /v1/responses` · `qwen-latest`: `ctx`: `991808`; `max_out`: `131072` `POST /v1/chat/completions` · `qwen-latest`: `ctx`: `991808`; `max_out`: `131072`; `messages.min_items`: `1` `POST /v1/messages` · `qwen-max`: `ctx`: `991808`; `max_out`: `131072`; `messages.min_items`: `1`; `max_tokens.minimum`: `1` `POST /v1/responses` · `qwen-max`: `ctx`: `991808`; `max_out`: `131072` `POST /v1/chat/completions` · `qwen-max`: `ctx`: `991808`; `max_out`: `131072`; `messages.min_items`: `1` `POST /v1/messages` · `qwen3.8-max-preview`: `ctx`: `991808`; `max_out`: `131072`; `messages.min_items`: `1`; `max_tokens.minimum`: `1` `POST /v1/responses` · `qwen3.8-max-preview`: `ctx`: `991808`; `max_out`: `131072` `POST /v1/chat/completions` · `qwen3.8-max-preview`: `ctx`: `991808`; `max_out`: `131072`; `messages.min_items`: `1`

Anslut Ailoot till Claude Code, OpenCode, Hermes eller din app.

## Företaget och dess projektportfölj

Företaget och dess projektportfölj: miljontals kunder; månatlig försäljning för miljarder.

## Köp token med rabatt.

Prenumerationsrabatt för återkommande arbete. Kampanjkoder ger upp till 50% vid tokenköp.

Prenumeration

Välj en rabatterad plan för återkommande anrop.

Kampanjkod upp till 50%

Ange koden vid köpet. Priset räknas om enligt kampanjen.

Kostnader i historiken

Modell, token och belopp sparas för varje anrop.

[Välj prenumeration](https://ailoot.ai/docs/sv/billing/subscriptions/) · [Se modellpriser](https://ailoot.ai/models/sv/)

## Anslut API till produkten som du säljer.

SaaS, appar och botar enligt Ailoots officiella villkor och licensavtal. Begär återförsäljarlicens för vidareförsäljning.

Kommersiell applikation

Bygg text-, bild-, video- och ljudgenerering i tjänstens betalda funktioner.

Återförsäljarlicens

Skicka projektbeskrivning och åtkomstupplägg. Begär skriftliga villkor för användning och vidareförsäljning.

Dokument på webbplatsen

Officiella villkor, licensavtal och databehandlingspolicy finns tillgängliga före anslutning.

[Begär återförsäljarlicens](mailto:support@ailoot.ai) · [Officiella villkor och licensavtal](https://ailoot.ai/legal/offer?lang=sv)

## Ailoot · Företaget och dess projektportfölj





Ailoot bygger på etablerad driftserfarenhet, en stor kundbas, stabil service och löpande KPI-kontroll.





Företaget och dess projektportfölj: miljontals kunder; månatlig försäljning för miljarder.





Ailoot använder denna driftserfarenhet för API-åtkomst till AI-funktioner i kundernas produkter, agenter, applikationer och automatiseringar.
