Gemini 3.1 Pro High
Multimodales Google-Modell für komplexe Programmieraufgaben, die Analyse umfangreicher Materialien und präzise mehrstufige Arbeit mit Werkzeugen.
- Ailoot · Anthropic Messages
POST /v1/messagesgemini-3.1-pro-high - Ailoot · Gemini generateContent
POST /v1beta/models/{model}:generateContentgemini-3.1-pro-high
Ü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.
Gemini 3.1 Pro Preview ist für die Arbeit mit komplexem Material und Aufgaben ausgelegt, die mehrere aufeinanderfolgende Entscheidungen benötigen. Google hebt Softwareentwicklung, den Werkzeugeinsatz und die Konsistenz faktischer Antworten hervor. Das Modell hilft bei der Auswertung grosser Datensätze, ganzer Software-Repositories und Aufgaben, die Text mit visuellen oder akustischen Materialien verbinden.
Welche Materialien das Modell versteht
Die Eigenschaften von Google nennen Text, Bilder, Video, Audio und PDF. Im aktuellen Ailoot-API-Katalog sind für Textmethoden Text und Bilder als Eingabe und Text als Ausgabe angegeben. Video, Audio und PDF gehören nicht zu diesen Eingabearten. Der lange Kontext bietet Platz für bis zu 1 048 576 Eingabetokens, die Textantwort für bis zu 65 536 Ausgabetokens. Das Verständnis von Bildern und Audio bedeutet nicht deren Generierung: Die Ausgabe dieser Version bleibt textuell.
Denken und schrittweise Arbeit
Thinking ermöglicht zusätzlichen Aufwand für internes Denken. Im von Google beschriebenen Modus des Basismodells ist die Standardstufe high; verfügbar sind low, medium, high. Diese Werte beschreiben das Google-Basismodell; Modus und Verfügbarkeit der Steuerung über die Ailoot API hängen von der gewählten Methode und Modellvariante ab. Zu den wichtigsten Einsatzgebieten gehören komplexe Programmierung, Algorithmusentwicklung, strategische Planung und die schrittweise Verbesserung einer Lösung. Das ist besonders nützlich, wenn mehrere zusammenhängende Anforderungen berücksichtigt und Zwischenergebnisse erneut aufgegriffen werden müssen.
Zu den Modellfähigkeiten gehören Funktionsaufrufe, Codeausführung und strukturierte Antworten. Unterstützt werden Kontext-Caching, Fundierung durch Suchergebnisse, Google Maps und die Nutzung von Inhalten von Webadressen; Stapelverarbeitung ist vorgesehen. Dieser Funktionsumfang erlaubt einen Prozess, in dem das Modell Daten analysiert, das nächste Werkzeug wählt und das Ergebnis formuliert. Die tatsächliche Verfügbarkeit jedes Werkzeugs hängt von der Methode der Modellnutzung ab.
Version und Besonderheiten
Die Karte betrifft die Vorabversion gemini-3.1-pro-preview. Ihre Grundlage ist Gemini 3 Pro. Der Hersteller nennt separat die Variante gemini-3.1-pro-preview-customtools, die auf Abläufe mit einer Kommandozeilenumgebung und benutzerdefinierten Werkzeugen ausgerichtet ist. Ihre Prioritäten bei der Werkzeugauswahl und ihr besonderes Verhalten sind keine Eigenschaften der gewöhnlichen Preview-Version.
Für das Modell gelten die allgemeinen Einschränkungen der Basislinie: Antworten können erfundene Informationen enthalten, und einzelne Anfragen können langsam ausgeführt werden oder durch Zeitüberschreitung enden. Mehrstufiges Denken, umfangreicher Kontext und Datenzugriff helfen bei komplexen Aufgaben, machen aber nicht jede generierte Schlussfolgerung zu einer überprüften Tatsache.
Praktische Aufgabe
Praktische Aufgabe
Technisches Beispiel auf Englisch
Plan a dependency-constrained move
A lab move has these constraints: archive samples before unplugging the freezer; test the backup freezer before moving samples; restore temperature monitoring before accepting new samples. Staff propose unplugging first to save time. Produce an ordered checklist, flag the unsafe proposed step and specify evidence needed before accepting new samples. Use only the supplied constraints.Erwartetes Ergebnis
An ordered checklist, one identified conflict and an acceptance-evidence item.Ergebnis prüfen
The checklist must place backup testing and sample protection before unplugging and monitoring before intake.Ailoot · Anthropic Messages POST /v1/messages gemini-3.1-pro-high
gemini-3.1-pro-highEinstieg
Multimodales Google-Modell für komplexe Programmieraufgaben, die Analyse umfangreicher Materialien und präzise mehrstufige Arbeit mit Werkzeugen.
- Zulässige Eingaben
- Text · Bilder
- Ergebnisse
- Text
In Ailoot verfügbar · Eingaben und Methoden
Ailoot · Anthropic Messages POST /v1/messages
- Eingabe
text,image- Ausgabe
text- Kontext
- 1'048'576 tokens
- Maximale Ausgabe
- 65'536 tokens
- Ausgabeformat
- json oder SSE
| Feld | Typ | Anforderung | Werte und Limits | Standard |
|---|---|---|---|---|
Feldmodel | Typstring | AnforderungErforderlich | Werte und Limits gemini-3.1-pro-high | 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.012 / 1K
- Cache lesen
- $ 0.0002 / 1K
Preise nach Anfragelänge · Anthropic Messages
| Anfrageumfang in Tokens | Eingabe | Ausgabe | Cache lesen | Cache schreiben | Cache 5 Min. | Cache 1 Stunde |
|---|---|---|---|---|---|---|
| Anfrageumfang in Tokens(0; 200'000] | Eingabe$ 0.002 | Ausgabe$ 0.012 | Cache lesen$ 0.0002 | Cache schreibenBasispreis: — | Cache 5 Min.Basispreis: — | Cache 1 StundeBasispreis: — |
| Anfrageumfang in Tokens(200'000; ∞) | Eingabe$ 0.004 | Ausgabe$ 0.018 | Cache lesen$ 0.0004 | Cache schreibenBasispreis: — | Cache 5 Min.Basispreis: — | Cache 1 StundeBasispreis: — |
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 abschliessenden Verbrauchsdatensatzes. So funktionieren Reservierung und Abrechnung →
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": "gemini-3.1-pro-high", "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": "gemini-3.1-pro-high", "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="gemini-3.1-pro-high",
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: "gemini-3.1-pro-high",
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='gemini-3.1-pro-high',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 gemini-3.1-pro-high
Aliasnamen für Methodenpfade
Verwenden Sie die oben angezeigten Methodenpfade.
Zugehörige Aufrufer-IDs
Ailoot · Gemini generateContent POST /v1beta/models/{model}:generateContent gemini-3.1-pro-high
gemini-3.1-pro-highEinstieg
Multimodales Google-Modell für komplexe Programmieraufgaben, die Analyse umfangreicher Materialien und präzise mehrstufige Arbeit mit Werkzeugen.
- Zulässige Eingaben
- Text · Bilder
- Ergebnisse
- Text
In Ailoot verfügbar · Eingaben und Methoden
Ailoot · Gemini generateContent POST /v1beta/models/{model}:generateContent
- Eingabe
text,image- Ausgabe
text- Kontext
- 1'048'576 tokens
- Maximale Ausgabe
- 65'536 tokens
- Ausgabeformat
- json oder unterstütztes Streaming
| Feld | Typ | Anforderung | Werte und Limits | Standard |
|---|---|---|---|---|
Feldpath.model | Typstring | AnforderungErforderlich | Werte und Limits gemini-3.1-pro-high | Standard— |
Feldcontents | Typcontent[] | AnforderungErforderlich | Werte und Limits Mindestanzahl Elemente: 1 | Standard— |
Feldcontents[].role | Typstring | AnforderungOptional | Werte und Limits user, model | Standard— |
Feldcontents[].parts | Typpart[] | AnforderungErforderlich | Werte und Limits | Standard— |
FeldsystemInstruction | Typcontent | AnforderungOptional | Werte und Limits | Standard— |
FeldgenerationConfig.maxOutputTokens | Typinteger | AnforderungOptional | Werte und Limits Minimum: 1 Modellabhängig | Standard— |
FeldgenerationConfig.temperature | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
FeldgenerationConfig.topP | Typnumber | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
FeldgenerationConfig.topK | Typinteger | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
FeldgenerationConfig.stopSequences | Typstring[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
FeldgenerationConfig.thinkingConfig.includeThoughts | Typboolean | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
FeldgenerationConfig.thinkingConfig.thinkingBudget | Typinteger | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldtools[].functionDeclarations | Typfunction_declaration[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
FeldtoolConfig.functionCallingConfig.mode | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
FeldsafetySettings | Typobject[] | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
FeldsessionId | Typstring | AnforderungOptional | Werte und Limits | Standard— |
Kombinationen von Eingabematerialien
Text · UTF8-Text
contents[].parts[].text
Text + Bild
parts[].inlineData={mimeType,data}
Methodenparameter und Lebenszyklus
| Parameter | Vertrag |
|---|---|
Parametermaterial_types | Vertragtext, image |
Parameterrequired | Vertragcontents |
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 /v1beta/models/{model}:generateContent- Eingabe
- $ 0.002 / 1K
- Ausgabe
- $ 0.012 / 1K
- Cache lesen
- $ 0.0002 / 1K
Preise nach Anfragelänge · Gemini generateContent
| Anfrageumfang in Tokens | Eingabe | Ausgabe | Cache lesen | Cache schreiben | Cache 5 Min. | Cache 1 Stunde |
|---|---|---|---|---|---|---|
| Anfrageumfang in Tokens(0; 200'000] | Eingabe$ 0.002 | Ausgabe$ 0.012 | Cache lesen$ 0.0002 | Cache schreibenBasispreis: — | Cache 5 Min.Basispreis: — | Cache 1 StundeBasispreis: — |
| Anfrageumfang in Tokens(200'000; ∞) | Eingabe$ 0.004 | Ausgabe$ 0.018 | Cache lesen$ 0.0004 | Cache schreibenBasispreis: — | Cache 5 Min.Basispreis: — | Cache 1 StundeBasispreis: — |
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 abschliessenden Verbrauchsdatensatzes. So funktionieren Reservierung und Abrechnung →
Beispielanfragen
Ailoot · Gemini generateContent
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('{"contents": []}')
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["contents"]=[{"role":"user","parts":[{"text":"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/v1beta/models/gemini-3.1-pro-high:generateContent \
-H "x-goog-api-key: $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('{"contents": [{"role": "user", "parts": [{"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["contents"][0]["parts"].append({"inlineData":{"mimeType":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/v1beta/models/gemini-3.1-pro-high:generateContent \
-H "x-goog-api-key: $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 google import genai
from google.genai import types
import os
if not os.environ.get("AILOOT_API_KEY", "").strip(): raise SystemExit("Set AILOOT_API_KEY before making a request")
client = genai.Client(
api_key=os.environ["AILOOT_API_KEY"],
http_options=types.HttpOptions(base_url="https://api.ailoot.ai"),
)
resp = client.models.generate_content(model="gemini-3.1-pro-high", contents="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_json_dict())
import { GoogleGenAI } from "@google/genai";
if (!process.env.AILOOT_API_KEY?.trim()) throw new Error("Set AILOOT_API_KEY before making a request");
const ai = new GoogleGenAI({ apiKey: process.env.AILOOT_API_KEY, httpOptions: { baseUrl: "https://api.ailoot.ai" } });
const resp = await ai.models.generateContent({ model: "gemini-3.1-pro-high", contents: "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 google import genai
from google.genai import types
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=genai.Client(api_key=os.environ["AILOOT_API_KEY"],http_options=types.HttpOptions(base_url="https://api.ailoot.ai"))
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))
count=0
with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
for chunk in client.models.generate_content_stream(model='gemini-3.1-pro-high',contents="Explain observations and hypotheses in three sentences."):
payload=chunk.to_json_dict()
log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
save_result(payload,"stream-chunk-"+str(count))
count+=1
Ergebnisse abrufen und speichern
Ailoot · Gemini generateContent
json oder unterstütztes Streaming
Alle fertiggestellten Ergebnisse aufbewahren
Bewahren Sie jede vollständig zurückgegebene Antwort, Datei und jeden Inhaltsteil auf.
Alle Kandidaten und Teile einschliesslich Funktionsaufrufen, Gedankensignaturen und Verbrauchsdaten beibehalten; Streaming-Abschnitte in der richtigen Reihenfolge zusammensetzen.
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 |
|---|---|
FeldresponseId | Typstring |
FeldmodelVersion | Typstring |
Feldcandidates[].content.parts[] | Typtext|inlineData|functionCall|other part |
Feldcandidates[].finishReason | Typstring |
FeldusageMetadata | 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 gemini-3.1-pro-high
Aliasnamen für Methodenpfade
Verwenden Sie die oben angezeigten Methodenpfade.
Zugehörige Aufrufer-IDs
FAQ · Gemini 3.1 Pro High
- Welche Eingaben und Ergebnisse sind verfügbar?
POST /v1/messages·gemini-3.1-pro-high:text,image→textPOST /v1beta/models/{model}:generateContent·gemini-3.1-pro-high:text,image→text- Welche Felder verwendet die Anfrage?
POST /v1/messages·gemini-3.1-pro-high:model,messages,system,max_tokens,stream,metadataPOST /v1beta/models/{model}:generateContent·gemini-3.1-pro-high:contents,systemInstruction,sessionId- Welche Grenzen gelten?
POST /v1/messages·gemini-3.1-pro-high:ctx:1048576;max_out:65536;messages.min_items:1;max_tokens.minimum:1POST /v1beta/models/{model}:generateContent·gemini-3.1-pro-high:ctx:1048576;max_out:65536;contents.min_items:1