SpaceXAI: Grok 4.5
Grok 4.5 ist das Modell von SpaceXAI für Programmierung, Wissensarbeit und MINT-Aufgaben. Es nimmt Text, Bilder und Dateien entgegen und liefert Textantworten. Das veröffentlichte Profil umfasst Steuerelemente für Reasoning, Werkzeuge und strukturierte Ausgaben sowie ein Kontextfenster von 500.000 Token.
- Ailoot · Anthropic Messages
POST /v1/messagesgrok-4.5 - Ailoot · OpenAI Responses
POST /v1/responsesgrok-4.5 - Ailoot · OpenAI Chat
POST /v1/chat/completionsgrok-4.5 - Ailoot Ultra · OpenAI Chat
POST /v1/chat/completionsgrok-4.5 - Ailoot Ultra · Anthropic Messages
POST /v1/messagesgrok-4.5 - Ailoot · Anthropic Messages
POST /v1/messagesgrok-4.5-latest - Ailoot · OpenAI Responses
POST /v1/responsesgrok-4.5-latest - Ailoot · OpenAI Chat
POST /v1/chat/completionsgrok-4.5-latest - Ailoot · Anthropic Messages
POST /v1/messagesgrok-build-latest - Ailoot · OpenAI Responses
POST /v1/responsesgrok-build-latest - Ailoot · OpenAI Chat
POST /v1/chat/completionsgrok-build-latest - Ailoot Ultra · OpenAI Chat
POST /v1/chat/completionsx-ai/grok-4.5 - Ailoot Ultra · Anthropic Messages
POST /v1/messagesx-ai/grok-4.5
Über das Modell
Diese Beschreibung erläutert die Fähigkeiten des Modells. Die über Ailoot verfügbaren Eingaben, Ausgaben und Optionen sind unten für die ausgewählte Methode aufgeführt.
Grok 4.5 ist das Modell von SpaceXAI für Programmierung, Wissensarbeit und MINT. Sein veröffentlichtes Profil nimmt Text, Bilder und Dateien entgegen und gibt Text zurück. Das Kontextfenster umfasst 500.000 Token, sodass zusammengehöriges Quellmaterial und die aktuelle Aufgabe in einem Arbeitsbriefing vereint bleiben können.
Programmierung und technische Fragen
Stellen Sie für eine Codeaufgabe die relevante Implementierung, den beobachteten Fehler oder das Verhalten und die benötigte Korrektur bereit. Fordern Sie eine gezielte Änderung und ein Verfahren zu ihrer Prüfung an. Geben Sie für eine MINT-Erklärung Größen, Annahmen und Fragestellung ausdrücklich an, einschließlich der Einheiten aus der Quelle. Halten Sie die Eingaben einer Berechnung identifizierbar, damit Argumentation und Ergebnis gemeinsam überprüft werden können.
Mit Dokumenten und visuellen Belegen arbeiten
Kennzeichnen Sie bereitgestellte Dateien, Textstellen und Bilder. Ein Briefing für Wissensarbeit kann einen Vergleich benannter Dokumente, die Zusammenfassung eines bestimmten Abschnitts oder eine Liste von Erkenntnissen mit Quellenbezug verlangen. Eine visuelle Frage sollte den zu untersuchenden Bereich oder Gegenstand und das benötigte Detail der Antwort benennen. Bewahren Sie fehlende oder widersprüchliche Informationen, statt sie in einer Zusammenfassung verschwinden zu lassen.
Reasoning und strukturierte Ergebnisse
Das veröffentlichte Hosting-Profil nennt Steuerelemente für Reasoning, Funktionswerkzeuge und strukturierte Ausgaben. Definieren Sie die erforderlichen Ergebnisfelder, wenn die Antwort in ein anderes System übernommen wird, und validieren Sie sowohl die Struktur als auch die inhaltlichen Werte. Bewahren Sie bei einer Aufgabe mit Werkzeugen die vom Werkzeug zurückgegebene Beobachtung auf, statt einen vorgeschlagenen Aufruf als erledigte Arbeit zu behandeln.
Ordnen Sie längeres Material in benannte Abschnitte und lassen Sie Platz für die angeforderte Antwort. Ein hilfreiches abschließendes Artefakt verbindet die Schlussfolgerung oder den Codevorschlag mit den stützenden Belegen. Quellenkennzeichnungen, Annahmen und relevante Validierungsschritte bleiben dabei für die nächste Stufe erhalten.
Praktische Aufgabe
Praktische Aufgabe
Technisches Beispiel auf Englisch
Check a power-budget decision
A portable instrument draws 12 watts for 3 hours and then 4 watts for 5 hours. Its battery stores 70 watt-hours, of which only 85 percent is usable. Calculate the required energy, compare it with usable capacity and state the minimum extra usable energy needed. Keep power and energy units distinct.Erwartetes Ergebnis
A labelled energy calculation, a capacity comparison and the remaining energy shortfall or surplus.Ergebnis prüfen
Check that watts are multiplied by hours and that the usability factor is applied to battery capacity.Ailoot · Anthropic Messages POST /v1/messages grok-4.5
grok-4.5grok-4.5grok-4.5-latestgrok-build-latest
Start
Grok 4.5 ist das Modell von SpaceXAI für Programmierung, Wissensarbeit und MINT-Aufgaben. Es nimmt Text, Bilder und Dateien entgegen und liefert Textantworten. Das veröffentlichte Profil umfasst Steuerelemente für Reasoning, Werkzeuge und strukturierte Ausgaben sowie ein Kontextfenster von 500.000 Token.
- Zulässige Eingaben
- Text · Bilder
- Ergebnisse
- Text
In Ailoot verfügbar · Eingaben und Methoden
Ailoot · Anthropic Messages POST /v1/messages
- Eingabetypen
text,image- Ausgabetypen
text- Kontext
- 500.000 tokens
- Maximale Ausgabe
- 500.000 tokens
- Ausgabeformat
- json oder SSE
| Feld | Typ | Anforderung | Werte und Limits | Standard |
|---|---|---|---|---|
Feldmodel | Typstring | AnforderungErforderlich | Werte und Limits grok-4.5 | Standard— |
Feldmessages | Typmessage[] | AnforderungErforderlich | Werte und Limits Mindestanzahl Elemente: 1 | Standard— |
Feldmessages[].role | Typstring | AnforderungErforderlich | Werte und Limits user, assistant | Standard— |
Feldmessages[].content | Typstring|content_block[] | AnforderungErforderlich | Werte und Limits | Standard— |
Feldsystem | Typstring|content_block[] | AnforderungOptional | Werte und Limits | Standard— |
Feldmax_tokens | Typinteger | AnforderungErforderlich | Werte und Limits Minimum: 1 Limit gilt für: Genaue Obergrenze des ausgewählten Modells bzw. seiner Modellkarte | Standard— |
Feldstream | Typboolean | AnforderungOptional | Werte und Limits | Standardfalse |
Feldtemperature | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtop_p | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldstop_sequences | Typstring[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtools | Typtool[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtools[].name | Typstring | AnforderungOptional | Werte und Limits Gilt, wenn: Werkzeug bereitgestellt | Standard— |
Feldtools[].description | Typstring | AnforderungOptional | Werte und Limits | Standard— |
Feldtools[].input_schema | TypJSON_schema | AnforderungOptional | Werte und Limits | Standard— |
Feldtool_choice | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldthinking.type | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldthinking.budget_tokens | Typinteger | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldoutput_config.effort | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldmetadata | Typobject | AnforderungOptional | Werte und Limits | Standard— |
Feldcache_control | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Kombinationen von Eingabematerialien
Text · UTF8-Text
messages[].content oder Block mit type=text
Text + Bild
{type:image,source:{type:base64,media_type,data}} oder Quelle mit type=url
Methodenparameter und Lebenszyklus
| Parameter | Vertrag |
|---|---|
Parametermaterial_types | Vertragtext, image |
Parameterrequired | Vertragmodel, messages, max_tokens |
Parameteroptional_controls | Vertragnull |
Parametercontent_type | Vertragapplication/json |
Parametertext_file_material | VertragTatsächlicher UTF-8-Inhalt wird als Text eingefügt; Datei-IDs/URLs müssen separat und exakt unterstützt werden |
Lebenszyklus: exact retained published method
Methodenstrukturen und IDs sind exakt; die Fähigkeiten des Anbieters sind von der Zulassung einer Anfrage zu unterscheiden.
Tarife
Ailoot-Methodentarife
POST /v1/messages- Eingabe
- 0,002 $ / 1K
- Ausgabe
- 0,006 $ / 1K
- Cache-Lesen
- 0,0003 $ / 1K
- Cache-Schreiben
- 0,00 $ / 1K
- Cache-Schreiben, 5 Min.
- 0,00 $ / 1K tokens
- Cache-Schreiben, 1 Stunde
- 0,00 $ / 1K tokens
Preise nach Anfragelänge · Anthropic Messages
| Anfragegröße in Token | Eingabe | Ausgabe | Cache-Lesen | Cache-Schreiben | Cache 5 Min. | Cache 1 Stunde |
|---|---|---|---|---|---|---|
| Anfragegröße in Token(0; 200.000] | Eingabe0,002 $ | Ausgabe0,006 $ | Cache-Lesen0,0003 $ | Cache-Schreiben0,00 $ | Cache 5 Min.0,00 $ | Cache 1 Stunde0,00 $ |
| Anfragegröße in Token(200.000; ∞) | Eingabe0,004 $ | Ausgabe0,012 $ | Cache-Lesen0,0006 $ | Cache-Schreiben0,00 $ | Cache 5 Min.0,00 $ | Cache 1 Stunde0,00 $ |
Tarife in USD pro 1K Token. Ist kein Tarif festgelegt, wird der Grundtarif dieser Methode übernommen; «—» bedeutet, dass kein Grundtarif festgelegt ist.
Ailoot reserviert vor einer Anfrage einen geschätzten Betrag. Nach dem Ergebnis rechnet Ailoot die endgültige Gebühr anhand des gemessenen Verbrauchs ab. Bei Streaming erfolgt die Abrechnung anhand des abschließenden Verbrauchsdatensatzes. So funktionieren Reservierung und Abrechnung →
Details zum Referenztarif
Referenztarifstaffeln auf Modellebene ändern weder Methodenauswahl noch Kostenvoranschläge oder Gebühren. Für die aktive Abrechnung gelten die Tarife der ausgewählten Ailoot-Methode.
Referenztarifstaffeln des Modells
Preise nach Konfiguration
Ordnen Sie jede Gebühr den angezeigten Bedingungen zu. Verwenden Sie für jede Gruppe alternativer Konfigurationen einen Tarif.
| Konfiguration | Tarifstaffel | Kontexttoken, mehr als | Kontexttoken, bis einschließlich | Gebühr |
|---|---|---|---|---|
| KonfigurationOpenAI Chat · Token-Basispreise | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationOpenAI Chat · Stufe 1 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationOpenAI Chat · Stufe 2 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Token-Basispreise | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Stufe 1 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Stufe 2 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
Beispielanfragen
Ailoot · Anthropic Messages
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 source-material file}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "grok-4.5", "max_tokens": 1024, "messages": []}')
f=Path(os.environ["AILOOT_TEXT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 source material")
text=f.read_text(encoding="utf-8")
if not text.strip():raise SystemExit("Source material must contain text")
p["messages"]=[{"role":"user","content":"Summarize this material and quote supporting source passages.\n\n"+text}]
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \
-H "x-api-key: $AILOOT_API_KEY" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_FILE:?Set your actual PNG JPEG or WebP image}"
export AILOOT_IMAGE_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "grok-4.5", "max_tokens": 1024, "messages": [{"role": "user", "content": [{"type": "text", "text": "Read labels and numbers in this image; flag unreadable text."}]}]}')
import base64
f=Path(os.environ["AILOOT_IMAGE_FILE"])
if not f.is_file():raise SystemExit("Choose an actual PNG JPEG or WebP image")
raw=f.read_bytes()
mime="image/png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "image/jpeg" if raw.startswith(b"\xff\xd8") else "image/webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else None
if not mime:raise SystemExit("Use PNG JPEG or WebP")
b64=base64.b64encode(raw).decode()
p["messages"][0]["content"].append({"type":"image","source":{"type":"base64","media_type":mime,"data":b64}})
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \
-H "x-api-key: $AILOOT_API_KEY" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
import anthropic
import os
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client = anthropic.Anthropic(base_url="https://api.ailoot.ai", api_key=os.environ["AILOOT_API_KEY"], max_retries=0)
msg = client.messages.create(
model="grok-4.5",
max_tokens=1024,
messages=[{"role": "user", "content": "Explain the difference between an observation and a hypothesis in three sentences."}],
)
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
save_result(msg.to_dict(mode="json"))
import Anthropic from "@anthropic-ai/sdk";
if (!process.env.AILOOT_API_KEY?.trim()) throw new Error("Set AILOOT_API_KEY before making a request");
const client = new Anthropic({ baseURL: "https://api.ailoot.ai", apiKey: process.env.AILOOT_API_KEY, maxRetries: 0 });
const msg = await client.messages.create({
model: "grok-4.5",
max_tokens: 1024,
messages: [{ role: "user", content: "Explain the difference between an observation and a hypothesis in three sentences." }],
});
import { writeFileSync } from "node:fs";
function saveResult(data, stem = "result") {
writeFileSync(stem + ".json", JSON.stringify(data, null, 2));
console.log(JSON.stringify(data, null, 2));
const saveBlob = (encoded, suffix, label) => {
const raw = Buffer.from(encoded, "base64");
const ext = raw.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10])) ? "png" : raw[0]===255 && raw[1]===216 ? "jpg" : raw.subarray(0,4).toString()==="RIFF" && raw.subarray(8,12).toString()==="WEBP" ? "webp" : suffix;
const file = `${stem}-${label}.${ext}`;
writeFileSync(file, raw); console.log("Saved", file);
};
for (const [i, block] of (data.content || []).entries()) console.log("Content", i, JSON.stringify(block));
for (const choice of data.choices || []) console.log("Choice", choice.index, JSON.stringify(choice.message || choice.delta || {}));
for (const [i, item] of (data.output || []).entries()) {
console.log("Output", i, JSON.stringify(item));
if (item.type === "image_generation_call" && item.result) saveBlob(item.result, item.output_format || "bin", `output-${i}`);
}
for (const [ci, candidate] of (data.candidates || []).entries()) {
for (const [pi, part] of (candidate.content?.parts || []).entries()) {
console.log("Candidate/part", ci, pi, JSON.stringify(part));
const blob = part.inlineData || part.inline_data;
if (blob?.data) {
const mime = blob.mimeType || blob.mime_type;
const suffix = ({"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"})[mime] || "bin";
saveBlob(blob.data, suffix, `candidate-${ci}-part-${pi}`);
}
}
}
}
saveResult(msg);
import anthropic,os
from pathlib import Path
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=anthropic.Anthropic(base_url="https://api.ailoot.ai",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
with client.messages.stream(model='grok-4.5',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")
Ergebnisse abrufen und speichern
Ailoot · Anthropic Messages
json oder SSE
Alle fertiggestellten Ergebnisse aufbewahren
Bewahren Sie jede vollständig zurückgegebene Antwort, Datei und jeden Inhaltsteil auf.
Alle Inhaltsblöcke, Thinking-Signaturen und tatsächlichen Werkzeugaufruf-IDs beibehalten. Alle SSE-Blockdeltas zusammensetzen; der erste Textblock ist nicht die vollständige Ausgabe.
Wenn die ursprüngliche Antwort geprüft werden muss
Anfrage- und Antwort-IDs sowie Header beibehalten. Eine allgemeine URL zum Abrufen von Textaufträgen wird nicht angegeben.
Antwortfelder
| Feld | Typ |
|---|---|
Feldid | Typstring |
Feldmodel | Typstring |
Feldcontent[] | Typtext|thinking|tool_use|other content block |
Feldstop_reason | Typstring|null |
Feldusage | Typobject |
Fehler und nächste Schritte
| Antwort | Bedingung | Nächster Schritt |
|---|---|---|
Antwort400 · invalid_request_error | BedingungPflichtfelder, Darstellung des Eingabematerials oder Parameterwert ungültig | Nächster SchrittDie angegebenen Felder vor einer neuen Erstellungsanfrage korrigieren. |
Aliasnamen
Modellaliasnamen
Ailoot grok-4.5, grok-4.5-latest, grok-build-latest
Ailoot Ultra grok-4.5, x-ai/grok-4.5
Aliasnamen für Methodenpfade
/chat/completions
Zugehörige Aufrufer-IDs
x-ai/grok-4.5, grok-4.5-latest, grok-build-latest, grok-4.5, grok-4.5
Ailoot · OpenAI Responses POST /v1/responses grok-4.5
grok-4.5grok-4.5grok-4.5-latestgrok-build-latest
Start
Grok 4.5 ist das Modell von SpaceXAI für Programmierung, Wissensarbeit und MINT-Aufgaben. Es nimmt Text, Bilder und Dateien entgegen und liefert Textantworten. Das veröffentlichte Profil umfasst Steuerelemente für Reasoning, Werkzeuge und strukturierte Ausgaben sowie ein Kontextfenster von 500.000 Token.
- Zulässige Eingaben
- Text · Bilder
- Ergebnisse
- Text
In Ailoot verfügbar · Eingaben und Methoden
Ailoot · OpenAI Responses POST /v1/responses
- Eingabetypen
text,image- Ausgabetypen
text- Kontext
- 500.000 tokens
- Maximale Ausgabe
- 500.000 tokens
- Ausgabeformat
- json oder SSE
| Feld | Typ | Anforderung | Werte und Limits | Standard |
|---|---|---|---|---|
Feldmodel | Typstring | AnforderungErforderlich | Werte und Limits grok-4.5 | Standard— |
Feldinput | Typstring|input_item[] | AnforderungErforderlich | Werte und Limits | Standard— |
Feldinstructions | Typstring | AnforderungOptional | Werte und Limits | Standard— |
Feldinput[].type | Typstring | AnforderungOptional | Werte und Limits message, reasoning, function_call, function_call_output | Standard— |
Feldinput[].content | Typstring|content_part[] | AnforderungOptional | Werte und Limits | Standard— |
Feldinput[].call_id | Typstring | AnforderungOptional | Werte und Limits Gilt, wenn: function_call_output; den tatsächlich zurückgegebenen Wert von call_id beibehalten | Standard— |
Feldinput[].output | Typstring|content_part[] | AnforderungOptional | Werte und Limits Gilt, wenn: function_call_output | Standard— |
Feldmax_output_tokens | Typinteger | AnforderungOptional | Werte und Limits Minimum: 1 Modellabhängig | Standard— |
Feldstream | Typboolean | AnforderungOptional | Werte und Limits | Standardfalse |
Feldtemperature | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtop_p | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtools | Typtool[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtool_choice | Typstring|object | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldparallel_tool_calls | Typboolean | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldreasoning.effort | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldreasoning.summary | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtext.format | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtext.verbosity | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldinclude | Typstring[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldstore | Typboolean | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldprevious_response_id | Typstring | AnforderungOptional | Werte und Limits ID-Anforderung: Nur eine tatsächliche Antwort-ID aus einer unterstützten Fortsetzung Modellabhängig | Standard— |
Feldservice_tier | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldprompt_cache_key | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldprompt_cache_options | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Kombinationen von Eingabematerialien
Text · UTF8-Text
Eingabetext oder input_text-Teil
Text + Bild
{type:input_image,image_url}
Methodenparameter und Lebenszyklus
| Parameter | Vertrag |
|---|---|
Parametermaterial_types | Vertragtext, image |
Parameterrequired | Vertragmodel, input |
Parameteroptional_controls | Vertragnull |
Parametercontent_type | Vertragapplication/json |
Parametertext_file_material | VertragTatsächlicher UTF-8-Inhalt wird als Text eingefügt; Datei-IDs/URLs müssen separat und exakt unterstützt werden |
Lebenszyklus: exact retained published method
Methodenstrukturen und IDs sind exakt; die Fähigkeiten des Anbieters sind von der Zulassung einer Anfrage zu unterscheiden.
Tarife
Ailoot-Methodentarife
POST /v1/responses- Eingabe
- 0,002 $ / 1K
- Ausgabe
- 0,006 $ / 1K
- Cache-Lesen
- 0,0003 $ / 1K
- Cache-Schreiben
- 0,00 $ / 1K
- Cache-Schreiben, 5 Min.
- 0,00 $ / 1K tokens
- Cache-Schreiben, 1 Stunde
- 0,00 $ / 1K tokens
Preise nach Anfragelänge · OpenAI Responses
| Anfragegröße in Token | Eingabe | Ausgabe | Cache-Lesen | Cache-Schreiben | Cache 5 Min. | Cache 1 Stunde |
|---|---|---|---|---|---|---|
| Anfragegröße in Token(0; 200.000] | Eingabe0,002 $ | Ausgabe0,006 $ | Cache-Lesen0,0003 $ | Cache-Schreiben0,00 $ | Cache 5 Min.0,00 $ | Cache 1 Stunde0,00 $ |
| Anfragegröße in Token(200.000; ∞) | Eingabe0,004 $ | Ausgabe0,012 $ | Cache-Lesen0,0006 $ | Cache-Schreiben0,00 $ | Cache 5 Min.0,00 $ | Cache 1 Stunde0,00 $ |
Tarife in USD pro 1K Token. Ist kein Tarif festgelegt, wird der Grundtarif dieser Methode übernommen; «—» bedeutet, dass kein Grundtarif festgelegt ist.
Ailoot reserviert vor einer Anfrage einen geschätzten Betrag. Nach dem Ergebnis rechnet Ailoot die endgültige Gebühr anhand des gemessenen Verbrauchs ab. Bei Streaming erfolgt die Abrechnung anhand des abschließenden Verbrauchsdatensatzes. So funktionieren Reservierung und Abrechnung →
Details zum Referenztarif
Referenztarifstaffeln auf Modellebene ändern weder Methodenauswahl noch Kostenvoranschläge oder Gebühren. Für die aktive Abrechnung gelten die Tarife der ausgewählten Ailoot-Methode.
Referenztarifstaffeln des Modells
Preise nach Konfiguration
Ordnen Sie jede Gebühr den angezeigten Bedingungen zu. Verwenden Sie für jede Gruppe alternativer Konfigurationen einen Tarif.
| Konfiguration | Tarifstaffel | Kontexttoken, mehr als | Kontexttoken, bis einschließlich | Gebühr |
|---|---|---|---|---|
| KonfigurationOpenAI Chat · Token-Basispreise | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationOpenAI Chat · Stufe 1 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationOpenAI Chat · Stufe 2 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Token-Basispreise | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Stufe 1 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Stufe 2 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
Beispielanfragen
Ailoot · OpenAI Responses
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 source-material file}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "grok-4.5", "input": ""}')
f=Path(os.environ["AILOOT_TEXT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 source material")
text=f.read_text(encoding="utf-8")
if not text.strip():raise SystemExit("Source material must contain text")
p["input"]="Summarize this material and quote supporting source passages.\n\n"+text
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/responses \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
save_result(json.loads(Path("result.json").read_text(encoding="utf-8")))
PY_RESULT
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_FILE:?Set your actual PNG JPEG or WebP image}"
export AILOOT_IMAGE_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "grok-4.5", "input": [{"role": "user", "content": [{"type": "input_text", "text": "Read labels and numbers in this image; flag unreadable text."}]}]}')
import base64
f=Path(os.environ["AILOOT_IMAGE_FILE"])
if not f.is_file():raise SystemExit("Choose an actual PNG JPEG or WebP image")
raw=f.read_bytes()
mime="image/png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "image/jpeg" if raw.startswith(b"\xff\xd8") else "image/webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else None
if not mime:raise SystemExit("Use PNG JPEG or WebP")
b64=base64.b64encode(raw).decode()
p["input"][0]["content"].append({"type":"input_image","image_url":"data:"+mime+";base64,"+b64})
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/responses \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
save_result(json.loads(Path("result.json").read_text(encoding="utf-8")))
PY_RESULT
from openai import OpenAI
import os
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client = OpenAI(base_url="https://api.ailoot.ai/v1", api_key=os.environ["AILOOT_API_KEY"], max_retries=0)
resp = client.responses.create(model="grok-4.5", input="Explain the difference between an observation and a hypothesis in three sentences.")
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
save_result(resp.to_dict(mode="json"))
import OpenAI from "openai";
if (!process.env.AILOOT_API_KEY?.trim()) throw new Error("Set AILOOT_API_KEY before making a request");
const client = new OpenAI({ baseURL: "https://api.ailoot.ai/v1", apiKey: process.env.AILOOT_API_KEY, maxRetries: 0 });
const resp = await client.responses.create({ model: "grok-4.5", input: "Explain the difference between an observation and a hypothesis in three sentences." });
import { writeFileSync } from "node:fs";
function saveResult(data, stem = "result") {
writeFileSync(stem + ".json", JSON.stringify(data, null, 2));
console.log(JSON.stringify(data, null, 2));
const saveBlob = (encoded, suffix, label) => {
const raw = Buffer.from(encoded, "base64");
const ext = raw.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10])) ? "png" : raw[0]===255 && raw[1]===216 ? "jpg" : raw.subarray(0,4).toString()==="RIFF" && raw.subarray(8,12).toString()==="WEBP" ? "webp" : suffix;
const file = `${stem}-${label}.${ext}`;
writeFileSync(file, raw); console.log("Saved", file);
};
for (const [i, block] of (data.content || []).entries()) console.log("Content", i, JSON.stringify(block));
for (const choice of data.choices || []) console.log("Choice", choice.index, JSON.stringify(choice.message || choice.delta || {}));
for (const [i, item] of (data.output || []).entries()) {
console.log("Output", i, JSON.stringify(item));
if (item.type === "image_generation_call" && item.result) saveBlob(item.result, item.output_format || "bin", `output-${i}`);
}
for (const [ci, candidate] of (data.candidates || []).entries()) {
for (const [pi, part] of (candidate.content?.parts || []).entries()) {
console.log("Candidate/part", ci, pi, JSON.stringify(part));
const blob = part.inlineData || part.inline_data;
if (blob?.data) {
const mime = blob.mimeType || blob.mime_type;
const suffix = ({"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"})[mime] || "bin";
saveBlob(blob.data, suffix, `candidate-${ci}-part-${pi}`);
}
}
}
}
saveResult(resp);
from openai import OpenAI
import os
from pathlib import Path
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
with client.responses.stream(model="grok-4.5", 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")
Ergebnisse abrufen und speichern
Ailoot · OpenAI Responses
json oder SSE
Alle fertiggestellten Ergebnisse aufbewahren
Bewahren Sie jede vollständig zurückgegebene Antwort, Datei und jeden Inhaltsteil auf.
Alle Ausgabeelemente und Inhaltsteile, die tatsächliche call_id der Funktion, verschlüsselte Reasoning-Daten und Verbrauchsdaten beibehalten. Beim Streaming die vollständige Identität von Ereignis und Element bewahren.
Wenn die ursprüngliche Antwort geprüft werden muss
Anfrage- und Antwort-IDs sowie Header beibehalten. Eine allgemeine URL zum Abrufen von Textaufträgen wird nicht angegeben.
Antwortfelder
| Feld | Typ |
|---|---|
Feldid | Typstring |
Feldstatus | Typstring |
Feldoutput[] | Typmessage|reasoning|function_call|other item |
Feldoutput[].content[] | Typcontent part |
Feldusage | Typobject |
Fehler und nächste Schritte
| Antwort | Bedingung | Nächster Schritt |
|---|---|---|
Antwort400 · invalid_request_error | BedingungPflichtfelder, Darstellung des Eingabematerials oder Parameterwert ungültig | Nächster SchrittDie angegebenen Felder vor einer neuen Erstellungsanfrage korrigieren. |
Aliasnamen
Modellaliasnamen
Ailoot grok-4.5, grok-4.5-latest, grok-build-latest
Ailoot Ultra grok-4.5, x-ai/grok-4.5
Aliasnamen für Methodenpfade
/chat/completions
Zugehörige Aufrufer-IDs
x-ai/grok-4.5, grok-4.5-latest, grok-build-latest, grok-4.5, grok-4.5
Ailoot · OpenAI Chat POST /v1/chat/completions grok-4.5
grok-4.5grok-4.5grok-4.5-latestgrok-build-latest
Start
Grok 4.5 ist das Modell von SpaceXAI für Programmierung, Wissensarbeit und MINT-Aufgaben. Es nimmt Text, Bilder und Dateien entgegen und liefert Textantworten. Das veröffentlichte Profil umfasst Steuerelemente für Reasoning, Werkzeuge und strukturierte Ausgaben sowie ein Kontextfenster von 500.000 Token.
- Zulässige Eingaben
- Text · Bilder
- Ergebnisse
- Text
In Ailoot verfügbar · Eingaben und Methoden
Ailoot · OpenAI Chat POST /v1/chat/completions
- Eingabetypen
text,image- Ausgabetypen
text- Kontext
- 500.000 tokens
- Maximale Ausgabe
- 500.000 tokens
- Ausgabeformat
- json oder SSE
| Feld | Typ | Anforderung | Werte und Limits | Standard |
|---|---|---|---|---|
Feldmodel | Typstring | AnforderungErforderlich | Werte und Limits grok-4.5 | Standard— |
Feldmessages | Typmessage[] | AnforderungErforderlich | Werte und Limits Mindestanzahl Elemente: 1 | Standard— |
Feldmessages[].role | Typstring | AnforderungErforderlich | Werte und Limits Beispiele: system, user, assistant, tool, function Bedingungen: Diese Rollen sind in den Kompatibilitätstypen des Quellcodes ausdrücklich dargestellt; der genaue Rollenumfang bleibt modellspezifisch. Modellabhängig | Standard— |
Feldmessages[].content | Typstring|content_part[]|null | AnforderungOptional | Werte und Limits | Standard— |
Feldmessages[].tool_calls | Typtool_call[] | AnforderungOptional | Werte und Limits | Standard— |
Feldmessages[].tool_call_id | Typstring | AnforderungOptional | Werte und Limits Gilt, wenn: role=tool; die tatsächlich zurückgegebene ID verwenden | Standard— |
Feldmessages[].name | Typstring | AnforderungOptional | Werte und Limits | Standard— |
Feldmessages[].reasoning_content | Typstring | AnforderungOptional | Werte und Limits Gilt, wenn: Tatsächlich zurückgegebene Reasoning-Daten erneut übermitteln, sofern dieses Modell sie verwendet | Standard— |
Feldmessages[].reasoning_details | Typobject|array | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldmax_tokens | Typinteger | AnforderungOptional | Werte und Limits Minimum: 1 Modellabhängig | Standard— |
Feldmax_completion_tokens | Typinteger | AnforderungOptional | Werte und Limits Minimum: 1 Modellabhängig | Standard— |
Feldstream | Typboolean | AnforderungOptional | Werte und Limits | Standardfalse |
Feldstream_options.include_usage | Typboolean | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtemperature | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtop_p | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldstop | Typstring|string[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtools | Typfunction_tool[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtools[].type | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtools[].function.name | Typstring | AnforderungErforderlich | Werte und Limits Gilt, wenn: Funktionswerkzeug bereitgestellt | Standard— |
Feldtools[].function.description | Typstring | AnforderungOptional | Werte und Limits | Standard— |
Feldtools[].function.parameters | TypJSON_schema | AnforderungOptional | Werte und Limits | Standard— |
Feldtool_choice | Typstring|object | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldparallel_tool_calls | Typboolean | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldresponse_format | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldreasoning_effort | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldreasoning | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldservice_tier | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldinstructions | Typstring | AnforderungOptional | Werte und Limits Kompatibilitätsfeld | Standard— |
Feldfunctions | Typfunction[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldfunction_call | Typstring|object | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldprompt_cache_options | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Kombinationen von Eingabematerialien
Text · UTF8-Text
messages[].content
Text + Bild
{type:image_url,image_url:{url,detail}}
Methodenparameter und Lebenszyklus
| Parameter | Vertrag |
|---|---|
Parametermaterial_types | Vertragtext, image |
Parameterrequired | Vertragmodel, messages |
Parameteroptional_controls | Vertragnull |
Parametercontent_type | Vertragapplication/json |
Parametertext_file_material | VertragTatsächlicher UTF-8-Inhalt wird als Text eingefügt; Datei-IDs/URLs müssen separat und exakt unterstützt werden |
Lebenszyklus: exact retained published method
Methodenstrukturen und IDs sind exakt; die Fähigkeiten des Anbieters sind von der Zulassung einer Anfrage zu unterscheiden.
Tarife
Ailoot-Methodentarife
POST /v1/chat/completions- Eingabe
- 0,002 $ / 1K
- Ausgabe
- 0,006 $ / 1K
- Cache-Lesen
- 0,0003 $ / 1K
- Cache-Schreiben
- 0,00 $ / 1K
- Cache-Schreiben, 5 Min.
- 0,00 $ / 1K tokens
- Cache-Schreiben, 1 Stunde
- 0,00 $ / 1K tokens
Preise nach Anfragelänge · OpenAI Chat
| Anfragegröße in Token | Eingabe | Ausgabe | Cache-Lesen | Cache-Schreiben | Cache 5 Min. | Cache 1 Stunde |
|---|---|---|---|---|---|---|
| Anfragegröße in Token(0; 200.000] | Eingabe0,002 $ | Ausgabe0,006 $ | Cache-Lesen0,0003 $ | Cache-Schreiben0,00 $ | Cache 5 Min.0,00 $ | Cache 1 Stunde0,00 $ |
| Anfragegröße in Token(200.000; ∞) | Eingabe0,004 $ | Ausgabe0,012 $ | Cache-Lesen0,0006 $ | Cache-Schreiben0,00 $ | Cache 5 Min.0,00 $ | Cache 1 Stunde0,00 $ |
Tarife in USD pro 1K Token. Ist kein Tarif festgelegt, wird der Grundtarif dieser Methode übernommen; «—» bedeutet, dass kein Grundtarif festgelegt ist.
Ailoot reserviert vor einer Anfrage einen geschätzten Betrag. Nach dem Ergebnis rechnet Ailoot die endgültige Gebühr anhand des gemessenen Verbrauchs ab. Bei Streaming erfolgt die Abrechnung anhand des abschließenden Verbrauchsdatensatzes. So funktionieren Reservierung und Abrechnung →
Details zum Referenztarif
Referenztarifstaffeln auf Modellebene ändern weder Methodenauswahl noch Kostenvoranschläge oder Gebühren. Für die aktive Abrechnung gelten die Tarife der ausgewählten Ailoot-Methode.
Referenztarifstaffeln des Modells
Preise nach Konfiguration
Ordnen Sie jede Gebühr den angezeigten Bedingungen zu. Verwenden Sie für jede Gruppe alternativer Konfigurationen einen Tarif.
| Konfiguration | Tarifstaffel | Kontexttoken, mehr als | Kontexttoken, bis einschließlich | Gebühr |
|---|---|---|---|---|
| KonfigurationOpenAI Chat · Token-Basispreise | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationOpenAI Chat · Stufe 1 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationOpenAI Chat · Stufe 2 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Token-Basispreise | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Stufe 1 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Stufe 2 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
Beispielanfragen
Ailoot · OpenAI Chat
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 source-material file}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "grok-4.5", "messages": []}')
f=Path(os.environ["AILOOT_TEXT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 source material")
text=f.read_text(encoding="utf-8")
if not text.strip():raise SystemExit("Source material must contain text")
p["messages"]=[{"role":"user","content":"Summarize this material and quote supporting source passages.\n\n"+text}]
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_FILE:?Set your actual PNG JPEG or WebP image}"
export AILOOT_IMAGE_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "grok-4.5", "messages": [{"role": "user", "content": [{"type": "text", "text": "Read labels and numbers in this image; flag unreadable text."}]}]}')
import base64
f=Path(os.environ["AILOOT_IMAGE_FILE"])
if not f.is_file():raise SystemExit("Choose an actual PNG JPEG or WebP image")
raw=f.read_bytes()
mime="image/png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "image/jpeg" if raw.startswith(b"\xff\xd8") else "image/webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else None
if not mime:raise SystemExit("Use PNG JPEG or WebP")
b64=base64.b64encode(raw).decode()
p["messages"][0]["content"].append({"type":"image_url","image_url":{"url":"data:"+mime+";base64,"+b64}})
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
from openai import OpenAI
import os
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client = OpenAI(base_url="https://api.ailoot.ai/v1", api_key=os.environ["AILOOT_API_KEY"], max_retries=0)
resp = client.chat.completions.create(
model="grok-4.5",
messages=[{"role": "user", "content": "Explain the difference between an observation and a hypothesis in three sentences."}],
)
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
save_result(resp.to_dict(mode="json"))
import OpenAI from "openai";
if (!process.env.AILOOT_API_KEY?.trim()) throw new Error("Set AILOOT_API_KEY before making a request");
const client = new OpenAI({ baseURL: "https://api.ailoot.ai/v1", apiKey: process.env.AILOOT_API_KEY, maxRetries: 0 });
const resp = await client.chat.completions.create({
model: "grok-4.5",
messages: [{ role: "user", content: "Explain the difference between an observation and a hypothesis in three sentences." }],
});
import { writeFileSync } from "node:fs";
function saveResult(data, stem = "result") {
writeFileSync(stem + ".json", JSON.stringify(data, null, 2));
console.log(JSON.stringify(data, null, 2));
const saveBlob = (encoded, suffix, label) => {
const raw = Buffer.from(encoded, "base64");
const ext = raw.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10])) ? "png" : raw[0]===255 && raw[1]===216 ? "jpg" : raw.subarray(0,4).toString()==="RIFF" && raw.subarray(8,12).toString()==="WEBP" ? "webp" : suffix;
const file = `${stem}-${label}.${ext}`;
writeFileSync(file, raw); console.log("Saved", file);
};
for (const [i, block] of (data.content || []).entries()) console.log("Content", i, JSON.stringify(block));
for (const choice of data.choices || []) console.log("Choice", choice.index, JSON.stringify(choice.message || choice.delta || {}));
for (const [i, item] of (data.output || []).entries()) {
console.log("Output", i, JSON.stringify(item));
if (item.type === "image_generation_call" && item.result) saveBlob(item.result, item.output_format || "bin", `output-${i}`);
}
for (const [ci, candidate] of (data.candidates || []).entries()) {
for (const [pi, part] of (candidate.content?.parts || []).entries()) {
console.log("Candidate/part", ci, pi, JSON.stringify(part));
const blob = part.inlineData || part.inline_data;
if (blob?.data) {
const mime = blob.mimeType || blob.mime_type;
const suffix = ({"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"})[mime] || "bin";
saveBlob(blob.data, suffix, `candidate-${ci}-part-${pi}`);
}
}
}
}
saveResult(resp);
from openai import OpenAI
import os
from pathlib import Path
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
with client.chat.completions.stream(model='grok-4.5',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")
Ergebnisse abrufen und speichern
Ailoot · OpenAI Chat
json oder SSE
Alle fertiggestellten Ergebnisse aufbewahren
Bewahren Sie jede vollständig zurückgegebene Antwort, Datei und jeden Inhaltsteil auf.
Alle Antwortvarianten mit ihren Inhalten, Werkzeugaufrufen und Reasoning-Daten beibehalten. In SSE die Deltas nach Varianten- und Werkzeugindex zusammensetzen; endgültigen Beendigungsgrund und Verbrauchsdaten beibehalten.
Wenn die ursprüngliche Antwort geprüft werden muss
Anfrage- und Antwort-IDs sowie Header beibehalten. Eine allgemeine URL zum Abrufen von Textaufträgen wird nicht angegeben.
Antwortfelder
| Feld | Typ |
|---|---|
Feldchoices[].index | Typinteger |
Feldchoices[].message.content | Typstring|null |
Feldchoices[].message.tool_calls | Typtool_call[] |
Feldchoices[].message.reasoning_content | Typstring |
Feldchoices[].message.reasoning_details | Typobject|array |
Feldchoices[].finish_reason | Typstring|null |
Feldusage | Typobject |
Fehler und nächste Schritte
| Antwort | Bedingung | Nächster Schritt |
|---|---|---|
Antwort400 · invalid_request_error | BedingungPflichtfelder, Darstellung des Eingabematerials oder Parameterwert ungültig | Nächster SchrittDie angegebenen Felder vor einer neuen Erstellungsanfrage korrigieren. |
Aliasnamen
Modellaliasnamen
Ailoot grok-4.5, grok-4.5-latest, grok-build-latest
Ailoot Ultra grok-4.5, x-ai/grok-4.5
Aliasnamen für Methodenpfade
/chat/completions
Zugehörige Aufrufer-IDs
x-ai/grok-4.5, grok-4.5-latest, grok-build-latest, grok-4.5, grok-4.5
Ailoot Ultra · OpenAI Chat POST /v1/chat/completions grok-4.5
grok-4.5grok-4.5x-ai/grok-4.5
Start
Grok 4.5 ist das Modell von SpaceXAI für Programmierung, Wissensarbeit und MINT-Aufgaben. Es nimmt Text, Bilder und Dateien entgegen und liefert Textantworten. Das veröffentlichte Profil umfasst Steuerelemente für Reasoning, Werkzeuge und strukturierte Ausgaben sowie ein Kontextfenster von 500.000 Token.
- Zulässige Eingaben
- Text
- Ergebnisse
- Text
In Ailoot verfügbar · Eingaben und Methoden
Ailoot Ultra · OpenAI Chat POST /v1/chat/completions
- Eingabetypen
text- Ausgabetypen
text- Ausgabeformat
- json oder SSE
| Feld | Typ | Anforderung | Werte und Limits | Standard |
|---|---|---|---|---|
Feldmodel | Typstring | AnforderungErforderlich | Werte und Limits grok-4.5 | Standard— |
Feldmessages | Typmessage[] | AnforderungErforderlich | Werte und Limits Mindestanzahl Elemente: 1 | Standard— |
Feldmessages[].role | Typstring | AnforderungErforderlich | Werte und Limits Modellabhängig | Standard— |
Feldmessages[].content | Typstring | AnforderungOptional | Werte und Limits Gilt, wenn: Textgespräch | Standard— |
Feldstream | Typboolean | AnforderungOptional | Werte und Limits | Standardfalse |
Kombinationen von Eingabematerialien
Text · UTF8-Text
messages[].content
Methodenparameter und Lebenszyklus
| Parameter | Vertrag |
|---|---|
Parametercontent_type | Vertragapplication/json |
Parameterrequired | Vertragmodel, messages |
Parametermaterial_types | Vertragtext |
Parametermessages | VertragNachrichtenarray mit role/content-Struktur |
Parameterfile_material | VertragTatsächliches UTF-8-Dokument als wörtlicher Text eingefügt; keine Datei-ID abgeleitet |
Parameteroptional_controls | Vertragstream |
Parametercontrol_scope | VertragTextgespräch; stream ist ein boolescher Wert und standardmäßig false. |
Parameteroutput_modalities | Vertragtext |
Parameterhosted_operations | Vertragfalse |
Parametermultimodal_input_binding | Vertragnull |
Methodenaliasnamen: /chat/completions
Lebenszyklus: synchronous_or_streamed
Die genaue Modell-ID zusammen mit messages senden.
Die Kontextlänge ist keine Ausgabeobergrenze.
Eine Textdatei kann wörtlichen Text liefern; Bild-, Audio- und Dateiobjekteingaben benötigen eine exakte Zuordnung.
Tarife
Tarifangaben erweitern die Anfrageoptionen nicht. Unterstützte Parameter stehen bei der ausgewählten Methode.
- Schnellmodus
- Standardtarif Wenn der Schnellmodus ausgewählt ist
- Flex-Modus
- Standardtarif Wenn der Modus flex ausgewählt ist
- Maximaler Denkaufwand
- Standardtarif Wenn beim maximalen Denkaufwand die Standardanpassung (default) verwendet wird
- Denkaufwand · hoch
- Standardtarif Wenn der Denkaufwand hoch ist
- Denkaufwand · niedrig
- Standardtarif Wenn der Denkaufwand niedrig ist
- Denkaufwand · mittel
- Standardtarif Wenn der Denkaufwand mittel ist
Ailoot-Tarife
Preise nach Konfiguration
Ordnen Sie jede Gebühr den angezeigten Bedingungen zu. Verwenden Sie für jede Gruppe alternativer Konfigurationen einen Tarif.
| Konfiguration | Tarifstaffel | Kontexttoken, mehr als | Kontexttoken, bis einschließlich | Gebühr |
|---|---|---|---|---|
| KonfigurationBasistarife für Token | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnfragelängenstufe 1 | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnfragelängenstufe 2 | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
Ailoot reserviert vor einer Anfrage einen geschätzten Betrag. Nach dem Ergebnis rechnet Ailoot die endgültige Gebühr anhand des gemessenen Verbrauchs ab. Bei Streaming erfolgt die Abrechnung anhand des abschließenden Verbrauchsdatensatzes. So funktionieren Reservierung und Abrechnung →
Beispielanfragen
Ailoot Ultra · OpenAI Chat
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model":"grok-4.5","messages":[{"role":"user","content":"hello"}],"stream":false}')
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
r=json.loads(Path("result.json").read_text())
for x in r.get("choices",[]):
if x.get("message",{}).get("content"): print(x["message"]["content"])
PY_RESULT
from openai import OpenAI
import os
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
result=client.chat.completions.create(model="grok-4.5", 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"))
Ergebnisse abrufen und speichern
Ailoot Ultra · OpenAI Chat
json oder SSE
Alle fertiggestellten Ergebnisse aufbewahren
Bewahren Sie jede vollständig zurückgegebene Antwort, Datei und jeden Inhaltsteil auf.
Alle Antwortvarianten mit ihren Inhalten, Werkzeugaufrufen und Reasoning-Daten beibehalten. In SSE die Deltas nach Varianten- und Werkzeugindex zusammensetzen; endgültigen Beendigungsgrund und Verbrauchsdaten beibehalten.
Wenn die ursprüngliche Antwort geprüft werden muss
Anfrage- und Antwort-IDs sowie Header beibehalten. Eine allgemeine URL zum Abrufen von Textaufträgen wird nicht angegeben.
Antwortfelder
| Feld | Typ |
|---|---|
Feldchoices[].index | Typinteger |
Feldchoices[].message.content | Typstring|null |
Feldchoices[].message.tool_calls | Typtool_call[] |
Feldchoices[].message.reasoning_content | Typstring |
Feldchoices[].message.reasoning_details | Typobject|array |
Feldchoices[].finish_reason | Typstring|null |
Feldusage | Typobject |
Fehler und nächste Schritte
| Antwort | Bedingung | Nächster Schritt |
|---|---|---|
Antwort400 · invalid_request_error | BedingungPflichtfelder, Darstellung des Eingabematerials oder Parameterwert ungültig | Nächster SchrittDie angegebenen Felder vor einer neuen Erstellungsanfrage korrigieren. |
Aliasnamen
Modellaliasnamen
Ailoot grok-4.5, grok-4.5-latest, grok-build-latest
Ailoot Ultra grok-4.5, x-ai/grok-4.5
Aliasnamen für Methodenpfade
/chat/completions
Zugehörige Aufrufer-IDs
x-ai/grok-4.5, grok-4.5-latest, grok-build-latest, grok-4.5, grok-4.5
Ailoot Ultra · Anthropic Messages POST /v1/messages grok-4.5
grok-4.5grok-4.5x-ai/grok-4.5
Start
Grok 4.5 ist das Modell von SpaceXAI für Programmierung, Wissensarbeit und MINT-Aufgaben. Es nimmt Text, Bilder und Dateien entgegen und liefert Textantworten. Das veröffentlichte Profil umfasst Steuerelemente für Reasoning, Werkzeuge und strukturierte Ausgaben sowie ein Kontextfenster von 500.000 Token.
- Zulässige Eingaben
- Text
- Ergebnisse
- json · sse
In Ailoot verfügbar · Eingaben und Methoden
Ailoot Ultra · Anthropic Messages POST /v1/messages
- Eingabetypen
text- Ausgabetypen
json,sse- Ausgabeformat
- JSON oder SSE
| Feld | Typ | Anforderung | Werte und Limits | Standard |
|---|---|---|---|---|
Feldmodel | Typstring | AnforderungErforderlich | Werte und Limits grok-4.5 | Standard— |
Feldmessages | Typmessage[] | AnforderungErforderlich | Werte und Limits | Standard— |
Feldmessages[].role | Typstring | AnforderungErforderlich | Werte und Limits user, assistant | Standard— |
Feldmessages[].content | Typstring | AnforderungErforderlich | Werte und Limits | Standard— |
Feldmax_tokens | Typinteger | AnforderungErforderlich | Werte und Limits | Standard— |
Feldstream | Typboolean | AnforderungOptional | Werte und Limits | Standardfalse |
Kombinationen von Eingabematerialien
Text · UTF-8-Text
Zeichenfolge messages[].content
Methodenparameter und Lebenszyklus
| Parameter | Vertrag |
|---|---|
Parametercontent_type | Vertragapplication/json |
Parameterrequired | Vertragmodel, messages, max_tokens |
Parameteroptional_controls | Vertragstream |
Parametermaterial_types | Vertragtext |
Parametertext_file_material | VertragDas tatsächliche UTF-8-Dokument lesen und seinen Text in die angegebene Zeichenfolge für Eingabe oder Nachrichteninhalt einfügen. |
Lebenszyklus: synchronous_or_streamed
Tarife
Tarifangaben erweitern die Anfrageoptionen nicht. Unterstützte Parameter stehen bei der ausgewählten Methode.
- Schnellmodus
- Standardtarif Wenn der Schnellmodus ausgewählt ist
- Flex-Modus
- Standardtarif Wenn der Modus flex ausgewählt ist
- Maximaler Denkaufwand
- Standardtarif Wenn beim maximalen Denkaufwand die Standardanpassung (default) verwendet wird
- Denkaufwand · hoch
- Standardtarif Wenn der Denkaufwand hoch ist
- Denkaufwand · niedrig
- Standardtarif Wenn der Denkaufwand niedrig ist
- Denkaufwand · mittel
- Standardtarif Wenn der Denkaufwand mittel ist
Ailoot-Tarife
Preise nach Konfiguration
Ordnen Sie jede Gebühr den angezeigten Bedingungen zu. Verwenden Sie für jede Gruppe alternativer Konfigurationen einen Tarif.
| Konfiguration | Tarifstaffel | Kontexttoken, mehr als | Kontexttoken, bis einschließlich | Gebühr |
|---|---|---|---|---|
| KonfigurationBasistarife für Token | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnfragelängenstufe 1 | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnfragelängenstufe 2 | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
Ailoot reserviert vor einer Anfrage einen geschätzten Betrag. Nach dem Ergebnis rechnet Ailoot die endgültige Gebühr anhand des gemessenen Verbrauchs ab. Bei Streaming erfolgt die Abrechnung anhand des abschließenden Verbrauchsdatensatzes. So funktionieren Reservierung und Abrechnung →
Beispielanfragen
Ailoot Ultra · Anthropic Messages
{
"model": "grok-4.5",
"max_tokens": 128,
"messages": [
{
"role": "user",
"content": "Summarize the incident report."
}
],
"stream": false
}set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 document}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json, os
from pathlib import Path
source_file = Path(os.environ['AILOOT_TEXT_FILE'])
if not source_file.is_file():
raise SystemExit('Set AILOOT_TEXT_FILE to your actual UTF-8 document')
text = source_file.read_text(encoding='utf-8')
if not text.strip():
raise SystemExit('Choose a document containing text')
payload = {'model': 'grok-4.5', 'max_tokens': 128, 'messages': [{'role': 'user', 'content': 'Summarize the incident report.'}]}
payload['messages'][0]['content'] = 'Summarize this material and quote supporting source passages.\n\n' + text
Path('request.json').write_text(json.dumps(payload, ensure_ascii=False), encoding='utf-8')
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \
-H "x-api-key: $AILOOT_API_KEY" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
result = json.loads(Path('result.json').read_text(encoding='utf-8'))
print(json.dumps(result, ensure_ascii=False, indent=2))
PY_RESULT
import json, os
from pathlib import Path
source_file = Path(os.environ['AILOOT_TEXT_FILE'])
if not source_file.is_file():
raise SystemExit('Set AILOOT_TEXT_FILE to your actual UTF-8 document')
text = source_file.read_text(encoding='utf-8')
if not text.strip():
raise SystemExit('Choose a document containing text')
payload = {'model': 'grok-4.5', '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))
Ergebnisse abrufen und speichern
Ailoot Ultra · Anthropic Messages
JSON oder SSE
Alle fertiggestellten Ergebnisse aufbewahren
Bewahren Sie jede vollständig zurückgegebene Antwort, Datei und jeden Inhaltsteil auf.
Alle Inhaltsblöcke, Thinking-Signaturen und tatsächlichen Werkzeugaufruf-IDs beibehalten. Alle SSE-Blockdeltas zusammensetzen; der erste Textblock ist nicht die vollständige Ausgabe.
Wenn die ursprüngliche Antwort geprüft werden muss
Anfrage- und Antwort-IDs sowie Header beibehalten. Eine allgemeine URL zum Abrufen von Textaufträgen wird nicht angegeben.
Antwortfelder
| Feld | Typ |
|---|---|
Feldid | Typstring |
Feldmodel | Typstring |
Feldcontent[] | Typtext|thinking|tool_use|other content block |
Feldstop_reason | Typstring|null |
Feldusage | Typobject |
Fehler und nächste Schritte
| Antwort | Bedingung | Nächster Schritt |
|---|---|---|
Antwort400 · invalid_request_error | BedingungPflichtfelder, Darstellung des Eingabematerials oder Parameterwert ungültig | Nächster SchrittDie angegebenen Felder vor einer neuen Erstellungsanfrage korrigieren. |
Aliasnamen
Modellaliasnamen
Ailoot grok-4.5, grok-4.5-latest, grok-build-latest
Ailoot Ultra grok-4.5, x-ai/grok-4.5
Aliasnamen für Methodenpfade
/chat/completions
Zugehörige Aufrufer-IDs
x-ai/grok-4.5, grok-4.5-latest, grok-build-latest, grok-4.5, grok-4.5
Ailoot · Anthropic Messages POST /v1/messages grok-4.5-latest
grok-4.5-latestgrok-4.5grok-4.5-latestgrok-build-latest
Start
Grok 4.5 ist das Modell von SpaceXAI für Programmierung, Wissensarbeit und MINT-Aufgaben. Es nimmt Text, Bilder und Dateien entgegen und liefert Textantworten. Das veröffentlichte Profil umfasst Steuerelemente für Reasoning, Werkzeuge und strukturierte Ausgaben sowie ein Kontextfenster von 500.000 Token.
- Zulässige Eingaben
- Text · Bilder
- Ergebnisse
- Text
In Ailoot verfügbar · Eingaben und Methoden
Ailoot · Anthropic Messages POST /v1/messages
- Eingabetypen
text,image- Ausgabetypen
text- Kontext
- 500.000 tokens
- Maximale Ausgabe
- 500.000 tokens
- Ausgabeformat
- json oder SSE
| Feld | Typ | Anforderung | Werte und Limits | Standard |
|---|---|---|---|---|
Feldmodel | Typstring | AnforderungErforderlich | Werte und Limits grok-4.5-latest | Standard— |
Feldmessages | Typmessage[] | AnforderungErforderlich | Werte und Limits Mindestanzahl Elemente: 1 | Standard— |
Feldmessages[].role | Typstring | AnforderungErforderlich | Werte und Limits user, assistant | Standard— |
Feldmessages[].content | Typstring|content_block[] | AnforderungErforderlich | Werte und Limits | Standard— |
Feldsystem | Typstring|content_block[] | AnforderungOptional | Werte und Limits | Standard— |
Feldmax_tokens | Typinteger | AnforderungErforderlich | Werte und Limits Minimum: 1 Limit gilt für: Genaue Obergrenze des ausgewählten Modells bzw. seiner Modellkarte | Standard— |
Feldstream | Typboolean | AnforderungOptional | Werte und Limits | Standardfalse |
Feldtemperature | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtop_p | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldstop_sequences | Typstring[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtools | Typtool[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtools[].name | Typstring | AnforderungOptional | Werte und Limits Gilt, wenn: Werkzeug bereitgestellt | Standard— |
Feldtools[].description | Typstring | AnforderungOptional | Werte und Limits | Standard— |
Feldtools[].input_schema | TypJSON_schema | AnforderungOptional | Werte und Limits | Standard— |
Feldtool_choice | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldthinking.type | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldthinking.budget_tokens | Typinteger | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldoutput_config.effort | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldmetadata | Typobject | AnforderungOptional | Werte und Limits | Standard— |
Feldcache_control | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Kombinationen von Eingabematerialien
Text · UTF8-Text
messages[].content oder Block mit type=text
Text + Bild
{type:image,source:{type:base64,media_type,data}} oder Quelle mit type=url
Methodenparameter und Lebenszyklus
| Parameter | Vertrag |
|---|---|
Parametermaterial_types | Vertragtext, image |
Parameterrequired | Vertragmodel, messages, max_tokens |
Parameteroptional_controls | Vertragnull |
Parametercontent_type | Vertragapplication/json |
Parametertext_file_material | VertragTatsächlicher UTF-8-Inhalt wird als Text eingefügt; Datei-IDs/URLs müssen separat und exakt unterstützt werden |
Lebenszyklus: exact retained published method
Methodenstrukturen und IDs sind exakt; die Fähigkeiten des Anbieters sind von der Zulassung einer Anfrage zu unterscheiden.
Tarife
Ailoot-Methodentarife
POST /v1/messages- Eingabe
- 0,002 $ / 1K
- Ausgabe
- 0,006 $ / 1K
- Cache-Lesen
- 0,0003 $ / 1K
- Cache-Schreiben
- 0,00 $ / 1K
- Cache-Schreiben, 5 Min.
- 0,00 $ / 1K tokens
- Cache-Schreiben, 1 Stunde
- 0,00 $ / 1K tokens
Preise nach Anfragelänge · Anthropic Messages
| Anfragegröße in Token | Eingabe | Ausgabe | Cache-Lesen | Cache-Schreiben | Cache 5 Min. | Cache 1 Stunde |
|---|---|---|---|---|---|---|
| Anfragegröße in Token(0; 200.000] | Eingabe0,002 $ | Ausgabe0,006 $ | Cache-Lesen0,0003 $ | Cache-Schreiben0,00 $ | Cache 5 Min.0,00 $ | Cache 1 Stunde0,00 $ |
| Anfragegröße in Token(200.000; ∞) | Eingabe0,004 $ | Ausgabe0,012 $ | Cache-Lesen0,0006 $ | Cache-Schreiben0,00 $ | Cache 5 Min.0,00 $ | Cache 1 Stunde0,00 $ |
Tarife in USD pro 1K Token. Ist kein Tarif festgelegt, wird der Grundtarif dieser Methode übernommen; «—» bedeutet, dass kein Grundtarif festgelegt ist.
Ailoot reserviert vor einer Anfrage einen geschätzten Betrag. Nach dem Ergebnis rechnet Ailoot die endgültige Gebühr anhand des gemessenen Verbrauchs ab. Bei Streaming erfolgt die Abrechnung anhand des abschließenden Verbrauchsdatensatzes. So funktionieren Reservierung und Abrechnung →
Details zum Referenztarif
Referenztarifstaffeln auf Modellebene ändern weder Methodenauswahl noch Kostenvoranschläge oder Gebühren. Für die aktive Abrechnung gelten die Tarife der ausgewählten Ailoot-Methode.
Referenztarifstaffeln des Modells
Preise nach Konfiguration
Ordnen Sie jede Gebühr den angezeigten Bedingungen zu. Verwenden Sie für jede Gruppe alternativer Konfigurationen einen Tarif.
| Konfiguration | Tarifstaffel | Kontexttoken, mehr als | Kontexttoken, bis einschließlich | Gebühr |
|---|---|---|---|---|
| KonfigurationOpenAI Chat · Token-Basispreise | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationOpenAI Chat · Stufe 1 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationOpenAI Chat · Stufe 2 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Token-Basispreise | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Stufe 1 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Stufe 2 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
Beispielanfragen
Ailoot · Anthropic Messages
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 source-material file}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "grok-4.5-latest", "max_tokens": 1024, "messages": []}')
f=Path(os.environ["AILOOT_TEXT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 source material")
text=f.read_text(encoding="utf-8")
if not text.strip():raise SystemExit("Source material must contain text")
p["messages"]=[{"role":"user","content":"Summarize this material and quote supporting source passages.\n\n"+text}]
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \
-H "x-api-key: $AILOOT_API_KEY" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_FILE:?Set your actual PNG JPEG or WebP image}"
export AILOOT_IMAGE_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "grok-4.5-latest", "max_tokens": 1024, "messages": [{"role": "user", "content": [{"type": "text", "text": "Read labels and numbers in this image; flag unreadable text."}]}]}')
import base64
f=Path(os.environ["AILOOT_IMAGE_FILE"])
if not f.is_file():raise SystemExit("Choose an actual PNG JPEG or WebP image")
raw=f.read_bytes()
mime="image/png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "image/jpeg" if raw.startswith(b"\xff\xd8") else "image/webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else None
if not mime:raise SystemExit("Use PNG JPEG or WebP")
b64=base64.b64encode(raw).decode()
p["messages"][0]["content"].append({"type":"image","source":{"type":"base64","media_type":mime,"data":b64}})
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \
-H "x-api-key: $AILOOT_API_KEY" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
import anthropic
import os
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client = anthropic.Anthropic(base_url="https://api.ailoot.ai", api_key=os.environ["AILOOT_API_KEY"], max_retries=0)
msg = client.messages.create(
model="grok-4.5-latest",
max_tokens=1024,
messages=[{"role": "user", "content": "Explain the difference between an observation and a hypothesis in three sentences."}],
)
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
save_result(msg.to_dict(mode="json"))
import Anthropic from "@anthropic-ai/sdk";
if (!process.env.AILOOT_API_KEY?.trim()) throw new Error("Set AILOOT_API_KEY before making a request");
const client = new Anthropic({ baseURL: "https://api.ailoot.ai", apiKey: process.env.AILOOT_API_KEY, maxRetries: 0 });
const msg = await client.messages.create({
model: "grok-4.5-latest",
max_tokens: 1024,
messages: [{ role: "user", content: "Explain the difference between an observation and a hypothesis in three sentences." }],
});
import { writeFileSync } from "node:fs";
function saveResult(data, stem = "result") {
writeFileSync(stem + ".json", JSON.stringify(data, null, 2));
console.log(JSON.stringify(data, null, 2));
const saveBlob = (encoded, suffix, label) => {
const raw = Buffer.from(encoded, "base64");
const ext = raw.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10])) ? "png" : raw[0]===255 && raw[1]===216 ? "jpg" : raw.subarray(0,4).toString()==="RIFF" && raw.subarray(8,12).toString()==="WEBP" ? "webp" : suffix;
const file = `${stem}-${label}.${ext}`;
writeFileSync(file, raw); console.log("Saved", file);
};
for (const [i, block] of (data.content || []).entries()) console.log("Content", i, JSON.stringify(block));
for (const choice of data.choices || []) console.log("Choice", choice.index, JSON.stringify(choice.message || choice.delta || {}));
for (const [i, item] of (data.output || []).entries()) {
console.log("Output", i, JSON.stringify(item));
if (item.type === "image_generation_call" && item.result) saveBlob(item.result, item.output_format || "bin", `output-${i}`);
}
for (const [ci, candidate] of (data.candidates || []).entries()) {
for (const [pi, part] of (candidate.content?.parts || []).entries()) {
console.log("Candidate/part", ci, pi, JSON.stringify(part));
const blob = part.inlineData || part.inline_data;
if (blob?.data) {
const mime = blob.mimeType || blob.mime_type;
const suffix = ({"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"})[mime] || "bin";
saveBlob(blob.data, suffix, `candidate-${ci}-part-${pi}`);
}
}
}
}
saveResult(msg);
import anthropic,os
from pathlib import Path
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=anthropic.Anthropic(base_url="https://api.ailoot.ai",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
with client.messages.stream(model='grok-4.5-latest',max_tokens=1024,messages=[{"role":"user","content":"Explain observations and hypotheses in three sentences."}]) as stream:
with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
for event in stream:
payload=event.to_dict(mode="json")
log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
print(json.dumps(payload,ensure_ascii=False))
final=stream.get_final_message()
save_result(final.to_dict(mode="json"),"stream-result")
Ergebnisse abrufen und speichern
Ailoot · Anthropic Messages
json oder SSE
Alle fertiggestellten Ergebnisse aufbewahren
Bewahren Sie jede vollständig zurückgegebene Antwort, Datei und jeden Inhaltsteil auf.
Alle Inhaltsblöcke, Thinking-Signaturen und tatsächlichen Werkzeugaufruf-IDs beibehalten. Alle SSE-Blockdeltas zusammensetzen; der erste Textblock ist nicht die vollständige Ausgabe.
Wenn die ursprüngliche Antwort geprüft werden muss
Anfrage- und Antwort-IDs sowie Header beibehalten. Eine allgemeine URL zum Abrufen von Textaufträgen wird nicht angegeben.
Antwortfelder
| Feld | Typ |
|---|---|
Feldid | Typstring |
Feldmodel | Typstring |
Feldcontent[] | Typtext|thinking|tool_use|other content block |
Feldstop_reason | Typstring|null |
Feldusage | Typobject |
Fehler und nächste Schritte
| Antwort | Bedingung | Nächster Schritt |
|---|---|---|
Antwort400 · invalid_request_error | BedingungPflichtfelder, Darstellung des Eingabematerials oder Parameterwert ungültig | Nächster SchrittDie angegebenen Felder vor einer neuen Erstellungsanfrage korrigieren. |
Aliasnamen
Modellaliasnamen
Ailoot grok-4.5, grok-4.5-latest, grok-build-latest
Ailoot Ultra grok-4.5, x-ai/grok-4.5
Aliasnamen für Methodenpfade
/chat/completions
Zugehörige Aufrufer-IDs
x-ai/grok-4.5, grok-4.5-latest, grok-build-latest, grok-4.5, grok-4.5
Ailoot · OpenAI Responses POST /v1/responses grok-4.5-latest
grok-4.5-latestgrok-4.5grok-4.5-latestgrok-build-latest
Start
Grok 4.5 ist das Modell von SpaceXAI für Programmierung, Wissensarbeit und MINT-Aufgaben. Es nimmt Text, Bilder und Dateien entgegen und liefert Textantworten. Das veröffentlichte Profil umfasst Steuerelemente für Reasoning, Werkzeuge und strukturierte Ausgaben sowie ein Kontextfenster von 500.000 Token.
- Zulässige Eingaben
- Text · Bilder
- Ergebnisse
- Text
In Ailoot verfügbar · Eingaben und Methoden
Ailoot · OpenAI Responses POST /v1/responses
- Eingabetypen
text,image- Ausgabetypen
text- Kontext
- 500.000 tokens
- Maximale Ausgabe
- 500.000 tokens
- Ausgabeformat
- json oder SSE
| Feld | Typ | Anforderung | Werte und Limits | Standard |
|---|---|---|---|---|
Feldmodel | Typstring | AnforderungErforderlich | Werte und Limits grok-4.5-latest | Standard— |
Feldinput | Typstring|input_item[] | AnforderungErforderlich | Werte und Limits | Standard— |
Feldinstructions | Typstring | AnforderungOptional | Werte und Limits | Standard— |
Feldinput[].type | Typstring | AnforderungOptional | Werte und Limits message, reasoning, function_call, function_call_output | Standard— |
Feldinput[].content | Typstring|content_part[] | AnforderungOptional | Werte und Limits | Standard— |
Feldinput[].call_id | Typstring | AnforderungOptional | Werte und Limits Gilt, wenn: function_call_output; den tatsächlich zurückgegebenen Wert von call_id beibehalten | Standard— |
Feldinput[].output | Typstring|content_part[] | AnforderungOptional | Werte und Limits Gilt, wenn: function_call_output | Standard— |
Feldmax_output_tokens | Typinteger | AnforderungOptional | Werte und Limits Minimum: 1 Modellabhängig | Standard— |
Feldstream | Typboolean | AnforderungOptional | Werte und Limits | Standardfalse |
Feldtemperature | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtop_p | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtools | Typtool[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtool_choice | Typstring|object | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldparallel_tool_calls | Typboolean | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldreasoning.effort | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldreasoning.summary | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtext.format | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtext.verbosity | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldinclude | Typstring[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldstore | Typboolean | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldprevious_response_id | Typstring | AnforderungOptional | Werte und Limits ID-Anforderung: Nur eine tatsächliche Antwort-ID aus einer unterstützten Fortsetzung Modellabhängig | Standard— |
Feldservice_tier | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldprompt_cache_key | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldprompt_cache_options | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Kombinationen von Eingabematerialien
Text · UTF8-Text
Eingabetext oder input_text-Teil
Text + Bild
{type:input_image,image_url}
Methodenparameter und Lebenszyklus
| Parameter | Vertrag |
|---|---|
Parametermaterial_types | Vertragtext, image |
Parameterrequired | Vertragmodel, input |
Parameteroptional_controls | Vertragnull |
Parametercontent_type | Vertragapplication/json |
Parametertext_file_material | VertragTatsächlicher UTF-8-Inhalt wird als Text eingefügt; Datei-IDs/URLs müssen separat und exakt unterstützt werden |
Lebenszyklus: exact retained published method
Methodenstrukturen und IDs sind exakt; die Fähigkeiten des Anbieters sind von der Zulassung einer Anfrage zu unterscheiden.
Tarife
Ailoot-Methodentarife
POST /v1/responses- Eingabe
- 0,002 $ / 1K
- Ausgabe
- 0,006 $ / 1K
- Cache-Lesen
- 0,0003 $ / 1K
- Cache-Schreiben
- 0,00 $ / 1K
- Cache-Schreiben, 5 Min.
- 0,00 $ / 1K tokens
- Cache-Schreiben, 1 Stunde
- 0,00 $ / 1K tokens
Preise nach Anfragelänge · OpenAI Responses
| Anfragegröße in Token | Eingabe | Ausgabe | Cache-Lesen | Cache-Schreiben | Cache 5 Min. | Cache 1 Stunde |
|---|---|---|---|---|---|---|
| Anfragegröße in Token(0; 200.000] | Eingabe0,002 $ | Ausgabe0,006 $ | Cache-Lesen0,0003 $ | Cache-Schreiben0,00 $ | Cache 5 Min.0,00 $ | Cache 1 Stunde0,00 $ |
| Anfragegröße in Token(200.000; ∞) | Eingabe0,004 $ | Ausgabe0,012 $ | Cache-Lesen0,0006 $ | Cache-Schreiben0,00 $ | Cache 5 Min.0,00 $ | Cache 1 Stunde0,00 $ |
Tarife in USD pro 1K Token. Ist kein Tarif festgelegt, wird der Grundtarif dieser Methode übernommen; «—» bedeutet, dass kein Grundtarif festgelegt ist.
Ailoot reserviert vor einer Anfrage einen geschätzten Betrag. Nach dem Ergebnis rechnet Ailoot die endgültige Gebühr anhand des gemessenen Verbrauchs ab. Bei Streaming erfolgt die Abrechnung anhand des abschließenden Verbrauchsdatensatzes. So funktionieren Reservierung und Abrechnung →
Details zum Referenztarif
Referenztarifstaffeln auf Modellebene ändern weder Methodenauswahl noch Kostenvoranschläge oder Gebühren. Für die aktive Abrechnung gelten die Tarife der ausgewählten Ailoot-Methode.
Referenztarifstaffeln des Modells
Preise nach Konfiguration
Ordnen Sie jede Gebühr den angezeigten Bedingungen zu. Verwenden Sie für jede Gruppe alternativer Konfigurationen einen Tarif.
| Konfiguration | Tarifstaffel | Kontexttoken, mehr als | Kontexttoken, bis einschließlich | Gebühr |
|---|---|---|---|---|
| KonfigurationOpenAI Chat · Token-Basispreise | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationOpenAI Chat · Stufe 1 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationOpenAI Chat · Stufe 2 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Token-Basispreise | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Stufe 1 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Stufe 2 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
Beispielanfragen
Ailoot · OpenAI Responses
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 source-material file}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "grok-4.5-latest", "input": ""}')
f=Path(os.environ["AILOOT_TEXT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 source material")
text=f.read_text(encoding="utf-8")
if not text.strip():raise SystemExit("Source material must contain text")
p["input"]="Summarize this material and quote supporting source passages.\n\n"+text
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/responses \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
save_result(json.loads(Path("result.json").read_text(encoding="utf-8")))
PY_RESULT
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_FILE:?Set your actual PNG JPEG or WebP image}"
export AILOOT_IMAGE_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "grok-4.5-latest", "input": [{"role": "user", "content": [{"type": "input_text", "text": "Read labels and numbers in this image; flag unreadable text."}]}]}')
import base64
f=Path(os.environ["AILOOT_IMAGE_FILE"])
if not f.is_file():raise SystemExit("Choose an actual PNG JPEG or WebP image")
raw=f.read_bytes()
mime="image/png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "image/jpeg" if raw.startswith(b"\xff\xd8") else "image/webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else None
if not mime:raise SystemExit("Use PNG JPEG or WebP")
b64=base64.b64encode(raw).decode()
p["input"][0]["content"].append({"type":"input_image","image_url":"data:"+mime+";base64,"+b64})
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/responses \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
save_result(json.loads(Path("result.json").read_text(encoding="utf-8")))
PY_RESULT
from openai import OpenAI
import os
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client = OpenAI(base_url="https://api.ailoot.ai/v1", api_key=os.environ["AILOOT_API_KEY"], max_retries=0)
resp = client.responses.create(model="grok-4.5-latest", input="Explain the difference between an observation and a hypothesis in three sentences.")
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
save_result(resp.to_dict(mode="json"))
import OpenAI from "openai";
if (!process.env.AILOOT_API_KEY?.trim()) throw new Error("Set AILOOT_API_KEY before making a request");
const client = new OpenAI({ baseURL: "https://api.ailoot.ai/v1", apiKey: process.env.AILOOT_API_KEY, maxRetries: 0 });
const resp = await client.responses.create({ model: "grok-4.5-latest", input: "Explain the difference between an observation and a hypothesis in three sentences." });
import { writeFileSync } from "node:fs";
function saveResult(data, stem = "result") {
writeFileSync(stem + ".json", JSON.stringify(data, null, 2));
console.log(JSON.stringify(data, null, 2));
const saveBlob = (encoded, suffix, label) => {
const raw = Buffer.from(encoded, "base64");
const ext = raw.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10])) ? "png" : raw[0]===255 && raw[1]===216 ? "jpg" : raw.subarray(0,4).toString()==="RIFF" && raw.subarray(8,12).toString()==="WEBP" ? "webp" : suffix;
const file = `${stem}-${label}.${ext}`;
writeFileSync(file, raw); console.log("Saved", file);
};
for (const [i, block] of (data.content || []).entries()) console.log("Content", i, JSON.stringify(block));
for (const choice of data.choices || []) console.log("Choice", choice.index, JSON.stringify(choice.message || choice.delta || {}));
for (const [i, item] of (data.output || []).entries()) {
console.log("Output", i, JSON.stringify(item));
if (item.type === "image_generation_call" && item.result) saveBlob(item.result, item.output_format || "bin", `output-${i}`);
}
for (const [ci, candidate] of (data.candidates || []).entries()) {
for (const [pi, part] of (candidate.content?.parts || []).entries()) {
console.log("Candidate/part", ci, pi, JSON.stringify(part));
const blob = part.inlineData || part.inline_data;
if (blob?.data) {
const mime = blob.mimeType || blob.mime_type;
const suffix = ({"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"})[mime] || "bin";
saveBlob(blob.data, suffix, `candidate-${ci}-part-${pi}`);
}
}
}
}
saveResult(resp);
from openai import OpenAI
import os
from pathlib import Path
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
with client.responses.stream(model="grok-4.5-latest", input="Explain the difference between an observation and a hypothesis in three sentences.") as stream:
with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
for event in stream:
payload=event.to_dict(mode="json")
log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
print(json.dumps(payload,ensure_ascii=False))
final=stream.get_final_response()
save_result(final.to_dict(mode="json"),"stream-result")
Ergebnisse abrufen und speichern
Ailoot · OpenAI Responses
json oder SSE
Alle fertiggestellten Ergebnisse aufbewahren
Bewahren Sie jede vollständig zurückgegebene Antwort, Datei und jeden Inhaltsteil auf.
Alle Ausgabeelemente und Inhaltsteile, die tatsächliche call_id der Funktion, verschlüsselte Reasoning-Daten und Verbrauchsdaten beibehalten. Beim Streaming die vollständige Identität von Ereignis und Element bewahren.
Wenn die ursprüngliche Antwort geprüft werden muss
Anfrage- und Antwort-IDs sowie Header beibehalten. Eine allgemeine URL zum Abrufen von Textaufträgen wird nicht angegeben.
Antwortfelder
| Feld | Typ |
|---|---|
Feldid | Typstring |
Feldstatus | Typstring |
Feldoutput[] | Typmessage|reasoning|function_call|other item |
Feldoutput[].content[] | Typcontent part |
Feldusage | Typobject |
Fehler und nächste Schritte
| Antwort | Bedingung | Nächster Schritt |
|---|---|---|
Antwort400 · invalid_request_error | BedingungPflichtfelder, Darstellung des Eingabematerials oder Parameterwert ungültig | Nächster SchrittDie angegebenen Felder vor einer neuen Erstellungsanfrage korrigieren. |
Aliasnamen
Modellaliasnamen
Ailoot grok-4.5, grok-4.5-latest, grok-build-latest
Ailoot Ultra grok-4.5, x-ai/grok-4.5
Aliasnamen für Methodenpfade
/chat/completions
Zugehörige Aufrufer-IDs
x-ai/grok-4.5, grok-4.5-latest, grok-build-latest, grok-4.5, grok-4.5
Ailoot · OpenAI Chat POST /v1/chat/completions grok-4.5-latest
grok-4.5-latestgrok-4.5grok-4.5-latestgrok-build-latest
Start
Grok 4.5 ist das Modell von SpaceXAI für Programmierung, Wissensarbeit und MINT-Aufgaben. Es nimmt Text, Bilder und Dateien entgegen und liefert Textantworten. Das veröffentlichte Profil umfasst Steuerelemente für Reasoning, Werkzeuge und strukturierte Ausgaben sowie ein Kontextfenster von 500.000 Token.
- Zulässige Eingaben
- Text · Bilder
- Ergebnisse
- Text
In Ailoot verfügbar · Eingaben und Methoden
Ailoot · OpenAI Chat POST /v1/chat/completions
- Eingabetypen
text,image- Ausgabetypen
text- Kontext
- 500.000 tokens
- Maximale Ausgabe
- 500.000 tokens
- Ausgabeformat
- json oder SSE
| Feld | Typ | Anforderung | Werte und Limits | Standard |
|---|---|---|---|---|
Feldmodel | Typstring | AnforderungErforderlich | Werte und Limits grok-4.5-latest | Standard— |
Feldmessages | Typmessage[] | AnforderungErforderlich | Werte und Limits Mindestanzahl Elemente: 1 | Standard— |
Feldmessages[].role | Typstring | AnforderungErforderlich | Werte und Limits Beispiele: system, user, assistant, tool, function Bedingungen: Diese Rollen sind in den Kompatibilitätstypen des Quellcodes ausdrücklich dargestellt; der genaue Rollenumfang bleibt modellspezifisch. Modellabhängig | Standard— |
Feldmessages[].content | Typstring|content_part[]|null | AnforderungOptional | Werte und Limits | Standard— |
Feldmessages[].tool_calls | Typtool_call[] | AnforderungOptional | Werte und Limits | Standard— |
Feldmessages[].tool_call_id | Typstring | AnforderungOptional | Werte und Limits Gilt, wenn: role=tool; die tatsächlich zurückgegebene ID verwenden | Standard— |
Feldmessages[].name | Typstring | AnforderungOptional | Werte und Limits | Standard— |
Feldmessages[].reasoning_content | Typstring | AnforderungOptional | Werte und Limits Gilt, wenn: Tatsächlich zurückgegebene Reasoning-Daten erneut übermitteln, sofern dieses Modell sie verwendet | Standard— |
Feldmessages[].reasoning_details | Typobject|array | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldmax_tokens | Typinteger | AnforderungOptional | Werte und Limits Minimum: 1 Modellabhängig | Standard— |
Feldmax_completion_tokens | Typinteger | AnforderungOptional | Werte und Limits Minimum: 1 Modellabhängig | Standard— |
Feldstream | Typboolean | AnforderungOptional | Werte und Limits | Standardfalse |
Feldstream_options.include_usage | Typboolean | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtemperature | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtop_p | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldstop | Typstring|string[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtools | Typfunction_tool[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtools[].type | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtools[].function.name | Typstring | AnforderungErforderlich | Werte und Limits Gilt, wenn: Funktionswerkzeug bereitgestellt | Standard— |
Feldtools[].function.description | Typstring | AnforderungOptional | Werte und Limits | Standard— |
Feldtools[].function.parameters | TypJSON_schema | AnforderungOptional | Werte und Limits | Standard— |
Feldtool_choice | Typstring|object | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldparallel_tool_calls | Typboolean | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldresponse_format | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldreasoning_effort | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldreasoning | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldservice_tier | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldinstructions | Typstring | AnforderungOptional | Werte und Limits Kompatibilitätsfeld | Standard— |
Feldfunctions | Typfunction[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldfunction_call | Typstring|object | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldprompt_cache_options | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Kombinationen von Eingabematerialien
Text · UTF8-Text
messages[].content
Text + Bild
{type:image_url,image_url:{url,detail}}
Methodenparameter und Lebenszyklus
| Parameter | Vertrag |
|---|---|
Parametermaterial_types | Vertragtext, image |
Parameterrequired | Vertragmodel, messages |
Parameteroptional_controls | Vertragnull |
Parametercontent_type | Vertragapplication/json |
Parametertext_file_material | VertragTatsächlicher UTF-8-Inhalt wird als Text eingefügt; Datei-IDs/URLs müssen separat und exakt unterstützt werden |
Lebenszyklus: exact retained published method
Methodenstrukturen und IDs sind exakt; die Fähigkeiten des Anbieters sind von der Zulassung einer Anfrage zu unterscheiden.
Tarife
Ailoot-Methodentarife
POST /v1/chat/completions- Eingabe
- 0,002 $ / 1K
- Ausgabe
- 0,006 $ / 1K
- Cache-Lesen
- 0,0003 $ / 1K
- Cache-Schreiben
- 0,00 $ / 1K
- Cache-Schreiben, 5 Min.
- 0,00 $ / 1K tokens
- Cache-Schreiben, 1 Stunde
- 0,00 $ / 1K tokens
Preise nach Anfragelänge · OpenAI Chat
| Anfragegröße in Token | Eingabe | Ausgabe | Cache-Lesen | Cache-Schreiben | Cache 5 Min. | Cache 1 Stunde |
|---|---|---|---|---|---|---|
| Anfragegröße in Token(0; 200.000] | Eingabe0,002 $ | Ausgabe0,006 $ | Cache-Lesen0,0003 $ | Cache-Schreiben0,00 $ | Cache 5 Min.0,00 $ | Cache 1 Stunde0,00 $ |
| Anfragegröße in Token(200.000; ∞) | Eingabe0,004 $ | Ausgabe0,012 $ | Cache-Lesen0,0006 $ | Cache-Schreiben0,00 $ | Cache 5 Min.0,00 $ | Cache 1 Stunde0,00 $ |
Tarife in USD pro 1K Token. Ist kein Tarif festgelegt, wird der Grundtarif dieser Methode übernommen; «—» bedeutet, dass kein Grundtarif festgelegt ist.
Ailoot reserviert vor einer Anfrage einen geschätzten Betrag. Nach dem Ergebnis rechnet Ailoot die endgültige Gebühr anhand des gemessenen Verbrauchs ab. Bei Streaming erfolgt die Abrechnung anhand des abschließenden Verbrauchsdatensatzes. So funktionieren Reservierung und Abrechnung →
Details zum Referenztarif
Referenztarifstaffeln auf Modellebene ändern weder Methodenauswahl noch Kostenvoranschläge oder Gebühren. Für die aktive Abrechnung gelten die Tarife der ausgewählten Ailoot-Methode.
Referenztarifstaffeln des Modells
Preise nach Konfiguration
Ordnen Sie jede Gebühr den angezeigten Bedingungen zu. Verwenden Sie für jede Gruppe alternativer Konfigurationen einen Tarif.
| Konfiguration | Tarifstaffel | Kontexttoken, mehr als | Kontexttoken, bis einschließlich | Gebühr |
|---|---|---|---|---|
| KonfigurationOpenAI Chat · Token-Basispreise | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationOpenAI Chat · Stufe 1 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationOpenAI Chat · Stufe 2 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Token-Basispreise | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Stufe 1 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Stufe 2 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
Beispielanfragen
Ailoot · OpenAI Chat
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 source-material file}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "grok-4.5-latest", "messages": []}')
f=Path(os.environ["AILOOT_TEXT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 source material")
text=f.read_text(encoding="utf-8")
if not text.strip():raise SystemExit("Source material must contain text")
p["messages"]=[{"role":"user","content":"Summarize this material and quote supporting source passages.\n\n"+text}]
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_FILE:?Set your actual PNG JPEG or WebP image}"
export AILOOT_IMAGE_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "grok-4.5-latest", "messages": [{"role": "user", "content": [{"type": "text", "text": "Read labels and numbers in this image; flag unreadable text."}]}]}')
import base64
f=Path(os.environ["AILOOT_IMAGE_FILE"])
if not f.is_file():raise SystemExit("Choose an actual PNG JPEG or WebP image")
raw=f.read_bytes()
mime="image/png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "image/jpeg" if raw.startswith(b"\xff\xd8") else "image/webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else None
if not mime:raise SystemExit("Use PNG JPEG or WebP")
b64=base64.b64encode(raw).decode()
p["messages"][0]["content"].append({"type":"image_url","image_url":{"url":"data:"+mime+";base64,"+b64}})
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
from openai import OpenAI
import os
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client = OpenAI(base_url="https://api.ailoot.ai/v1", api_key=os.environ["AILOOT_API_KEY"], max_retries=0)
resp = client.chat.completions.create(
model="grok-4.5-latest",
messages=[{"role": "user", "content": "Explain the difference between an observation and a hypothesis in three sentences."}],
)
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
save_result(resp.to_dict(mode="json"))
import OpenAI from "openai";
if (!process.env.AILOOT_API_KEY?.trim()) throw new Error("Set AILOOT_API_KEY before making a request");
const client = new OpenAI({ baseURL: "https://api.ailoot.ai/v1", apiKey: process.env.AILOOT_API_KEY, maxRetries: 0 });
const resp = await client.chat.completions.create({
model: "grok-4.5-latest",
messages: [{ role: "user", content: "Explain the difference between an observation and a hypothesis in three sentences." }],
});
import { writeFileSync } from "node:fs";
function saveResult(data, stem = "result") {
writeFileSync(stem + ".json", JSON.stringify(data, null, 2));
console.log(JSON.stringify(data, null, 2));
const saveBlob = (encoded, suffix, label) => {
const raw = Buffer.from(encoded, "base64");
const ext = raw.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10])) ? "png" : raw[0]===255 && raw[1]===216 ? "jpg" : raw.subarray(0,4).toString()==="RIFF" && raw.subarray(8,12).toString()==="WEBP" ? "webp" : suffix;
const file = `${stem}-${label}.${ext}`;
writeFileSync(file, raw); console.log("Saved", file);
};
for (const [i, block] of (data.content || []).entries()) console.log("Content", i, JSON.stringify(block));
for (const choice of data.choices || []) console.log("Choice", choice.index, JSON.stringify(choice.message || choice.delta || {}));
for (const [i, item] of (data.output || []).entries()) {
console.log("Output", i, JSON.stringify(item));
if (item.type === "image_generation_call" && item.result) saveBlob(item.result, item.output_format || "bin", `output-${i}`);
}
for (const [ci, candidate] of (data.candidates || []).entries()) {
for (const [pi, part] of (candidate.content?.parts || []).entries()) {
console.log("Candidate/part", ci, pi, JSON.stringify(part));
const blob = part.inlineData || part.inline_data;
if (blob?.data) {
const mime = blob.mimeType || blob.mime_type;
const suffix = ({"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"})[mime] || "bin";
saveBlob(blob.data, suffix, `candidate-${ci}-part-${pi}`);
}
}
}
}
saveResult(resp);
from openai import OpenAI
import os
from pathlib import Path
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
with client.chat.completions.stream(model='grok-4.5-latest',messages=[{"role":"user","content":"Explain observations and hypotheses in three sentences."}]) as stream:
with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
for event in stream:
payload=event.to_dict(mode="json")
log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
print(json.dumps(payload,ensure_ascii=False))
final=stream.get_final_completion()
save_result(final.to_dict(mode="json"),"stream-result")
Ergebnisse abrufen und speichern
Ailoot · OpenAI Chat
json oder SSE
Alle fertiggestellten Ergebnisse aufbewahren
Bewahren Sie jede vollständig zurückgegebene Antwort, Datei und jeden Inhaltsteil auf.
Alle Antwortvarianten mit ihren Inhalten, Werkzeugaufrufen und Reasoning-Daten beibehalten. In SSE die Deltas nach Varianten- und Werkzeugindex zusammensetzen; endgültigen Beendigungsgrund und Verbrauchsdaten beibehalten.
Wenn die ursprüngliche Antwort geprüft werden muss
Anfrage- und Antwort-IDs sowie Header beibehalten. Eine allgemeine URL zum Abrufen von Textaufträgen wird nicht angegeben.
Antwortfelder
| Feld | Typ |
|---|---|
Feldchoices[].index | Typinteger |
Feldchoices[].message.content | Typstring|null |
Feldchoices[].message.tool_calls | Typtool_call[] |
Feldchoices[].message.reasoning_content | Typstring |
Feldchoices[].message.reasoning_details | Typobject|array |
Feldchoices[].finish_reason | Typstring|null |
Feldusage | Typobject |
Fehler und nächste Schritte
| Antwort | Bedingung | Nächster Schritt |
|---|---|---|
Antwort400 · invalid_request_error | BedingungPflichtfelder, Darstellung des Eingabematerials oder Parameterwert ungültig | Nächster SchrittDie angegebenen Felder vor einer neuen Erstellungsanfrage korrigieren. |
Aliasnamen
Modellaliasnamen
Ailoot grok-4.5, grok-4.5-latest, grok-build-latest
Ailoot Ultra grok-4.5, x-ai/grok-4.5
Aliasnamen für Methodenpfade
/chat/completions
Zugehörige Aufrufer-IDs
x-ai/grok-4.5, grok-4.5-latest, grok-build-latest, grok-4.5, grok-4.5
Ailoot · Anthropic Messages POST /v1/messages grok-build-latest
grok-build-latestgrok-4.5grok-4.5-latestgrok-build-latest
Start
Grok 4.5 ist das Modell von SpaceXAI für Programmierung, Wissensarbeit und MINT-Aufgaben. Es nimmt Text, Bilder und Dateien entgegen und liefert Textantworten. Das veröffentlichte Profil umfasst Steuerelemente für Reasoning, Werkzeuge und strukturierte Ausgaben sowie ein Kontextfenster von 500.000 Token.
- Zulässige Eingaben
- Text · Bilder
- Ergebnisse
- Text
In Ailoot verfügbar · Eingaben und Methoden
Ailoot · Anthropic Messages POST /v1/messages
- Eingabetypen
text,image- Ausgabetypen
text- Kontext
- 500.000 tokens
- Maximale Ausgabe
- 500.000 tokens
- Ausgabeformat
- json oder SSE
| Feld | Typ | Anforderung | Werte und Limits | Standard |
|---|---|---|---|---|
Feldmodel | Typstring | AnforderungErforderlich | Werte und Limits grok-build-latest | Standard— |
Feldmessages | Typmessage[] | AnforderungErforderlich | Werte und Limits Mindestanzahl Elemente: 1 | Standard— |
Feldmessages[].role | Typstring | AnforderungErforderlich | Werte und Limits user, assistant | Standard— |
Feldmessages[].content | Typstring|content_block[] | AnforderungErforderlich | Werte und Limits | Standard— |
Feldsystem | Typstring|content_block[] | AnforderungOptional | Werte und Limits | Standard— |
Feldmax_tokens | Typinteger | AnforderungErforderlich | Werte und Limits Minimum: 1 Limit gilt für: Genaue Obergrenze des ausgewählten Modells bzw. seiner Modellkarte | Standard— |
Feldstream | Typboolean | AnforderungOptional | Werte und Limits | Standardfalse |
Feldtemperature | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtop_p | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldstop_sequences | Typstring[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtools | Typtool[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtools[].name | Typstring | AnforderungOptional | Werte und Limits Gilt, wenn: Werkzeug bereitgestellt | Standard— |
Feldtools[].description | Typstring | AnforderungOptional | Werte und Limits | Standard— |
Feldtools[].input_schema | TypJSON_schema | AnforderungOptional | Werte und Limits | Standard— |
Feldtool_choice | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldthinking.type | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldthinking.budget_tokens | Typinteger | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldoutput_config.effort | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldmetadata | Typobject | AnforderungOptional | Werte und Limits | Standard— |
Feldcache_control | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Kombinationen von Eingabematerialien
Text · UTF8-Text
messages[].content oder Block mit type=text
Text + Bild
{type:image,source:{type:base64,media_type,data}} oder Quelle mit type=url
Methodenparameter und Lebenszyklus
| Parameter | Vertrag |
|---|---|
Parametermaterial_types | Vertragtext, image |
Parameterrequired | Vertragmodel, messages, max_tokens |
Parameteroptional_controls | Vertragnull |
Parametercontent_type | Vertragapplication/json |
Parametertext_file_material | VertragTatsächlicher UTF-8-Inhalt wird als Text eingefügt; Datei-IDs/URLs müssen separat und exakt unterstützt werden |
Lebenszyklus: exact retained published method
Methodenstrukturen und IDs sind exakt; die Fähigkeiten des Anbieters sind von der Zulassung einer Anfrage zu unterscheiden.
Tarife
Ailoot-Methodentarife
POST /v1/messages- Eingabe
- 0,002 $ / 1K
- Ausgabe
- 0,006 $ / 1K
- Cache-Lesen
- 0,0003 $ / 1K
- Cache-Schreiben
- 0,00 $ / 1K
- Cache-Schreiben, 5 Min.
- 0,00 $ / 1K tokens
- Cache-Schreiben, 1 Stunde
- 0,00 $ / 1K tokens
Preise nach Anfragelänge · Anthropic Messages
| Anfragegröße in Token | Eingabe | Ausgabe | Cache-Lesen | Cache-Schreiben | Cache 5 Min. | Cache 1 Stunde |
|---|---|---|---|---|---|---|
| Anfragegröße in Token(0; 200.000] | Eingabe0,002 $ | Ausgabe0,006 $ | Cache-Lesen0,0003 $ | Cache-Schreiben0,00 $ | Cache 5 Min.0,00 $ | Cache 1 Stunde0,00 $ |
| Anfragegröße in Token(200.000; ∞) | Eingabe0,004 $ | Ausgabe0,012 $ | Cache-Lesen0,0006 $ | Cache-Schreiben0,00 $ | Cache 5 Min.0,00 $ | Cache 1 Stunde0,00 $ |
Tarife in USD pro 1K Token. Ist kein Tarif festgelegt, wird der Grundtarif dieser Methode übernommen; «—» bedeutet, dass kein Grundtarif festgelegt ist.
Ailoot reserviert vor einer Anfrage einen geschätzten Betrag. Nach dem Ergebnis rechnet Ailoot die endgültige Gebühr anhand des gemessenen Verbrauchs ab. Bei Streaming erfolgt die Abrechnung anhand des abschließenden Verbrauchsdatensatzes. So funktionieren Reservierung und Abrechnung →
Details zum Referenztarif
Referenztarifstaffeln auf Modellebene ändern weder Methodenauswahl noch Kostenvoranschläge oder Gebühren. Für die aktive Abrechnung gelten die Tarife der ausgewählten Ailoot-Methode.
Referenztarifstaffeln des Modells
Preise nach Konfiguration
Ordnen Sie jede Gebühr den angezeigten Bedingungen zu. Verwenden Sie für jede Gruppe alternativer Konfigurationen einen Tarif.
| Konfiguration | Tarifstaffel | Kontexttoken, mehr als | Kontexttoken, bis einschließlich | Gebühr |
|---|---|---|---|---|
| KonfigurationOpenAI Chat · Token-Basispreise | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationOpenAI Chat · Stufe 1 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationOpenAI Chat · Stufe 2 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Token-Basispreise | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Stufe 1 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Stufe 2 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
Beispielanfragen
Ailoot · Anthropic Messages
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 source-material file}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "grok-build-latest", "max_tokens": 1024, "messages": []}')
f=Path(os.environ["AILOOT_TEXT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 source material")
text=f.read_text(encoding="utf-8")
if not text.strip():raise SystemExit("Source material must contain text")
p["messages"]=[{"role":"user","content":"Summarize this material and quote supporting source passages.\n\n"+text}]
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \
-H "x-api-key: $AILOOT_API_KEY" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_FILE:?Set your actual PNG JPEG or WebP image}"
export AILOOT_IMAGE_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "grok-build-latest", "max_tokens": 1024, "messages": [{"role": "user", "content": [{"type": "text", "text": "Read labels and numbers in this image; flag unreadable text."}]}]}')
import base64
f=Path(os.environ["AILOOT_IMAGE_FILE"])
if not f.is_file():raise SystemExit("Choose an actual PNG JPEG or WebP image")
raw=f.read_bytes()
mime="image/png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "image/jpeg" if raw.startswith(b"\xff\xd8") else "image/webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else None
if not mime:raise SystemExit("Use PNG JPEG or WebP")
b64=base64.b64encode(raw).decode()
p["messages"][0]["content"].append({"type":"image","source":{"type":"base64","media_type":mime,"data":b64}})
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \
-H "x-api-key: $AILOOT_API_KEY" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
import anthropic
import os
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client = anthropic.Anthropic(base_url="https://api.ailoot.ai", api_key=os.environ["AILOOT_API_KEY"], max_retries=0)
msg = client.messages.create(
model="grok-build-latest",
max_tokens=1024,
messages=[{"role": "user", "content": "Explain the difference between an observation and a hypothesis in three sentences."}],
)
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
save_result(msg.to_dict(mode="json"))
import Anthropic from "@anthropic-ai/sdk";
if (!process.env.AILOOT_API_KEY?.trim()) throw new Error("Set AILOOT_API_KEY before making a request");
const client = new Anthropic({ baseURL: "https://api.ailoot.ai", apiKey: process.env.AILOOT_API_KEY, maxRetries: 0 });
const msg = await client.messages.create({
model: "grok-build-latest",
max_tokens: 1024,
messages: [{ role: "user", content: "Explain the difference between an observation and a hypothesis in three sentences." }],
});
import { writeFileSync } from "node:fs";
function saveResult(data, stem = "result") {
writeFileSync(stem + ".json", JSON.stringify(data, null, 2));
console.log(JSON.stringify(data, null, 2));
const saveBlob = (encoded, suffix, label) => {
const raw = Buffer.from(encoded, "base64");
const ext = raw.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10])) ? "png" : raw[0]===255 && raw[1]===216 ? "jpg" : raw.subarray(0,4).toString()==="RIFF" && raw.subarray(8,12).toString()==="WEBP" ? "webp" : suffix;
const file = `${stem}-${label}.${ext}`;
writeFileSync(file, raw); console.log("Saved", file);
};
for (const [i, block] of (data.content || []).entries()) console.log("Content", i, JSON.stringify(block));
for (const choice of data.choices || []) console.log("Choice", choice.index, JSON.stringify(choice.message || choice.delta || {}));
for (const [i, item] of (data.output || []).entries()) {
console.log("Output", i, JSON.stringify(item));
if (item.type === "image_generation_call" && item.result) saveBlob(item.result, item.output_format || "bin", `output-${i}`);
}
for (const [ci, candidate] of (data.candidates || []).entries()) {
for (const [pi, part] of (candidate.content?.parts || []).entries()) {
console.log("Candidate/part", ci, pi, JSON.stringify(part));
const blob = part.inlineData || part.inline_data;
if (blob?.data) {
const mime = blob.mimeType || blob.mime_type;
const suffix = ({"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"})[mime] || "bin";
saveBlob(blob.data, suffix, `candidate-${ci}-part-${pi}`);
}
}
}
}
saveResult(msg);
import anthropic,os
from pathlib import Path
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=anthropic.Anthropic(base_url="https://api.ailoot.ai",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
with client.messages.stream(model='grok-build-latest',max_tokens=1024,messages=[{"role":"user","content":"Explain observations and hypotheses in three sentences."}]) as stream:
with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
for event in stream:
payload=event.to_dict(mode="json")
log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
print(json.dumps(payload,ensure_ascii=False))
final=stream.get_final_message()
save_result(final.to_dict(mode="json"),"stream-result")
Ergebnisse abrufen und speichern
Ailoot · Anthropic Messages
json oder SSE
Alle fertiggestellten Ergebnisse aufbewahren
Bewahren Sie jede vollständig zurückgegebene Antwort, Datei und jeden Inhaltsteil auf.
Alle Inhaltsblöcke, Thinking-Signaturen und tatsächlichen Werkzeugaufruf-IDs beibehalten. Alle SSE-Blockdeltas zusammensetzen; der erste Textblock ist nicht die vollständige Ausgabe.
Wenn die ursprüngliche Antwort geprüft werden muss
Anfrage- und Antwort-IDs sowie Header beibehalten. Eine allgemeine URL zum Abrufen von Textaufträgen wird nicht angegeben.
Antwortfelder
| Feld | Typ |
|---|---|
Feldid | Typstring |
Feldmodel | Typstring |
Feldcontent[] | Typtext|thinking|tool_use|other content block |
Feldstop_reason | Typstring|null |
Feldusage | Typobject |
Fehler und nächste Schritte
| Antwort | Bedingung | Nächster Schritt |
|---|---|---|
Antwort400 · invalid_request_error | BedingungPflichtfelder, Darstellung des Eingabematerials oder Parameterwert ungültig | Nächster SchrittDie angegebenen Felder vor einer neuen Erstellungsanfrage korrigieren. |
Aliasnamen
Modellaliasnamen
Ailoot grok-4.5, grok-4.5-latest, grok-build-latest
Ailoot Ultra grok-4.5, x-ai/grok-4.5
Aliasnamen für Methodenpfade
/chat/completions
Zugehörige Aufrufer-IDs
x-ai/grok-4.5, grok-4.5-latest, grok-build-latest, grok-4.5, grok-4.5
Ailoot · OpenAI Responses POST /v1/responses grok-build-latest
grok-build-latestgrok-4.5grok-4.5-latestgrok-build-latest
Start
Grok 4.5 ist das Modell von SpaceXAI für Programmierung, Wissensarbeit und MINT-Aufgaben. Es nimmt Text, Bilder und Dateien entgegen und liefert Textantworten. Das veröffentlichte Profil umfasst Steuerelemente für Reasoning, Werkzeuge und strukturierte Ausgaben sowie ein Kontextfenster von 500.000 Token.
- Zulässige Eingaben
- Text · Bilder
- Ergebnisse
- Text
In Ailoot verfügbar · Eingaben und Methoden
Ailoot · OpenAI Responses POST /v1/responses
- Eingabetypen
text,image- Ausgabetypen
text- Kontext
- 500.000 tokens
- Maximale Ausgabe
- 500.000 tokens
- Ausgabeformat
- json oder SSE
| Feld | Typ | Anforderung | Werte und Limits | Standard |
|---|---|---|---|---|
Feldmodel | Typstring | AnforderungErforderlich | Werte und Limits grok-build-latest | Standard— |
Feldinput | Typstring|input_item[] | AnforderungErforderlich | Werte und Limits | Standard— |
Feldinstructions | Typstring | AnforderungOptional | Werte und Limits | Standard— |
Feldinput[].type | Typstring | AnforderungOptional | Werte und Limits message, reasoning, function_call, function_call_output | Standard— |
Feldinput[].content | Typstring|content_part[] | AnforderungOptional | Werte und Limits | Standard— |
Feldinput[].call_id | Typstring | AnforderungOptional | Werte und Limits Gilt, wenn: function_call_output; den tatsächlich zurückgegebenen Wert von call_id beibehalten | Standard— |
Feldinput[].output | Typstring|content_part[] | AnforderungOptional | Werte und Limits Gilt, wenn: function_call_output | Standard— |
Feldmax_output_tokens | Typinteger | AnforderungOptional | Werte und Limits Minimum: 1 Modellabhängig | Standard— |
Feldstream | Typboolean | AnforderungOptional | Werte und Limits | Standardfalse |
Feldtemperature | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtop_p | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtools | Typtool[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtool_choice | Typstring|object | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldparallel_tool_calls | Typboolean | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldreasoning.effort | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldreasoning.summary | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtext.format | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtext.verbosity | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldinclude | Typstring[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldstore | Typboolean | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldprevious_response_id | Typstring | AnforderungOptional | Werte und Limits ID-Anforderung: Nur eine tatsächliche Antwort-ID aus einer unterstützten Fortsetzung Modellabhängig | Standard— |
Feldservice_tier | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldprompt_cache_key | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldprompt_cache_options | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Kombinationen von Eingabematerialien
Text · UTF8-Text
Eingabetext oder input_text-Teil
Text + Bild
{type:input_image,image_url}
Methodenparameter und Lebenszyklus
| Parameter | Vertrag |
|---|---|
Parametermaterial_types | Vertragtext, image |
Parameterrequired | Vertragmodel, input |
Parameteroptional_controls | Vertragnull |
Parametercontent_type | Vertragapplication/json |
Parametertext_file_material | VertragTatsächlicher UTF-8-Inhalt wird als Text eingefügt; Datei-IDs/URLs müssen separat und exakt unterstützt werden |
Lebenszyklus: exact retained published method
Methodenstrukturen und IDs sind exakt; die Fähigkeiten des Anbieters sind von der Zulassung einer Anfrage zu unterscheiden.
Tarife
Ailoot-Methodentarife
POST /v1/responses- Eingabe
- 0,002 $ / 1K
- Ausgabe
- 0,006 $ / 1K
- Cache-Lesen
- 0,0003 $ / 1K
- Cache-Schreiben
- 0,00 $ / 1K
- Cache-Schreiben, 5 Min.
- 0,00 $ / 1K tokens
- Cache-Schreiben, 1 Stunde
- 0,00 $ / 1K tokens
Preise nach Anfragelänge · OpenAI Responses
| Anfragegröße in Token | Eingabe | Ausgabe | Cache-Lesen | Cache-Schreiben | Cache 5 Min. | Cache 1 Stunde |
|---|---|---|---|---|---|---|
| Anfragegröße in Token(0; 200.000] | Eingabe0,002 $ | Ausgabe0,006 $ | Cache-Lesen0,0003 $ | Cache-Schreiben0,00 $ | Cache 5 Min.0,00 $ | Cache 1 Stunde0,00 $ |
| Anfragegröße in Token(200.000; ∞) | Eingabe0,004 $ | Ausgabe0,012 $ | Cache-Lesen0,0006 $ | Cache-Schreiben0,00 $ | Cache 5 Min.0,00 $ | Cache 1 Stunde0,00 $ |
Tarife in USD pro 1K Token. Ist kein Tarif festgelegt, wird der Grundtarif dieser Methode übernommen; «—» bedeutet, dass kein Grundtarif festgelegt ist.
Ailoot reserviert vor einer Anfrage einen geschätzten Betrag. Nach dem Ergebnis rechnet Ailoot die endgültige Gebühr anhand des gemessenen Verbrauchs ab. Bei Streaming erfolgt die Abrechnung anhand des abschließenden Verbrauchsdatensatzes. So funktionieren Reservierung und Abrechnung →
Details zum Referenztarif
Referenztarifstaffeln auf Modellebene ändern weder Methodenauswahl noch Kostenvoranschläge oder Gebühren. Für die aktive Abrechnung gelten die Tarife der ausgewählten Ailoot-Methode.
Referenztarifstaffeln des Modells
Preise nach Konfiguration
Ordnen Sie jede Gebühr den angezeigten Bedingungen zu. Verwenden Sie für jede Gruppe alternativer Konfigurationen einen Tarif.
| Konfiguration | Tarifstaffel | Kontexttoken, mehr als | Kontexttoken, bis einschließlich | Gebühr |
|---|---|---|---|---|
| KonfigurationOpenAI Chat · Token-Basispreise | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationOpenAI Chat · Stufe 1 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationOpenAI Chat · Stufe 2 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Token-Basispreise | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Stufe 1 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Stufe 2 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
Beispielanfragen
Ailoot · OpenAI Responses
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 source-material file}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "grok-build-latest", "input": ""}')
f=Path(os.environ["AILOOT_TEXT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 source material")
text=f.read_text(encoding="utf-8")
if not text.strip():raise SystemExit("Source material must contain text")
p["input"]="Summarize this material and quote supporting source passages.\n\n"+text
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/responses \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
save_result(json.loads(Path("result.json").read_text(encoding="utf-8")))
PY_RESULT
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_FILE:?Set your actual PNG JPEG or WebP image}"
export AILOOT_IMAGE_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "grok-build-latest", "input": [{"role": "user", "content": [{"type": "input_text", "text": "Read labels and numbers in this image; flag unreadable text."}]}]}')
import base64
f=Path(os.environ["AILOOT_IMAGE_FILE"])
if not f.is_file():raise SystemExit("Choose an actual PNG JPEG or WebP image")
raw=f.read_bytes()
mime="image/png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "image/jpeg" if raw.startswith(b"\xff\xd8") else "image/webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else None
if not mime:raise SystemExit("Use PNG JPEG or WebP")
b64=base64.b64encode(raw).decode()
p["input"][0]["content"].append({"type":"input_image","image_url":"data:"+mime+";base64,"+b64})
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/responses \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
save_result(json.loads(Path("result.json").read_text(encoding="utf-8")))
PY_RESULT
from openai import OpenAI
import os
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client = OpenAI(base_url="https://api.ailoot.ai/v1", api_key=os.environ["AILOOT_API_KEY"], max_retries=0)
resp = client.responses.create(model="grok-build-latest", input="Explain the difference between an observation and a hypothesis in three sentences.")
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
save_result(resp.to_dict(mode="json"))
import OpenAI from "openai";
if (!process.env.AILOOT_API_KEY?.trim()) throw new Error("Set AILOOT_API_KEY before making a request");
const client = new OpenAI({ baseURL: "https://api.ailoot.ai/v1", apiKey: process.env.AILOOT_API_KEY, maxRetries: 0 });
const resp = await client.responses.create({ model: "grok-build-latest", input: "Explain the difference between an observation and a hypothesis in three sentences." });
import { writeFileSync } from "node:fs";
function saveResult(data, stem = "result") {
writeFileSync(stem + ".json", JSON.stringify(data, null, 2));
console.log(JSON.stringify(data, null, 2));
const saveBlob = (encoded, suffix, label) => {
const raw = Buffer.from(encoded, "base64");
const ext = raw.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10])) ? "png" : raw[0]===255 && raw[1]===216 ? "jpg" : raw.subarray(0,4).toString()==="RIFF" && raw.subarray(8,12).toString()==="WEBP" ? "webp" : suffix;
const file = `${stem}-${label}.${ext}`;
writeFileSync(file, raw); console.log("Saved", file);
};
for (const [i, block] of (data.content || []).entries()) console.log("Content", i, JSON.stringify(block));
for (const choice of data.choices || []) console.log("Choice", choice.index, JSON.stringify(choice.message || choice.delta || {}));
for (const [i, item] of (data.output || []).entries()) {
console.log("Output", i, JSON.stringify(item));
if (item.type === "image_generation_call" && item.result) saveBlob(item.result, item.output_format || "bin", `output-${i}`);
}
for (const [ci, candidate] of (data.candidates || []).entries()) {
for (const [pi, part] of (candidate.content?.parts || []).entries()) {
console.log("Candidate/part", ci, pi, JSON.stringify(part));
const blob = part.inlineData || part.inline_data;
if (blob?.data) {
const mime = blob.mimeType || blob.mime_type;
const suffix = ({"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"})[mime] || "bin";
saveBlob(blob.data, suffix, `candidate-${ci}-part-${pi}`);
}
}
}
}
saveResult(resp);
from openai import OpenAI
import os
from pathlib import Path
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
with client.responses.stream(model="grok-build-latest", input="Explain the difference between an observation and a hypothesis in three sentences.") as stream:
with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
for event in stream:
payload=event.to_dict(mode="json")
log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
print(json.dumps(payload,ensure_ascii=False))
final=stream.get_final_response()
save_result(final.to_dict(mode="json"),"stream-result")
Ergebnisse abrufen und speichern
Ailoot · OpenAI Responses
json oder SSE
Alle fertiggestellten Ergebnisse aufbewahren
Bewahren Sie jede vollständig zurückgegebene Antwort, Datei und jeden Inhaltsteil auf.
Alle Ausgabeelemente und Inhaltsteile, die tatsächliche call_id der Funktion, verschlüsselte Reasoning-Daten und Verbrauchsdaten beibehalten. Beim Streaming die vollständige Identität von Ereignis und Element bewahren.
Wenn die ursprüngliche Antwort geprüft werden muss
Anfrage- und Antwort-IDs sowie Header beibehalten. Eine allgemeine URL zum Abrufen von Textaufträgen wird nicht angegeben.
Antwortfelder
| Feld | Typ |
|---|---|
Feldid | Typstring |
Feldstatus | Typstring |
Feldoutput[] | Typmessage|reasoning|function_call|other item |
Feldoutput[].content[] | Typcontent part |
Feldusage | Typobject |
Fehler und nächste Schritte
| Antwort | Bedingung | Nächster Schritt |
|---|---|---|
Antwort400 · invalid_request_error | BedingungPflichtfelder, Darstellung des Eingabematerials oder Parameterwert ungültig | Nächster SchrittDie angegebenen Felder vor einer neuen Erstellungsanfrage korrigieren. |
Aliasnamen
Modellaliasnamen
Ailoot grok-4.5, grok-4.5-latest, grok-build-latest
Ailoot Ultra grok-4.5, x-ai/grok-4.5
Aliasnamen für Methodenpfade
/chat/completions
Zugehörige Aufrufer-IDs
x-ai/grok-4.5, grok-4.5-latest, grok-build-latest, grok-4.5, grok-4.5
Ailoot · OpenAI Chat POST /v1/chat/completions grok-build-latest
grok-build-latestgrok-4.5grok-4.5-latestgrok-build-latest
Start
Grok 4.5 ist das Modell von SpaceXAI für Programmierung, Wissensarbeit und MINT-Aufgaben. Es nimmt Text, Bilder und Dateien entgegen und liefert Textantworten. Das veröffentlichte Profil umfasst Steuerelemente für Reasoning, Werkzeuge und strukturierte Ausgaben sowie ein Kontextfenster von 500.000 Token.
- Zulässige Eingaben
- Text · Bilder
- Ergebnisse
- Text
In Ailoot verfügbar · Eingaben und Methoden
Ailoot · OpenAI Chat POST /v1/chat/completions
- Eingabetypen
text,image- Ausgabetypen
text- Kontext
- 500.000 tokens
- Maximale Ausgabe
- 500.000 tokens
- Ausgabeformat
- json oder SSE
| Feld | Typ | Anforderung | Werte und Limits | Standard |
|---|---|---|---|---|
Feldmodel | Typstring | AnforderungErforderlich | Werte und Limits grok-build-latest | Standard— |
Feldmessages | Typmessage[] | AnforderungErforderlich | Werte und Limits Mindestanzahl Elemente: 1 | Standard— |
Feldmessages[].role | Typstring | AnforderungErforderlich | Werte und Limits Beispiele: system, user, assistant, tool, function Bedingungen: Diese Rollen sind in den Kompatibilitätstypen des Quellcodes ausdrücklich dargestellt; der genaue Rollenumfang bleibt modellspezifisch. Modellabhängig | Standard— |
Feldmessages[].content | Typstring|content_part[]|null | AnforderungOptional | Werte und Limits | Standard— |
Feldmessages[].tool_calls | Typtool_call[] | AnforderungOptional | Werte und Limits | Standard— |
Feldmessages[].tool_call_id | Typstring | AnforderungOptional | Werte und Limits Gilt, wenn: role=tool; die tatsächlich zurückgegebene ID verwenden | Standard— |
Feldmessages[].name | Typstring | AnforderungOptional | Werte und Limits | Standard— |
Feldmessages[].reasoning_content | Typstring | AnforderungOptional | Werte und Limits Gilt, wenn: Tatsächlich zurückgegebene Reasoning-Daten erneut übermitteln, sofern dieses Modell sie verwendet | Standard— |
Feldmessages[].reasoning_details | Typobject|array | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldmax_tokens | Typinteger | AnforderungOptional | Werte und Limits Minimum: 1 Modellabhängig | Standard— |
Feldmax_completion_tokens | Typinteger | AnforderungOptional | Werte und Limits Minimum: 1 Modellabhängig | Standard— |
Feldstream | Typboolean | AnforderungOptional | Werte und Limits | Standardfalse |
Feldstream_options.include_usage | Typboolean | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtemperature | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtop_p | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldstop | Typstring|string[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtools | Typfunction_tool[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtools[].type | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtools[].function.name | Typstring | AnforderungErforderlich | Werte und Limits Gilt, wenn: Funktionswerkzeug bereitgestellt | Standard— |
Feldtools[].function.description | Typstring | AnforderungOptional | Werte und Limits | Standard— |
Feldtools[].function.parameters | TypJSON_schema | AnforderungOptional | Werte und Limits | Standard— |
Feldtool_choice | Typstring|object | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldparallel_tool_calls | Typboolean | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldresponse_format | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldreasoning_effort | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldreasoning | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldservice_tier | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldinstructions | Typstring | AnforderungOptional | Werte und Limits Kompatibilitätsfeld | Standard— |
Feldfunctions | Typfunction[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldfunction_call | Typstring|object | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldprompt_cache_options | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Kombinationen von Eingabematerialien
Text · UTF8-Text
messages[].content
Text + Bild
{type:image_url,image_url:{url,detail}}
Methodenparameter und Lebenszyklus
| Parameter | Vertrag |
|---|---|
Parametermaterial_types | Vertragtext, image |
Parameterrequired | Vertragmodel, messages |
Parameteroptional_controls | Vertragnull |
Parametercontent_type | Vertragapplication/json |
Parametertext_file_material | VertragTatsächlicher UTF-8-Inhalt wird als Text eingefügt; Datei-IDs/URLs müssen separat und exakt unterstützt werden |
Lebenszyklus: exact retained published method
Methodenstrukturen und IDs sind exakt; die Fähigkeiten des Anbieters sind von der Zulassung einer Anfrage zu unterscheiden.
Tarife
Ailoot-Methodentarife
POST /v1/chat/completions- Eingabe
- 0,002 $ / 1K
- Ausgabe
- 0,006 $ / 1K
- Cache-Lesen
- 0,0003 $ / 1K
- Cache-Schreiben
- 0,00 $ / 1K
- Cache-Schreiben, 5 Min.
- 0,00 $ / 1K tokens
- Cache-Schreiben, 1 Stunde
- 0,00 $ / 1K tokens
Preise nach Anfragelänge · OpenAI Chat
| Anfragegröße in Token | Eingabe | Ausgabe | Cache-Lesen | Cache-Schreiben | Cache 5 Min. | Cache 1 Stunde |
|---|---|---|---|---|---|---|
| Anfragegröße in Token(0; 200.000] | Eingabe0,002 $ | Ausgabe0,006 $ | Cache-Lesen0,0003 $ | Cache-Schreiben0,00 $ | Cache 5 Min.0,00 $ | Cache 1 Stunde0,00 $ |
| Anfragegröße in Token(200.000; ∞) | Eingabe0,004 $ | Ausgabe0,012 $ | Cache-Lesen0,0006 $ | Cache-Schreiben0,00 $ | Cache 5 Min.0,00 $ | Cache 1 Stunde0,00 $ |
Tarife in USD pro 1K Token. Ist kein Tarif festgelegt, wird der Grundtarif dieser Methode übernommen; «—» bedeutet, dass kein Grundtarif festgelegt ist.
Ailoot reserviert vor einer Anfrage einen geschätzten Betrag. Nach dem Ergebnis rechnet Ailoot die endgültige Gebühr anhand des gemessenen Verbrauchs ab. Bei Streaming erfolgt die Abrechnung anhand des abschließenden Verbrauchsdatensatzes. So funktionieren Reservierung und Abrechnung →
Details zum Referenztarif
Referenztarifstaffeln auf Modellebene ändern weder Methodenauswahl noch Kostenvoranschläge oder Gebühren. Für die aktive Abrechnung gelten die Tarife der ausgewählten Ailoot-Methode.
Referenztarifstaffeln des Modells
Preise nach Konfiguration
Ordnen Sie jede Gebühr den angezeigten Bedingungen zu. Verwenden Sie für jede Gruppe alternativer Konfigurationen einen Tarif.
| Konfiguration | Tarifstaffel | Kontexttoken, mehr als | Kontexttoken, bis einschließlich | Gebühr |
|---|---|---|---|---|
| KonfigurationOpenAI Chat · Token-Basispreise | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationOpenAI Chat · Stufe 1 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationOpenAI Chat · Stufe 2 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Token-Basispreise | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Stufe 1 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnthropic Messages · Stufe 2 nach Anfragelänge | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
Beispielanfragen
Ailoot · OpenAI Chat
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 source-material file}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "grok-build-latest", "messages": []}')
f=Path(os.environ["AILOOT_TEXT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 source material")
text=f.read_text(encoding="utf-8")
if not text.strip():raise SystemExit("Source material must contain text")
p["messages"]=[{"role":"user","content":"Summarize this material and quote supporting source passages.\n\n"+text}]
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_IMAGE_FILE:?Set your actual PNG JPEG or WebP image}"
export AILOOT_IMAGE_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "grok-build-latest", "messages": [{"role": "user", "content": [{"type": "text", "text": "Read labels and numbers in this image; flag unreadable text."}]}]}')
import base64
f=Path(os.environ["AILOOT_IMAGE_FILE"])
if not f.is_file():raise SystemExit("Choose an actual PNG JPEG or WebP image")
raw=f.read_bytes()
mime="image/png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "image/jpeg" if raw.startswith(b"\xff\xd8") else "image/webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else None
if not mime:raise SystemExit("Use PNG JPEG or WebP")
b64=base64.b64encode(raw).decode()
p["messages"][0]["content"].append({"type":"image_url","image_url":{"url":"data:"+mime+";base64,"+b64}})
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
print(json.dumps(json.loads(Path("result.json").read_text()),ensure_ascii=False,indent=2))
PY_RESULT
from openai import OpenAI
import os
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client = OpenAI(base_url="https://api.ailoot.ai/v1", api_key=os.environ["AILOOT_API_KEY"], max_retries=0)
resp = client.chat.completions.create(
model="grok-build-latest",
messages=[{"role": "user", "content": "Explain the difference between an observation and a hypothesis in three sentences."}],
)
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
save_result(resp.to_dict(mode="json"))
import OpenAI from "openai";
if (!process.env.AILOOT_API_KEY?.trim()) throw new Error("Set AILOOT_API_KEY before making a request");
const client = new OpenAI({ baseURL: "https://api.ailoot.ai/v1", apiKey: process.env.AILOOT_API_KEY, maxRetries: 0 });
const resp = await client.chat.completions.create({
model: "grok-build-latest",
messages: [{ role: "user", content: "Explain the difference between an observation and a hypothesis in three sentences." }],
});
import { writeFileSync } from "node:fs";
function saveResult(data, stem = "result") {
writeFileSync(stem + ".json", JSON.stringify(data, null, 2));
console.log(JSON.stringify(data, null, 2));
const saveBlob = (encoded, suffix, label) => {
const raw = Buffer.from(encoded, "base64");
const ext = raw.subarray(0,8).equals(Buffer.from([137,80,78,71,13,10,26,10])) ? "png" : raw[0]===255 && raw[1]===216 ? "jpg" : raw.subarray(0,4).toString()==="RIFF" && raw.subarray(8,12).toString()==="WEBP" ? "webp" : suffix;
const file = `${stem}-${label}.${ext}`;
writeFileSync(file, raw); console.log("Saved", file);
};
for (const [i, block] of (data.content || []).entries()) console.log("Content", i, JSON.stringify(block));
for (const choice of data.choices || []) console.log("Choice", choice.index, JSON.stringify(choice.message || choice.delta || {}));
for (const [i, item] of (data.output || []).entries()) {
console.log("Output", i, JSON.stringify(item));
if (item.type === "image_generation_call" && item.result) saveBlob(item.result, item.output_format || "bin", `output-${i}`);
}
for (const [ci, candidate] of (data.candidates || []).entries()) {
for (const [pi, part] of (candidate.content?.parts || []).entries()) {
console.log("Candidate/part", ci, pi, JSON.stringify(part));
const blob = part.inlineData || part.inline_data;
if (blob?.data) {
const mime = blob.mimeType || blob.mime_type;
const suffix = ({"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"})[mime] || "bin";
saveBlob(blob.data, suffix, `candidate-${ci}-part-${pi}`);
}
}
}
}
saveResult(resp);
from openai import OpenAI
import os
from pathlib import Path
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
with client.chat.completions.stream(model='grok-build-latest',messages=[{"role":"user","content":"Explain observations and hypotheses in three sentences."}]) as stream:
with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
for event in stream:
payload=event.to_dict(mode="json")
log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
print(json.dumps(payload,ensure_ascii=False))
final=stream.get_final_completion()
save_result(final.to_dict(mode="json"),"stream-result")
Ergebnisse abrufen und speichern
Ailoot · OpenAI Chat
json oder SSE
Alle fertiggestellten Ergebnisse aufbewahren
Bewahren Sie jede vollständig zurückgegebene Antwort, Datei und jeden Inhaltsteil auf.
Alle Antwortvarianten mit ihren Inhalten, Werkzeugaufrufen und Reasoning-Daten beibehalten. In SSE die Deltas nach Varianten- und Werkzeugindex zusammensetzen; endgültigen Beendigungsgrund und Verbrauchsdaten beibehalten.
Wenn die ursprüngliche Antwort geprüft werden muss
Anfrage- und Antwort-IDs sowie Header beibehalten. Eine allgemeine URL zum Abrufen von Textaufträgen wird nicht angegeben.
Antwortfelder
| Feld | Typ |
|---|---|
Feldchoices[].index | Typinteger |
Feldchoices[].message.content | Typstring|null |
Feldchoices[].message.tool_calls | Typtool_call[] |
Feldchoices[].message.reasoning_content | Typstring |
Feldchoices[].message.reasoning_details | Typobject|array |
Feldchoices[].finish_reason | Typstring|null |
Feldusage | Typobject |
Fehler und nächste Schritte
| Antwort | Bedingung | Nächster Schritt |
|---|---|---|
Antwort400 · invalid_request_error | BedingungPflichtfelder, Darstellung des Eingabematerials oder Parameterwert ungültig | Nächster SchrittDie angegebenen Felder vor einer neuen Erstellungsanfrage korrigieren. |
Aliasnamen
Modellaliasnamen
Ailoot grok-4.5, grok-4.5-latest, grok-build-latest
Ailoot Ultra grok-4.5, x-ai/grok-4.5
Aliasnamen für Methodenpfade
/chat/completions
Zugehörige Aufrufer-IDs
x-ai/grok-4.5, grok-4.5-latest, grok-build-latest, grok-4.5, grok-4.5
Ailoot Ultra · OpenAI Chat POST /v1/chat/completions x-ai/grok-4.5
x-ai/grok-4.5grok-4.5x-ai/grok-4.5
Start
Grok 4.5 ist das Modell von SpaceXAI für Programmierung, Wissensarbeit und MINT-Aufgaben. Es nimmt Text, Bilder und Dateien entgegen und liefert Textantworten. Das veröffentlichte Profil umfasst Steuerelemente für Reasoning, Werkzeuge und strukturierte Ausgaben sowie ein Kontextfenster von 500.000 Token.
- Zulässige Eingaben
- Text
- Ergebnisse
- Text
In Ailoot verfügbar · Eingaben und Methoden
Ailoot Ultra · OpenAI Chat POST /v1/chat/completions
- Eingabetypen
text- Ausgabetypen
text- Ausgabeformat
- json oder SSE
| Feld | Typ | Anforderung | Werte und Limits | Standard |
|---|---|---|---|---|
Feldmodel | Typstring | AnforderungErforderlich | Werte und Limits x-ai/grok-4.5 | Standard— |
Feldmessages | Typmessage[] | AnforderungErforderlich | Werte und Limits Mindestanzahl Elemente: 1 | Standard— |
Feldmessages[].role | Typstring | AnforderungErforderlich | Werte und Limits Beispiele: system, user, assistant, tool, function Bedingungen: Diese Rollen sind in den Kompatibilitätstypen des Quellcodes ausdrücklich dargestellt; der genaue Rollenumfang bleibt modellspezifisch. Modellabhängig | Standard— |
Feldmessages[].content | Typstring|content_part[]|null | AnforderungOptional | Werte und Limits | Standard— |
Feldmessages[].tool_calls | Typtool_call[] | AnforderungOptional | Werte und Limits | Standard— |
Feldmessages[].tool_call_id | Typstring | AnforderungOptional | Werte und Limits Gilt, wenn: role=tool; die tatsächlich zurückgegebene ID verwenden | Standard— |
Feldmessages[].name | Typstring | AnforderungOptional | Werte und Limits | Standard— |
Feldmessages[].reasoning_content | Typstring | AnforderungOptional | Werte und Limits Gilt, wenn: Tatsächlich zurückgegebene Reasoning-Daten erneut übermitteln, sofern dieses Modell sie verwendet | Standard— |
Feldmessages[].reasoning_details | Typobject|array | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldmax_tokens | Typinteger | AnforderungOptional | Werte und Limits Minimum: 1 Modellabhängig | Standard— |
Feldmax_completion_tokens | Typinteger | AnforderungOptional | Werte und Limits Minimum: 1 Modellabhängig | Standard— |
Feldstream | Typboolean | AnforderungOptional | Werte und Limits | Standardfalse |
Feldstream_options.include_usage | Typboolean | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtemperature | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtop_p | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldstop | Typstring|string[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtools | Typfunction_tool[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtools[].type | Typstring | AnforderungOptional | Werte und Limits function Modellabhängig | Standard— |
Feldtools[].function.name | Typstring | AnforderungErforderlich | Werte und Limits Gilt, wenn: Funktionswerkzeug bereitgestellt | Standard— |
Feldtools[].function.description | Typstring | AnforderungOptional | Werte und Limits | Standard— |
Feldtools[].function.parameters | TypJSON_schema | AnforderungOptional | Werte und Limits | Standard— |
Feldtool_choice | Typstring|object | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldparallel_tool_calls | Typboolean | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldresponse_format | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldreasoning_effort | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldreasoning | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldservice_tier | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldinstructions | Typstring | AnforderungOptional | Werte und Limits Kompatibilitätsfeld | Standard— |
Feldfunctions | Typfunction[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldfunction_call | Typstring|object | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldprompt_cache_options | Typobject | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldmodalities | Typstring[] | AnforderungOptional | Werte und Limits text | Standard— |
Feldprovider | Typobject | AnforderungOptional | Werte und Limits Bedingungen: provider.options wird auf dieser Ultra-Textroute abgelehnt | Standard— |
Feldcache_control.ttl | Typstring | AnforderungOptional | Werte und Limits Bedingungen: 1h wird in den tatsächlichen Prompt-Cache-Feldern abgelehnt | Standard— |
Kombinationen von Eingabematerialien
Text · UTF8-Text
messages[].content
Methodenparameter und Lebenszyklus
| Parameter | Vertrag |
|---|---|
Parametercontent_type | Vertragapplication/json |
Parameterrequired | Vertragmodel, messages |
Parametermaterial_types | Vertragtext |
Parametermessages | VertragNachrichtenarray mit role/content-Struktur |
Parameterfile_material | VertragTatsächliches UTF-8-Dokument als wörtlicher Text eingefügt; keine Datei-ID abgeleitet |
Parameteroptional_controls | Vertragstream, temperature, top_p, stop, max_tokens, max_completion_tokens, reasoning, response_format, tools, tool_choice |
Parametercontrol_scope | VertragModellspezifisch; benutzerseitige Funktionswerkzeuge unterscheiden sich von gehosteten Werkzeugen |
Parameteroutput_modalities | Vertragtext |
Parameterhosted_operations | Vertragfalse |
Parametermultimodal_input_binding | Vertragnull |
Lebenszyklus: synchronous_or_streamed
Die genaue Modell-ID zusammen mit messages senden.
Die Kontextlänge ist keine Ausgabeobergrenze.
Eine Textdatei kann wörtlichen Text liefern; Bild-, Audio- und Dateiobjekteingaben benötigen eine exakte Zuordnung.
Tarife
Tarifangaben erweitern die Anfrageoptionen nicht. Unterstützte Parameter stehen bei der ausgewählten Methode.
- Schnellmodus
- Standardtarif Wenn der Schnellmodus ausgewählt ist
- Flex-Modus
- Standardtarif Wenn der Modus flex ausgewählt ist
- Maximaler Denkaufwand
- Standardtarif Wenn beim maximalen Denkaufwand die Standardanpassung (default) verwendet wird
- Denkaufwand · hoch
- Standardtarif Wenn der Denkaufwand hoch ist
- Denkaufwand · niedrig
- Standardtarif Wenn der Denkaufwand niedrig ist
- Denkaufwand · mittel
- Standardtarif Wenn der Denkaufwand mittel ist
Ailoot-Tarife
Preise nach Konfiguration
Ordnen Sie jede Gebühr den angezeigten Bedingungen zu. Verwenden Sie für jede Gruppe alternativer Konfigurationen einen Tarif.
| Konfiguration | Tarifstaffel | Kontexttoken, mehr als | Kontexttoken, bis einschließlich | Gebühr |
|---|---|---|---|---|
| KonfigurationBasistarife für Token | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnfragelängenstufe 1 | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnfragelängenstufe 2 | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
Ailoot reserviert vor einer Anfrage einen geschätzten Betrag. Nach dem Ergebnis rechnet Ailoot die endgültige Gebühr anhand des gemessenen Verbrauchs ab. Bei Streaming erfolgt die Abrechnung anhand des abschließenden Verbrauchsdatensatzes. So funktionieren Reservierung und Abrechnung →
Beispielanfragen
Ailoot Ultra · OpenAI Chat
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "x-ai/grok-4.5", "messages": [{"role": "user", "content": "Explain the difference between an observation and a hypothesis in three sentences."}]}')
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/chat/completions \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
r=json.loads(Path("result.json").read_text())
for x in r.get("choices",[]):
if x.get("message",{}).get("content"): print(x["message"]["content"])
PY_RESULT
from openai import OpenAI
import os
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
result=client.chat.completions.create(model='x-ai/grok-4.5',messages=[{"role":"user","content":"Explain observations and hypotheses in three sentences."}])
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
save_result(result.to_dict(mode="json"))
from openai import OpenAI
import os
from pathlib import Path
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
import base64, json
from pathlib import Path
def save_result(data, stem="result"):
# Keep every field, including usage, IDs, reasoning and tool requests.
Path(stem + ".json").write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
print(json.dumps(data, ensure_ascii=False, indent=2))
def save_blob(encoded, suffix, label):
raw = base64.b64decode(encoded, altchars=b"-_", validate=True)
ext = "png" if raw.startswith(b"\x89PNG\r\n\x1a\n") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4] == b"RIFF" and raw[8:12] == b"WEBP" else suffix
file = Path(stem + "-" + label + "." + ext)
file.write_bytes(raw)
print("Saved", file)
for index, block in enumerate(data.get("content") or []):
print("Content", index, json.dumps(block, ensure_ascii=False))
for choice in data.get("choices") or []:
print("Choice", choice.get("index"), json.dumps(choice.get("message", choice.get("delta", {})), ensure_ascii=False))
for index, item in enumerate(data.get("output") or []):
print("Output", index, json.dumps(item, ensure_ascii=False))
if item.get("type") == "image_generation_call" and item.get("result"):
save_blob(item["result"], item.get("output_format") or "bin", "output-" + str(index))
for ci, candidate in enumerate(data.get("candidates") or []):
for pi, part in enumerate((candidate.get("content") or {}).get("parts") or []):
print("Candidate/part", ci, pi, json.dumps(part, ensure_ascii=False))
blob = part.get("inlineData") or part.get("inline_data")
if blob and blob.get("data"):
mime = blob.get("mimeType") or blob.get("mime_type")
suffix = {"image/png":"png", "image/jpeg":"jpg", "image/webp":"webp", "audio/wav":"wav", "audio/mpeg":"mp3", "video/mp4":"mp4"}.get(mime, "bin")
save_blob(blob["data"], suffix, "candidate-" + str(ci) + "-part-" + str(pi))
with client.chat.completions.stream(model='x-ai/grok-4.5',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")
Ergebnisse abrufen und speichern
Ailoot Ultra · OpenAI Chat
json oder SSE
Alle fertiggestellten Ergebnisse aufbewahren
Bewahren Sie jede vollständig zurückgegebene Antwort, Datei und jeden Inhaltsteil auf.
Alle Antwortvarianten mit ihren Inhalten, Werkzeugaufrufen und Reasoning-Daten beibehalten. In SSE die Deltas nach Varianten- und Werkzeugindex zusammensetzen; endgültigen Beendigungsgrund und Verbrauchsdaten beibehalten.
Wenn die ursprüngliche Antwort geprüft werden muss
Anfrage- und Antwort-IDs sowie Header beibehalten. Eine allgemeine URL zum Abrufen von Textaufträgen wird nicht angegeben.
Antwortfelder
| Feld | Typ |
|---|---|
Feldchoices[].index | Typinteger |
Feldchoices[].message.content | Typstring|null |
Feldchoices[].message.tool_calls | Typtool_call[] |
Feldchoices[].message.reasoning_content | Typstring |
Feldchoices[].message.reasoning_details | Typobject|array |
Feldchoices[].finish_reason | Typstring|null |
Feldusage | Typobject |
Fehler und nächste Schritte
| Antwort | Bedingung | Nächster Schritt |
|---|---|---|
Antwort400 · invalid_request_error | BedingungPflichtfelder, Darstellung des Eingabematerials oder Parameterwert ungültig | Nächster SchrittDie angegebenen Felder vor einer neuen Erstellungsanfrage korrigieren. |
Aliasnamen
Modellaliasnamen
Ailoot grok-4.5, grok-4.5-latest, grok-build-latest
Ailoot Ultra grok-4.5, x-ai/grok-4.5
Aliasnamen für Methodenpfade
/chat/completions
Zugehörige Aufrufer-IDs
x-ai/grok-4.5, grok-4.5-latest, grok-build-latest, grok-4.5, grok-4.5
Ailoot Ultra · Anthropic Messages POST /v1/messages x-ai/grok-4.5
x-ai/grok-4.5grok-4.5x-ai/grok-4.5
Start
Grok 4.5 ist das Modell von SpaceXAI für Programmierung, Wissensarbeit und MINT-Aufgaben. Es nimmt Text, Bilder und Dateien entgegen und liefert Textantworten. Das veröffentlichte Profil umfasst Steuerelemente für Reasoning, Werkzeuge und strukturierte Ausgaben sowie ein Kontextfenster von 500.000 Token.
- Zulässige Eingaben
- Text
- Ergebnisse
- json · sse
In Ailoot verfügbar · Eingaben und Methoden
Ailoot Ultra · Anthropic Messages POST /v1/messages
- Eingabetypen
text- Ausgabetypen
json,sse- Ausgabeformat
- JSON oder SSE
| Feld | Typ | Anforderung | Werte und Limits | Standard |
|---|---|---|---|---|
Feldmodel | Typstring | AnforderungErforderlich | Werte und Limits x-ai/grok-4.5 | Standard— |
Feldmessages | Typmessage[] | AnforderungErforderlich | Werte und Limits | Standard— |
Feldmessages[].role | Typstring | AnforderungErforderlich | Werte und Limits user, assistant | Standard— |
Feldmessages[].content | Typstring | AnforderungErforderlich | Werte und Limits | Standard— |
Feldmax_tokens | Typinteger | AnforderungErforderlich | Werte und Limits | Standard— |
Feldstream | Typboolean | AnforderungOptional | Werte und Limits | Standardfalse |
Kombinationen von Eingabematerialien
Text · UTF-8-Text
Zeichenfolge messages[].content
Methodenparameter und Lebenszyklus
| Parameter | Vertrag |
|---|---|
Parametercontent_type | Vertragapplication/json |
Parameterrequired | Vertragmodel, messages, max_tokens |
Parameteroptional_controls | Vertragstream |
Parametermaterial_types | Vertragtext |
Parametertext_file_material | VertragDas tatsächliche UTF-8-Dokument lesen und seinen Text in die angegebene Zeichenfolge für Eingabe oder Nachrichteninhalt einfügen. |
Lebenszyklus: synchronous_or_streamed
Tarife
Tarifangaben erweitern die Anfrageoptionen nicht. Unterstützte Parameter stehen bei der ausgewählten Methode.
- Schnellmodus
- Standardtarif Wenn der Schnellmodus ausgewählt ist
- Flex-Modus
- Standardtarif Wenn der Modus flex ausgewählt ist
- Maximaler Denkaufwand
- Standardtarif Wenn beim maximalen Denkaufwand die Standardanpassung (default) verwendet wird
- Denkaufwand · hoch
- Standardtarif Wenn der Denkaufwand hoch ist
- Denkaufwand · niedrig
- Standardtarif Wenn der Denkaufwand niedrig ist
- Denkaufwand · mittel
- Standardtarif Wenn der Denkaufwand mittel ist
Ailoot-Tarife
Preise nach Konfiguration
Ordnen Sie jede Gebühr den angezeigten Bedingungen zu. Verwenden Sie für jede Gruppe alternativer Konfigurationen einen Tarif.
| Konfiguration | Tarifstaffel | Kontexttoken, mehr als | Kontexttoken, bis einschließlich | Gebühr |
|---|---|---|---|---|
| KonfigurationBasistarife für Token | TarifstaffelGrundtarif | Kontexttoken, mehr als— | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnfragelängenstufe 1 | Tarifstaffel— | Kontexttoken, mehr als0 | Kontexttoken, bis einschließlich200.000 | Gebühr Eingabe · Eingabetoken $0.004 / 1K Token Ausgabe · Ausgabetoken $0.012 / 1K Token Eingabe · Cache-Lesen $0.0006 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
| KonfigurationAnfragelängenstufe 2 | Tarifstaffel— | Kontexttoken, mehr als200.000 | Kontexttoken, bis einschließlichKeine Obergrenze | Gebühr Eingabe · Eingabetoken $0.008 / 1K Token Ausgabe · Ausgabetoken $0.024 / 1K Token Eingabe · Cache-Lesen $0.0012 / 1K Token Eingabe · Cache-Schreiben — / 1K Token Eingabe · Cache-Schreiben, 1 Stunde — / 1K Token |
Ailoot reserviert vor einer Anfrage einen geschätzten Betrag. Nach dem Ergebnis rechnet Ailoot die endgültige Gebühr anhand des gemessenen Verbrauchs ab. Bei Streaming erfolgt die Abrechnung anhand des abschließenden Verbrauchsdatensatzes. So funktionieren Reservierung und Abrechnung →
Beispielanfragen
Ailoot Ultra · Anthropic Messages
{
"model": "x-ai/grok-4.5",
"max_tokens": 128,
"messages": [
{
"role": "user",
"content": "Summarize the incident report."
}
],
"stream": false
}set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
: "${AILOOT_TEXT_FILE:?Set your actual UTF-8 document}"
export AILOOT_TEXT_FILE
python3 - <<'PY_REQUEST'
import json, os
from pathlib import Path
source_file = Path(os.environ['AILOOT_TEXT_FILE'])
if not source_file.is_file():
raise SystemExit('Set AILOOT_TEXT_FILE to your actual UTF-8 document')
text = source_file.read_text(encoding='utf-8')
if not text.strip():
raise SystemExit('Choose a document containing text')
payload = {'model': 'x-ai/grok-4.5', 'max_tokens': 128, 'messages': [{'role': 'user', 'content': 'Summarize the incident report.'}]}
payload['messages'][0]['content'] = 'Summarize this material and quote supporting source passages.\n\n' + text
Path('request.json').write_text(json.dumps(payload, ensure_ascii=False), encoding='utf-8')
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/messages \
-H "x-api-key: $AILOOT_API_KEY" -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import json
from pathlib import Path
result = json.loads(Path('result.json').read_text(encoding='utf-8'))
print(json.dumps(result, ensure_ascii=False, indent=2))
PY_RESULT
import json, os
from pathlib import Path
source_file = Path(os.environ['AILOOT_TEXT_FILE'])
if not source_file.is_file():
raise SystemExit('Set AILOOT_TEXT_FILE to your actual UTF-8 document')
text = source_file.read_text(encoding='utf-8')
if not text.strip():
raise SystemExit('Choose a document containing text')
payload = {'model': 'x-ai/grok-4.5', '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))
Ergebnisse abrufen und speichern
Ailoot Ultra · Anthropic Messages
JSON oder SSE
Alle fertiggestellten Ergebnisse aufbewahren
Bewahren Sie jede vollständig zurückgegebene Antwort, Datei und jeden Inhaltsteil auf.
Alle Inhaltsblöcke, Thinking-Signaturen und tatsächlichen Werkzeugaufruf-IDs beibehalten. Alle SSE-Blockdeltas zusammensetzen; der erste Textblock ist nicht die vollständige Ausgabe.
Wenn die ursprüngliche Antwort geprüft werden muss
Anfrage- und Antwort-IDs sowie Header beibehalten. Eine allgemeine URL zum Abrufen von Textaufträgen wird nicht angegeben.
Antwortfelder
| Feld | Typ |
|---|---|
Feldid | Typstring |
Feldmodel | Typstring |
Feldcontent[] | Typtext|thinking|tool_use|other content block |
Feldstop_reason | Typstring|null |
Feldusage | Typobject |
Fehler und nächste Schritte
| Antwort | Bedingung | Nächster Schritt |
|---|---|---|
Antwort400 · invalid_request_error | BedingungPflichtfelder, Darstellung des Eingabematerials oder Parameterwert ungültig | Nächster SchrittDie angegebenen Felder vor einer neuen Erstellungsanfrage korrigieren. |
Aliasnamen
Modellaliasnamen
Ailoot grok-4.5, grok-4.5-latest, grok-build-latest
Ailoot Ultra grok-4.5, x-ai/grok-4.5
Aliasnamen für Methodenpfade
/chat/completions
Zugehörige Aufrufer-IDs
x-ai/grok-4.5, grok-4.5-latest, grok-build-latest, grok-4.5, grok-4.5
FAQ · SpaceXAI: Grok 4.5
- Welche Eingaben und Ergebnisse sind verfügbar?
POST /v1/messages·grok-4.5:text,image→textPOST /v1/responses·grok-4.5:text,image→textPOST /v1/chat/completions·grok-4.5:text,image→textPOST /v1/chat/completions·grok-4.5:text→textPOST /v1/messages·grok-4.5:text→json,ssePOST /v1/messages·grok-4.5-latest:text,image→textPOST /v1/responses·grok-4.5-latest:text,image→textPOST /v1/chat/completions·grok-4.5-latest:text,image→textPOST /v1/messages·grok-build-latest:text,image→textPOST /v1/responses·grok-build-latest:text,image→textPOST /v1/chat/completions·grok-build-latest:text,image→textPOST /v1/chat/completions·x-ai/grok-4.5:text→textPOST /v1/messages·x-ai/grok-4.5:text→json,sse- Welche Felder verwendet die Anfrage?
POST /v1/messages·grok-4.5:model,messages,system,max_tokens,stream,metadataPOST /v1/responses·grok-4.5:model,input,instructions,streamPOST /v1/chat/completions·grok-4.5:model,messages,streamPOST /v1/chat/completions·grok-4.5:model,messages,streamPOST /v1/messages·grok-4.5:model,messages,max_tokens,streamPOST /v1/messages·grok-4.5-latest:model,messages,system,max_tokens,stream,metadataPOST /v1/responses·grok-4.5-latest:model,input,instructions,streamPOST /v1/chat/completions·grok-4.5-latest:model,messages,streamPOST /v1/messages·grok-build-latest:model,messages,system,max_tokens,stream,metadataPOST /v1/responses·grok-build-latest:model,input,instructions,streamPOST /v1/chat/completions·grok-build-latest:model,messages,streamPOST /v1/chat/completions·x-ai/grok-4.5:model,messages,stream,modalities,providerPOST /v1/messages·x-ai/grok-4.5:model,messages,max_tokens,stream- Welche Grenzen gelten?
POST /v1/messages·grok-4.5:ctx:500000;max_out:500000;messages.min_items:1;max_tokens.minimum:1POST /v1/responses·grok-4.5:ctx:500000;max_out:500000POST /v1/chat/completions·grok-4.5:ctx:500000;max_out:500000;messages.min_items:1POST /v1/chat/completions·grok-4.5:messages.min_items:1POST /v1/messages·grok-4.5-latest:ctx:500000;max_out:500000;messages.min_items:1;max_tokens.minimum:1POST /v1/responses·grok-4.5-latest:ctx:500000;max_out:500000POST /v1/chat/completions·grok-4.5-latest:ctx:500000;max_out:500000;messages.min_items:1POST /v1/messages·grok-build-latest:ctx:500000;max_out:500000;messages.min_items:1;max_tokens.minimum:1POST /v1/responses·grok-build-latest:ctx:500000;max_out:500000POST /v1/chat/completions·grok-build-latest:ctx:500000;max_out:500000;messages.min_items:1POST /v1/chat/completions·x-ai/grok-4.5:messages.min_items:1