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

# Qwen: Qwen3.7 Plus

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

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

Qwen3.7 Plus è il modello Qwen di Alibaba per attività testuali e con immagini, con risposte testuali. Il profilo pubblicato combina un contesto di un milione di token, ragionamento, strumenti basati su funzioni e controlli degli output strutturati per assistenti e analisi documentale o visiva.

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

Informazioni sul modello

Questa descrizione illustra le funzionalità del modello. Gli input, gli output e le opzioni disponibili in Ailoot per il metodo selezionato sono elencati di seguito.

Qwen3.7 Plus è un modello della serie Qwen3.7 di Alibaba. Accetta testo e immagini e restituisce testo, combinando le capacità linguistiche della serie con input visivo. Il profilo pubblicato elenca una finestra di contesto di 1,000,000 token e fino a 131,072 token di completamento, con controlli di ragionamento, strumenti e output strutturati.

#### Combinare la domanda con le sue evidenze

Per una domanda documentale, fornire il materiale pertinente e identificare i passaggi o le sezioni che la risposta deve confrontare. Per un’attività visiva, fornire un’immagine leggibile e indicare l’oggetto, il testo o lo stato dell’interfaccia da esaminare. Uno screenshot può sostenere una domanda su un errore o un layout, mentre il risultato è una spiegazione testuale o un insieme di risultati estratti.

Etichettare più fonti affinché le osservazioni restino associate al materiale giusto. Un confronto può richiedere un risultato per criterio con il relativo identificatore della fonte. Un brief di estrazione può definire i campi da restituire e come debbano apparire le informazioni mancanti. Tenere disponibili le evidenze originali quando si esaminano risposte ambigue.

#### Ragionamento, strumenti e struttura dei risultati

I metadati di hosting elencano controlli del ragionamento, strumenti basati su funzioni e output strutturati. Specificare la profondità necessaria all’attività e definire le operazioni disponibili all’applicazione circostante. Il modello può proporre una chiamata a uno strumento, mentre l’applicazione restituisce l’osservazione effettiva. Usare tale osservazione come evidenza per il passaggio successivo.

Per un risultato destinato al software, definire la struttura richiesta e convalidare sia campi sia valori. Per una risposta leggibile da una persona, richiedere la conclusione seguita dalle evidenze rilevanti. Le stesse etichette delle fonti devono collegare la risposta concisa al materiale di lavoro più lungo.

#### Usare il contesto disponibile in modo mirato

Organizzare il materiale lungo intorno alla domanda attuale, lasciando spazio alla risposta. Conservare decisioni consolidate e dettagli pertinenti delle fonti eliminando ripetizioni che non cambiano più la risposta. Un artefatto finale utile è un risultato testuale verificabile rispetto alle immagini o ai passaggi forniti e trasferibile al passaggio applicativo successivo.

Caso pratico

### Caso pratico

Esempio tecnico in inglese

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

#### Risultato atteso

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

#### Verificare il risultato

```
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/it/#m=qwen%2Fqwen3.7-plus&route=Core&caller=qwen3.7-plus&fmt=messages)

Alibaba /`qwen3.7-plus`

ID del modello

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

### Introduzione

Qwen3.7 Plus è il modello Qwen di Alibaba per attività testuali e con immagini, con risposte testuali. Il profilo pubblicato combina un contesto di un milione di token, ragionamento, strumenti basati su funzioni e controlli degli output strutturati per assistenti e analisi documentale o visiva.

Input accettati

Testo · Immagini

Risultati

Testo

### Disponibile in Ailoot · input e metodi

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

Tipi di input

`text`, `image`

Tipi di output

`text`

Contesto

991.808 tokens

Output massimo

131.072 tokens

Formato di output

json o SSE

| Campo | Tipo | Requisito | Valori e limiti | Predefinito |
| --- | --- | --- | --- | --- |
| Campo`model` | Tipo`string` | RequisitoObbligatorio | Valori e limiti qwen3.7-plus | Predefinito— |
| Campo`messages` | Tipo`message[]` | RequisitoObbligatorio | Valori e limiti Numero minimo di elementi: 1 | Predefinito— |
| Campo`messages[].role` | Tipo`string` | RequisitoObbligatorio | Valori e limiti user, assistant | Predefinito— |
| Campo`messages[].content` | Tipo`string\|content_block[]` | RequisitoObbligatorio | Valori e limiti | Predefinito— |
| Campo`system` | Tipo`string\|content_block[]` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`max_tokens` | Tipo`integer` | RequisitoObbligatorio | Valori e limiti Minimo: 1 Il limite si applica a: Limite esatto del modello o della scheda selezionati | Predefinito— |
| Campo`stream` | Tipo`boolean` | RequisitoFacoltativo | Valori e limiti | Predefinitofalse |
| Campo`temperature` | Tipo`number` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`top_p` | Tipo`number` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`stop_sequences` | Tipo`string[]` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`tools` | Tipo`tool[]` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`tools[].name` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Si applica quando: Strumento fornito | Predefinito— |
| Campo`tools[].description` | Tipo`string` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`tools[].input_schema` | Tipo`JSON_schema` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`tool_choice` | Tipo`object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`thinking.type` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`thinking.budget_tokens` | Tipo`integer` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`output_config.effort` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`metadata` | Tipo`object` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`cache_control` | Tipo`object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |

Combinazioni di materiali in input

**Testo** · Testo UTF8

`messages[].content o blocco type=text`

**Testo + immagine**

`{type:image,source:{type:base64,media_type,data}} o origine type=url`

Parametri e ciclo di vita del metodo

| Parametro | Contratto |
| --- | --- |
| Parametro`material_types` | Contrattotext, image |
| Parametro`required` | Contrattomodel, messages, max\_tokens |
| Parametro`optional_controls` | Contrattonull |
| Parametro`content_type` | Contrattoapplication/json |
| Parametro`text_file_material` | ContrattoContenuto UTF-8 effettivo inserito come testo; ID di file/URLs richiedono supporto separato ed esatto |

Ciclo di vita: `exact retained published method`

Le strutture dei metodi e gli ID sono esatti; la capacità del fornitore è distinta dall’ammissione delle richieste.

### Tariffe

#### Tariffe dei metodi Ailoot

Input

0,0004 USD */ 1K*

Output

0,0016 USD */ 1K*

Lettura dalla cache

0,00004 USD */ 1K*

Scrittura nella cache

0,0005 USD */ 1K*

Scrittura nella cache, 5 min

0,0005 USD */ 1K tokens*

#### Prezzi per lunghezza della richiesta · Anthropic Messages

| Dimensione della richiesta, in token | Input | Output | Lettura dalla cache | Scrittura nella cache | Cache 5 min | Cache 1 ora |
| --- | --- | --- | --- | --- | --- | --- |
| Dimensione della richiesta, in token(0; 256.000\] | Input0,0004 USD | Output0,0016 USD | Lettura dalla cache0,00004 USD | Scrittura nella cache0,0005 USD | Cache 5 min0,0005 USD | Cache 1 oraTariffa base: — |
| Dimensione della richiesta, in token(256.000; ∞) | Input0,0012 USD | Output0,0048 USD | Lettura dalla cache≈0,00012 USD | Scrittura nella cache0,0015 USD | Cache 5 min0,0015 USD | Cache 1 oraTariffa base: — |

Tariffe in USD per 1K token. Se non è impostata alcuna tariffa, viene ereditata la tariffa base di questo metodo; «—» indica che non è impostata alcuna tariffa base.

Ailoot prenota un importo stimato prima di una richiesta. Dopo il risultato, addebita il costo finale in base all’utilizzo misurato. Per lo streaming, l’addebito usa il record finale di utilizzo. [Come funzionano la prenotazione e l’addebito finale →](https://ailoot.ai/docs/it/billing/reserve/)

#### Dettagli della tariffa di riferimento

I listini di riferimento del modello non modificano la selezione del metodo, i preventivi o gli addebiti. Gli addebiti attivi usano le tariffe del metodo Ailoot selezionato.

Listini di riferimento del modello

#### Prezzi per configurazione

Associa ogni costo alle condizioni indicate. Usa una sola tariffa per ogni insieme di configurazioni alternative.

| Configurazione | Listino delle tariffe | Token di contesto, più di | Token di contesto, fino al limite incluso | Costo |
| --- | --- | --- | --- | --- |
| ConfigurazioneOpenAI Chat · Tariffe base per token | Listino delle tariffeTariffa base | Token di contesto, più di— | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneOpenAI Chat · Fascia 1 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di0 | Token di contesto, fino al limite incluso256.000 | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneOpenAI Chat · Fascia 2 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di256.000 | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00192** / 1K token Output · Token in output **$0.00768** / 1K token Input · Lettura dalla cache **$0.000384** / 1K token Input · Scrittura nella cache **$0.0024** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneAnthropic Messages · Tariffe base per token | Listino delle tariffeTariffa base | Token di contesto, più di— | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneAnthropic Messages · Fascia 1 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di0 | Token di contesto, fino al limite incluso256.000 | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneAnthropic Messages · Fascia 2 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di256.000 | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00192** / 1K token Output · Token in output **$0.00768** / 1K token Input · Lettura dalla cache **$0.000384** / 1K token Input · Scrittura nella cache **$0.0024** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |

### Esempi di richieste

#### Ailoot · Anthropic Messages

Esempio di testoInput, immaginePython SDKNode.js SDKStreaming Python

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

### Ricevi e salva i risultati

#### Ailoot · Anthropic Messages

json o SSE

##### Conserva tutti i risultati completati

Conserva ogni risposta, file e parte di contenuto restituiti per intero.

Conserva tutti i blocchi di contenuto, le firme di ragionamento e gli ID effettivi di utilizzo degli strumenti. Assembla tutti i delta dei blocchi SSE; il primo blocco di testo non è l’uscita completa.

##### Se occorre verificare la risposta originale

Conserva gli ID e le intestazioni di richiesta/risposta. Non viene fornito alcun URL generico per recuperare un’attività testuale.

Campi della risposta

| Campo | Tipo |
| --- | --- |
| Campo`id` | Tipostring |
| Campo`model` | Tipostring |
| Campo`content[]` | Tipotext\|thinking\|tool\_use\|other content block |
| Campo`stop_reason` | Tipostring\|null |
| Campo`usage` | Tipoobject |

Errori e passaggi successivi

| Risposta | Condizione | Passaggio successivo |
| --- | --- | --- |
| Risposta400 · `invalid_request_error` | CondizioneCampi obbligatori, rappresentazione del materiale o valore del parametro non validi | Passaggio successivoCorreggi i campi indicati prima di una nuova richiesta di creazione. |

### Alias

#### Alias del modello

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

#### Alias dei percorsi dei metodi

`/chat/completions`

#### ID di chiamata correlati

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

Alibaba /`qwen3.7-plus`

ID del modello

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

### Introduzione

Qwen3.7 Plus è il modello Qwen di Alibaba per attività testuali e con immagini, con risposte testuali. Il profilo pubblicato combina un contesto di un milione di token, ragionamento, strumenti basati su funzioni e controlli degli output strutturati per assistenti e analisi documentale o visiva.

Input accettati

Testo · Immagini

Risultati

Testo

### Disponibile in Ailoot · input e metodi

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

Tipi di input

`text`, `image`

Tipi di output

`text`

Contesto

991.808 tokens

Output massimo

131.072 tokens

Formato di output

json o SSE

| Campo | Tipo | Requisito | Valori e limiti | Predefinito |
| --- | --- | --- | --- | --- |
| Campo`model` | Tipo`string` | RequisitoObbligatorio | Valori e limiti qwen3.7-plus | Predefinito— |
| Campo`input` | Tipo`string\|input_item[]` | RequisitoObbligatorio | Valori e limiti | Predefinito— |
| Campo`instructions` | Tipo`string` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`input[].type` | Tipo`string` | RequisitoFacoltativo | Valori e limiti message, reasoning, function\_call, function\_call\_output | Predefinito— |
| Campo`input[].content` | Tipo`string\|content_part[]` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`input[].call_id` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Si applica quando: function\_call\_output; conserva il call\_id effettivamente restituito | Predefinito— |
| Campo`input[].output` | Tipo`string\|content_part[]` | RequisitoFacoltativo | Valori e limiti Si applica quando: function\_call\_output | Predefinito— |
| Campo`max_output_tokens` | Tipo`integer` | RequisitoFacoltativo | Valori e limiti Minimo: 1 Dipende dal modello | Predefinito— |
| Campo`stream` | Tipo`boolean` | RequisitoFacoltativo | Valori e limiti | Predefinitofalse |
| Campo`temperature` | Tipo`number` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`top_p` | Tipo`number` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`tools` | Tipo`tool[]` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`tool_choice` | Tipo`string\|object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`parallel_tool_calls` | Tipo`boolean` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`reasoning.effort` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`reasoning.summary` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`text.format` | Tipo`object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`text.verbosity` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`include` | Tipo`string[]` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`store` | Tipo`boolean` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`previous_response_id` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Requisito dell’ID: Solo un ID di risposta effettivo proveniente da una continuazione supportata Dipende dal modello | Predefinito— |
| Campo`service_tier` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`prompt_cache_key` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`prompt_cache_options` | Tipo`object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |

