Source: https://ailoot.ai/models/sv/qwen3-7-plus/
Canonical: https://ailoot.ai/models/sv/qwen3-7-plus/
Language: sv

# Qwen: Qwen3.7 Plus

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

## [Qwen: Qwen3.7 Plus](https://ailoot.ai/models/sv/qwen3-7-plus/)

Qwen3.7 Plus är Alibabas Qwen-modell för text- och bilduppgifter med textsvar. Den publicerade profilen kombinerar en kontext på en miljon token, resonemang, funktionsverktyg och kontroller för strukturerade utdata för assistenter samt dokument- eller visuell analys.

- [**Ailoot · Anthropic Messages** `POST /v1/messages` `qwen3.7-plus`](https://ailoot.ai/models/sv/qwen3-7-plus/#method-0)
- [**Ailoot · OpenAI Responses** `POST /v1/responses` `qwen3.7-plus`](https://ailoot.ai/models/sv/qwen3-7-plus/#method-1)
- [**Ailoot · OpenAI Chat** `POST /v1/chat/completions` `qwen3.7-plus`](https://ailoot.ai/models/sv/qwen3-7-plus/#method-2)
- [**Ailoot Ultra · OpenAI Chat** `POST /v1/chat/completions` `qwen3.7-plus`](https://ailoot.ai/models/sv/qwen3-7-plus/#method-3)
- [**Ailoot Ultra · Anthropic Messages** `POST /v1/messages` `qwen3.7-plus`](https://ailoot.ai/models/sv/qwen3-7-plus/#method-4)
- [**Ailoot · Anthropic Messages** `POST /v1/messages` `qwen-plus`](https://ailoot.ai/models/sv/qwen3-7-plus/#method-5)
- [**Ailoot · OpenAI Responses** `POST /v1/responses` `qwen-plus`](https://ailoot.ai/models/sv/qwen3-7-plus/#method-6)
- [**Ailoot · OpenAI Chat** `POST /v1/chat/completions` `qwen-plus`](https://ailoot.ai/models/sv/qwen3-7-plus/#method-7)
- [**Ailoot Ultra · OpenAI Chat** `POST /v1/chat/completions` `qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/qwen3-7-plus/#method-8)
- [**Ailoot Ultra · Anthropic Messages** `POST /v1/messages` `qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/qwen3-7-plus/#method-9)

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.7 Plus är en modell i Alibabas serie Qwen3.7. Den tar emot text och bilder och returnerar text, vilket kombinerar seriens språkförmågor med visuella indata. Den publicerade profilen anger ett kontextfönster på 1,000,000 token och upp till 131,072 kompletteringstoken, med kontroller för resonemang, verktyg och strukturerade utdata.

#### Kombinera frågan med dess belägg

För en dokumentfråga ska relevant material tillhandahållas och avsnitt eller delar som svaret ska jämföra identifieras. För en visuell uppgift ska en läsbar bild ges och objektet, texten eller gränssnittstillståndet som ska undersökas namnges. En skärmbild kan stödja en fråga om ett fel eller en layout, medan resultatet är en textförklaring eller en uppsättning extraherade fynd.

Märk flera källor så att observationer förblir kopplade till rätt material. En jämförelse kan begära ett fynd per kriterium med källidentifierare. Ett extraktionsunderlag kan definiera fälten som ska returneras och hur saknad information ska visas. Håll ursprungliga belägg tillgängliga när tvetydiga svar granskas.

#### Resonemang, verktyg och resultatstruktur

Hostingmetadata anger resonemangskontroller, funktionsverktyg och strukturerade utdata. Ange det djup uppgiften behöver och definiera operationerna som den omgivande applikationen har tillgång till. Modellen kan föreslå ett verktygsanrop, medan applikationen returnerar den faktiska observationen. Använd observationen som belägg för nästa steg.

För ett resultat som ska användas i programvara ska den nödvändiga formen definieras och både fält och värden valideras. För ett människoläsbart svar ska slutsatsen begäras följd av de belägg som är viktiga för den. Samma källetiketter ska koppla det kortfattade svaret till det längre arbetsmaterialet.

#### Använd den tillgängliga kontexten målmedvetet

Ordna långt material kring den aktuella frågan och lämna plats för svaret. Behåll etablerade beslut och relevanta källdetaljer samtidigt som upprepning som inte längre ändrar svaret tas bort. En användbar slutartefakt är ett textresultat som kan kontrolleras mot tillhandahållna bilder eller avsnitt och föras vidare till nästa applikationssteg.

Praktisk uppgift

### Praktisk uppgift

Tekniskt exempel på engelska

```
Extract milestones with source references

Extract a milestone table from these labeled notes. Design D: prototype review on 12 July, owner Eva. Engineering E: implementation starts after prototype approval; finish date not committed. Support S: help draft due 15 July, owner Leo. Return milestone, owner, date or dependency and source label. Use 'not stated' rather than filling missing ownership or dates.
```

#### Förväntat resultat

```
A source-linked milestone table with explicit dates, dependencies and missing-value markers.
```

#### Kontrollera resultatet

```
Engineering's uncommitted finish date and absent owner remain marked as not stated.
```

**Ailoot · Anthropic Messages** `POST /v1/messages` `qwen3.7-plus`

[`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=messages)

Alibaba /`qwen3.7-plus`

Modell-ID

- `qwen3.7-plus`
- `qwen-plus`

### Start

Qwen3.7 Plus är Alibabas Qwen-modell för text- och bilduppgifter med textsvar. Den publicerade profilen kombinerar en kontext på en miljon token, resonemang, funktionsverktyg och kontroller för strukturerade utdata för assistenter samt dokument- eller visuell analys.

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.7-plus | 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,0004 US$ */ 1K*

Utdata

0,0016 US$ */ 1K*

Cacheläsning

0,00004 US$ */ 1K*

Skrivning till cache

0,0005 US$ */ 1K*

Skrivning till cache, 5 min

0,0005 US$ */ 1K tokens*

#### Priser efter begärans längd · Anthropic Messages

| Begärans storlek i token | Indata | Utdata | Cacheläsning | Skrivning till cache | Cache 5 min | Cache 1 tim |
| --- | --- | --- | --- | --- | --- | --- |
| Begärans storlek i token(0; 256 000\] | Indata0,0004 US$ | Utdata0,0016 US$ | Cacheläsning0,00004 US$ | Skrivning till cache0,0005 US$ | Cache 5 min0,0005 US$ | Cache 1 timBaspris: — |
| Begärans storlek i token(256 000; ∞) | Indata0,0012 US$ | Utdata0,0048 US$ | Cacheläsning≈0,00012 US$ | Skrivning till cache0,0015 US$ | Cache 5 min0,0015 US$ | Cache 1 timBaspris: — |

Priser i USD per 1K token. Om inget pris anges ärvs grundpriset för den här metoden; «—» betyder att inget grundpris har angetts.

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 | Kontexttoken, fler än | Kontexttoken, upp till och med | Avgift |
| --- | --- | --- | --- | --- |
| KonfigurationOpenAI Chat · Grundpriser för token | PrislistaGrundpris | Kontexttoken, fler än— | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationOpenAI Chat · Nivå 1 baserad på begärans längd | Prislista— | Kontexttoken, fler än0 | Kontexttoken, upp till och med256 000 | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationOpenAI Chat · Nivå 2 baserad på begärans längd | Prislista— | Kontexttoken, fler än256 000 | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00192** / 1K token Utdata · Utdatatoken **$0.00768** / 1K token Indata · Cacheläsning **$0.000384** / 1K token Indata · Skrivning till cache **$0.0024** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Grundpriser för token | PrislistaGrundpris | Kontexttoken, fler än— | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Nivå 1 baserad på begärans längd | Prislista— | Kontexttoken, fler än0 | Kontexttoken, upp till och med256 000 | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Nivå 2 baserad på begärans längd | Prislista— | Kontexttoken, fler än256 000 | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00192** / 1K token Utdata · Utdatatoken **$0.00768** / 1K token Indata · Cacheläsning **$0.000384** / 1K token Indata · Skrivning till cache **$0.0024** / 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.7-plus", "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.7-plus", "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.7-plus",
    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.7-plus",
  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.7-plus',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.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=messages), [`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=messages)
**Ailoot Ultra** [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus&fmt=messages), [`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus&fmt=messages)

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

`/chat/completions`

#### Relaterade anropar-ID:n

[`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus&fmt=messages), [`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=messages), [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=messages), [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus&fmt=messages)

**Ailoot · OpenAI Responses** `POST /v1/responses` `qwen3.7-plus`

[`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=responses)

Alibaba /`qwen3.7-plus`

Modell-ID

- `qwen3.7-plus`
- `qwen-plus`

### Start

Qwen3.7 Plus är Alibabas Qwen-modell för text- och bilduppgifter med textsvar. Den publicerade profilen kombinerar en kontext på en miljon token, resonemang, funktionsverktyg och kontroller för strukturerade utdata för assistenter samt dokument- eller visuell analys.

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.7-plus | 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,0004 US$ */ 1K*

Utdata

0,0016 US$ */ 1K*

Cacheläsning

0,00008 US$ */ 1K*

Skrivning till cache

0,0004 US$ */ 1K*

Skrivning till cache, 5 min

0,0004 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

#### Priser efter begärans längd · OpenAI Responses

| Begärans storlek i token | Indata | Utdata | Cacheläsning | Skrivning till cache | Cache 5 min | Cache 1 tim |
| --- | --- | --- | --- | --- | --- | --- |
| Begärans storlek i token(0; 256 000\] | Indata0,0004 US$ | Utdata0,0016 US$ | Cacheläsning0,00008 US$ | Skrivning till cache0,0004 US$ | Cache 5 min0,0004 US$ | Cache 1 timBaspris: — |
| Begärans storlek i token(256 000; ∞) | Indata0,0012 US$ | Utdata0,0048 US$ | Cacheläsning≈0,00024 US$ | Skrivning till cache0,0012 US$ | Cache 5 min0,0012 US$ | Cache 1 timBaspris: — |

Priser i USD per 1K token. Om inget pris anges ärvs grundpriset för den här metoden; «—» betyder att inget grundpris har angetts.

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 | Kontexttoken, fler än | Kontexttoken, upp till och med | Avgift |
| --- | --- | --- | --- | --- |
| KonfigurationOpenAI Chat · Grundpriser för token | PrislistaGrundpris | Kontexttoken, fler än— | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationOpenAI Chat · Nivå 1 baserad på begärans längd | Prislista— | Kontexttoken, fler än0 | Kontexttoken, upp till och med256 000 | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationOpenAI Chat · Nivå 2 baserad på begärans längd | Prislista— | Kontexttoken, fler än256 000 | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00192** / 1K token Utdata · Utdatatoken **$0.00768** / 1K token Indata · Cacheläsning **$0.000384** / 1K token Indata · Skrivning till cache **$0.0024** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Grundpriser för token | PrislistaGrundpris | Kontexttoken, fler än— | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Nivå 1 baserad på begärans längd | Prislista— | Kontexttoken, fler än0 | Kontexttoken, upp till och med256 000 | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Nivå 2 baserad på begärans längd | Prislista— | Kontexttoken, fler än256 000 | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00192** / 1K token Utdata · Utdatatoken **$0.00768** / 1K token Indata · Cacheläsning **$0.000384** / 1K token Indata · Skrivning till cache **$0.0024** / 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.7-plus", "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.7-plus", "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.7-plus", 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.7-plus", 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.7-plus", 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.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=responses), [`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=responses)
**Ailoot Ultra** [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus), [`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus)

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

`/chat/completions`

#### Relaterade anropar-ID:n

[`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus), [`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=responses), [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=responses), [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus)

**Ailoot · OpenAI Chat** `POST /v1/chat/completions` `qwen3.7-plus`

[`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=chat)

Alibaba /`qwen3.7-plus`

Modell-ID

- `qwen3.7-plus`
- `qwen-plus`

### Start

Qwen3.7 Plus är Alibabas Qwen-modell för text- och bilduppgifter med textsvar. Den publicerade profilen kombinerar en kontext på en miljon token, resonemang, funktionsverktyg och kontroller för strukturerade utdata för assistenter samt dokument- eller visuell analys.

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.7-plus | 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,0004 US$ */ 1K*

Utdata

0,0016 US$ */ 1K*

Cacheläsning

0,00008 US$ */ 1K*

Skrivning till cache

0,0004 US$ */ 1K*

Skrivning till cache, 5 min

0,0004 US$ */ 1K tokens*

#### Priser efter begärans längd · OpenAI Chat

| Begärans storlek i token | Indata | Utdata | Cacheläsning | Skrivning till cache | Cache 5 min | Cache 1 tim |
| --- | --- | --- | --- | --- | --- | --- |
| Begärans storlek i token(0; 256 000\] | Indata0,0004 US$ | Utdata0,0016 US$ | Cacheläsning0,00008 US$ | Skrivning till cache0,0004 US$ | Cache 5 min0,0004 US$ | Cache 1 timBaspris: — |
| Begärans storlek i token(256 000; ∞) | Indata0,0012 US$ | Utdata0,0048 US$ | Cacheläsning≈0,00024 US$ | Skrivning till cache0,0012 US$ | Cache 5 min0,0012 US$ | Cache 1 timBaspris: — |

Priser i USD per 1K token. Om inget pris anges ärvs grundpriset för den här metoden; «—» betyder att inget grundpris har angetts.

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 | Kontexttoken, fler än | Kontexttoken, upp till och med | Avgift |
| --- | --- | --- | --- | --- |
| KonfigurationOpenAI Chat · Grundpriser för token | PrislistaGrundpris | Kontexttoken, fler än— | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationOpenAI Chat · Nivå 1 baserad på begärans längd | Prislista— | Kontexttoken, fler än0 | Kontexttoken, upp till och med256 000 | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationOpenAI Chat · Nivå 2 baserad på begärans längd | Prislista— | Kontexttoken, fler än256 000 | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00192** / 1K token Utdata · Utdatatoken **$0.00768** / 1K token Indata · Cacheläsning **$0.000384** / 1K token Indata · Skrivning till cache **$0.0024** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Grundpriser för token | PrislistaGrundpris | Kontexttoken, fler än— | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Nivå 1 baserad på begärans längd | Prislista— | Kontexttoken, fler än0 | Kontexttoken, upp till och med256 000 | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Nivå 2 baserad på begärans längd | Prislista— | Kontexttoken, fler än256 000 | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00192** / 1K token Utdata · Utdatatoken **$0.00768** / 1K token Indata · Cacheläsning **$0.000384** / 1K token Indata · Skrivning till cache **$0.0024** / 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.7-plus", "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.7-plus", "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.7-plus",
    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.7-plus",
  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.7-plus',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.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=chat), [`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=chat)
**Ailoot Ultra** [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus&fmt=chat), [`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus&fmt=chat)

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

`/chat/completions`

#### Relaterade anropar-ID:n

[`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus&fmt=chat), [`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=chat), [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=chat), [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus&fmt=chat)

**Ailoot Ultra · OpenAI Chat** `POST /v1/chat/completions` `qwen3.7-plus`

[`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus&fmt=chat)

Alibaba /`qwen3.7-plus`

Modell-ID

- `qwen3.7-plus`
- `qwen/qwen3.7-plus`

### Start

Qwen3.7 Plus är Alibabas Qwen-modell för text- och bilduppgifter med textsvar. Den publicerade profilen kombinerar en kontext på en miljon token, resonemang, funktionsverktyg och kontroller för strukturerade utdata för assistenter samt dokument- eller visuell analys.

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.7-plus | 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 Beror på modellen | Standard— |
| Fält`messages[].content` | Typ`string` | KravValfritt | Värden & gränser Gäller när: Textsamtal | Standard— |
| Fält`stream` | Typ`boolean` | KravValfritt | Värden & gränser | Standardfalse |

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 |
| Parameter`control_scope` | AvtalTextsamtal; stream är ett booleskt värde och har false som standard. |
| Parameter`output_modalities` | Avtaltext |
| Parameter`hosted_operations` | Avtalfalse |
| Parameter`multimodal_input_binding` | Avtalnull |

Metodalias: `/chat/completions`

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

Standardpris När snabbt läge är valt

Flex-läge

Standardpris När läget flex är valt

Högsta resonemangsnivå

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

#### Ailoot-priser

#### Priser efter konfiguration

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

| Konfiguration | Prislista | Kontexttoken, fler än | Kontexttoken, upp till och med | Avgift |
| --- | --- | --- | --- | --- |
| KonfigurationGrundpriser för token | PrislistaGrundpris | Kontexttoken, fler än— | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationNivå 1 för förfrågans längd | Prislista— | Kontexttoken, fler än0 | Kontexttoken, upp till och med256 000 | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationNivå 2 för förfrågans längd | Prislista— | Kontexttoken, fler än256 000 | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00192** / 1K token Utdata · Utdatatoken **$0.00768** / 1K token Indata · Cacheläsning **$0.000384** / 1K token Indata · Skrivning till cache **$0.0024** / 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 SDK

```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.7-plus","messages":[{"role":"user","content":"hello"}],"stream":false}')

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

```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.7-plus", messages=[{"role":"user","content":"hello"}], stream=False)
import base64, json
from pathlib import Path

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

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

### 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.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=chat), [`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=chat)
**Ailoot Ultra** [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus&fmt=chat), [`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus&fmt=chat)

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

`/chat/completions`

#### Relaterade anropar-ID:n

[`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus&fmt=chat), [`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=chat), [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=chat), [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus&fmt=chat)

**Ailoot Ultra · Anthropic Messages** `POST /v1/messages` `qwen3.7-plus`

[`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus&fmt=messages)

Alibaba /`qwen3.7-plus`

Modell-ID

- `qwen3.7-plus`
- `qwen/qwen3.7-plus`

### Start

Qwen3.7 Plus är Alibabas Qwen-modell för text- och bilduppgifter med textsvar. Den publicerade profilen kombinerar en kontext på en miljon token, resonemang, funktionsverktyg och kontroller för strukturerade utdata för assistenter samt dokument- eller visuell analys.

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

Standardpris När snabbt läge är valt

Flex-läge

Standardpris När läget flex är valt

Högsta resonemangsnivå

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

#### Ailoot-priser

#### Priser efter konfiguration

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

| Konfiguration | Prislista | Kontexttoken, fler än | Kontexttoken, upp till och med | Avgift |
| --- | --- | --- | --- | --- |
| KonfigurationGrundpriser för token | PrislistaGrundpris | Kontexttoken, fler än— | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationNivå 1 för förfrågans längd | Prislista— | Kontexttoken, fler än0 | Kontexttoken, upp till och med256 000 | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationNivå 2 för förfrågans längd | Prislista— | Kontexttoken, fler än256 000 | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00192** / 1K token Utdata · Utdatatoken **$0.00768** / 1K token Indata · Cacheläsning **$0.000384** / 1K token Indata · Skrivning till cache **$0.0024** / 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.7-plus",
  "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.7-plus', '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.7-plus', '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.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=messages), [`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=messages)
**Ailoot Ultra** [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus&fmt=messages), [`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus&fmt=messages)

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

`/chat/completions`

#### Relaterade anropar-ID:n

[`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus&fmt=messages), [`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=messages), [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=messages), [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus&fmt=messages)

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

[`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=messages)

Alibaba /`qwen-plus`

Modell-ID

- `qwen3.7-plus`
- `qwen-plus`

### Start

Qwen3.7 Plus är Alibabas Qwen-modell för text- och bilduppgifter med textsvar. Den publicerade profilen kombinerar en kontext på en miljon token, resonemang, funktionsverktyg och kontroller för strukturerade utdata för assistenter samt dokument- eller visuell analys.

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-plus | 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,0004 US$ */ 1K*

Utdata

0,0016 US$ */ 1K*

Cacheläsning

0,00004 US$ */ 1K*

Skrivning till cache

0,0005 US$ */ 1K*

Skrivning till cache, 5 min

0,0005 US$ */ 1K tokens*

#### Priser efter begärans längd · Anthropic Messages

| Begärans storlek i token | Indata | Utdata | Cacheläsning | Skrivning till cache | Cache 5 min | Cache 1 tim |
| --- | --- | --- | --- | --- | --- | --- |
| Begärans storlek i token(0; 256 000\] | Indata0,0004 US$ | Utdata0,0016 US$ | Cacheläsning0,00004 US$ | Skrivning till cache0,0005 US$ | Cache 5 min0,0005 US$ | Cache 1 timBaspris: — |
| Begärans storlek i token(256 000; ∞) | Indata0,0012 US$ | Utdata0,0048 US$ | Cacheläsning≈0,00012 US$ | Skrivning till cache0,0015 US$ | Cache 5 min0,0015 US$ | Cache 1 timBaspris: — |

Priser i USD per 1K token. Om inget pris anges ärvs grundpriset för den här metoden; «—» betyder att inget grundpris har angetts.

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 | Kontexttoken, fler än | Kontexttoken, upp till och med | Avgift |
| --- | --- | --- | --- | --- |
| KonfigurationOpenAI Chat · Grundpriser för token | PrislistaGrundpris | Kontexttoken, fler än— | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationOpenAI Chat · Nivå 1 baserad på begärans längd | Prislista— | Kontexttoken, fler än0 | Kontexttoken, upp till och med256 000 | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationOpenAI Chat · Nivå 2 baserad på begärans längd | Prislista— | Kontexttoken, fler än256 000 | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00192** / 1K token Utdata · Utdatatoken **$0.00768** / 1K token Indata · Cacheläsning **$0.000384** / 1K token Indata · Skrivning till cache **$0.0024** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Grundpriser för token | PrislistaGrundpris | Kontexttoken, fler än— | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Nivå 1 baserad på begärans längd | Prislista— | Kontexttoken, fler än0 | Kontexttoken, upp till och med256 000 | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Nivå 2 baserad på begärans längd | Prislista— | Kontexttoken, fler än256 000 | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00192** / 1K token Utdata · Utdatatoken **$0.00768** / 1K token Indata · Cacheläsning **$0.000384** / 1K token Indata · Skrivning till cache **$0.0024** / 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-plus", "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-plus", "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-plus",
    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-plus",
  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-plus',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.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=messages), [`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=messages)
**Ailoot Ultra** [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus&fmt=messages), [`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus&fmt=messages)

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

`/chat/completions`

#### Relaterade anropar-ID:n

[`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus&fmt=messages), [`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=messages), [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=messages), [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus&fmt=messages)

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

[`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=responses)

Alibaba /`qwen-plus`

Modell-ID

- `qwen3.7-plus`
- `qwen-plus`

### Start

Qwen3.7 Plus är Alibabas Qwen-modell för text- och bilduppgifter med textsvar. Den publicerade profilen kombinerar en kontext på en miljon token, resonemang, funktionsverktyg och kontroller för strukturerade utdata för assistenter samt dokument- eller visuell analys.

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-plus | 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,0004 US$ */ 1K*

Utdata

0,0016 US$ */ 1K*

Cacheläsning

0,00008 US$ */ 1K*

Skrivning till cache

0,0004 US$ */ 1K*

Skrivning till cache, 5 min

0,0004 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

#### Priser efter begärans längd · OpenAI Responses

| Begärans storlek i token | Indata | Utdata | Cacheläsning | Skrivning till cache | Cache 5 min | Cache 1 tim |
| --- | --- | --- | --- | --- | --- | --- |
| Begärans storlek i token(0; 256 000\] | Indata0,0004 US$ | Utdata0,0016 US$ | Cacheläsning0,00008 US$ | Skrivning till cache0,0004 US$ | Cache 5 min0,0004 US$ | Cache 1 timBaspris: — |
| Begärans storlek i token(256 000; ∞) | Indata0,0012 US$ | Utdata0,0048 US$ | Cacheläsning≈0,00024 US$ | Skrivning till cache0,0012 US$ | Cache 5 min0,0012 US$ | Cache 1 timBaspris: — |

Priser i USD per 1K token. Om inget pris anges ärvs grundpriset för den här metoden; «—» betyder att inget grundpris har angetts.

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 | Kontexttoken, fler än | Kontexttoken, upp till och med | Avgift |
| --- | --- | --- | --- | --- |
| KonfigurationOpenAI Chat · Grundpriser för token | PrislistaGrundpris | Kontexttoken, fler än— | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationOpenAI Chat · Nivå 1 baserad på begärans längd | Prislista— | Kontexttoken, fler än0 | Kontexttoken, upp till och med256 000 | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationOpenAI Chat · Nivå 2 baserad på begärans längd | Prislista— | Kontexttoken, fler än256 000 | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00192** / 1K token Utdata · Utdatatoken **$0.00768** / 1K token Indata · Cacheläsning **$0.000384** / 1K token Indata · Skrivning till cache **$0.0024** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Grundpriser för token | PrislistaGrundpris | Kontexttoken, fler än— | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Nivå 1 baserad på begärans längd | Prislista— | Kontexttoken, fler än0 | Kontexttoken, upp till och med256 000 | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Nivå 2 baserad på begärans längd | Prislista— | Kontexttoken, fler än256 000 | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00192** / 1K token Utdata · Utdatatoken **$0.00768** / 1K token Indata · Cacheläsning **$0.000384** / 1K token Indata · Skrivning till cache **$0.0024** / 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-plus", "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-plus", "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-plus", 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-plus", 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-plus", 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.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=responses), [`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=responses)
**Ailoot Ultra** [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus), [`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus)

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

`/chat/completions`

#### Relaterade anropar-ID:n

[`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus), [`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=responses), [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=responses), [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus)

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

[`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=chat)

Alibaba /`qwen-plus`

Modell-ID

- `qwen3.7-plus`
- `qwen-plus`

### Start

Qwen3.7 Plus är Alibabas Qwen-modell för text- och bilduppgifter med textsvar. Den publicerade profilen kombinerar en kontext på en miljon token, resonemang, funktionsverktyg och kontroller för strukturerade utdata för assistenter samt dokument- eller visuell analys.

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-plus | 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,0004 US$ */ 1K*

Utdata

0,0016 US$ */ 1K*

Cacheläsning

0,00008 US$ */ 1K*

Skrivning till cache

0,0004 US$ */ 1K*

Skrivning till cache, 5 min

0,0004 US$ */ 1K tokens*

#### Priser efter begärans längd · OpenAI Chat

| Begärans storlek i token | Indata | Utdata | Cacheläsning | Skrivning till cache | Cache 5 min | Cache 1 tim |
| --- | --- | --- | --- | --- | --- | --- |
| Begärans storlek i token(0; 256 000\] | Indata0,0004 US$ | Utdata0,0016 US$ | Cacheläsning0,00008 US$ | Skrivning till cache0,0004 US$ | Cache 5 min0,0004 US$ | Cache 1 timBaspris: — |
| Begärans storlek i token(256 000; ∞) | Indata0,0012 US$ | Utdata0,0048 US$ | Cacheläsning≈0,00024 US$ | Skrivning till cache0,0012 US$ | Cache 5 min0,0012 US$ | Cache 1 timBaspris: — |

Priser i USD per 1K token. Om inget pris anges ärvs grundpriset för den här metoden; «—» betyder att inget grundpris har angetts.

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 | Kontexttoken, fler än | Kontexttoken, upp till och med | Avgift |
| --- | --- | --- | --- | --- |
| KonfigurationOpenAI Chat · Grundpriser för token | PrislistaGrundpris | Kontexttoken, fler än— | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationOpenAI Chat · Nivå 1 baserad på begärans längd | Prislista— | Kontexttoken, fler än0 | Kontexttoken, upp till och med256 000 | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationOpenAI Chat · Nivå 2 baserad på begärans längd | Prislista— | Kontexttoken, fler än256 000 | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00192** / 1K token Utdata · Utdatatoken **$0.00768** / 1K token Indata · Cacheläsning **$0.000384** / 1K token Indata · Skrivning till cache **$0.0024** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Grundpriser för token | PrislistaGrundpris | Kontexttoken, fler än— | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Nivå 1 baserad på begärans längd | Prislista— | Kontexttoken, fler än0 | Kontexttoken, upp till och med256 000 | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationAnthropic Messages · Nivå 2 baserad på begärans längd | Prislista— | Kontexttoken, fler än256 000 | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00192** / 1K token Utdata · Utdatatoken **$0.00768** / 1K token Indata · Cacheläsning **$0.000384** / 1K token Indata · Skrivning till cache **$0.0024** / 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-plus", "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-plus", "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-plus",
    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-plus",
  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-plus',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.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=chat), [`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=chat)
**Ailoot Ultra** [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus&fmt=chat), [`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus&fmt=chat)

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

`/chat/completions`

#### Relaterade anropar-ID:n

[`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus&fmt=chat), [`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=chat), [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=chat), [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus&fmt=chat)

**Ailoot Ultra · OpenAI Chat** `POST /v1/chat/completions` `qwen/qwen3.7-plus`

[`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus&fmt=chat)

Alibaba /`qwen/qwen3.7-plus`

Modell-ID

- `qwen3.7-plus`
- `qwen/qwen3.7-plus`

### Start

Qwen3.7 Plus är Alibabas Qwen-modell för text- och bilduppgifter med textsvar. Den publicerade profilen kombinerar en kontext på en miljon token, resonemang, funktionsverktyg och kontroller för strukturerade utdata för assistenter samt dokument- eller visuell analys.

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 qwen/qwen3.7-plus | 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

Standardpris När snabbt läge är valt

Flex-läge

Standardpris När läget flex är valt

Högsta resonemangsnivå

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

#### Ailoot-priser

#### Priser efter konfiguration

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

| Konfiguration | Prislista | Kontexttoken, fler än | Kontexttoken, upp till och med | Avgift |
| --- | --- | --- | --- | --- |
| KonfigurationGrundpriser för token | PrislistaGrundpris | Kontexttoken, fler än— | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationNivå 1 för förfrågans längd | Prislista— | Kontexttoken, fler än0 | Kontexttoken, upp till och med256 000 | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationNivå 2 för förfrågans längd | Prislista— | Kontexttoken, fler än256 000 | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00192** / 1K token Utdata · Utdatatoken **$0.00768** / 1K token Indata · Cacheläsning **$0.000384** / 1K token Indata · Skrivning till cache **$0.0024** / 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": "qwen/qwen3.7-plus", "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='qwen/qwen3.7-plus',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='qwen/qwen3.7-plus',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.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=chat), [`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=chat)
**Ailoot Ultra** [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus&fmt=chat), [`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus&fmt=chat)

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

`/chat/completions`

#### Relaterade anropar-ID:n

[`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus&fmt=chat), [`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=chat), [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=chat), [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus&fmt=chat)

**Ailoot Ultra · Anthropic Messages** `POST /v1/messages` `qwen/qwen3.7-plus`

[`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus&fmt=messages)

Alibaba /`qwen/qwen3.7-plus`

Modell-ID

- `qwen3.7-plus`
- `qwen/qwen3.7-plus`

### Start

Qwen3.7 Plus är Alibabas Qwen-modell för text- och bilduppgifter med textsvar. Den publicerade profilen kombinerar en kontext på en miljon token, resonemang, funktionsverktyg och kontroller för strukturerade utdata för assistenter samt dokument- eller visuell analys.

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 qwen/qwen3.7-plus | 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

Standardpris När snabbt läge är valt

Flex-läge

Standardpris När läget flex är valt

Högsta resonemangsnivå

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

#### Ailoot-priser

#### Priser efter konfiguration

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

| Konfiguration | Prislista | Kontexttoken, fler än | Kontexttoken, upp till och med | Avgift |
| --- | --- | --- | --- | --- |
| KonfigurationGrundpriser för token | PrislistaGrundpris | Kontexttoken, fler än— | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationNivå 1 för förfrågans längd | Prislista— | Kontexttoken, fler än0 | Kontexttoken, upp till och med256 000 | Avgift Indata · Indatatoken **$0.00064** / 1K token Utdata · Utdatatoken **$0.00256** / 1K token Indata · Cacheläsning **$0.000128** / 1K token Indata · Skrivning till cache **$0.0008** / 1K token Indata · Skrivning till cache, 1 tim **—** / 1K token |
| KonfigurationNivå 2 för förfrågans längd | Prislista— | Kontexttoken, fler än256 000 | Kontexttoken, upp till och medIngen övre gräns | Avgift Indata · Indatatoken **$0.00192** / 1K token Utdata · Utdatatoken **$0.00768** / 1K token Indata · Cacheläsning **$0.000384** / 1K token Indata · Skrivning till cache **$0.0024** / 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": "qwen/qwen3.7-plus",
  "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': 'qwen/qwen3.7-plus', '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': 'qwen/qwen3.7-plus', '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.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=messages), [`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=messages)
**Ailoot Ultra** [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus&fmt=messages), [`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus&fmt=messages)

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

`/chat/completions`

#### Relaterade anropar-ID:n

[`qwen/qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen%2Fqwen3.7-plus&fmt=messages), [`qwen-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen-plus&fmt=messages), [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=messages), [`qwen3.7-plus`](https://ailoot.ai/models/sv/#m=qwen%2Fqwen3.7-plus&route=Ultra&caller=qwen3.7-plus&fmt=messages)

FAQ · Qwen: Qwen3.7 Plus

Vilka indata och resultat finns?

`POST /v1/messages` · `qwen3.7-plus`: `text`, `image` → `text` `POST /v1/responses` · `qwen3.7-plus`: `text`, `image` → `text` `POST /v1/chat/completions` · `qwen3.7-plus`: `text`, `image` → `text` `POST /v1/chat/completions` · `qwen3.7-plus`: `text` → `text` `POST /v1/messages` · `qwen3.7-plus`: `text` → `json`, `sse` `POST /v1/messages` · `qwen-plus`: `text`, `image` → `text` `POST /v1/responses` · `qwen-plus`: `text`, `image` → `text` `POST /v1/chat/completions` · `qwen-plus`: `text`, `image` → `text` `POST /v1/chat/completions` · `qwen/qwen3.7-plus`: `text` → `text` `POST /v1/messages` · `qwen/qwen3.7-plus`: `text` → `json`, `sse`

Vilka fält använder begäran?

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

Vilka gränser gäller?

`POST /v1/messages` · `qwen3.7-plus`: `ctx`: `991808`; `max_out`: `131072`; `messages.min_items`: `1`; `max_tokens.minimum`: `1` `POST /v1/responses` · `qwen3.7-plus`: `ctx`: `991808`; `max_out`: `131072` `POST /v1/chat/completions` · `qwen3.7-plus`: `ctx`: `991808`; `max_out`: `131072`; `messages.min_items`: `1` `POST /v1/chat/completions` · `qwen3.7-plus`: `messages.min_items`: `1` `POST /v1/messages` · `qwen-plus`: `ctx`: `991808`; `max_out`: `131072`; `messages.min_items`: `1`; `max_tokens.minimum`: `1` `POST /v1/responses` · `qwen-plus`: `ctx`: `991808`; `max_out`: `131072` `POST /v1/chat/completions` · `qwen-plus`: `ctx`: `991808`; `max_out`: `131072`; `messages.min_items`: `1` `POST /v1/chat/completions` · `qwen/qwen3.7-plus`: `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.