Combinazioni di materiali in input

**Testo** · Testo UTF8

`Testo in ingresso o parte input_text`

**Testo + immagine**

`{type:input_image,image_url}`

Parametri e ciclo di vita del metodo

| Parametro | Contratto |
| --- | --- |
| Parametro`material_types` | Contrattotext, image |
| Parametro`required` | Contrattomodel, input |
| Parametro`optional_controls` | Contrattonull |
| Parametro`content_type` | Contrattoapplication/json |
| Parametro`text_file_material` | ContrattoContenuto UTF-8 effettivo inserito come testo; ID di file/URLs richiedono supporto separato ed esatto |

Ciclo di vita: `exact retained published method`

Le strutture dei metodi e gli ID sono esatti; la capacità del fornitore è distinta dall’ammissione delle richieste.

### Tariffe

#### Tariffe dei metodi Ailoot

Input

0,0004 USD */ 1K*

Output

0,0016 USD */ 1K*

Lettura dalla cache

0,00008 USD */ 1K*

Scrittura nella cache

0,0004 USD */ 1K*

Scrittura nella cache, 5 min

0,0004 USD */ 1K tokens*

code\_interpreter\_call

0,00 USD *per chiamata*

image\_search\_call

0,008 USD *per chiamata*

web\_extractor\_call

0,00 USD *per chiamata*

web\_search\_call

0,01 USD *per chiamata*

web\_search\_image\_call

0,008 USD *per chiamata*

Numero massimo di chiamate code\_interpreter\_call

8

Numero massimo di chiamate image\_search\_call

8

Numero massimo di chiamate web\_extractor\_call

8

Numero massimo di chiamate web\_search\_call

8

Numero massimo di chiamate web\_search\_image\_call

8

#### Prezzi per lunghezza della richiesta · OpenAI Responses

| Dimensione della richiesta, in token | Input | Output | Lettura dalla cache | Scrittura nella cache | Cache 5 min | Cache 1 ora |
| --- | --- | --- | --- | --- | --- | --- |
| Dimensione della richiesta, in token(0; 256.000\] | Input0,0004 USD | Output0,0016 USD | Lettura dalla cache0,00008 USD | Scrittura nella cache0,0004 USD | Cache 5 min0,0004 USD | Cache 1 oraTariffa base: — |
| Dimensione della richiesta, in token(256.000; ∞) | Input0,0012 USD | Output0,0048 USD | Lettura dalla cache≈0,00024 USD | Scrittura nella cache0,0012 USD | Cache 5 min0,0012 USD | Cache 1 oraTariffa base: — |

Tariffe in USD per 1K token. Se non è impostata alcuna tariffa, viene ereditata la tariffa base di questo metodo; «—» indica che non è impostata alcuna tariffa base.

Ailoot prenota un importo stimato prima di una richiesta. Dopo il risultato, addebita il costo finale in base all’utilizzo misurato. Per lo streaming, l’addebito usa il record finale di utilizzo. [Come funzionano la prenotazione e l’addebito finale →](https://ailoot.ai/docs/it/billing/reserve/)

#### Dettagli della tariffa di riferimento

I listini di riferimento del modello non modificano la selezione del metodo, i preventivi o gli addebiti. Gli addebiti attivi usano le tariffe del metodo Ailoot selezionato.

Listini di riferimento del modello

#### Prezzi per configurazione

Associa ogni costo alle condizioni indicate. Usa una sola tariffa per ogni insieme di configurazioni alternative.

| Configurazione | Listino delle tariffe | Token di contesto, più di | Token di contesto, fino al limite incluso | Costo |
| --- | --- | --- | --- | --- |
| ConfigurazioneOpenAI Chat · Tariffe base per token | Listino delle tariffeTariffa base | Token di contesto, più di— | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneOpenAI Chat · Fascia 1 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di0 | Token di contesto, fino al limite incluso256.000 | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneOpenAI Chat · Fascia 2 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di256.000 | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00192** / 1K token Output · Token in output **$0.00768** / 1K token Input · Lettura dalla cache **$0.000384** / 1K token Input · Scrittura nella cache **$0.0024** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneAnthropic Messages · Tariffe base per token | Listino delle tariffeTariffa base | Token di contesto, più di— | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneAnthropic Messages · Fascia 1 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di0 | Token di contesto, fino al limite incluso256.000 | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneAnthropic Messages · Fascia 2 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di256.000 | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00192** / 1K token Output · Token in output **$0.00768** / 1K token Input · Lettura dalla cache **$0.000384** / 1K token Input · Scrittura nella cache **$0.0024** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |

### Esempi di richieste

#### Ailoot · OpenAI Responses

Esempio di testoInput, immaginePython SDKNode.js SDKStreaming Python

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

### Ricevi e salva i risultati

#### Ailoot · OpenAI Responses

json o SSE

##### Conserva tutti i risultati completati

Conserva ogni risposta, file e parte di contenuto restituiti per intero.

Conserva ogni elemento di uscita e parte di contenuto, il call\_id effettivo della funzione, il ragionamento cifrato e i dati di utilizzo. Nello streaming conserva l’identità completa di eventi ed elementi.

##### Se occorre verificare la risposta originale

Conserva gli ID e le intestazioni di richiesta/risposta. Non viene fornito alcun URL generico per recuperare un’attività testuale.

Campi della risposta

| Campo | Tipo |
| --- | --- |
| Campo`id` | Tipostring |
| Campo`status` | Tipostring |
| Campo`output[]` | Tipomessage\|reasoning\|function\_call\|other item |
| Campo`output[].content[]` | Tipocontent part |
| Campo`usage` | Tipoobject |

Errori e passaggi successivi

| Risposta | Condizione | Passaggio successivo |
| --- | --- | --- |
| Risposta400 · `invalid_request_error` | CondizioneCampi obbligatori, rappresentazione del materiale o valore del parametro non validi | Passaggio successivoCorreggi i campi indicati prima di una nuova richiesta di creazione. |

### Alias

#### Alias del modello

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

#### Alias dei percorsi dei metodi

`/chat/completions`

#### ID di chiamata correlati

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

Alibaba /`qwen3.7-plus`

ID del modello

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

### Introduzione

Qwen3.7 Plus è il modello Qwen di Alibaba per attività testuali e con immagini, con risposte testuali. Il profilo pubblicato combina un contesto di un milione di token, ragionamento, strumenti basati su funzioni e controlli degli output strutturati per assistenti e analisi documentale o visiva.

Input accettati

Testo · Immagini

Risultati

Testo

### Disponibile in Ailoot · input e metodi

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

Tipi di input

`text`, `image`

Tipi di output

`text`

Contesto

991.808 tokens

Output massimo

131.072 tokens

Formato di output

json o SSE

| Campo | Tipo | Requisito | Valori e limiti | Predefinito |
| --- | --- | --- | --- | --- |
| Campo`model` | Tipo`string` | RequisitoObbligatorio | Valori e limiti qwen3.7-plus | Predefinito— |
| Campo`messages` | Tipo`message[]` | RequisitoObbligatorio | Valori e limiti Numero minimo di elementi: 1 | Predefinito— |
| Campo`messages[].role` | Tipo`string` | RequisitoObbligatorio | Valori e limiti Esempi: system, user, assistant, tool, function Condizioni: Questi ruoli sono rappresentati esplicitamente dai tipi di compatibilità del codice sorgente; l’insieme esatto dei ruoli rimane specifico del modello. Dipende dal modello | Predefinito— |
| Campo`messages[].content` | Tipo`string\|content_part[]\|null` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`messages[].tool_calls` | Tipo`tool_call[]` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`messages[].tool_call_id` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Si applica quando: role=tool; usa l’ID effettivamente restituito | Predefinito— |
| Campo`messages[].name` | Tipo`string` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`messages[].reasoning_content` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Si applica quando: Reinserisci il ragionamento effettivamente restituito quando il modello lo utilizza | Predefinito— |
| Campo`messages[].reasoning_details` | Tipo`object\|array` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`max_tokens` | Tipo`integer` | RequisitoFacoltativo | Valori e limiti Minimo: 1 Dipende dal modello | Predefinito— |
| Campo`max_completion_tokens` | Tipo`integer` | RequisitoFacoltativo | Valori e limiti Minimo: 1 Dipende dal modello | Predefinito— |
| Campo`stream` | Tipo`boolean` | RequisitoFacoltativo | Valori e limiti | Predefinitofalse |
| Campo`stream_options.include_usage` | Tipo`boolean` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`temperature` | Tipo`number` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`top_p` | Tipo`number` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`stop` | Tipo`string\|string[]` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`tools` | Tipo`function_tool[]` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`tools[].type` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`tools[].function.name` | Tipo`string` | RequisitoObbligatorio | Valori e limiti Si applica quando: Funzione fornita come strumento | Predefinito— |
| Campo`tools[].function.description` | Tipo`string` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`tools[].function.parameters` | Tipo`JSON_schema` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`tool_choice` | Tipo`string\|object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`parallel_tool_calls` | Tipo`boolean` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`response_format` | Tipo`object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`reasoning_effort` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`reasoning` | Tipo`object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`service_tier` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`instructions` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Campo di compatibilità | Predefinito— |
| Campo`functions` | Tipo`function[]` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`function_call` | Tipo`string\|object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`prompt_cache_options` | Tipo`object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |

Combinazioni di materiali in input

**Testo** · Testo UTF8

`messages[].content`

**Testo + immagine**

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

Parametri e ciclo di vita del metodo

| Parametro | Contratto |
| --- | --- |
| Parametro`material_types` | Contrattotext, image |
| Parametro`required` | Contrattomodel, messages |
| Parametro`optional_controls` | Contrattonull |
| Parametro`content_type` | Contrattoapplication/json |
| Parametro`text_file_material` | ContrattoContenuto UTF-8 effettivo inserito come testo; ID di file/URLs richiedono supporto separato ed esatto |

Ciclo di vita: `exact retained published method`

Le strutture dei metodi e gli ID sono esatti; la capacità del fornitore è distinta dall’ammissione delle richieste.

### Tariffe

#### Tariffe dei metodi Ailoot

Input

0,0004 USD */ 1K*

Output

0,0016 USD */ 1K*

Lettura dalla cache

0,00008 USD */ 1K*

Scrittura nella cache

0,0004 USD */ 1K*

Scrittura nella cache, 5 min

0,0004 USD */ 1K tokens*

#### Prezzi per lunghezza della richiesta · OpenAI Chat

| Dimensione della richiesta, in token | Input | Output | Lettura dalla cache | Scrittura nella cache | Cache 5 min | Cache 1 ora |
| --- | --- | --- | --- | --- | --- | --- |
| Dimensione della richiesta, in token(0; 256.000\] | Input0,0004 USD | Output0,0016 USD | Lettura dalla cache0,00008 USD | Scrittura nella cache0,0004 USD | Cache 5 min0,0004 USD | Cache 1 oraTariffa base: — |
| Dimensione della richiesta, in token(256.000; ∞) | Input0,0012 USD | Output0,0048 USD | Lettura dalla cache≈0,00024 USD | Scrittura nella cache0,0012 USD | Cache 5 min0,0012 USD | Cache 1 oraTariffa base: — |

Tariffe in USD per 1K token. Se non è impostata alcuna tariffa, viene ereditata la tariffa base di questo metodo; «—» indica che non è impostata alcuna tariffa base.

Ailoot prenota un importo stimato prima di una richiesta. Dopo il risultato, addebita il costo finale in base all’utilizzo misurato. Per lo streaming, l’addebito usa il record finale di utilizzo. [Come funzionano la prenotazione e l’addebito finale →](https://ailoot.ai/docs/it/billing/reserve/)

#### Dettagli della tariffa di riferimento

I listini di riferimento del modello non modificano la selezione del metodo, i preventivi o gli addebiti. Gli addebiti attivi usano le tariffe del metodo Ailoot selezionato.

Listini di riferimento del modello

#### Prezzi per configurazione

Associa ogni costo alle condizioni indicate. Usa una sola tariffa per ogni insieme di configurazioni alternative.

| Configurazione | Listino delle tariffe | Token di contesto, più di | Token di contesto, fino al limite incluso | Costo |
| --- | --- | --- | --- | --- |
| ConfigurazioneOpenAI Chat · Tariffe base per token | Listino delle tariffeTariffa base | Token di contesto, più di— | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneOpenAI Chat · Fascia 1 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di0 | Token di contesto, fino al limite incluso256.000 | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneOpenAI Chat · Fascia 2 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di256.000 | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00192** / 1K token Output · Token in output **$0.00768** / 1K token Input · Lettura dalla cache **$0.000384** / 1K token Input · Scrittura nella cache **$0.0024** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneAnthropic Messages · Tariffe base per token | Listino delle tariffeTariffa base | Token di contesto, più di— | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneAnthropic Messages · Fascia 1 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di0 | Token di contesto, fino al limite incluso256.000 | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneAnthropic Messages · Fascia 2 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di256.000 | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00192** / 1K token Output · Token in output **$0.00768** / 1K token Input · Lettura dalla cache **$0.000384** / 1K token Input · Scrittura nella cache **$0.0024** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |

### Esempi di richieste

#### Ailoot · OpenAI Chat

Esempio di testoInput, immaginePython SDKNode.js SDKStreaming Python

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

### Ricevi e salva i risultati

#### Ailoot · OpenAI Chat

json o SSE

##### Conserva tutti i risultati completati

Conserva ogni risposta, file e parte di contenuto restituiti per intero.

Conserva ogni scelta con contenuto, chiamate agli strumenti e ragionamento. In SSE assembla i delta per indice di scelta e strumento e conserva il motivo finale di completamento e i dati di utilizzo.

##### Se occorre verificare la risposta originale

Conserva gli ID e le intestazioni di richiesta/risposta. Non viene fornito alcun URL generico per recuperare un’attività testuale.

Campi della risposta

| Campo | Tipo |
| --- | --- |
| Campo`choices[].index` | Tipointeger |
| Campo`choices[].message.content` | Tipostring\|null |
| Campo`choices[].message.tool_calls` | Tipotool\_call\[\] |
| Campo`choices[].message.reasoning_content` | Tipostring |
| Campo`choices[].message.reasoning_details` | Tipoobject\|array |
| Campo`choices[].finish_reason` | Tipostring\|null |
| Campo`usage` | Tipoobject |

Errori e passaggi successivi

| Risposta | Condizione | Passaggio successivo |
| --- | --- | --- |
| Risposta400 · `invalid_request_error` | CondizioneCampi obbligatori, rappresentazione del materiale o valore del parametro non validi | Passaggio successivoCorreggi i campi indicati prima di una nuova richiesta di creazione. |

### Alias

#### Alias del modello

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

#### Alias dei percorsi dei metodi

`/chat/completions`

#### ID di chiamata correlati

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

Alibaba /`qwen3.7-plus`

ID del modello

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

### Introduzione

Qwen3.7 Plus è il modello Qwen di Alibaba per attività testuali e con immagini, con risposte testuali. Il profilo pubblicato combina un contesto di un milione di token, ragionamento, strumenti basati su funzioni e controlli degli output strutturati per assistenti e analisi documentale o visiva.

Input accettati

Testo

Risultati

Testo

### Disponibile in Ailoot · input e metodi

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

Tipi di input

`text`

Tipi di output

`text`

Formato di output

json o SSE

| Campo | Tipo | Requisito | Valori e limiti | Predefinito |
| --- | --- | --- | --- | --- |
| Campo`model` | Tipo`string` | RequisitoObbligatorio | Valori e limiti qwen3.7-plus | Predefinito— |
| Campo`messages` | Tipo`message[]` | RequisitoObbligatorio | Valori e limiti Numero minimo di elementi: 1 | Predefinito— |
| Campo`messages[].role` | Tipo`string` | RequisitoObbligatorio | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`messages[].content` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Si applica quando: Conversazione testuale | Predefinito— |
| Campo`stream` | Tipo`boolean` | RequisitoFacoltativo | Valori e limiti | Predefinitofalse |

Combinazioni di materiali in input

**Testo** · Testo UTF8

`messages[].content`

Parametri e ciclo di vita del metodo

| Parametro | Contratto |
| --- | --- |
| Parametro`content_type` | Contrattoapplication/json |
| Parametro`required` | Contrattomodel, messages |
| Parametro`material_types` | Contrattotext |
| Parametro`messages` | ContrattoArray di messaggi con struttura role/content |
| Parametro`file_material` | ContrattoDocumento UTF-8 effettivo inserito come testo letterale; nessun ID di file dedotto |
| Parametro`optional_controls` | Contrattostream |
| Parametro`control_scope` | ContrattoConversazione testuale; stream è un booleano e per impostazione predefinita vale false. |
| Parametro`output_modalities` | Contrattotext |
| Parametro`hosted_operations` | Contrattofalse |
| Parametro`multimodal_input_binding` | Contrattonull |

Alias del metodo: `/chat/completions`

Ciclo di vita: `synchronous_or_streamed`

Invia l’ID esatto del modello con messages.

La lunghezza del contesto non è un limite di uscita.

Un file di testo può fornire testo letterale; gli ingressi immagine/audio/oggetto file richiedono un’associazione esatta.

### Tariffe

Le tariffe non aggiungono opzioni alla richiesta. I parametri supportati sono elencati nel metodo selezionato.

Modalità rapida

Tariffa standard Quando è selezionata la modalità rapida

Modalità flex

Tariffa standard Quando è selezionata la modalità flex

Sforzo massimo di ragionamento

Tariffa standard Quando lo sforzo massimo di ragionamento usa l'adeguamento predefinito (default)

#### Tariffe Ailoot

#### Prezzi per configurazione

Associa ogni costo alle condizioni indicate. Usa una sola tariffa per ogni insieme di configurazioni alternative.

| Configurazione | Listino delle tariffe | Token di contesto, più di | Token di contesto, fino al limite incluso | Costo |
| --- | --- | --- | --- | --- |
| ConfigurazioneTariffe di base dei token | Listino delle tariffeTariffa base | Token di contesto, più di— | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneFascia 1 di lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di0 | Token di contesto, fino al limite incluso256.000 | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneFascia 2 di lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di256.000 | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00192** / 1K token Output · Token in output **$0.00768** / 1K token Input · Lettura dalla cache **$0.000384** / 1K token Input · Scrittura nella cache **$0.0024** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |

Ailoot prenota un importo stimato prima di una richiesta. Dopo il risultato, addebita il costo finale in base all’utilizzo misurato. Per lo streaming, l’addebito usa il record finale di utilizzo. [Come funzionano la prenotazione e l’addebito finale →](https://ailoot.ai/docs/it/billing/reserve/)

### Esempi di richieste

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

### Ricevi e salva i risultati

#### Ailoot Ultra · OpenAI Chat

json o SSE

##### Conserva tutti i risultati completati

Conserva ogni risposta, file e parte di contenuto restituiti per intero.

Conserva ogni scelta con contenuto, chiamate agli strumenti e ragionamento. In SSE assembla i delta per indice di scelta e strumento e conserva il motivo finale di completamento e i dati di utilizzo.

##### Se occorre verificare la risposta originale

Conserva gli ID e le intestazioni di richiesta/risposta. Non viene fornito alcun URL generico per recuperare un’attività testuale.

Campi della risposta

| Campo | Tipo |
| --- | --- |
| Campo`choices[].index` | Tipointeger |
| Campo`choices[].message.content` | Tipostring\|null |
| Campo`choices[].message.tool_calls` | Tipotool\_call\[\] |
| Campo`choices[].message.reasoning_content` | Tipostring |
| Campo`choices[].message.reasoning_details` | Tipoobject\|array |
| Campo`choices[].finish_reason` | Tipostring\|null |
| Campo`usage` | Tipoobject |

Errori e passaggi successivi

| Risposta | Condizione | Passaggio successivo |
| --- | --- | --- |
| Risposta400 · `invalid_request_error` | CondizioneCampi obbligatori, rappresentazione del materiale o valore del parametro non validi | Passaggio successivoCorreggi i campi indicati prima di una nuova richiesta di creazione. |

### Alias

#### Alias del modello

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

#### Alias dei percorsi dei metodi

`/chat/completions`

#### ID di chiamata correlati

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

Alibaba /`qwen3.7-plus`

ID del modello

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

### Introduzione

Qwen3.7 Plus è il modello Qwen di Alibaba per attività testuali e con immagini, con risposte testuali. Il profilo pubblicato combina un contesto di un milione di token, ragionamento, strumenti basati su funzioni e controlli degli output strutturati per assistenti e analisi documentale o visiva.

Input accettati

Testo

Risultati

json · sse

### Disponibile in Ailoot · input e metodi

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

Tipi di input

`text`

Tipi di output

`json`, `sse`

Formato di output

JSON o SSE

| Campo | Tipo | Requisito | Valori e limiti | Predefinito |
| --- | --- | --- | --- | --- |
| Campo`model` | Tipo`string` | RequisitoObbligatorio | Valori e limiti qwen3.7-plus | Predefinito— |
| Campo`messages` | Tipo`message[]` | RequisitoObbligatorio | Valori e limiti | Predefinito— |
| Campo`messages[].role` | Tipo`string` | RequisitoObbligatorio | Valori e limiti user, assistant | Predefinito— |
| Campo`messages[].content` | Tipo`string` | RequisitoObbligatorio | Valori e limiti | Predefinito— |
| Campo`max_tokens` | Tipo`integer` | RequisitoObbligatorio | Valori e limiti | Predefinito— |
| Campo`stream` | Tipo`boolean` | RequisitoFacoltativo | Valori e limiti | Predefinitofalse |

Combinazioni di materiali in input

**Testo** · Testo UTF-8

`Stringa messages[].content`

Parametri e ciclo di vita del metodo

| Parametro | Contratto |
| --- | --- |
| Parametro`content_type` | Contrattoapplication/json |
| Parametro`required` | Contrattomodel, messages, max\_tokens |
| Parametro`optional_controls` | Contrattostream |
| Parametro`material_types` | Contrattotext |
| Parametro`text_file_material` | ContrattoLeggi il documento UTF-8 effettivo e inserisci il testo nell’ingresso indicato o nella stringa del contenuto del messaggio. |

Ciclo di vita: `synchronous_or_streamed`

### Tariffe

Le tariffe non aggiungono opzioni alla richiesta. I parametri supportati sono elencati nel metodo selezionato.

Modalità rapida

Tariffa standard Quando è selezionata la modalità rapida

Modalità flex

Tariffa standard Quando è selezionata la modalità flex

Sforzo massimo di ragionamento

Tariffa standard Quando lo sforzo massimo di ragionamento usa l'adeguamento predefinito (default)

#### Tariffe Ailoot

#### Prezzi per configurazione

Associa ogni costo alle condizioni indicate. Usa una sola tariffa per ogni insieme di configurazioni alternative.

| Configurazione | Listino delle tariffe | Token di contesto, più di | Token di contesto, fino al limite incluso | Costo |
| --- | --- | --- | --- | --- |
| ConfigurazioneTariffe di base dei token | Listino delle tariffeTariffa base | Token di contesto, più di— | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneFascia 1 di lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di0 | Token di contesto, fino al limite incluso256.000 | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneFascia 2 di lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di256.000 | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00192** / 1K token Output · Token in output **$0.00768** / 1K token Input · Lettura dalla cache **$0.000384** / 1K token Input · Scrittura nella cache **$0.0024** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |

Ailoot prenota un importo stimato prima di una richiesta. Dopo il risultato, addebita il costo finale in base all’utilizzo misurato. Per lo streaming, l’addebito usa il record finale di utilizzo. [Come funzionano la prenotazione e l’addebito finale →](https://ailoot.ai/docs/it/billing/reserve/)

### Esempi di richieste

#### Ailoot Ultra · Anthropic Messages

Corpo JSON minimo completocurl · usa il tuo documento UTF-8Python · salva il risultato completo

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

### Ricevi e salva i risultati

#### Ailoot Ultra · Anthropic Messages

JSON o SSE

##### Conserva tutti i risultati completati

Conserva ogni risposta, file e parte di contenuto restituiti per intero.

Conserva tutti i blocchi di contenuto, le firme di ragionamento e gli ID effettivi di utilizzo degli strumenti. Assembla tutti i delta dei blocchi SSE; il primo blocco di testo non è l’uscita completa.

##### Se occorre verificare la risposta originale

Conserva gli ID e le intestazioni di richiesta/risposta. Non viene fornito alcun URL generico per recuperare un’attività testuale.

Campi della risposta

| Campo | Tipo |
| --- | --- |
| Campo`id` | Tipostring |
| Campo`model` | Tipostring |
| Campo`content[]` | Tipotext\|thinking\|tool\_use\|other content block |
| Campo`stop_reason` | Tipostring\|null |
| Campo`usage` | Tipoobject |

Errori e passaggi successivi

| Risposta | Condizione | Passaggio successivo |
| --- | --- | --- |
| Risposta400 · `invalid_request_error` | CondizioneCampi obbligatori, rappresentazione del materiale o valore del parametro non validi | Passaggio successivoCorreggi i campi indicati prima di una nuova richiesta di creazione. |

### Alias

#### Alias del modello

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

#### Alias dei percorsi dei metodi

`/chat/completions`

#### ID di chiamata correlati

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

Alibaba /`qwen-plus`

ID del modello

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

### Introduzione

Qwen3.7 Plus è il modello Qwen di Alibaba per attività testuali e con immagini, con risposte testuali. Il profilo pubblicato combina un contesto di un milione di token, ragionamento, strumenti basati su funzioni e controlli degli output strutturati per assistenti e analisi documentale o visiva.

Input accettati

Testo · Immagini

Risultati

Testo

### Disponibile in Ailoot · input e metodi

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

Tipi di input

`text`, `image`

Tipi di output

`text`

Contesto

991.808 tokens

Output massimo

131.072 tokens

Formato di output

json o SSE

| Campo | Tipo | Requisito | Valori e limiti | Predefinito |
| --- | --- | --- | --- | --- |
| Campo`model` | Tipo`string` | RequisitoObbligatorio | Valori e limiti qwen-plus | Predefinito— |
| Campo`messages` | Tipo`message[]` | RequisitoObbligatorio | Valori e limiti Numero minimo di elementi: 1 | Predefinito— |
| Campo`messages[].role` | Tipo`string` | RequisitoObbligatorio | Valori e limiti user, assistant | Predefinito— |
| Campo`messages[].content` | Tipo`string\|content_block[]` | RequisitoObbligatorio | Valori e limiti | Predefinito— |
| Campo`system` | Tipo`string\|content_block[]` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`max_tokens` | Tipo`integer` | RequisitoObbligatorio | Valori e limiti Minimo: 1 Il limite si applica a: Limite esatto del modello o della scheda selezionati | Predefinito— |
| Campo`stream` | Tipo`boolean` | RequisitoFacoltativo | Valori e limiti | Predefinitofalse |
| Campo`temperature` | Tipo`number` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`top_p` | Tipo`number` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`stop_sequences` | Tipo`string[]` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`tools` | Tipo`tool[]` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`tools[].name` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Si applica quando: Strumento fornito | Predefinito— |
| Campo`tools[].description` | Tipo`string` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`tools[].input_schema` | Tipo`JSON_schema` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`tool_choice` | Tipo`object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`thinking.type` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`thinking.budget_tokens` | Tipo`integer` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`output_config.effort` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`metadata` | Tipo`object` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`cache_control` | Tipo`object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |

Combinazioni di materiali in input

**Testo** · Testo UTF8

`messages[].content o blocco type=text`

**Testo + immagine**

`{type:image,source:{type:base64,media_type,data}} o origine type=url`

Parametri e ciclo di vita del metodo

| Parametro | Contratto |
| --- | --- |
| Parametro`material_types` | Contrattotext, image |
| Parametro`required` | Contrattomodel, messages, max\_tokens |
| Parametro`optional_controls` | Contrattonull |
| Parametro`content_type` | Contrattoapplication/json |
| Parametro`text_file_material` | ContrattoContenuto UTF-8 effettivo inserito come testo; ID di file/URLs richiedono supporto separato ed esatto |

Ciclo di vita: `exact retained published method`

Le strutture dei metodi e gli ID sono esatti; la capacità del fornitore è distinta dall’ammissione delle richieste.

### Tariffe

#### Tariffe dei metodi Ailoot

Input

0,0004 USD */ 1K*

Output

0,0016 USD */ 1K*

Lettura dalla cache

0,00004 USD */ 1K*

Scrittura nella cache

0,0005 USD */ 1K*

Scrittura nella cache, 5 min

0,0005 USD */ 1K tokens*

#### Prezzi per lunghezza della richiesta · Anthropic Messages

| Dimensione della richiesta, in token | Input | Output | Lettura dalla cache | Scrittura nella cache | Cache 5 min | Cache 1 ora |
| --- | --- | --- | --- | --- | --- | --- |
| Dimensione della richiesta, in token(0; 256.000\] | Input0,0004 USD | Output0,0016 USD | Lettura dalla cache0,00004 USD | Scrittura nella cache0,0005 USD | Cache 5 min0,0005 USD | Cache 1 oraTariffa base: — |
| Dimensione della richiesta, in token(256.000; ∞) | Input0,0012 USD | Output0,0048 USD | Lettura dalla cache≈0,00012 USD | Scrittura nella cache0,0015 USD | Cache 5 min0,0015 USD | Cache 1 oraTariffa base: — |

Tariffe in USD per 1K token. Se non è impostata alcuna tariffa, viene ereditata la tariffa base di questo metodo; «—» indica che non è impostata alcuna tariffa base.

Ailoot prenota un importo stimato prima di una richiesta. Dopo il risultato, addebita il costo finale in base all’utilizzo misurato. Per lo streaming, l’addebito usa il record finale di utilizzo. [Come funzionano la prenotazione e l’addebito finale →](https://ailoot.ai/docs/it/billing/reserve/)

#### Dettagli della tariffa di riferimento

I listini di riferimento del modello non modificano la selezione del metodo, i preventivi o gli addebiti. Gli addebiti attivi usano le tariffe del metodo Ailoot selezionato.

Listini di riferimento del modello

#### Prezzi per configurazione

Associa ogni costo alle condizioni indicate. Usa una sola tariffa per ogni insieme di configurazioni alternative.

| Configurazione | Listino delle tariffe | Token di contesto, più di | Token di contesto, fino al limite incluso | Costo |
| --- | --- | --- | --- | --- |
| ConfigurazioneOpenAI Chat · Tariffe base per token | Listino delle tariffeTariffa base | Token di contesto, più di— | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneOpenAI Chat · Fascia 1 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di0 | Token di contesto, fino al limite incluso256.000 | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneOpenAI Chat · Fascia 2 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di256.000 | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00192** / 1K token Output · Token in output **$0.00768** / 1K token Input · Lettura dalla cache **$0.000384** / 1K token Input · Scrittura nella cache **$0.0024** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneAnthropic Messages · Tariffe base per token | Listino delle tariffeTariffa base | Token di contesto, più di— | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneAnthropic Messages · Fascia 1 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di0 | Token di contesto, fino al limite incluso256.000 | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneAnthropic Messages · Fascia 2 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di256.000 | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00192** / 1K token Output · Token in output **$0.00768** / 1K token Input · Lettura dalla cache **$0.000384** / 1K token Input · Scrittura nella cache **$0.0024** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |

### Esempi di richieste

#### Ailoot · Anthropic Messages

Esempio di testoInput, immaginePython SDKNode.js SDKStreaming Python

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

### Ricevi e salva i risultati

#### Ailoot · Anthropic Messages

json o SSE

##### Conserva tutti i risultati completati

Conserva ogni risposta, file e parte di contenuto restituiti per intero.

Conserva tutti i blocchi di contenuto, le firme di ragionamento e gli ID effettivi di utilizzo degli strumenti. Assembla tutti i delta dei blocchi SSE; il primo blocco di testo non è l’uscita completa.

##### Se occorre verificare la risposta originale

Conserva gli ID e le intestazioni di richiesta/risposta. Non viene fornito alcun URL generico per recuperare un’attività testuale.

Campi della risposta

| Campo | Tipo |
| --- | --- |
| Campo`id` | Tipostring |
| Campo`model` | Tipostring |
| Campo`content[]` | Tipotext\|thinking\|tool\_use\|other content block |
| Campo`stop_reason` | Tipostring\|null |
| Campo`usage` | Tipoobject |

Errori e passaggi successivi

| Risposta | Condizione | Passaggio successivo |
| --- | --- | --- |
| Risposta400 · `invalid_request_error` | CondizioneCampi obbligatori, rappresentazione del materiale o valore del parametro non validi | Passaggio successivoCorreggi i campi indicati prima di una nuova richiesta di creazione. |

### Alias

#### Alias del modello

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

#### Alias dei percorsi dei metodi

`/chat/completions`

#### ID di chiamata correlati

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

Alibaba /`qwen-plus`

ID del modello

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

### Introduzione

Qwen3.7 Plus è il modello Qwen di Alibaba per attività testuali e con immagini, con risposte testuali. Il profilo pubblicato combina un contesto di un milione di token, ragionamento, strumenti basati su funzioni e controlli degli output strutturati per assistenti e analisi documentale o visiva.

Input accettati

Testo · Immagini

Risultati

Testo

### Disponibile in Ailoot · input e metodi

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

Tipi di input

`text`, `image`

Tipi di output

`text`

Contesto

991.808 tokens

Output massimo

131.072 tokens

Formato di output

json o SSE

| Campo | Tipo | Requisito | Valori e limiti | Predefinito |
| --- | --- | --- | --- | --- |
| Campo`model` | Tipo`string` | RequisitoObbligatorio | Valori e limiti qwen-plus | Predefinito— |
| Campo`input` | Tipo`string\|input_item[]` | RequisitoObbligatorio | Valori e limiti | Predefinito— |
| Campo`instructions` | Tipo`string` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`input[].type` | Tipo`string` | RequisitoFacoltativo | Valori e limiti message, reasoning, function\_call, function\_call\_output | Predefinito— |
| Campo`input[].content` | Tipo`string\|content_part[]` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`input[].call_id` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Si applica quando: function\_call\_output; conserva il call\_id effettivamente restituito | Predefinito— |
| Campo`input[].output` | Tipo`string\|content_part[]` | RequisitoFacoltativo | Valori e limiti Si applica quando: function\_call\_output | Predefinito— |
| Campo`max_output_tokens` | Tipo`integer` | RequisitoFacoltativo | Valori e limiti Minimo: 1 Dipende dal modello | Predefinito— |
| Campo`stream` | Tipo`boolean` | RequisitoFacoltativo | Valori e limiti | Predefinitofalse |
| Campo`temperature` | Tipo`number` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`top_p` | Tipo`number` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`tools` | Tipo`tool[]` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`tool_choice` | Tipo`string\|object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`parallel_tool_calls` | Tipo`boolean` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`reasoning.effort` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`reasoning.summary` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`text.format` | Tipo`object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`text.verbosity` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`include` | Tipo`string[]` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`store` | Tipo`boolean` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`previous_response_id` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Requisito dell’ID: Solo un ID di risposta effettivo proveniente da una continuazione supportata Dipende dal modello | Predefinito— |
| Campo`service_tier` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`prompt_cache_key` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`prompt_cache_options` | Tipo`object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |

Combinazioni di materiali in input

**Testo** · Testo UTF8

`Testo in ingresso o parte input_text`

**Testo + immagine**

`{type:input_image,image_url}`

Parametri e ciclo di vita del metodo

| Parametro | Contratto |
| --- | --- |
| Parametro`material_types` | Contrattotext, image |
| Parametro`required` | Contrattomodel, input |
| Parametro`optional_controls` | Contrattonull |
| Parametro`content_type` | Contrattoapplication/json |
| Parametro`text_file_material` | ContrattoContenuto UTF-8 effettivo inserito come testo; ID di file/URLs richiedono supporto separato ed esatto |

Ciclo di vita: `exact retained published method`

Le strutture dei metodi e gli ID sono esatti; la capacità del fornitore è distinta dall’ammissione delle richieste.

### Tariffe

#### Tariffe dei metodi Ailoot

Input

0,0004 USD */ 1K*

Output

0,0016 USD */ 1K*

Lettura dalla cache

0,00008 USD */ 1K*

Scrittura nella cache

0,0004 USD */ 1K*

Scrittura nella cache, 5 min

0,0004 USD */ 1K tokens*

code\_interpreter\_call

0,00 USD *per chiamata*

image\_search\_call

0,008 USD *per chiamata*

web\_extractor\_call

0,00 USD *per chiamata*

web\_search\_call

0,01 USD *per chiamata*

web\_search\_image\_call

0,008 USD *per chiamata*

Numero massimo di chiamate code\_interpreter\_call

8

Numero massimo di chiamate image\_search\_call

8

Numero massimo di chiamate web\_extractor\_call

8

Numero massimo di chiamate web\_search\_call

8

Numero massimo di chiamate web\_search\_image\_call

8

#### Prezzi per lunghezza della richiesta · OpenAI Responses

| Dimensione della richiesta, in token | Input | Output | Lettura dalla cache | Scrittura nella cache | Cache 5 min | Cache 1 ora |
| --- | --- | --- | --- | --- | --- | --- |
| Dimensione della richiesta, in token(0; 256.000\] | Input0,0004 USD | Output0,0016 USD | Lettura dalla cache0,00008 USD | Scrittura nella cache0,0004 USD | Cache 5 min0,0004 USD | Cache 1 oraTariffa base: — |
| Dimensione della richiesta, in token(256.000; ∞) | Input0,0012 USD | Output0,0048 USD | Lettura dalla cache≈0,00024 USD | Scrittura nella cache0,0012 USD | Cache 5 min0,0012 USD | Cache 1 oraTariffa base: — |

Tariffe in USD per 1K token. Se non è impostata alcuna tariffa, viene ereditata la tariffa base di questo metodo; «—» indica che non è impostata alcuna tariffa base.

Ailoot prenota un importo stimato prima di una richiesta. Dopo il risultato, addebita il costo finale in base all’utilizzo misurato. Per lo streaming, l’addebito usa il record finale di utilizzo. [Come funzionano la prenotazione e l’addebito finale →](https://ailoot.ai/docs/it/billing/reserve/)

#### Dettagli della tariffa di riferimento

I listini di riferimento del modello non modificano la selezione del metodo, i preventivi o gli addebiti. Gli addebiti attivi usano le tariffe del metodo Ailoot selezionato.

Listini di riferimento del modello

#### Prezzi per configurazione

Associa ogni costo alle condizioni indicate. Usa una sola tariffa per ogni insieme di configurazioni alternative.

| Configurazione | Listino delle tariffe | Token di contesto, più di | Token di contesto, fino al limite incluso | Costo |
| --- | --- | --- | --- | --- |
| ConfigurazioneOpenAI Chat · Tariffe base per token | Listino delle tariffeTariffa base | Token di contesto, più di— | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneOpenAI Chat · Fascia 1 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di0 | Token di contesto, fino al limite incluso256.000 | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneOpenAI Chat · Fascia 2 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di256.000 | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00192** / 1K token Output · Token in output **$0.00768** / 1K token Input · Lettura dalla cache **$0.000384** / 1K token Input · Scrittura nella cache **$0.0024** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneAnthropic Messages · Tariffe base per token | Listino delle tariffeTariffa base | Token di contesto, più di— | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneAnthropic Messages · Fascia 1 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di0 | Token di contesto, fino al limite incluso256.000 | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneAnthropic Messages · Fascia 2 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di256.000 | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00192** / 1K token Output · Token in output **$0.00768** / 1K token Input · Lettura dalla cache **$0.000384** / 1K token Input · Scrittura nella cache **$0.0024** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |

### Esempi di richieste

#### Ailoot · OpenAI Responses

Esempio di testoInput, immaginePython SDKNode.js SDKStreaming Python

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

### Ricevi e salva i risultati

#### Ailoot · OpenAI Responses

json o SSE

##### Conserva tutti i risultati completati

Conserva ogni risposta, file e parte di contenuto restituiti per intero.

Conserva ogni elemento di uscita e parte di contenuto, il call\_id effettivo della funzione, il ragionamento cifrato e i dati di utilizzo. Nello streaming conserva l’identità completa di eventi ed elementi.

##### Se occorre verificare la risposta originale

Conserva gli ID e le intestazioni di richiesta/risposta. Non viene fornito alcun URL generico per recuperare un’attività testuale.

Campi della risposta

| Campo | Tipo |
| --- | --- |
| Campo`id` | Tipostring |
| Campo`status` | Tipostring |
| Campo`output[]` | Tipomessage\|reasoning\|function\_call\|other item |
| Campo`output[].content[]` | Tipocontent part |
| Campo`usage` | Tipoobject |

Errori e passaggi successivi

| Risposta | Condizione | Passaggio successivo |
| --- | --- | --- |
| Risposta400 · `invalid_request_error` | CondizioneCampi obbligatori, rappresentazione del materiale o valore del parametro non validi | Passaggio successivoCorreggi i campi indicati prima di una nuova richiesta di creazione. |

### Alias

#### Alias del modello

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

#### Alias dei percorsi dei metodi

`/chat/completions`

#### ID di chiamata correlati

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

Alibaba /`qwen-plus`

ID del modello

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

### Introduzione

Qwen3.7 Plus è il modello Qwen di Alibaba per attività testuali e con immagini, con risposte testuali. Il profilo pubblicato combina un contesto di un milione di token, ragionamento, strumenti basati su funzioni e controlli degli output strutturati per assistenti e analisi documentale o visiva.

Input accettati

Testo · Immagini

Risultati

Testo

### Disponibile in Ailoot · input e metodi

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

Tipi di input

`text`, `image`

Tipi di output

`text`

Contesto

991.808 tokens

Output massimo

131.072 tokens

Formato di output

json o SSE

| Campo | Tipo | Requisito | Valori e limiti | Predefinito |
| --- | --- | --- | --- | --- |
| Campo`model` | Tipo`string` | RequisitoObbligatorio | Valori e limiti qwen-plus | Predefinito— |
| Campo`messages` | Tipo`message[]` | RequisitoObbligatorio | Valori e limiti Numero minimo di elementi: 1 | Predefinito— |
| Campo`messages[].role` | Tipo`string` | RequisitoObbligatorio | Valori e limiti Esempi: system, user, assistant, tool, function Condizioni: Questi ruoli sono rappresentati esplicitamente dai tipi di compatibilità del codice sorgente; l’insieme esatto dei ruoli rimane specifico del modello. Dipende dal modello | Predefinito— |
| Campo`messages[].content` | Tipo`string\|content_part[]\|null` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`messages[].tool_calls` | Tipo`tool_call[]` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`messages[].tool_call_id` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Si applica quando: role=tool; usa l’ID effettivamente restituito | Predefinito— |
| Campo`messages[].name` | Tipo`string` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`messages[].reasoning_content` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Si applica quando: Reinserisci il ragionamento effettivamente restituito quando il modello lo utilizza | Predefinito— |
| Campo`messages[].reasoning_details` | Tipo`object\|array` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`max_tokens` | Tipo`integer` | RequisitoFacoltativo | Valori e limiti Minimo: 1 Dipende dal modello | Predefinito— |
| Campo`max_completion_tokens` | Tipo`integer` | RequisitoFacoltativo | Valori e limiti Minimo: 1 Dipende dal modello | Predefinito— |
| Campo`stream` | Tipo`boolean` | RequisitoFacoltativo | Valori e limiti | Predefinitofalse |
| Campo`stream_options.include_usage` | Tipo`boolean` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`temperature` | Tipo`number` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`top_p` | Tipo`number` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`stop` | Tipo`string\|string[]` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`tools` | Tipo`function_tool[]` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`tools[].type` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`tools[].function.name` | Tipo`string` | RequisitoObbligatorio | Valori e limiti Si applica quando: Funzione fornita come strumento | Predefinito— |
| Campo`tools[].function.description` | Tipo`string` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`tools[].function.parameters` | Tipo`JSON_schema` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`tool_choice` | Tipo`string\|object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`parallel_tool_calls` | Tipo`boolean` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`response_format` | Tipo`object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`reasoning_effort` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`reasoning` | Tipo`object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`service_tier` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`instructions` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Campo di compatibilità | Predefinito— |
| Campo`functions` | Tipo`function[]` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`function_call` | Tipo`string\|object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`prompt_cache_options` | Tipo`object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |

Combinazioni di materiali in input

**Testo** · Testo UTF8

`messages[].content`

**Testo + immagine**

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

Parametri e ciclo di vita del metodo

| Parametro | Contratto |
| --- | --- |
| Parametro`material_types` | Contrattotext, image |
| Parametro`required` | Contrattomodel, messages |
| Parametro`optional_controls` | Contrattonull |
| Parametro`content_type` | Contrattoapplication/json |
| Parametro`text_file_material` | ContrattoContenuto UTF-8 effettivo inserito come testo; ID di file/URLs richiedono supporto separato ed esatto |

Ciclo di vita: `exact retained published method`

Le strutture dei metodi e gli ID sono esatti; la capacità del fornitore è distinta dall’ammissione delle richieste.

### Tariffe

#### Tariffe dei metodi Ailoot

Input

0,0004 USD */ 1K*

Output

0,0016 USD */ 1K*

Lettura dalla cache

0,00008 USD */ 1K*

Scrittura nella cache

0,0004 USD */ 1K*

Scrittura nella cache, 5 min

0,0004 USD */ 1K tokens*

#### Prezzi per lunghezza della richiesta · OpenAI Chat

| Dimensione della richiesta, in token | Input | Output | Lettura dalla cache | Scrittura nella cache | Cache 5 min | Cache 1 ora |
| --- | --- | --- | --- | --- | --- | --- |
| Dimensione della richiesta, in token(0; 256.000\] | Input0,0004 USD | Output0,0016 USD | Lettura dalla cache0,00008 USD | Scrittura nella cache0,0004 USD | Cache 5 min0,0004 USD | Cache 1 oraTariffa base: — |
| Dimensione della richiesta, in token(256.000; ∞) | Input0,0012 USD | Output0,0048 USD | Lettura dalla cache≈0,00024 USD | Scrittura nella cache0,0012 USD | Cache 5 min0,0012 USD | Cache 1 oraTariffa base: — |

Tariffe in USD per 1K token. Se non è impostata alcuna tariffa, viene ereditata la tariffa base di questo metodo; «—» indica che non è impostata alcuna tariffa base.

Ailoot prenota un importo stimato prima di una richiesta. Dopo il risultato, addebita il costo finale in base all’utilizzo misurato. Per lo streaming, l’addebito usa il record finale di utilizzo. [Come funzionano la prenotazione e l’addebito finale →](https://ailoot.ai/docs/it/billing/reserve/)

#### Dettagli della tariffa di riferimento

I listini di riferimento del modello non modificano la selezione del metodo, i preventivi o gli addebiti. Gli addebiti attivi usano le tariffe del metodo Ailoot selezionato.

Listini di riferimento del modello

#### Prezzi per configurazione

Associa ogni costo alle condizioni indicate. Usa una sola tariffa per ogni insieme di configurazioni alternative.

| Configurazione | Listino delle tariffe | Token di contesto, più di | Token di contesto, fino al limite incluso | Costo |
| --- | --- | --- | --- | --- |
| ConfigurazioneOpenAI Chat · Tariffe base per token | Listino delle tariffeTariffa base | Token di contesto, più di— | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneOpenAI Chat · Fascia 1 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di0 | Token di contesto, fino al limite incluso256.000 | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneOpenAI Chat · Fascia 2 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di256.000 | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00192** / 1K token Output · Token in output **$0.00768** / 1K token Input · Lettura dalla cache **$0.000384** / 1K token Input · Scrittura nella cache **$0.0024** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneAnthropic Messages · Tariffe base per token | Listino delle tariffeTariffa base | Token di contesto, più di— | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneAnthropic Messages · Fascia 1 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di0 | Token di contesto, fino al limite incluso256.000 | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneAnthropic Messages · Fascia 2 in base alla lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di256.000 | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00192** / 1K token Output · Token in output **$0.00768** / 1K token Input · Lettura dalla cache **$0.000384** / 1K token Input · Scrittura nella cache **$0.0024** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |

### Esempi di richieste

#### Ailoot · OpenAI Chat

Esempio di testoInput, immaginePython SDKNode.js SDKStreaming Python

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

### Ricevi e salva i risultati

#### Ailoot · OpenAI Chat

json o SSE

##### Conserva tutti i risultati completati

Conserva ogni risposta, file e parte di contenuto restituiti per intero.

Conserva ogni scelta con contenuto, chiamate agli strumenti e ragionamento. In SSE assembla i delta per indice di scelta e strumento e conserva il motivo finale di completamento e i dati di utilizzo.

##### Se occorre verificare la risposta originale

Conserva gli ID e le intestazioni di richiesta/risposta. Non viene fornito alcun URL generico per recuperare un’attività testuale.

Campi della risposta

| Campo | Tipo |
| --- | --- |
| Campo`choices[].index` | Tipointeger |
| Campo`choices[].message.content` | Tipostring\|null |
| Campo`choices[].message.tool_calls` | Tipotool\_call\[\] |
| Campo`choices[].message.reasoning_content` | Tipostring |
| Campo`choices[].message.reasoning_details` | Tipoobject\|array |
| Campo`choices[].finish_reason` | Tipostring\|null |
| Campo`usage` | Tipoobject |

Errori e passaggi successivi

| Risposta | Condizione | Passaggio successivo |
| --- | --- | --- |
| Risposta400 · `invalid_request_error` | CondizioneCampi obbligatori, rappresentazione del materiale o valore del parametro non validi | Passaggio successivoCorreggi i campi indicati prima di una nuova richiesta di creazione. |

### Alias

#### Alias del modello

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

#### Alias dei percorsi dei metodi

`/chat/completions`

#### ID di chiamata correlati

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

Alibaba /`qwen/qwen3.7-plus`

ID del modello

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

### Introduzione

Qwen3.7 Plus è il modello Qwen di Alibaba per attività testuali e con immagini, con risposte testuali. Il profilo pubblicato combina un contesto di un milione di token, ragionamento, strumenti basati su funzioni e controlli degli output strutturati per assistenti e analisi documentale o visiva.

Input accettati

Testo

Risultati

Testo

### Disponibile in Ailoot · input e metodi

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

Tipi di input

`text`

Tipi di output

`text`

Formato di output

json o SSE

| Campo | Tipo | Requisito | Valori e limiti | Predefinito |
| --- | --- | --- | --- | --- |
| Campo`model` | Tipo`string` | RequisitoObbligatorio | Valori e limiti qwen/qwen3.7-plus | Predefinito— |
| Campo`messages` | Tipo`message[]` | RequisitoObbligatorio | Valori e limiti Numero minimo di elementi: 1 | Predefinito— |
| Campo`messages[].role` | Tipo`string` | RequisitoObbligatorio | Valori e limiti Esempi: system, user, assistant, tool, function Condizioni: Questi ruoli sono rappresentati esplicitamente dai tipi di compatibilità del codice sorgente; l’insieme esatto dei ruoli rimane specifico del modello. Dipende dal modello | Predefinito— |
| Campo`messages[].content` | Tipo`string\|content_part[]\|null` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`messages[].tool_calls` | Tipo`tool_call[]` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`messages[].tool_call_id` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Si applica quando: role=tool; usa l’ID effettivamente restituito | Predefinito— |
| Campo`messages[].name` | Tipo`string` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`messages[].reasoning_content` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Si applica quando: Reinserisci il ragionamento effettivamente restituito quando il modello lo utilizza | Predefinito— |
| Campo`messages[].reasoning_details` | Tipo`object\|array` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`max_tokens` | Tipo`integer` | RequisitoFacoltativo | Valori e limiti Minimo: 1 Dipende dal modello | Predefinito— |
| Campo`max_completion_tokens` | Tipo`integer` | RequisitoFacoltativo | Valori e limiti Minimo: 1 Dipende dal modello | Predefinito— |
| Campo`stream` | Tipo`boolean` | RequisitoFacoltativo | Valori e limiti | Predefinitofalse |
| Campo`stream_options.include_usage` | Tipo`boolean` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`temperature` | Tipo`number` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`top_p` | Tipo`number` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`stop` | Tipo`string\|string[]` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`tools` | Tipo`function_tool[]` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`tools[].type` | Tipo`string` | RequisitoFacoltativo | Valori e limiti function Dipende dal modello | Predefinito— |
| Campo`tools[].function.name` | Tipo`string` | RequisitoObbligatorio | Valori e limiti Si applica quando: Funzione fornita come strumento | Predefinito— |
| Campo`tools[].function.description` | Tipo`string` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`tools[].function.parameters` | Tipo`JSON_schema` | RequisitoFacoltativo | Valori e limiti | Predefinito— |
| Campo`tool_choice` | Tipo`string\|object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`parallel_tool_calls` | Tipo`boolean` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`response_format` | Tipo`object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`reasoning_effort` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`reasoning` | Tipo`object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`service_tier` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`instructions` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Campo di compatibilità | Predefinito— |
| Campo`functions` | Tipo`function[]` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`function_call` | Tipo`string\|object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`prompt_cache_options` | Tipo`object` | RequisitoFacoltativo | Valori e limiti Dipende dal modello | Predefinito— |
| Campo`modalities` | Tipo`string[]` | RequisitoFacoltativo | Valori e limiti text | Predefinito— |
| Campo`provider` | Tipo`object` | RequisitoFacoltativo | Valori e limiti Condizioni: provider.options viene rifiutato su questa rotta testuale Ultra | Predefinito— |
| Campo`cache_control.ttl` | Tipo`string` | RequisitoFacoltativo | Valori e limiti Condizioni: 1h viene rifiutato nelle posizioni effettive della cache dei prompt | Predefinito— |

Combinazioni di materiali in input

**Testo** · Testo UTF8

`messages[].content`

Parametri e ciclo di vita del metodo

| Parametro | Contratto |
| --- | --- |
| Parametro`content_type` | Contrattoapplication/json |
| Parametro`required` | Contrattomodel, messages |
| Parametro`material_types` | Contrattotext |
| Parametro`messages` | ContrattoArray di messaggi con struttura role/content |
| Parametro`file_material` | ContrattoDocumento UTF-8 effettivo inserito come testo letterale; nessun ID di file dedotto |
| Parametro`optional_controls` | Contrattostream, temperature, top\_p, stop, max\_tokens, max\_completion\_tokens, reasoning, response\_format, tools, tool\_choice |
| Parametro`control_scope` | ContrattoSpecifico del modello; gli strumenti di funzione dell’utente differiscono dagli strumenti ospitati |
| Parametro`output_modalities` | Contrattotext |
| Parametro`hosted_operations` | Contrattofalse |
| Parametro`multimodal_input_binding` | Contrattonull |

Ciclo di vita: `synchronous_or_streamed`

Invia l’ID esatto del modello con messages.

La lunghezza del contesto non è un limite di uscita.

Un file di testo può fornire testo letterale; gli ingressi immagine/audio/oggetto file richiedono un’associazione esatta.

### Tariffe

Le tariffe non aggiungono opzioni alla richiesta. I parametri supportati sono elencati nel metodo selezionato.

Modalità rapida

Tariffa standard Quando è selezionata la modalità rapida

Modalità flex

Tariffa standard Quando è selezionata la modalità flex

Sforzo massimo di ragionamento

Tariffa standard Quando lo sforzo massimo di ragionamento usa l'adeguamento predefinito (default)

#### Tariffe Ailoot

#### Prezzi per configurazione

Associa ogni costo alle condizioni indicate. Usa una sola tariffa per ogni insieme di configurazioni alternative.

| Configurazione | Listino delle tariffe | Token di contesto, più di | Token di contesto, fino al limite incluso | Costo |
| --- | --- | --- | --- | --- |
| ConfigurazioneTariffe di base dei token | Listino delle tariffeTariffa base | Token di contesto, più di— | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneFascia 1 di lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di0 | Token di contesto, fino al limite incluso256.000 | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneFascia 2 di lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di256.000 | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00192** / 1K token Output · Token in output **$0.00768** / 1K token Input · Lettura dalla cache **$0.000384** / 1K token Input · Scrittura nella cache **$0.0024** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |

Ailoot prenota un importo stimato prima di una richiesta. Dopo il risultato, addebita il costo finale in base all’utilizzo misurato. Per lo streaming, l’addebito usa il record finale di utilizzo. [Come funzionano la prenotazione e l’addebito finale →](https://ailoot.ai/docs/it/billing/reserve/)

### Esempi di richieste

#### Ailoot Ultra · OpenAI Chat

curlPython SDKStreaming Python

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

### Ricevi e salva i risultati

#### Ailoot Ultra · OpenAI Chat

json o SSE

##### Conserva tutti i risultati completati

Conserva ogni risposta, file e parte di contenuto restituiti per intero.

Conserva ogni scelta con contenuto, chiamate agli strumenti e ragionamento. In SSE assembla i delta per indice di scelta e strumento e conserva il motivo finale di completamento e i dati di utilizzo.

##### Se occorre verificare la risposta originale

Conserva gli ID e le intestazioni di richiesta/risposta. Non viene fornito alcun URL generico per recuperare un’attività testuale.

Campi della risposta

| Campo | Tipo |
| --- | --- |
| Campo`choices[].index` | Tipointeger |
| Campo`choices[].message.content` | Tipostring\|null |
| Campo`choices[].message.tool_calls` | Tipotool\_call\[\] |
| Campo`choices[].message.reasoning_content` | Tipostring |
| Campo`choices[].message.reasoning_details` | Tipoobject\|array |
| Campo`choices[].finish_reason` | Tipostring\|null |
| Campo`usage` | Tipoobject |

Errori e passaggi successivi

| Risposta | Condizione | Passaggio successivo |
| --- | --- | --- |
| Risposta400 · `invalid_request_error` | CondizioneCampi obbligatori, rappresentazione del materiale o valore del parametro non validi | Passaggio successivoCorreggi i campi indicati prima di una nuova richiesta di creazione. |

### Alias

#### Alias del modello

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

#### Alias dei percorsi dei metodi

`/chat/completions`

#### ID di chiamata correlati

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

Alibaba /`qwen/qwen3.7-plus`

ID del modello

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

### Introduzione

Qwen3.7 Plus è il modello Qwen di Alibaba per attività testuali e con immagini, con risposte testuali. Il profilo pubblicato combina un contesto di un milione di token, ragionamento, strumenti basati su funzioni e controlli degli output strutturati per assistenti e analisi documentale o visiva.

Input accettati

Testo

Risultati

json · sse

### Disponibile in Ailoot · input e metodi

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

Tipi di input

`text`

Tipi di output

`json`, `sse`

Formato di output

JSON o SSE

| Campo | Tipo | Requisito | Valori e limiti | Predefinito |
| --- | --- | --- | --- | --- |
| Campo`model` | Tipo`string` | RequisitoObbligatorio | Valori e limiti qwen/qwen3.7-plus | Predefinito— |
| Campo`messages` | Tipo`message[]` | RequisitoObbligatorio | Valori e limiti | Predefinito— |
| Campo`messages[].role` | Tipo`string` | RequisitoObbligatorio | Valori e limiti user, assistant | Predefinito— |
| Campo`messages[].content` | Tipo`string` | RequisitoObbligatorio | Valori e limiti | Predefinito— |
| Campo`max_tokens` | Tipo`integer` | RequisitoObbligatorio | Valori e limiti | Predefinito— |
| Campo`stream` | Tipo`boolean` | RequisitoFacoltativo | Valori e limiti | Predefinitofalse |

Combinazioni di materiali in input

**Testo** · Testo UTF-8

`Stringa messages[].content`

Parametri e ciclo di vita del metodo

| Parametro | Contratto |
| --- | --- |
| Parametro`content_type` | Contrattoapplication/json |
| Parametro`required` | Contrattomodel, messages, max\_tokens |
| Parametro`optional_controls` | Contrattostream |
| Parametro`material_types` | Contrattotext |
| Parametro`text_file_material` | ContrattoLeggi il documento UTF-8 effettivo e inserisci il testo nell’ingresso indicato o nella stringa del contenuto del messaggio. |

Ciclo di vita: `synchronous_or_streamed`

### Tariffe

Le tariffe non aggiungono opzioni alla richiesta. I parametri supportati sono elencati nel metodo selezionato.

Modalità rapida

Tariffa standard Quando è selezionata la modalità rapida

Modalità flex

Tariffa standard Quando è selezionata la modalità flex

Sforzo massimo di ragionamento

Tariffa standard Quando lo sforzo massimo di ragionamento usa l'adeguamento predefinito (default)

#### Tariffe Ailoot

#### Prezzi per configurazione

Associa ogni costo alle condizioni indicate. Usa una sola tariffa per ogni insieme di configurazioni alternative.

| Configurazione | Listino delle tariffe | Token di contesto, più di | Token di contesto, fino al limite incluso | Costo |
| --- | --- | --- | --- | --- |
| ConfigurazioneTariffe di base dei token | Listino delle tariffeTariffa base | Token di contesto, più di— | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneFascia 1 di lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di0 | Token di contesto, fino al limite incluso256.000 | Costo Input · Token in input **$0.00064** / 1K token Output · Token in output **$0.00256** / 1K token Input · Lettura dalla cache **$0.000128** / 1K token Input · Scrittura nella cache **$0.0008** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |
| ConfigurazioneFascia 2 di lunghezza della richiesta | Listino delle tariffe— | Token di contesto, più di256.000 | Token di contesto, fino al limite inclusoNessun limite superiore | Costo Input · Token in input **$0.00192** / 1K token Output · Token in output **$0.00768** / 1K token Input · Lettura dalla cache **$0.000384** / 1K token Input · Scrittura nella cache **$0.0024** / 1K token Input · Scrittura nella cache, 1 ora **—** / 1K token |

Ailoot prenota un importo stimato prima di una richiesta. Dopo il risultato, addebita il costo finale in base all’utilizzo misurato. Per lo streaming, l’addebito usa il record finale di utilizzo. [Come funzionano la prenotazione e l’addebito finale →](https://ailoot.ai/docs/it/billing/reserve/)

### Esempi di richieste

#### Ailoot Ultra · Anthropic Messages

Corpo JSON minimo completocurl · usa il tuo documento UTF-8Python · salva il risultato completo

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

### Ricevi e salva i risultati

#### Ailoot Ultra · Anthropic Messages

JSON o SSE

##### Conserva tutti i risultati completati

Conserva ogni risposta, file e parte di contenuto restituiti per intero.

Conserva tutti i blocchi di contenuto, le firme di ragionamento e gli ID effettivi di utilizzo degli strumenti. Assembla tutti i delta dei blocchi SSE; il primo blocco di testo non è l’uscita completa.

##### Se occorre verificare la risposta originale

Conserva gli ID e le intestazioni di richiesta/risposta. Non viene fornito alcun URL generico per recuperare un’attività testuale.

Campi della risposta

| Campo | Tipo |
| --- | --- |
| Campo`id` | Tipostring |
| Campo`model` | Tipostring |
| Campo`content[]` | Tipotext\|thinking\|tool\_use\|other content block |
| Campo`stop_reason` | Tipostring\|null |
| Campo`usage` | Tipoobject |

Errori e passaggi successivi

| Risposta | Condizione | Passaggio successivo |
| --- | --- | --- |
| Risposta400 · `invalid_request_error` | CondizioneCampi obbligatori, rappresentazione del materiale o valore del parametro non validi | Passaggio successivoCorreggi i campi indicati prima di una nuova richiesta di creazione. |

### Alias

#### Alias del modello

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

#### Alias dei percorsi dei metodi

`/chat/completions`

#### ID di chiamata correlati

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

FAQ · Qwen: Qwen3.7 Plus

Quali input e risultati sono disponibili?

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

Quali campi usa la richiesta?

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

Quali limiti si applicano?

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

Collega Ailoot a Claude Code, OpenCode, Hermes o alla tua applicazione.

## L’azienda e il suo portafoglio di progetti

L’azienda e il suo portafoglio di progetti: milioni di clienti; vendite nell’ordine dei miliardi ogni mese.

## Acquista token con uno sconto.

Sconto con abbonamento per lavoro regolare. Codici fino al 50% sull’acquisto di token.

Abbonamento

Scegli un piano scontato per richieste regolari.

Codice fino al 50%

Inserisci il codice all’acquisto. Il prezzo si aggiorna secondo la promozione.

Spese nella cronologia

Modello, token e importo sono salvati per ogni richiesta.

[Scegli abbonamento](https://ailoot.ai/docs/it/billing/subscriptions/) · [Consulta prezzi dei modelli](https://ailoot.ai/models/it/)

## Collega l’API al prodotto che vendi.

SaaS, app e bot secondo offerta e accordo di licenza Ailoot. Per rivendere, richiedi una licenza reseller.

Applicazione commerciale

Integra generazione di testo, immagini, video e suono nelle funzioni a pagamento.

Licenza reseller

Invia descrizione del progetto e schema di accesso. Richiedi condizioni scritte per uso e rivendita.

Documenti sul sito

Offerta, accordo di licenza e politica sui dati sono disponibili prima della connessione.

[Richiedi licenza reseller](mailto:support@ailoot.ai) · [Offerta e accordo di licenza](https://ailoot.ai/legal/offer?lang=it)

## Ailoot · L’azienda e il suo portafoglio di progetti





Ailoot si basa su un’esperienza operativa consolidata, un’ampia base di clienti, un servizio stabile e un controllo costante dei KPI.





L’azienda e il suo portafoglio di progetti: milioni di clienti; vendite nell’ordine dei miliardi ogni mese.





Ailoot mette questa esperienza operativa al servizio dell’accesso API alle funzioni AI nei prodotti dei clienti, negli agenti, nelle applicazioni e nelle automazioni.
