SpaceXAI: Grok 4.7
Grok 4.7 je model spoločnosti xAI na vývoj programov a odbornú prácu so znalosťami. Podporuje text, obrázky, kontext 500 000 tokenov, volania funkcií a štruktúrované odpovede.
- Ailoot · Anthropic Messages
POST /v1/messagesgrok-4.7 - Ailoot · OpenAI Responses
POST /v1/responsesgrok-4.7 - Ailoot · OpenAI Chat
POST /v1/chat/completionsgrok-4.7 - Ailoot Ultra · OpenAI Chat
POST /v1/chat/completionsgrok-4.7 - Ailoot Ultra · Anthropic Messages
POST /v1/messagesgrok-4.7 - Ailoot · Anthropic Messages
POST /v1/messagesgrok - Ailoot · OpenAI Responses
POST /v1/responsesgrok - Ailoot · OpenAI Chat
POST /v1/chat/completionsgrok - Ailoot · Anthropic Messages
POST /v1/messagesgrok-4.7-latest - Ailoot · OpenAI Responses
POST /v1/responsesgrok-4.7-latest - Ailoot · OpenAI Chat
POST /v1/chat/completionsgrok-4.7-latest - Ailoot · Anthropic Messages
POST /v1/messagesgrok-latest - Ailoot · OpenAI Responses
POST /v1/responsesgrok-latest - Ailoot · OpenAI Chat
POST /v1/chat/completionsgrok-latest - Ailoot Ultra · OpenAI Chat
POST /v1/chat/completionsx-ai/grok-4.7 - Ailoot Ultra · Anthropic Messages
POST /v1/messagesx-ai/grok-4.7 - Ailoot Ultra · OpenAI Chat
POST /v1/chat/completions~x-ai/grok-latest - Ailoot Ultra · Anthropic Messages
POST /v1/messages~x-ai/grok-latest
O modeli
Tento opis pokrýva možnosti modelu. Dostupné vstupy, výstupy a voľby v Ailoot sú uvedené nižšie pre vybranú metódu.
Vývoj a práca so znalosťami
Grok 4.7 je určený na programovanie, agentné úlohy a odbornú prácu s informáciami. xAI kladie dôraz na zložité úlohy, ktoré vyžadujú dlhodobé postupné vykonávanie, overovanie vlastnej práce a riadenie dlhého kontextu.
Pri trénovaní sa používal väčší základný model a dlhá etapa učenia posilňovaním na náročných zadaniach. Praktické oblasti zahŕňajú vývoj programov, vytváranie dokumentov a prezentácií aj konverzačné úlohy a prácu so znalosťami. Vykonávanie príkazov a vytváranie súborov prebiehajú prostredníctvom nástrojov prostredia, samotný model však vracia text.
Základné charakteristiky
- Vstup: text a obrázky.
- Výstup: text vrátane programového kódu a údajov v štruktúrovanom formáte.
- Kontext: 500 000 tokenov.
- Hranica zabudovaných znalostí: máj 2026.
- Uvažovanie:
low,medium,highaleboxhigh; predvolenehigh.
Tieto charakteristiky sa vzťahujú na Grok 4.7. Dodatočné údaje a výsledky krokov získava model z odovzdaného kontextu a pripojených funkcií.
Podľa charakteristík xAI nemá Grok 4.7 samostatný limit dĺžky textového výstupu. Táto vlastnosť modelu nie je prísľubom neobmedzenej odpovede prostredníctvom Ailoot API.
Uvažovanie pri viackrokovej práci
low zachováva premýšľanie a je vhodné na jednoduché kroky; medium je určené na analýzu údajov a prácu s dlhými podkladmi. high venuje viac úsilia zložitej matematike a logike a xhigh najnáročnejším úlohám. Podľa xAI sa zvyšovanie hĺbky spája s väčším oneskorením. Uvažovanie nemožno vypnúť.
Vo formáte Responses vracia Grok 4.7 zašifrovaný stav uvažovania. Tieto prvky možno bez zmien odovzdať do ďalšieho ťahu spolu s históriou, aby sa zachoval stav viackrokovej práce. Neodhaľujú skryté uvažovanie v čitateľnej podobe. Chat Completions nemá pole s takýmto zašifrovaným obsahom.
Model osobitne podporuje stručné vyjadrenie uvažovania, ktoré sa môže odovzdávať v priebehu odpovede. Líši sa od zašifrovaných prvkov: zhrnutie je určené na čítanie, zašifrovaný stav na pokračovanie procesu.
Nástroje a formát výsledku
Vlastné funkcie umožňujú prepojiť model s údajmi a krokmi aplikácie. Model vytvára volanie s argumentmi, program vykonáva funkciu a vracia výsledok. Podporované sú automatický výber, povinné volanie, zákaz nástrojov aj výber konkrétnej funkcie; v jednej odpovedi sa môže objaviť viacero volaní.
Pre výsledky spracúvané kódom sú k dispozícii JSON a JSON podľa zadanej schémy. Schéma určuje typy polí, vnorenú štruktúru a povolené možnosti. Tento režim sa používa na získavanie údajov, rozbor dokumentov a tvorbu správ; možno ho kombinovať s volaniami vlastných funkcií.
V režime opísanom xAI sú k dispozícii webové vyhľadávanie, vyhľadávanie v príspevkoch X a vykonávanie kódu; možno ich kombinovať s vlastnými funkciami. Dostupnosť vstavaných nástrojov prostredníctvom Ailoot API určuje podpora zvolenej metódy.
Obmedzenia riadenia
S týmto modelom sa nepoužívajú presencePenalty, frequencyPenalty a stop. Podpora JSON Schema má hranice: časť podmienených konštrukcií a zložitých obmedzení zostáva na úrovni správania modelu, preto ich overuje program. Veľký kontext pomáha pracovať s rozsiahlymi podkladmi, nenahrádza však nástroj, ktorý získava čerstvé fakty alebo vykonáva úkon.
Praktická úloha
Praktická úloha
Technický príklad v angličtine
Build a decision memo from supplied evidence
Prepare a procurement memo from these records: vendor A delivers in 5 days, costs 900 credits and offers a 12-month warranty; vendor B delivers in 9 days, costs 750 and offers 24 months. The team needs delivery within 7 days and budget below 1,000. Recommend an option, explain trade-offs and list missing evidence.Očakávaný výsledok
A concise decision memo with requirements, recommendation, trade-offs and unanswered questions tied to the records.Overenie výsledku
The recommendation applies both the delivery deadline and budget, while warranty length remains a separate trade-off.Ailoot · Anthropic Messages POST /v1/messages grok-4.7
grok-4.7grok-4.7grokgrok-4.7-latestgrok-latest
Úvod
Grok 4.7 je model spoločnosti xAI na vývoj programov a odbornú prácu so znalosťami. Podporuje text, obrázky, kontext 500 000 tokenov, volania funkcií a štruktúrované odpovede.
- Povolené vstupy
- Text · Obrázky
- Výsledky
- Text
Dostupné v Ailoot · vstupy a metódy
Ailoot · Anthropic Messages POST /v1/messages
- Vstup
text,image- Výstup
text- Kontext
- 500 000 tokens
- Maximálny výstup
- 500 000 tokens
- Výstupný formát
- json alebo SSE
| Pole | Typ | Požiadavka | Hodnoty a limity | Predvolené |
|---|---|---|---|---|
Polemodel | Typstring | PožiadavkaPovinné | Hodnoty a limity grok-4.7 | Predvolené— |
Polemessages | Typmessage[] | PožiadavkaPovinné | Hodnoty a limity Minimálny počet položiek: 1 | Predvolené— |
Polemessages[].role | Typstring | PožiadavkaPovinné | Hodnoty a limity user, assistant | Predvolené— |
Polemessages[].content | Typstring|content_block[] | PožiadavkaPovinné | Hodnoty a limity | Predvolené— |
Polesystem | Typstring|content_block[] | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemax_tokens | Typinteger | PožiadavkaPovinné | Hodnoty a limity Minimum: 1 Limit sa vzťahuje na: presná horná hranica zvoleného modelu/karty | Predvolené— |
Polestream | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity | Predvolenéfalse |
Poletemperature | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletop_p | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polestop_sequences | Typstring[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools | Typtool[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools[].name | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: poskytnutý nástroj | Predvolené— |
Poletools[].description | Typstring | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poletools[].input_schema | TypJSON_schema | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poletool_choice | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polethinking.type | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polethinking.budget_tokens | Typinteger | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleoutput_config.effort | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polemetadata | Typobject | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polecache_control | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Kombinácie vstupných podkladov
Text · Text UTF8
messages[].content alebo blok type=text
Text + obrázok
{type:image,source:{type:base64,media_type,data}} alebo zdroj s type=url
Parametre a životný cyklus metódy
| Parameter | Špecifikácia |
|---|---|
Parametermaterial_types | Špecifikáciatext, image |
Parameterrequired | Špecifikáciamodel, messages, max_tokens |
Parameteroptional_controls | Špecifikácianull |
Parametercontent_type | Špecifikáciaapplication/json |
Parametertext_file_material | Špecifikáciaskutočný obsah UTF-8 vložený ako text; ID súborov a URLs potrebujú samostatnú presne určenú podporu |
Životný cyklus: exact retained published method
Štruktúry metód a ID sú presné; možnosti dodávateľa sa posudzujú oddelene od prijatia požiadavky.
Cenník
Sadzby metód Ailoot
POST /v1/messages- Vstup
- 0,002 USD / 1K
- Výstup
- 0,006 USD / 1K
- Čítanie cache
- 0,0005 USD / 1K
- Zápis do cache
- 0,00 USD / 1K
- Zápis do cache, 5 min
- 0,00 USD / 1K tokens
- Zápis do cache, 1 hod
- 0,00 USD / 1K tokens
Ceny podľa dĺžky požiadavky · Anthropic Messages
| Veľkosť požiadavky v tokenoch | Vstup | Výstup | Čítanie cache | Zápis do cache | Cache 5 min | Cache 1 hod |
|---|---|---|---|---|---|---|
| Veľkosť požiadavky v tokenoch(0; 200 000] | Vstup0,002 USD | Výstup0,006 USD | Čítanie cache0,0005 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
| Veľkosť požiadavky v tokenoch(200 000; ∞) | Vstup0,004 USD | Výstup0,012 USD | Čítanie cache0,001 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
Sadzby v USD za 1K tokenov. Ak sadzba nie je nastavená, preberá sa základná sadzba tejto metódy; «—» znamená, že základná sadzba nie je nastavená.
Ailoot pred požiadavkou rezervuje odhadovanú sumu. Po získaní výsledku vyúčtuje konečný poplatok podľa nameraného využitia. Pri streamovaní sa vyúčtovanie riadi konečným záznamom využitia. Ako funguje rezervácia a vyúčtovanie →
Podrobnosti referenčnej tarify
Referenčné sadzobníky modelu nemenia výber metódy, cenové odhady ani poplatky. Aktívne poplatky používajú sadzby vybranej metódy Ailoot.
Referenčné sadzobníky modelu
Ceny podľa konfigurácie
Každý poplatok priraďte k zobrazeným podmienkam. Pre každú skupinu alternatívnych konfigurácií použite jednu sadzbu.
| Konfigurácia | Sadzobník | Počet tokenov kontextu väčší než | Tokeny kontextu, najviac (vrátane hranice) | Poplatok |
|---|---|---|---|---|
| KonfiguráciaOpenAI Chat · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
Príklady požiadaviek
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.7", "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.7", "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.7",
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.7",
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.7',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")
Prijať a uložiť výsledky
Ailoot · Anthropic Messages
json alebo SSE
Uchovať všetky dokončené výsledky
Uložte každú úplnú vrátenú odpoveď, súbor a časť obsahu.
Zachovajte všetky bloky obsahu, podpisy uvažovania a skutočné ID volaní nástrojov. Zostavte všetky čiastkové zmeny blokov SSE; prvý textový blok nie je celý výstup.
Ak treba overiť pôvodnú odpoveď
Zachovajte ID požiadaviek/odpovedí aj hlavičky. Všeobecná URL na načítanie textovej úlohy nie je poskytnutá.
Polia odpovede
| Pole | Typ |
|---|---|
Poleid | Typstring |
Polemodel | Typstring |
Polecontent[] | Typtext|thinking|tool_use|other content block |
Polestop_reason | Typstring|null |
Poleusage | Typobject |
Chyby a ďalšie kroky
| Odpoveď | Podmienka | Ďalší krok |
|---|---|---|
Odpoveď400 · invalid_request_error | PodmienkaNeplatné povinné polia, reprezentácia materiálu alebo hodnota parametra | Ďalší krokPred novou požiadavkou na vytvorenie opravte uvedené polia. |
Aliasy
Aliasy modelov
Ailoot grok-4.7, grok, grok-4.7-latest, grok-latest
Ailoot Ultra grok-4.7, x-ai/grok-4.7, ~x-ai/grok-latest
Aliasy ciest metód
/chat/completions
Súvisiace ID na volanie
x-ai/grok-4.7, grok, grok-4.7-latest, grok-latest, ~x-ai/grok-latest, grok-4.7, grok-4.7
Ailoot · OpenAI Responses POST /v1/responses grok-4.7
grok-4.7grok-4.7grokgrok-4.7-latestgrok-latest
Úvod
Grok 4.7 je model spoločnosti xAI na vývoj programov a odbornú prácu so znalosťami. Podporuje text, obrázky, kontext 500 000 tokenov, volania funkcií a štruktúrované odpovede.
- Povolené vstupy
- Text · Obrázky
- Výsledky
- Text
Dostupné v Ailoot · vstupy a metódy
Ailoot · OpenAI Responses POST /v1/responses
- Vstup
text,image- Výstup
text- Kontext
- 500 000 tokens
- Maximálny výstup
- 500 000 tokens
- Výstupný formát
- json alebo SSE
| Pole | Typ | Požiadavka | Hodnoty a limity | Predvolené |
|---|---|---|---|---|
Polemodel | Typstring | PožiadavkaPovinné | Hodnoty a limity grok-4.7 | Predvolené— |
Poleinput | Typstring|input_item[] | PožiadavkaPovinné | Hodnoty a limity | Predvolené— |
Poleinstructions | Typstring | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poleinput[].type | Typstring | PožiadavkaVoliteľné | Hodnoty a limity message, reasoning, function_call, function_call_output | Predvolené— |
Poleinput[].content | Typstring|content_part[] | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poleinput[].call_id | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: function_call_output; zachovajte skutočne vrátený call_id | Predvolené— |
Poleinput[].output | Typstring|content_part[] | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: function_call_output | Predvolené— |
Polemax_output_tokens | Typinteger | PožiadavkaVoliteľné | Hodnoty a limity Minimum: 1 Závisí od modelu | Predvolené— |
Polestream | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity | Predvolenéfalse |
Poletemperature | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletop_p | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools | Typtool[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletool_choice | Typstring|object | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleparallel_tool_calls | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polereasoning.effort | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polereasoning.summary | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletext.format | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletext.verbosity | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleinclude | Typstring[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polestore | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleprevious_response_id | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Požiadavka na ID: Len skutočné ID odpovede z podporovaného pokračovania Závisí od modelu | Predvolené— |
Poleservice_tier | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleprompt_cache_key | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleprompt_cache_options | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Kombinácie vstupných podkladov
Text · Text UTF8
vstupný text alebo časť input_text
Text + obrázok
{type:input_image,image_url}
Parametre a životný cyklus metódy
| Parameter | Špecifikácia |
|---|---|
Parametermaterial_types | Špecifikáciatext, image |
Parameterrequired | Špecifikáciamodel, input |
Parameteroptional_controls | Špecifikácianull |
Parametercontent_type | Špecifikáciaapplication/json |
Parametertext_file_material | Špecifikáciaskutočný obsah UTF-8 vložený ako text; ID súborov a URLs potrebujú samostatnú presne určenú podporu |
Životný cyklus: exact retained published method
Štruktúry metód a ID sú presné; možnosti dodávateľa sa posudzujú oddelene od prijatia požiadavky.
Cenník
Sadzby metód Ailoot
POST /v1/responses- Vstup
- 0,002 USD / 1K
- Výstup
- 0,006 USD / 1K
- Čítanie cache
- 0,0005 USD / 1K
- Zápis do cache
- 0,00 USD / 1K
- Zápis do cache, 5 min
- 0,00 USD / 1K tokens
- Zápis do cache, 1 hod
- 0,00 USD / 1K tokens
Ceny podľa dĺžky požiadavky · OpenAI Responses
| Veľkosť požiadavky v tokenoch | Vstup | Výstup | Čítanie cache | Zápis do cache | Cache 5 min | Cache 1 hod |
|---|---|---|---|---|---|---|
| Veľkosť požiadavky v tokenoch(0; 200 000] | Vstup0,002 USD | Výstup0,006 USD | Čítanie cache0,0005 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
| Veľkosť požiadavky v tokenoch(200 000; ∞) | Vstup0,004 USD | Výstup0,012 USD | Čítanie cache0,001 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
Sadzby v USD za 1K tokenov. Ak sadzba nie je nastavená, preberá sa základná sadzba tejto metódy; «—» znamená, že základná sadzba nie je nastavená.
Ailoot pred požiadavkou rezervuje odhadovanú sumu. Po získaní výsledku vyúčtuje konečný poplatok podľa nameraného využitia. Pri streamovaní sa vyúčtovanie riadi konečným záznamom využitia. Ako funguje rezervácia a vyúčtovanie →
Podrobnosti referenčnej tarify
Referenčné sadzobníky modelu nemenia výber metódy, cenové odhady ani poplatky. Aktívne poplatky používajú sadzby vybranej metódy Ailoot.
Referenčné sadzobníky modelu
Ceny podľa konfigurácie
Každý poplatok priraďte k zobrazeným podmienkam. Pre každú skupinu alternatívnych konfigurácií použite jednu sadzbu.
| Konfigurácia | Sadzobník | Počet tokenov kontextu väčší než | Tokeny kontextu, najviac (vrátane hranice) | Poplatok |
|---|---|---|---|---|
| KonfiguráciaOpenAI Chat · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
Príklady požiadaviek
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.7", "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.7", "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.7", 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.7", 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.7", 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")
Prijať a uložiť výsledky
Ailoot · OpenAI Responses
json alebo SSE
Uchovať všetky dokončené výsledky
Uložte každú úplnú vrátenú odpoveď, súbor a časť obsahu.
Zachovajte každú výstupnú položku a časť obsahu, skutočný call_id funkcie, šifrované uvažovanie a údaje o spotrebe. Pri streamovaní zachovajte úplné identifikačné údaje udalostí a položiek.
Ak treba overiť pôvodnú odpoveď
Zachovajte ID požiadaviek/odpovedí aj hlavičky. Všeobecná URL na načítanie textovej úlohy nie je poskytnutá.
Polia odpovede
| Pole | Typ |
|---|---|
Poleid | Typstring |
Polestatus | Typstring |
Poleoutput[] | Typmessage|reasoning|function_call|other item |
Poleoutput[].content[] | Typcontent part |
Poleusage | Typobject |
Chyby a ďalšie kroky
| Odpoveď | Podmienka | Ďalší krok |
|---|---|---|
Odpoveď400 · invalid_request_error | PodmienkaNeplatné povinné polia, reprezentácia materiálu alebo hodnota parametra | Ďalší krokPred novou požiadavkou na vytvorenie opravte uvedené polia. |
Aliasy
Aliasy modelov
Ailoot grok-4.7, grok, grok-4.7-latest, grok-latest
Ailoot Ultra grok-4.7, x-ai/grok-4.7, ~x-ai/grok-latest
Aliasy ciest metód
/chat/completions
Súvisiace ID na volanie
x-ai/grok-4.7, grok, grok-4.7-latest, grok-latest, ~x-ai/grok-latest, grok-4.7, grok-4.7
Ailoot · OpenAI Chat POST /v1/chat/completions grok-4.7
grok-4.7grok-4.7grokgrok-4.7-latestgrok-latest
Úvod
Grok 4.7 je model spoločnosti xAI na vývoj programov a odbornú prácu so znalosťami. Podporuje text, obrázky, kontext 500 000 tokenov, volania funkcií a štruktúrované odpovede.
- Povolené vstupy
- Text · Obrázky
- Výsledky
- Text
Dostupné v Ailoot · vstupy a metódy
Ailoot · OpenAI Chat POST /v1/chat/completions
- Vstup
text,image- Výstup
text- Kontext
- 500 000 tokens
- Maximálny výstup
- 500 000 tokens
- Výstupný formát
- json alebo SSE
| Pole | Typ | Požiadavka | Hodnoty a limity | Predvolené |
|---|---|---|---|---|
Polemodel | Typstring | PožiadavkaPovinné | Hodnoty a limity grok-4.7 | Predvolené— |
Polemessages | Typmessage[] | PožiadavkaPovinné | Hodnoty a limity Minimálny počet položiek: 1 | Predvolené— |
Polemessages[].role | Typstring | PožiadavkaPovinné | Hodnoty a limity Príklady: system, user, assistant, tool, function Podmienky: Tieto roly sú výslovne zastúpené typmi kompatibility v zdrojovom kóde; presný súbor rolí zostáva závislý od modelu. Závisí od modelu | Predvolené— |
Polemessages[].content | Typstring|content_part[]|null | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemessages[].tool_calls | Typtool_call[] | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemessages[].tool_call_id | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: role=tool; použite skutočne vrátené ID | Predvolené— |
Polemessages[].name | Typstring | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemessages[].reasoning_content | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: Posielajte späť skutočne vrátené uvažovanie, ak ho tento model používa | Predvolené— |
Polemessages[].reasoning_details | Typobject|array | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polemax_tokens | Typinteger | PožiadavkaVoliteľné | Hodnoty a limity Minimum: 1 Závisí od modelu | Predvolené— |
Polemax_completion_tokens | Typinteger | PožiadavkaVoliteľné | Hodnoty a limity Minimum: 1 Závisí od modelu | Predvolené— |
Polestream | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity | Predvolenéfalse |
Polestream_options.include_usage | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletemperature | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletop_p | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polestop | Typstring|string[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools | Typfunction_tool[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools[].type | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools[].function.name | Typstring | PožiadavkaPovinné | Hodnoty a limity Platí, keď: poskytnutý nástroj typu funkcia | Predvolené— |
Poletools[].function.description | Typstring | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poletools[].function.parameters | TypJSON_schema | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poletool_choice | Typstring|object | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleparallel_tool_calls | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleresponse_format | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polereasoning_effort | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polereasoning | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleservice_tier | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleinstructions | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Pole kompatibility | Predvolené— |
Polefunctions | Typfunction[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polefunction_call | Typstring|object | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleprompt_cache_options | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Kombinácie vstupných podkladov
Text · Text UTF8
messages[].content
Text + obrázok
{type:image_url,image_url:{url,detail}}
Parametre a životný cyklus metódy
| Parameter | Špecifikácia |
|---|---|
Parametermaterial_types | Špecifikáciatext, image |
Parameterrequired | Špecifikáciamodel, messages |
Parameteroptional_controls | Špecifikácianull |
Parametercontent_type | Špecifikáciaapplication/json |
Parametertext_file_material | Špecifikáciaskutočný obsah UTF-8 vložený ako text; ID súborov a URLs potrebujú samostatnú presne určenú podporu |
Životný cyklus: exact retained published method
Štruktúry metód a ID sú presné; možnosti dodávateľa sa posudzujú oddelene od prijatia požiadavky.
Cenník
Sadzby metód Ailoot
POST /v1/chat/completions- Vstup
- 0,002 USD / 1K
- Výstup
- 0,006 USD / 1K
- Čítanie cache
- 0,0005 USD / 1K
- Zápis do cache
- 0,00 USD / 1K
- Zápis do cache, 5 min
- 0,00 USD / 1K tokens
- Zápis do cache, 1 hod
- 0,00 USD / 1K tokens
Ceny podľa dĺžky požiadavky · OpenAI Chat
| Veľkosť požiadavky v tokenoch | Vstup | Výstup | Čítanie cache | Zápis do cache | Cache 5 min | Cache 1 hod |
|---|---|---|---|---|---|---|
| Veľkosť požiadavky v tokenoch(0; 200 000] | Vstup0,002 USD | Výstup0,006 USD | Čítanie cache0,0005 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
| Veľkosť požiadavky v tokenoch(200 000; ∞) | Vstup0,004 USD | Výstup0,012 USD | Čítanie cache0,001 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
Sadzby v USD za 1K tokenov. Ak sadzba nie je nastavená, preberá sa základná sadzba tejto metódy; «—» znamená, že základná sadzba nie je nastavená.
Ailoot pred požiadavkou rezervuje odhadovanú sumu. Po získaní výsledku vyúčtuje konečný poplatok podľa nameraného využitia. Pri streamovaní sa vyúčtovanie riadi konečným záznamom využitia. Ako funguje rezervácia a vyúčtovanie →
Podrobnosti referenčnej tarify
Referenčné sadzobníky modelu nemenia výber metódy, cenové odhady ani poplatky. Aktívne poplatky používajú sadzby vybranej metódy Ailoot.
Referenčné sadzobníky modelu
Ceny podľa konfigurácie
Každý poplatok priraďte k zobrazeným podmienkam. Pre každú skupinu alternatívnych konfigurácií použite jednu sadzbu.
| Konfigurácia | Sadzobník | Počet tokenov kontextu väčší než | Tokeny kontextu, najviac (vrátane hranice) | Poplatok |
|---|---|---|---|---|
| KonfiguráciaOpenAI Chat · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
Príklady požiadaviek
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.7", "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.7", "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.7",
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.7",
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.7',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")
Prijať a uložiť výsledky
Ailoot · OpenAI Chat
json alebo SSE
Uchovať všetky dokončené výsledky
Uložte každú úplnú vrátenú odpoveď, súbor a časť obsahu.
Zachovajte každý variant odpovede a jeho obsah, volania nástrojov a uvažovanie. V SSE zostavujte čiastkové zmeny podľa indexu variantu/nástroja a zachovajte konečný dôvod ukončenia aj údaje o spotrebe.
Ak treba overiť pôvodnú odpoveď
Zachovajte ID požiadaviek/odpovedí aj hlavičky. Všeobecná URL na načítanie textovej úlohy nie je poskytnutá.
Polia odpovede
| Pole | Typ |
|---|---|
Polechoices[].index | Typinteger |
Polechoices[].message.content | Typstring|null |
Polechoices[].message.tool_calls | Typtool_call[] |
Polechoices[].message.reasoning_content | Typstring |
Polechoices[].message.reasoning_details | Typobject|array |
Polechoices[].finish_reason | Typstring|null |
Poleusage | Typobject |
Chyby a ďalšie kroky
| Odpoveď | Podmienka | Ďalší krok |
|---|---|---|
Odpoveď400 · invalid_request_error | PodmienkaNeplatné povinné polia, reprezentácia materiálu alebo hodnota parametra | Ďalší krokPred novou požiadavkou na vytvorenie opravte uvedené polia. |
Aliasy
Aliasy modelov
Ailoot grok-4.7, grok, grok-4.7-latest, grok-latest
Ailoot Ultra grok-4.7, x-ai/grok-4.7, ~x-ai/grok-latest
Aliasy ciest metód
/chat/completions
Súvisiace ID na volanie
x-ai/grok-4.7, grok, grok-4.7-latest, grok-latest, ~x-ai/grok-latest, grok-4.7, grok-4.7
Ailoot Ultra · OpenAI Chat POST /v1/chat/completions grok-4.7
grok-4.7grok-4.7x-ai/grok-4.7~x-ai/grok-latest
Úvod
Grok 4.7 je model spoločnosti xAI na vývoj programov a odbornú prácu so znalosťami. Podporuje text, obrázky, kontext 500 000 tokenov, volania funkcií a štruktúrované odpovede.
- Povolené vstupy
- Text
- Výsledky
- Text
Dostupné v Ailoot · vstupy a metódy
Ailoot Ultra · OpenAI Chat POST /v1/chat/completions
- Vstup
text- Výstup
text- Výstupný formát
- json alebo SSE
| Pole | Typ | Požiadavka | Hodnoty a limity | Predvolené |
|---|---|---|---|---|
Polemodel | Typstring | PožiadavkaPovinné | Hodnoty a limity grok-4.7 | Predvolené— |
Polemessages | Typmessage[] | PožiadavkaPovinné | Hodnoty a limity Minimálny počet položiek: 1 | Predvolené— |
Polemessages[].role | Typstring | PožiadavkaPovinné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polemessages[].content | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: Textová konverzácia | Predvolené— |
Polestream | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity | Predvolenéfalse |
Kombinácie vstupných podkladov
Text · Text UTF8
messages[].content
Parametre a životný cyklus metódy
| Parameter | Špecifikácia |
|---|---|
Parametercontent_type | Špecifikáciaapplication/json |
Parameterrequired | Špecifikáciamodel, messages |
Parametermaterial_types | Špecifikáciatext |
Parametermessages | Špecifikáciapole správ so štruktúrou role/content |
Parameterfile_material | Špecifikáciaskutočný dokument UTF-8 vložený ako doslovný text; ID súboru sa neodvodzuje |
Parameteroptional_controls | Špecifikáciastream |
Parametercontrol_scope | ŠpecifikáciaTextová konverzácia; stream je logická hodnota a predvolene má hodnotu false. |
Parameteroutput_modalities | Špecifikáciatext |
Parameterhosted_operations | Špecifikáciafalse |
Parametermultimodal_input_binding | Špecifikácianull |
Aliasy metódy: /chat/completions
Životný cyklus: synchronous_or_streamed
Pošlite presné ID modelu spolu s messages.
Dĺžka kontextu nie je horná hranica výstupu.
Textový súbor môže poskytnúť doslovný text; obrazové a zvukové vstupy a vstupy so súborovými objektmi potrebujú presné naviazanie.
Cenník
Tarifné údaje nepridávajú možnosti požiadavky. Podporované parametre sú uvedené pri vybranej metóde.
- Rýchly režim
- Štandardná sadzba Keď je zvolený rýchly režim
- Režim Flex
- Štandardná sadzba Keď je zvolený režim flex
- Maximálna úroveň uvažovania
- Štandardná sadzba Keď sa pri maximálnej úrovni uvažovania používa predvolená úprava (default)
- Úroveň uvažovania · vysoká
- Štandardná sadzba Keď je úroveň uvažovania vysoká
- Úroveň uvažovania · nízka
- Štandardná sadzba Keď je úroveň uvažovania nízka
- Úroveň uvažovania · stredná
- Štandardná sadzba Keď je úroveň uvažovania stredná
- Úroveň uvažovania · xhigh
- Štandardná sadzba Keď je úroveň uvažovania xhigh
Sadzby Ailoot
Ceny podľa konfigurácie
Každý poplatok priraďte k zobrazeným podmienkam. Pre každú skupinu alternatívnych konfigurácií použite jednu sadzbu.
| Konfigurácia | Sadzobník | Počet tokenov kontextu väčší než | Tokeny kontextu, najviac (vrátane hranice) | Poplatok |
|---|---|---|---|---|
| KonfiguráciaZákladné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaPásmo dĺžky požiadavky 1 | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaPásmo dĺžky požiadavky 2 | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
Ailoot pred požiadavkou rezervuje odhadovanú sumu. Po získaní výsledku vyúčtuje konečný poplatok podľa nameraného využitia. Pri streamovaní sa vyúčtovanie riadi konečným záznamom využitia. Ako funguje rezervácia a vyúčtovanie →
Príklady požiadaviek
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.7","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.7", 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"))
Prijať a uložiť výsledky
Ailoot Ultra · OpenAI Chat
json alebo SSE
Uchovať všetky dokončené výsledky
Uložte každú úplnú vrátenú odpoveď, súbor a časť obsahu.
Zachovajte každý variant odpovede a jeho obsah, volania nástrojov a uvažovanie. V SSE zostavujte čiastkové zmeny podľa indexu variantu/nástroja a zachovajte konečný dôvod ukončenia aj údaje o spotrebe.
Ak treba overiť pôvodnú odpoveď
Zachovajte ID požiadaviek/odpovedí aj hlavičky. Všeobecná URL na načítanie textovej úlohy nie je poskytnutá.
Polia odpovede
| Pole | Typ |
|---|---|
Polechoices[].index | Typinteger |
Polechoices[].message.content | Typstring|null |
Polechoices[].message.tool_calls | Typtool_call[] |
Polechoices[].message.reasoning_content | Typstring |
Polechoices[].message.reasoning_details | Typobject|array |
Polechoices[].finish_reason | Typstring|null |
Poleusage | Typobject |
Chyby a ďalšie kroky
| Odpoveď | Podmienka | Ďalší krok |
|---|---|---|
Odpoveď400 · invalid_request_error | PodmienkaNeplatné povinné polia, reprezentácia materiálu alebo hodnota parametra | Ďalší krokPred novou požiadavkou na vytvorenie opravte uvedené polia. |
Aliasy
Aliasy modelov
Ailoot grok-4.7, grok, grok-4.7-latest, grok-latest
Ailoot Ultra grok-4.7, x-ai/grok-4.7, ~x-ai/grok-latest
Aliasy ciest metód
/chat/completions
Súvisiace ID na volanie
x-ai/grok-4.7, grok, grok-4.7-latest, grok-latest, ~x-ai/grok-latest, grok-4.7, grok-4.7
Ailoot Ultra · Anthropic Messages POST /v1/messages grok-4.7
grok-4.7grok-4.7x-ai/grok-4.7~x-ai/grok-latest
Úvod
Grok 4.7 je model spoločnosti xAI na vývoj programov a odbornú prácu so znalosťami. Podporuje text, obrázky, kontext 500 000 tokenov, volania funkcií a štruktúrované odpovede.
- Povolené vstupy
- Text
- Výsledky
- json · sse
Dostupné v Ailoot · vstupy a metódy
Ailoot Ultra · Anthropic Messages POST /v1/messages
- Vstup
text- Výstup
json,sse- Výstupný formát
- JSON alebo SSE
| Pole | Typ | Požiadavka | Hodnoty a limity | Predvolené |
|---|---|---|---|---|
Polemodel | Typstring | PožiadavkaPovinné | Hodnoty a limity grok-4.7 | Predvolené— |
Polemessages | Typmessage[] | PožiadavkaPovinné | Hodnoty a limity | Predvolené— |
Polemessages[].role | Typstring | PožiadavkaPovinné | Hodnoty a limity user, assistant | Predvolené— |
Polemessages[].content | Typstring | PožiadavkaPovinné | Hodnoty a limity | Predvolené— |
Polemax_tokens | Typinteger | PožiadavkaPovinné | Hodnoty a limity | Predvolené— |
Polestream | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity | Predvolenéfalse |
Kombinácie vstupných podkladov
Text · Text UTF-8
reťazec messages[].content
Parametre a životný cyklus metódy
| Parameter | Špecifikácia |
|---|---|
Parametercontent_type | Špecifikáciaapplication/json |
Parameterrequired | Špecifikáciamodel, messages, max_tokens |
Parameteroptional_controls | Špecifikáciastream |
Parametermaterial_types | Špecifikáciatext |
Parametertext_file_material | ŠpecifikáciaPrečítajte skutočný dokument UTF-8 a vložte jeho text do uvedeného vstupného reťazca alebo reťazca obsahu správy. |
Životný cyklus: synchronous_or_streamed
Cenník
Tarifné údaje nepridávajú možnosti požiadavky. Podporované parametre sú uvedené pri vybranej metóde.
- Rýchly režim
- Štandardná sadzba Keď je zvolený rýchly režim
- Režim Flex
- Štandardná sadzba Keď je zvolený režim flex
- Maximálna úroveň uvažovania
- Štandardná sadzba Keď sa pri maximálnej úrovni uvažovania používa predvolená úprava (default)
- Úroveň uvažovania · vysoká
- Štandardná sadzba Keď je úroveň uvažovania vysoká
- Úroveň uvažovania · nízka
- Štandardná sadzba Keď je úroveň uvažovania nízka
- Úroveň uvažovania · stredná
- Štandardná sadzba Keď je úroveň uvažovania stredná
- Úroveň uvažovania · xhigh
- Štandardná sadzba Keď je úroveň uvažovania xhigh
Sadzby Ailoot
Ceny podľa konfigurácie
Každý poplatok priraďte k zobrazeným podmienkam. Pre každú skupinu alternatívnych konfigurácií použite jednu sadzbu.
| Konfigurácia | Sadzobník | Počet tokenov kontextu väčší než | Tokeny kontextu, najviac (vrátane hranice) | Poplatok |
|---|---|---|---|---|
| KonfiguráciaZákladné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaPásmo dĺžky požiadavky 1 | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaPásmo dĺžky požiadavky 2 | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
Ailoot pred požiadavkou rezervuje odhadovanú sumu. Po získaní výsledku vyúčtuje konečný poplatok podľa nameraného využitia. Pri streamovaní sa vyúčtovanie riadi konečným záznamom využitia. Ako funguje rezervácia a vyúčtovanie →
Príklady požiadaviek
Ailoot Ultra · Anthropic Messages
{
"model": "grok-4.7",
"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.7', '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.7', '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))
Prijať a uložiť výsledky
Ailoot Ultra · Anthropic Messages
JSON alebo SSE
Uchovať všetky dokončené výsledky
Uložte každú úplnú vrátenú odpoveď, súbor a časť obsahu.
Zachovajte všetky bloky obsahu, podpisy uvažovania a skutočné ID volaní nástrojov. Zostavte všetky čiastkové zmeny blokov SSE; prvý textový blok nie je celý výstup.
Ak treba overiť pôvodnú odpoveď
Zachovajte ID požiadaviek/odpovedí aj hlavičky. Všeobecná URL na načítanie textovej úlohy nie je poskytnutá.
Polia odpovede
| Pole | Typ |
|---|---|
Poleid | Typstring |
Polemodel | Typstring |
Polecontent[] | Typtext|thinking|tool_use|other content block |
Polestop_reason | Typstring|null |
Poleusage | Typobject |
Chyby a ďalšie kroky
| Odpoveď | Podmienka | Ďalší krok |
|---|---|---|
Odpoveď400 · invalid_request_error | PodmienkaNeplatné povinné polia, reprezentácia materiálu alebo hodnota parametra | Ďalší krokPred novou požiadavkou na vytvorenie opravte uvedené polia. |
Aliasy
Aliasy modelov
Ailoot grok-4.7, grok, grok-4.7-latest, grok-latest
Ailoot Ultra grok-4.7, x-ai/grok-4.7, ~x-ai/grok-latest
Aliasy ciest metód
/chat/completions
Súvisiace ID na volanie
x-ai/grok-4.7, grok, grok-4.7-latest, grok-latest, ~x-ai/grok-latest, grok-4.7, grok-4.7
Ailoot · Anthropic Messages POST /v1/messages grok
grokgrok-4.7grokgrok-4.7-latestgrok-latest
Úvod
Grok 4.7 je model spoločnosti xAI na vývoj programov a odbornú prácu so znalosťami. Podporuje text, obrázky, kontext 500 000 tokenov, volania funkcií a štruktúrované odpovede.
- Povolené vstupy
- Text · Obrázky
- Výsledky
- Text
Dostupné v Ailoot · vstupy a metódy
Ailoot · Anthropic Messages POST /v1/messages
- Vstup
text,image- Výstup
text- Kontext
- 500 000 tokens
- Maximálny výstup
- 500 000 tokens
- Výstupný formát
- json alebo SSE
| Pole | Typ | Požiadavka | Hodnoty a limity | Predvolené |
|---|---|---|---|---|
Polemodel | Typstring | PožiadavkaPovinné | Hodnoty a limity grok | Predvolené— |
Polemessages | Typmessage[] | PožiadavkaPovinné | Hodnoty a limity Minimálny počet položiek: 1 | Predvolené— |
Polemessages[].role | Typstring | PožiadavkaPovinné | Hodnoty a limity user, assistant | Predvolené— |
Polemessages[].content | Typstring|content_block[] | PožiadavkaPovinné | Hodnoty a limity | Predvolené— |
Polesystem | Typstring|content_block[] | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemax_tokens | Typinteger | PožiadavkaPovinné | Hodnoty a limity Minimum: 1 Limit sa vzťahuje na: presná horná hranica zvoleného modelu/karty | Predvolené— |
Polestream | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity | Predvolenéfalse |
Poletemperature | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletop_p | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polestop_sequences | Typstring[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools | Typtool[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools[].name | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: poskytnutý nástroj | Predvolené— |
Poletools[].description | Typstring | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poletools[].input_schema | TypJSON_schema | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poletool_choice | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polethinking.type | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polethinking.budget_tokens | Typinteger | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleoutput_config.effort | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polemetadata | Typobject | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polecache_control | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Kombinácie vstupných podkladov
Text · Text UTF8
messages[].content alebo blok type=text
Text + obrázok
{type:image,source:{type:base64,media_type,data}} alebo zdroj s type=url
Parametre a životný cyklus metódy
| Parameter | Špecifikácia |
|---|---|
Parametermaterial_types | Špecifikáciatext, image |
Parameterrequired | Špecifikáciamodel, messages, max_tokens |
Parameteroptional_controls | Špecifikácianull |
Parametercontent_type | Špecifikáciaapplication/json |
Parametertext_file_material | Špecifikáciaskutočný obsah UTF-8 vložený ako text; ID súborov a URLs potrebujú samostatnú presne určenú podporu |
Životný cyklus: exact retained published method
Štruktúry metód a ID sú presné; možnosti dodávateľa sa posudzujú oddelene od prijatia požiadavky.
Cenník
Sadzby metód Ailoot
POST /v1/messages- Vstup
- 0,002 USD / 1K
- Výstup
- 0,006 USD / 1K
- Čítanie cache
- 0,0005 USD / 1K
- Zápis do cache
- 0,00 USD / 1K
- Zápis do cache, 5 min
- 0,00 USD / 1K tokens
- Zápis do cache, 1 hod
- 0,00 USD / 1K tokens
Ceny podľa dĺžky požiadavky · Anthropic Messages
| Veľkosť požiadavky v tokenoch | Vstup | Výstup | Čítanie cache | Zápis do cache | Cache 5 min | Cache 1 hod |
|---|---|---|---|---|---|---|
| Veľkosť požiadavky v tokenoch(0; 200 000] | Vstup0,002 USD | Výstup0,006 USD | Čítanie cache0,0005 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
| Veľkosť požiadavky v tokenoch(200 000; ∞) | Vstup0,004 USD | Výstup0,012 USD | Čítanie cache0,001 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
Sadzby v USD za 1K tokenov. Ak sadzba nie je nastavená, preberá sa základná sadzba tejto metódy; «—» znamená, že základná sadzba nie je nastavená.
Ailoot pred požiadavkou rezervuje odhadovanú sumu. Po získaní výsledku vyúčtuje konečný poplatok podľa nameraného využitia. Pri streamovaní sa vyúčtovanie riadi konečným záznamom využitia. Ako funguje rezervácia a vyúčtovanie →
Podrobnosti referenčnej tarify
Referenčné sadzobníky modelu nemenia výber metódy, cenové odhady ani poplatky. Aktívne poplatky používajú sadzby vybranej metódy Ailoot.
Referenčné sadzobníky modelu
Ceny podľa konfigurácie
Každý poplatok priraďte k zobrazeným podmienkam. Pre každú skupinu alternatívnych konfigurácií použite jednu sadzbu.
| Konfigurácia | Sadzobník | Počet tokenov kontextu väčší než | Tokeny kontextu, najviac (vrátane hranice) | Poplatok |
|---|---|---|---|---|
| KonfiguráciaOpenAI Chat · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
Príklady požiadaviek
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", "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", "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",
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",
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',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")
Prijať a uložiť výsledky
Ailoot · Anthropic Messages
json alebo SSE
Uchovať všetky dokončené výsledky
Uložte každú úplnú vrátenú odpoveď, súbor a časť obsahu.
Zachovajte všetky bloky obsahu, podpisy uvažovania a skutočné ID volaní nástrojov. Zostavte všetky čiastkové zmeny blokov SSE; prvý textový blok nie je celý výstup.
Ak treba overiť pôvodnú odpoveď
Zachovajte ID požiadaviek/odpovedí aj hlavičky. Všeobecná URL na načítanie textovej úlohy nie je poskytnutá.
Polia odpovede
| Pole | Typ |
|---|---|
Poleid | Typstring |
Polemodel | Typstring |
Polecontent[] | Typtext|thinking|tool_use|other content block |
Polestop_reason | Typstring|null |
Poleusage | Typobject |
Chyby a ďalšie kroky
| Odpoveď | Podmienka | Ďalší krok |
|---|---|---|
Odpoveď400 · invalid_request_error | PodmienkaNeplatné povinné polia, reprezentácia materiálu alebo hodnota parametra | Ďalší krokPred novou požiadavkou na vytvorenie opravte uvedené polia. |
Aliasy
Aliasy modelov
Ailoot grok-4.7, grok, grok-4.7-latest, grok-latest
Ailoot Ultra grok-4.7, x-ai/grok-4.7, ~x-ai/grok-latest
Aliasy ciest metód
/chat/completions
Súvisiace ID na volanie
x-ai/grok-4.7, grok, grok-4.7-latest, grok-latest, ~x-ai/grok-latest, grok-4.7, grok-4.7
Ailoot · OpenAI Responses POST /v1/responses grok
grokgrok-4.7grokgrok-4.7-latestgrok-latest
Úvod
Grok 4.7 je model spoločnosti xAI na vývoj programov a odbornú prácu so znalosťami. Podporuje text, obrázky, kontext 500 000 tokenov, volania funkcií a štruktúrované odpovede.
- Povolené vstupy
- Text · Obrázky
- Výsledky
- Text
Dostupné v Ailoot · vstupy a metódy
Ailoot · OpenAI Responses POST /v1/responses
- Vstup
text,image- Výstup
text- Kontext
- 500 000 tokens
- Maximálny výstup
- 500 000 tokens
- Výstupný formát
- json alebo SSE
| Pole | Typ | Požiadavka | Hodnoty a limity | Predvolené |
|---|---|---|---|---|
Polemodel | Typstring | PožiadavkaPovinné | Hodnoty a limity grok | Predvolené— |
Poleinput | Typstring|input_item[] | PožiadavkaPovinné | Hodnoty a limity | Predvolené— |
Poleinstructions | Typstring | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poleinput[].type | Typstring | PožiadavkaVoliteľné | Hodnoty a limity message, reasoning, function_call, function_call_output | Predvolené— |
Poleinput[].content | Typstring|content_part[] | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poleinput[].call_id | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: function_call_output; zachovajte skutočne vrátený call_id | Predvolené— |
Poleinput[].output | Typstring|content_part[] | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: function_call_output | Predvolené— |
Polemax_output_tokens | Typinteger | PožiadavkaVoliteľné | Hodnoty a limity Minimum: 1 Závisí od modelu | Predvolené— |
Polestream | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity | Predvolenéfalse |
Poletemperature | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletop_p | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools | Typtool[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletool_choice | Typstring|object | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleparallel_tool_calls | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polereasoning.effort | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polereasoning.summary | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletext.format | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletext.verbosity | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleinclude | Typstring[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polestore | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleprevious_response_id | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Požiadavka na ID: Len skutočné ID odpovede z podporovaného pokračovania Závisí od modelu | Predvolené— |
Poleservice_tier | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleprompt_cache_key | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleprompt_cache_options | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Kombinácie vstupných podkladov
Text · Text UTF8
vstupný text alebo časť input_text
Text + obrázok
{type:input_image,image_url}
Parametre a životný cyklus metódy
| Parameter | Špecifikácia |
|---|---|
Parametermaterial_types | Špecifikáciatext, image |
Parameterrequired | Špecifikáciamodel, input |
Parameteroptional_controls | Špecifikácianull |
Parametercontent_type | Špecifikáciaapplication/json |
Parametertext_file_material | Špecifikáciaskutočný obsah UTF-8 vložený ako text; ID súborov a URLs potrebujú samostatnú presne určenú podporu |
Životný cyklus: exact retained published method
Štruktúry metód a ID sú presné; možnosti dodávateľa sa posudzujú oddelene od prijatia požiadavky.
Cenník
Sadzby metód Ailoot
POST /v1/responses- Vstup
- 0,002 USD / 1K
- Výstup
- 0,006 USD / 1K
- Čítanie cache
- 0,0005 USD / 1K
- Zápis do cache
- 0,00 USD / 1K
- Zápis do cache, 5 min
- 0,00 USD / 1K tokens
- Zápis do cache, 1 hod
- 0,00 USD / 1K tokens
Ceny podľa dĺžky požiadavky · OpenAI Responses
| Veľkosť požiadavky v tokenoch | Vstup | Výstup | Čítanie cache | Zápis do cache | Cache 5 min | Cache 1 hod |
|---|---|---|---|---|---|---|
| Veľkosť požiadavky v tokenoch(0; 200 000] | Vstup0,002 USD | Výstup0,006 USD | Čítanie cache0,0005 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
| Veľkosť požiadavky v tokenoch(200 000; ∞) | Vstup0,004 USD | Výstup0,012 USD | Čítanie cache0,001 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
Sadzby v USD za 1K tokenov. Ak sadzba nie je nastavená, preberá sa základná sadzba tejto metódy; «—» znamená, že základná sadzba nie je nastavená.
Ailoot pred požiadavkou rezervuje odhadovanú sumu. Po získaní výsledku vyúčtuje konečný poplatok podľa nameraného využitia. Pri streamovaní sa vyúčtovanie riadi konečným záznamom využitia. Ako funguje rezervácia a vyúčtovanie →
Podrobnosti referenčnej tarify
Referenčné sadzobníky modelu nemenia výber metódy, cenové odhady ani poplatky. Aktívne poplatky používajú sadzby vybranej metódy Ailoot.
Referenčné sadzobníky modelu
Ceny podľa konfigurácie
Každý poplatok priraďte k zobrazeným podmienkam. Pre každú skupinu alternatívnych konfigurácií použite jednu sadzbu.
| Konfigurácia | Sadzobník | Počet tokenov kontextu väčší než | Tokeny kontextu, najviac (vrátane hranice) | Poplatok |
|---|---|---|---|---|
| KonfiguráciaOpenAI Chat · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
Príklady požiadaviek
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", "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", "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", 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", 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", 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")
Prijať a uložiť výsledky
Ailoot · OpenAI Responses
json alebo SSE
Uchovať všetky dokončené výsledky
Uložte každú úplnú vrátenú odpoveď, súbor a časť obsahu.
Zachovajte každú výstupnú položku a časť obsahu, skutočný call_id funkcie, šifrované uvažovanie a údaje o spotrebe. Pri streamovaní zachovajte úplné identifikačné údaje udalostí a položiek.
Ak treba overiť pôvodnú odpoveď
Zachovajte ID požiadaviek/odpovedí aj hlavičky. Všeobecná URL na načítanie textovej úlohy nie je poskytnutá.
Polia odpovede
| Pole | Typ |
|---|---|
Poleid | Typstring |
Polestatus | Typstring |
Poleoutput[] | Typmessage|reasoning|function_call|other item |
Poleoutput[].content[] | Typcontent part |
Poleusage | Typobject |
Chyby a ďalšie kroky
| Odpoveď | Podmienka | Ďalší krok |
|---|---|---|
Odpoveď400 · invalid_request_error | PodmienkaNeplatné povinné polia, reprezentácia materiálu alebo hodnota parametra | Ďalší krokPred novou požiadavkou na vytvorenie opravte uvedené polia. |
Aliasy
Aliasy modelov
Ailoot grok-4.7, grok, grok-4.7-latest, grok-latest
Ailoot Ultra grok-4.7, x-ai/grok-4.7, ~x-ai/grok-latest
Aliasy ciest metód
/chat/completions
Súvisiace ID na volanie
x-ai/grok-4.7, grok, grok-4.7-latest, grok-latest, ~x-ai/grok-latest, grok-4.7, grok-4.7
Ailoot · OpenAI Chat POST /v1/chat/completions grok
grokgrok-4.7grokgrok-4.7-latestgrok-latest
Úvod
Grok 4.7 je model spoločnosti xAI na vývoj programov a odbornú prácu so znalosťami. Podporuje text, obrázky, kontext 500 000 tokenov, volania funkcií a štruktúrované odpovede.
- Povolené vstupy
- Text · Obrázky
- Výsledky
- Text
Dostupné v Ailoot · vstupy a metódy
Ailoot · OpenAI Chat POST /v1/chat/completions
- Vstup
text,image- Výstup
text- Kontext
- 500 000 tokens
- Maximálny výstup
- 500 000 tokens
- Výstupný formát
- json alebo SSE
| Pole | Typ | Požiadavka | Hodnoty a limity | Predvolené |
|---|---|---|---|---|
Polemodel | Typstring | PožiadavkaPovinné | Hodnoty a limity grok | Predvolené— |
Polemessages | Typmessage[] | PožiadavkaPovinné | Hodnoty a limity Minimálny počet položiek: 1 | Predvolené— |
Polemessages[].role | Typstring | PožiadavkaPovinné | Hodnoty a limity Príklady: system, user, assistant, tool, function Podmienky: Tieto roly sú výslovne zastúpené typmi kompatibility v zdrojovom kóde; presný súbor rolí zostáva závislý od modelu. Závisí od modelu | Predvolené— |
Polemessages[].content | Typstring|content_part[]|null | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemessages[].tool_calls | Typtool_call[] | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemessages[].tool_call_id | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: role=tool; použite skutočne vrátené ID | Predvolené— |
Polemessages[].name | Typstring | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemessages[].reasoning_content | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: Posielajte späť skutočne vrátené uvažovanie, ak ho tento model používa | Predvolené— |
Polemessages[].reasoning_details | Typobject|array | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polemax_tokens | Typinteger | PožiadavkaVoliteľné | Hodnoty a limity Minimum: 1 Závisí od modelu | Predvolené— |
Polemax_completion_tokens | Typinteger | PožiadavkaVoliteľné | Hodnoty a limity Minimum: 1 Závisí od modelu | Predvolené— |
Polestream | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity | Predvolenéfalse |
Polestream_options.include_usage | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletemperature | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletop_p | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polestop | Typstring|string[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools | Typfunction_tool[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools[].type | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools[].function.name | Typstring | PožiadavkaPovinné | Hodnoty a limity Platí, keď: poskytnutý nástroj typu funkcia | Predvolené— |
Poletools[].function.description | Typstring | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poletools[].function.parameters | TypJSON_schema | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poletool_choice | Typstring|object | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleparallel_tool_calls | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleresponse_format | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polereasoning_effort | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polereasoning | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleservice_tier | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleinstructions | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Pole kompatibility | Predvolené— |
Polefunctions | Typfunction[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polefunction_call | Typstring|object | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleprompt_cache_options | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Kombinácie vstupných podkladov
Text · Text UTF8
messages[].content
Text + obrázok
{type:image_url,image_url:{url,detail}}
Parametre a životný cyklus metódy
| Parameter | Špecifikácia |
|---|---|
Parametermaterial_types | Špecifikáciatext, image |
Parameterrequired | Špecifikáciamodel, messages |
Parameteroptional_controls | Špecifikácianull |
Parametercontent_type | Špecifikáciaapplication/json |
Parametertext_file_material | Špecifikáciaskutočný obsah UTF-8 vložený ako text; ID súborov a URLs potrebujú samostatnú presne určenú podporu |
Životný cyklus: exact retained published method
Štruktúry metód a ID sú presné; možnosti dodávateľa sa posudzujú oddelene od prijatia požiadavky.
Cenník
Sadzby metód Ailoot
POST /v1/chat/completions- Vstup
- 0,002 USD / 1K
- Výstup
- 0,006 USD / 1K
- Čítanie cache
- 0,0005 USD / 1K
- Zápis do cache
- 0,00 USD / 1K
- Zápis do cache, 5 min
- 0,00 USD / 1K tokens
- Zápis do cache, 1 hod
- 0,00 USD / 1K tokens
Ceny podľa dĺžky požiadavky · OpenAI Chat
| Veľkosť požiadavky v tokenoch | Vstup | Výstup | Čítanie cache | Zápis do cache | Cache 5 min | Cache 1 hod |
|---|---|---|---|---|---|---|
| Veľkosť požiadavky v tokenoch(0; 200 000] | Vstup0,002 USD | Výstup0,006 USD | Čítanie cache0,0005 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
| Veľkosť požiadavky v tokenoch(200 000; ∞) | Vstup0,004 USD | Výstup0,012 USD | Čítanie cache0,001 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
Sadzby v USD za 1K tokenov. Ak sadzba nie je nastavená, preberá sa základná sadzba tejto metódy; «—» znamená, že základná sadzba nie je nastavená.
Ailoot pred požiadavkou rezervuje odhadovanú sumu. Po získaní výsledku vyúčtuje konečný poplatok podľa nameraného využitia. Pri streamovaní sa vyúčtovanie riadi konečným záznamom využitia. Ako funguje rezervácia a vyúčtovanie →
Podrobnosti referenčnej tarify
Referenčné sadzobníky modelu nemenia výber metódy, cenové odhady ani poplatky. Aktívne poplatky používajú sadzby vybranej metódy Ailoot.
Referenčné sadzobníky modelu
Ceny podľa konfigurácie
Každý poplatok priraďte k zobrazeným podmienkam. Pre každú skupinu alternatívnych konfigurácií použite jednu sadzbu.
| Konfigurácia | Sadzobník | Počet tokenov kontextu väčší než | Tokeny kontextu, najviac (vrátane hranice) | Poplatok |
|---|---|---|---|---|
| KonfiguráciaOpenAI Chat · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
Príklady požiadaviek
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", "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", "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",
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",
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',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")
Prijať a uložiť výsledky
Ailoot · OpenAI Chat
json alebo SSE
Uchovať všetky dokončené výsledky
Uložte každú úplnú vrátenú odpoveď, súbor a časť obsahu.
Zachovajte každý variant odpovede a jeho obsah, volania nástrojov a uvažovanie. V SSE zostavujte čiastkové zmeny podľa indexu variantu/nástroja a zachovajte konečný dôvod ukončenia aj údaje o spotrebe.
Ak treba overiť pôvodnú odpoveď
Zachovajte ID požiadaviek/odpovedí aj hlavičky. Všeobecná URL na načítanie textovej úlohy nie je poskytnutá.
Polia odpovede
| Pole | Typ |
|---|---|
Polechoices[].index | Typinteger |
Polechoices[].message.content | Typstring|null |
Polechoices[].message.tool_calls | Typtool_call[] |
Polechoices[].message.reasoning_content | Typstring |
Polechoices[].message.reasoning_details | Typobject|array |
Polechoices[].finish_reason | Typstring|null |
Poleusage | Typobject |
Chyby a ďalšie kroky
| Odpoveď | Podmienka | Ďalší krok |
|---|---|---|
Odpoveď400 · invalid_request_error | PodmienkaNeplatné povinné polia, reprezentácia materiálu alebo hodnota parametra | Ďalší krokPred novou požiadavkou na vytvorenie opravte uvedené polia. |
Aliasy
Aliasy modelov
Ailoot grok-4.7, grok, grok-4.7-latest, grok-latest
Ailoot Ultra grok-4.7, x-ai/grok-4.7, ~x-ai/grok-latest
Aliasy ciest metód
/chat/completions
Súvisiace ID na volanie
x-ai/grok-4.7, grok, grok-4.7-latest, grok-latest, ~x-ai/grok-latest, grok-4.7, grok-4.7
Ailoot · Anthropic Messages POST /v1/messages grok-4.7-latest
grok-4.7-latestgrok-4.7grokgrok-4.7-latestgrok-latest
Úvod
Grok 4.7 je model spoločnosti xAI na vývoj programov a odbornú prácu so znalosťami. Podporuje text, obrázky, kontext 500 000 tokenov, volania funkcií a štruktúrované odpovede.
- Povolené vstupy
- Text · Obrázky
- Výsledky
- Text
Dostupné v Ailoot · vstupy a metódy
Ailoot · Anthropic Messages POST /v1/messages
- Vstup
text,image- Výstup
text- Kontext
- 500 000 tokens
- Maximálny výstup
- 500 000 tokens
- Výstupný formát
- json alebo SSE
| Pole | Typ | Požiadavka | Hodnoty a limity | Predvolené |
|---|---|---|---|---|
Polemodel | Typstring | PožiadavkaPovinné | Hodnoty a limity grok-4.7-latest | Predvolené— |
Polemessages | Typmessage[] | PožiadavkaPovinné | Hodnoty a limity Minimálny počet položiek: 1 | Predvolené— |
Polemessages[].role | Typstring | PožiadavkaPovinné | Hodnoty a limity user, assistant | Predvolené— |
Polemessages[].content | Typstring|content_block[] | PožiadavkaPovinné | Hodnoty a limity | Predvolené— |
Polesystem | Typstring|content_block[] | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemax_tokens | Typinteger | PožiadavkaPovinné | Hodnoty a limity Minimum: 1 Limit sa vzťahuje na: presná horná hranica zvoleného modelu/karty | Predvolené— |
Polestream | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity | Predvolenéfalse |
Poletemperature | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletop_p | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polestop_sequences | Typstring[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools | Typtool[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools[].name | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: poskytnutý nástroj | Predvolené— |
Poletools[].description | Typstring | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poletools[].input_schema | TypJSON_schema | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poletool_choice | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polethinking.type | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polethinking.budget_tokens | Typinteger | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleoutput_config.effort | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polemetadata | Typobject | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polecache_control | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Kombinácie vstupných podkladov
Text · Text UTF8
messages[].content alebo blok type=text
Text + obrázok
{type:image,source:{type:base64,media_type,data}} alebo zdroj s type=url
Parametre a životný cyklus metódy
| Parameter | Špecifikácia |
|---|---|
Parametermaterial_types | Špecifikáciatext, image |
Parameterrequired | Špecifikáciamodel, messages, max_tokens |
Parameteroptional_controls | Špecifikácianull |
Parametercontent_type | Špecifikáciaapplication/json |
Parametertext_file_material | Špecifikáciaskutočný obsah UTF-8 vložený ako text; ID súborov a URLs potrebujú samostatnú presne určenú podporu |
Životný cyklus: exact retained published method
Štruktúry metód a ID sú presné; možnosti dodávateľa sa posudzujú oddelene od prijatia požiadavky.
Cenník
Sadzby metód Ailoot
POST /v1/messages- Vstup
- 0,002 USD / 1K
- Výstup
- 0,006 USD / 1K
- Čítanie cache
- 0,0005 USD / 1K
- Zápis do cache
- 0,00 USD / 1K
- Zápis do cache, 5 min
- 0,00 USD / 1K tokens
- Zápis do cache, 1 hod
- 0,00 USD / 1K tokens
Ceny podľa dĺžky požiadavky · Anthropic Messages
| Veľkosť požiadavky v tokenoch | Vstup | Výstup | Čítanie cache | Zápis do cache | Cache 5 min | Cache 1 hod |
|---|---|---|---|---|---|---|
| Veľkosť požiadavky v tokenoch(0; 200 000] | Vstup0,002 USD | Výstup0,006 USD | Čítanie cache0,0005 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
| Veľkosť požiadavky v tokenoch(200 000; ∞) | Vstup0,004 USD | Výstup0,012 USD | Čítanie cache0,001 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
Sadzby v USD za 1K tokenov. Ak sadzba nie je nastavená, preberá sa základná sadzba tejto metódy; «—» znamená, že základná sadzba nie je nastavená.
Ailoot pred požiadavkou rezervuje odhadovanú sumu. Po získaní výsledku vyúčtuje konečný poplatok podľa nameraného využitia. Pri streamovaní sa vyúčtovanie riadi konečným záznamom využitia. Ako funguje rezervácia a vyúčtovanie →
Podrobnosti referenčnej tarify
Referenčné sadzobníky modelu nemenia výber metódy, cenové odhady ani poplatky. Aktívne poplatky používajú sadzby vybranej metódy Ailoot.
Referenčné sadzobníky modelu
Ceny podľa konfigurácie
Každý poplatok priraďte k zobrazeným podmienkam. Pre každú skupinu alternatívnych konfigurácií použite jednu sadzbu.
| Konfigurácia | Sadzobník | Počet tokenov kontextu väčší než | Tokeny kontextu, najviac (vrátane hranice) | Poplatok |
|---|---|---|---|---|
| KonfiguráciaOpenAI Chat · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
Príklady požiadaviek
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.7-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.7-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.7-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.7-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.7-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")
Prijať a uložiť výsledky
Ailoot · Anthropic Messages
json alebo SSE
Uchovať všetky dokončené výsledky
Uložte každú úplnú vrátenú odpoveď, súbor a časť obsahu.
Zachovajte všetky bloky obsahu, podpisy uvažovania a skutočné ID volaní nástrojov. Zostavte všetky čiastkové zmeny blokov SSE; prvý textový blok nie je celý výstup.
Ak treba overiť pôvodnú odpoveď
Zachovajte ID požiadaviek/odpovedí aj hlavičky. Všeobecná URL na načítanie textovej úlohy nie je poskytnutá.
Polia odpovede
| Pole | Typ |
|---|---|
Poleid | Typstring |
Polemodel | Typstring |
Polecontent[] | Typtext|thinking|tool_use|other content block |
Polestop_reason | Typstring|null |
Poleusage | Typobject |
Chyby a ďalšie kroky
| Odpoveď | Podmienka | Ďalší krok |
|---|---|---|
Odpoveď400 · invalid_request_error | PodmienkaNeplatné povinné polia, reprezentácia materiálu alebo hodnota parametra | Ďalší krokPred novou požiadavkou na vytvorenie opravte uvedené polia. |
Aliasy
Aliasy modelov
Ailoot grok-4.7, grok, grok-4.7-latest, grok-latest
Ailoot Ultra grok-4.7, x-ai/grok-4.7, ~x-ai/grok-latest
Aliasy ciest metód
/chat/completions
Súvisiace ID na volanie
x-ai/grok-4.7, grok, grok-4.7-latest, grok-latest, ~x-ai/grok-latest, grok-4.7, grok-4.7
Ailoot · OpenAI Responses POST /v1/responses grok-4.7-latest
grok-4.7-latestgrok-4.7grokgrok-4.7-latestgrok-latest
Úvod
Grok 4.7 je model spoločnosti xAI na vývoj programov a odbornú prácu so znalosťami. Podporuje text, obrázky, kontext 500 000 tokenov, volania funkcií a štruktúrované odpovede.
- Povolené vstupy
- Text · Obrázky
- Výsledky
- Text
Dostupné v Ailoot · vstupy a metódy
Ailoot · OpenAI Responses POST /v1/responses
- Vstup
text,image- Výstup
text- Kontext
- 500 000 tokens
- Maximálny výstup
- 500 000 tokens
- Výstupný formát
- json alebo SSE
| Pole | Typ | Požiadavka | Hodnoty a limity | Predvolené |
|---|---|---|---|---|
Polemodel | Typstring | PožiadavkaPovinné | Hodnoty a limity grok-4.7-latest | Predvolené— |
Poleinput | Typstring|input_item[] | PožiadavkaPovinné | Hodnoty a limity | Predvolené— |
Poleinstructions | Typstring | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poleinput[].type | Typstring | PožiadavkaVoliteľné | Hodnoty a limity message, reasoning, function_call, function_call_output | Predvolené— |
Poleinput[].content | Typstring|content_part[] | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poleinput[].call_id | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: function_call_output; zachovajte skutočne vrátený call_id | Predvolené— |
Poleinput[].output | Typstring|content_part[] | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: function_call_output | Predvolené— |
Polemax_output_tokens | Typinteger | PožiadavkaVoliteľné | Hodnoty a limity Minimum: 1 Závisí od modelu | Predvolené— |
Polestream | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity | Predvolenéfalse |
Poletemperature | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletop_p | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools | Typtool[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletool_choice | Typstring|object | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleparallel_tool_calls | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polereasoning.effort | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polereasoning.summary | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletext.format | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletext.verbosity | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleinclude | Typstring[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polestore | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleprevious_response_id | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Požiadavka na ID: Len skutočné ID odpovede z podporovaného pokračovania Závisí od modelu | Predvolené— |
Poleservice_tier | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleprompt_cache_key | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleprompt_cache_options | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Kombinácie vstupných podkladov
Text · Text UTF8
vstupný text alebo časť input_text
Text + obrázok
{type:input_image,image_url}
Parametre a životný cyklus metódy
| Parameter | Špecifikácia |
|---|---|
Parametermaterial_types | Špecifikáciatext, image |
Parameterrequired | Špecifikáciamodel, input |
Parameteroptional_controls | Špecifikácianull |
Parametercontent_type | Špecifikáciaapplication/json |
Parametertext_file_material | Špecifikáciaskutočný obsah UTF-8 vložený ako text; ID súborov a URLs potrebujú samostatnú presne určenú podporu |
Životný cyklus: exact retained published method
Štruktúry metód a ID sú presné; možnosti dodávateľa sa posudzujú oddelene od prijatia požiadavky.
Cenník
Sadzby metód Ailoot
POST /v1/responses- Vstup
- 0,002 USD / 1K
- Výstup
- 0,006 USD / 1K
- Čítanie cache
- 0,0005 USD / 1K
- Zápis do cache
- 0,00 USD / 1K
- Zápis do cache, 5 min
- 0,00 USD / 1K tokens
- Zápis do cache, 1 hod
- 0,00 USD / 1K tokens
Ceny podľa dĺžky požiadavky · OpenAI Responses
| Veľkosť požiadavky v tokenoch | Vstup | Výstup | Čítanie cache | Zápis do cache | Cache 5 min | Cache 1 hod |
|---|---|---|---|---|---|---|
| Veľkosť požiadavky v tokenoch(0; 200 000] | Vstup0,002 USD | Výstup0,006 USD | Čítanie cache0,0005 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
| Veľkosť požiadavky v tokenoch(200 000; ∞) | Vstup0,004 USD | Výstup0,012 USD | Čítanie cache0,001 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
Sadzby v USD za 1K tokenov. Ak sadzba nie je nastavená, preberá sa základná sadzba tejto metódy; «—» znamená, že základná sadzba nie je nastavená.
Ailoot pred požiadavkou rezervuje odhadovanú sumu. Po získaní výsledku vyúčtuje konečný poplatok podľa nameraného využitia. Pri streamovaní sa vyúčtovanie riadi konečným záznamom využitia. Ako funguje rezervácia a vyúčtovanie →
Podrobnosti referenčnej tarify
Referenčné sadzobníky modelu nemenia výber metódy, cenové odhady ani poplatky. Aktívne poplatky používajú sadzby vybranej metódy Ailoot.
Referenčné sadzobníky modelu
Ceny podľa konfigurácie
Každý poplatok priraďte k zobrazeným podmienkam. Pre každú skupinu alternatívnych konfigurácií použite jednu sadzbu.
| Konfigurácia | Sadzobník | Počet tokenov kontextu väčší než | Tokeny kontextu, najviac (vrátane hranice) | Poplatok |
|---|---|---|---|---|
| KonfiguráciaOpenAI Chat · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
Príklady požiadaviek
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.7-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.7-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.7-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.7-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.7-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")
Prijať a uložiť výsledky
Ailoot · OpenAI Responses
json alebo SSE
Uchovať všetky dokončené výsledky
Uložte každú úplnú vrátenú odpoveď, súbor a časť obsahu.
Zachovajte každú výstupnú položku a časť obsahu, skutočný call_id funkcie, šifrované uvažovanie a údaje o spotrebe. Pri streamovaní zachovajte úplné identifikačné údaje udalostí a položiek.
Ak treba overiť pôvodnú odpoveď
Zachovajte ID požiadaviek/odpovedí aj hlavičky. Všeobecná URL na načítanie textovej úlohy nie je poskytnutá.
Polia odpovede
| Pole | Typ |
|---|---|
Poleid | Typstring |
Polestatus | Typstring |
Poleoutput[] | Typmessage|reasoning|function_call|other item |
Poleoutput[].content[] | Typcontent part |
Poleusage | Typobject |
Chyby a ďalšie kroky
| Odpoveď | Podmienka | Ďalší krok |
|---|---|---|
Odpoveď400 · invalid_request_error | PodmienkaNeplatné povinné polia, reprezentácia materiálu alebo hodnota parametra | Ďalší krokPred novou požiadavkou na vytvorenie opravte uvedené polia. |
Aliasy
Aliasy modelov
Ailoot grok-4.7, grok, grok-4.7-latest, grok-latest
Ailoot Ultra grok-4.7, x-ai/grok-4.7, ~x-ai/grok-latest
Aliasy ciest metód
/chat/completions
Súvisiace ID na volanie
x-ai/grok-4.7, grok, grok-4.7-latest, grok-latest, ~x-ai/grok-latest, grok-4.7, grok-4.7
Ailoot · OpenAI Chat POST /v1/chat/completions grok-4.7-latest
grok-4.7-latestgrok-4.7grokgrok-4.7-latestgrok-latest
Úvod
Grok 4.7 je model spoločnosti xAI na vývoj programov a odbornú prácu so znalosťami. Podporuje text, obrázky, kontext 500 000 tokenov, volania funkcií a štruktúrované odpovede.
- Povolené vstupy
- Text · Obrázky
- Výsledky
- Text
Dostupné v Ailoot · vstupy a metódy
Ailoot · OpenAI Chat POST /v1/chat/completions
- Vstup
text,image- Výstup
text- Kontext
- 500 000 tokens
- Maximálny výstup
- 500 000 tokens
- Výstupný formát
- json alebo SSE
| Pole | Typ | Požiadavka | Hodnoty a limity | Predvolené |
|---|---|---|---|---|
Polemodel | Typstring | PožiadavkaPovinné | Hodnoty a limity grok-4.7-latest | Predvolené— |
Polemessages | Typmessage[] | PožiadavkaPovinné | Hodnoty a limity Minimálny počet položiek: 1 | Predvolené— |
Polemessages[].role | Typstring | PožiadavkaPovinné | Hodnoty a limity Príklady: system, user, assistant, tool, function Podmienky: Tieto roly sú výslovne zastúpené typmi kompatibility v zdrojovom kóde; presný súbor rolí zostáva závislý od modelu. Závisí od modelu | Predvolené— |
Polemessages[].content | Typstring|content_part[]|null | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemessages[].tool_calls | Typtool_call[] | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemessages[].tool_call_id | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: role=tool; použite skutočne vrátené ID | Predvolené— |
Polemessages[].name | Typstring | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemessages[].reasoning_content | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: Posielajte späť skutočne vrátené uvažovanie, ak ho tento model používa | Predvolené— |
Polemessages[].reasoning_details | Typobject|array | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polemax_tokens | Typinteger | PožiadavkaVoliteľné | Hodnoty a limity Minimum: 1 Závisí od modelu | Predvolené— |
Polemax_completion_tokens | Typinteger | PožiadavkaVoliteľné | Hodnoty a limity Minimum: 1 Závisí od modelu | Predvolené— |
Polestream | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity | Predvolenéfalse |
Polestream_options.include_usage | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletemperature | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletop_p | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polestop | Typstring|string[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools | Typfunction_tool[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools[].type | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools[].function.name | Typstring | PožiadavkaPovinné | Hodnoty a limity Platí, keď: poskytnutý nástroj typu funkcia | Predvolené— |
Poletools[].function.description | Typstring | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poletools[].function.parameters | TypJSON_schema | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poletool_choice | Typstring|object | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleparallel_tool_calls | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleresponse_format | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polereasoning_effort | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polereasoning | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleservice_tier | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleinstructions | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Pole kompatibility | Predvolené— |
Polefunctions | Typfunction[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polefunction_call | Typstring|object | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleprompt_cache_options | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Kombinácie vstupných podkladov
Text · Text UTF8
messages[].content
Text + obrázok
{type:image_url,image_url:{url,detail}}
Parametre a životný cyklus metódy
| Parameter | Špecifikácia |
|---|---|
Parametermaterial_types | Špecifikáciatext, image |
Parameterrequired | Špecifikáciamodel, messages |
Parameteroptional_controls | Špecifikácianull |
Parametercontent_type | Špecifikáciaapplication/json |
Parametertext_file_material | Špecifikáciaskutočný obsah UTF-8 vložený ako text; ID súborov a URLs potrebujú samostatnú presne určenú podporu |
Životný cyklus: exact retained published method
Štruktúry metód a ID sú presné; možnosti dodávateľa sa posudzujú oddelene od prijatia požiadavky.
Cenník
Sadzby metód Ailoot
POST /v1/chat/completions- Vstup
- 0,002 USD / 1K
- Výstup
- 0,006 USD / 1K
- Čítanie cache
- 0,0005 USD / 1K
- Zápis do cache
- 0,00 USD / 1K
- Zápis do cache, 5 min
- 0,00 USD / 1K tokens
- Zápis do cache, 1 hod
- 0,00 USD / 1K tokens
Ceny podľa dĺžky požiadavky · OpenAI Chat
| Veľkosť požiadavky v tokenoch | Vstup | Výstup | Čítanie cache | Zápis do cache | Cache 5 min | Cache 1 hod |
|---|---|---|---|---|---|---|
| Veľkosť požiadavky v tokenoch(0; 200 000] | Vstup0,002 USD | Výstup0,006 USD | Čítanie cache0,0005 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
| Veľkosť požiadavky v tokenoch(200 000; ∞) | Vstup0,004 USD | Výstup0,012 USD | Čítanie cache0,001 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
Sadzby v USD za 1K tokenov. Ak sadzba nie je nastavená, preberá sa základná sadzba tejto metódy; «—» znamená, že základná sadzba nie je nastavená.
Ailoot pred požiadavkou rezervuje odhadovanú sumu. Po získaní výsledku vyúčtuje konečný poplatok podľa nameraného využitia. Pri streamovaní sa vyúčtovanie riadi konečným záznamom využitia. Ako funguje rezervácia a vyúčtovanie →
Podrobnosti referenčnej tarify
Referenčné sadzobníky modelu nemenia výber metódy, cenové odhady ani poplatky. Aktívne poplatky používajú sadzby vybranej metódy Ailoot.
Referenčné sadzobníky modelu
Ceny podľa konfigurácie
Každý poplatok priraďte k zobrazeným podmienkam. Pre každú skupinu alternatívnych konfigurácií použite jednu sadzbu.
| Konfigurácia | Sadzobník | Počet tokenov kontextu väčší než | Tokeny kontextu, najviac (vrátane hranice) | Poplatok |
|---|---|---|---|---|
| KonfiguráciaOpenAI Chat · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
Príklady požiadaviek
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.7-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.7-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.7-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.7-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.7-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")
Prijať a uložiť výsledky
Ailoot · OpenAI Chat
json alebo SSE
Uchovať všetky dokončené výsledky
Uložte každú úplnú vrátenú odpoveď, súbor a časť obsahu.
Zachovajte každý variant odpovede a jeho obsah, volania nástrojov a uvažovanie. V SSE zostavujte čiastkové zmeny podľa indexu variantu/nástroja a zachovajte konečný dôvod ukončenia aj údaje o spotrebe.
Ak treba overiť pôvodnú odpoveď
Zachovajte ID požiadaviek/odpovedí aj hlavičky. Všeobecná URL na načítanie textovej úlohy nie je poskytnutá.
Polia odpovede
| Pole | Typ |
|---|---|
Polechoices[].index | Typinteger |
Polechoices[].message.content | Typstring|null |
Polechoices[].message.tool_calls | Typtool_call[] |
Polechoices[].message.reasoning_content | Typstring |
Polechoices[].message.reasoning_details | Typobject|array |
Polechoices[].finish_reason | Typstring|null |
Poleusage | Typobject |
Chyby a ďalšie kroky
| Odpoveď | Podmienka | Ďalší krok |
|---|---|---|
Odpoveď400 · invalid_request_error | PodmienkaNeplatné povinné polia, reprezentácia materiálu alebo hodnota parametra | Ďalší krokPred novou požiadavkou na vytvorenie opravte uvedené polia. |
Aliasy
Aliasy modelov
Ailoot grok-4.7, grok, grok-4.7-latest, grok-latest
Ailoot Ultra grok-4.7, x-ai/grok-4.7, ~x-ai/grok-latest
Aliasy ciest metód
/chat/completions
Súvisiace ID na volanie
x-ai/grok-4.7, grok, grok-4.7-latest, grok-latest, ~x-ai/grok-latest, grok-4.7, grok-4.7
Ailoot · Anthropic Messages POST /v1/messages grok-latest
grok-latestgrok-4.7grokgrok-4.7-latestgrok-latest
Úvod
Grok 4.7 je model spoločnosti xAI na vývoj programov a odbornú prácu so znalosťami. Podporuje text, obrázky, kontext 500 000 tokenov, volania funkcií a štruktúrované odpovede.
- Povolené vstupy
- Text · Obrázky
- Výsledky
- Text
Dostupné v Ailoot · vstupy a metódy
Ailoot · Anthropic Messages POST /v1/messages
- Vstup
text,image- Výstup
text- Kontext
- 500 000 tokens
- Maximálny výstup
- 500 000 tokens
- Výstupný formát
- json alebo SSE
| Pole | Typ | Požiadavka | Hodnoty a limity | Predvolené |
|---|---|---|---|---|
Polemodel | Typstring | PožiadavkaPovinné | Hodnoty a limity grok-latest | Predvolené— |
Polemessages | Typmessage[] | PožiadavkaPovinné | Hodnoty a limity Minimálny počet položiek: 1 | Predvolené— |
Polemessages[].role | Typstring | PožiadavkaPovinné | Hodnoty a limity user, assistant | Predvolené— |
Polemessages[].content | Typstring|content_block[] | PožiadavkaPovinné | Hodnoty a limity | Predvolené— |
Polesystem | Typstring|content_block[] | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemax_tokens | Typinteger | PožiadavkaPovinné | Hodnoty a limity Minimum: 1 Limit sa vzťahuje na: presná horná hranica zvoleného modelu/karty | Predvolené— |
Polestream | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity | Predvolenéfalse |
Poletemperature | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletop_p | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polestop_sequences | Typstring[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools | Typtool[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools[].name | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: poskytnutý nástroj | Predvolené— |
Poletools[].description | Typstring | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poletools[].input_schema | TypJSON_schema | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poletool_choice | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polethinking.type | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polethinking.budget_tokens | Typinteger | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleoutput_config.effort | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polemetadata | Typobject | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polecache_control | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Kombinácie vstupných podkladov
Text · Text UTF8
messages[].content alebo blok type=text
Text + obrázok
{type:image,source:{type:base64,media_type,data}} alebo zdroj s type=url
Parametre a životný cyklus metódy
| Parameter | Špecifikácia |
|---|---|
Parametermaterial_types | Špecifikáciatext, image |
Parameterrequired | Špecifikáciamodel, messages, max_tokens |
Parameteroptional_controls | Špecifikácianull |
Parametercontent_type | Špecifikáciaapplication/json |
Parametertext_file_material | Špecifikáciaskutočný obsah UTF-8 vložený ako text; ID súborov a URLs potrebujú samostatnú presne určenú podporu |
Životný cyklus: exact retained published method
Štruktúry metód a ID sú presné; možnosti dodávateľa sa posudzujú oddelene od prijatia požiadavky.
Cenník
Sadzby metód Ailoot
POST /v1/messages- Vstup
- 0,002 USD / 1K
- Výstup
- 0,006 USD / 1K
- Čítanie cache
- 0,0005 USD / 1K
- Zápis do cache
- 0,00 USD / 1K
- Zápis do cache, 5 min
- 0,00 USD / 1K tokens
- Zápis do cache, 1 hod
- 0,00 USD / 1K tokens
Ceny podľa dĺžky požiadavky · Anthropic Messages
| Veľkosť požiadavky v tokenoch | Vstup | Výstup | Čítanie cache | Zápis do cache | Cache 5 min | Cache 1 hod |
|---|---|---|---|---|---|---|
| Veľkosť požiadavky v tokenoch(0; 200 000] | Vstup0,002 USD | Výstup0,006 USD | Čítanie cache0,0005 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
| Veľkosť požiadavky v tokenoch(200 000; ∞) | Vstup0,004 USD | Výstup0,012 USD | Čítanie cache0,001 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
Sadzby v USD za 1K tokenov. Ak sadzba nie je nastavená, preberá sa základná sadzba tejto metódy; «—» znamená, že základná sadzba nie je nastavená.
Ailoot pred požiadavkou rezervuje odhadovanú sumu. Po získaní výsledku vyúčtuje konečný poplatok podľa nameraného využitia. Pri streamovaní sa vyúčtovanie riadi konečným záznamom využitia. Ako funguje rezervácia a vyúčtovanie →
Podrobnosti referenčnej tarify
Referenčné sadzobníky modelu nemenia výber metódy, cenové odhady ani poplatky. Aktívne poplatky používajú sadzby vybranej metódy Ailoot.
Referenčné sadzobníky modelu
Ceny podľa konfigurácie
Každý poplatok priraďte k zobrazeným podmienkam. Pre každú skupinu alternatívnych konfigurácií použite jednu sadzbu.
| Konfigurácia | Sadzobník | Počet tokenov kontextu väčší než | Tokeny kontextu, najviac (vrátane hranice) | Poplatok |
|---|---|---|---|---|
| KonfiguráciaOpenAI Chat · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
Príklady požiadaviek
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-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-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-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-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-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")
Prijať a uložiť výsledky
Ailoot · Anthropic Messages
json alebo SSE
Uchovať všetky dokončené výsledky
Uložte každú úplnú vrátenú odpoveď, súbor a časť obsahu.
Zachovajte všetky bloky obsahu, podpisy uvažovania a skutočné ID volaní nástrojov. Zostavte všetky čiastkové zmeny blokov SSE; prvý textový blok nie je celý výstup.
Ak treba overiť pôvodnú odpoveď
Zachovajte ID požiadaviek/odpovedí aj hlavičky. Všeobecná URL na načítanie textovej úlohy nie je poskytnutá.
Polia odpovede
| Pole | Typ |
|---|---|
Poleid | Typstring |
Polemodel | Typstring |
Polecontent[] | Typtext|thinking|tool_use|other content block |
Polestop_reason | Typstring|null |
Poleusage | Typobject |
Chyby a ďalšie kroky
| Odpoveď | Podmienka | Ďalší krok |
|---|---|---|
Odpoveď400 · invalid_request_error | PodmienkaNeplatné povinné polia, reprezentácia materiálu alebo hodnota parametra | Ďalší krokPred novou požiadavkou na vytvorenie opravte uvedené polia. |
Aliasy
Aliasy modelov
Ailoot grok-4.7, grok, grok-4.7-latest, grok-latest
Ailoot Ultra grok-4.7, x-ai/grok-4.7, ~x-ai/grok-latest
Aliasy ciest metód
/chat/completions
Súvisiace ID na volanie
x-ai/grok-4.7, grok, grok-4.7-latest, grok-latest, ~x-ai/grok-latest, grok-4.7, grok-4.7
Ailoot · OpenAI Responses POST /v1/responses grok-latest
grok-latestgrok-4.7grokgrok-4.7-latestgrok-latest
Úvod
Grok 4.7 je model spoločnosti xAI na vývoj programov a odbornú prácu so znalosťami. Podporuje text, obrázky, kontext 500 000 tokenov, volania funkcií a štruktúrované odpovede.
- Povolené vstupy
- Text · Obrázky
- Výsledky
- Text
Dostupné v Ailoot · vstupy a metódy
Ailoot · OpenAI Responses POST /v1/responses
- Vstup
text,image- Výstup
text- Kontext
- 500 000 tokens
- Maximálny výstup
- 500 000 tokens
- Výstupný formát
- json alebo SSE
| Pole | Typ | Požiadavka | Hodnoty a limity | Predvolené |
|---|---|---|---|---|
Polemodel | Typstring | PožiadavkaPovinné | Hodnoty a limity grok-latest | Predvolené— |
Poleinput | Typstring|input_item[] | PožiadavkaPovinné | Hodnoty a limity | Predvolené— |
Poleinstructions | Typstring | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poleinput[].type | Typstring | PožiadavkaVoliteľné | Hodnoty a limity message, reasoning, function_call, function_call_output | Predvolené— |
Poleinput[].content | Typstring|content_part[] | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poleinput[].call_id | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: function_call_output; zachovajte skutočne vrátený call_id | Predvolené— |
Poleinput[].output | Typstring|content_part[] | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: function_call_output | Predvolené— |
Polemax_output_tokens | Typinteger | PožiadavkaVoliteľné | Hodnoty a limity Minimum: 1 Závisí od modelu | Predvolené— |
Polestream | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity | Predvolenéfalse |
Poletemperature | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletop_p | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools | Typtool[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletool_choice | Typstring|object | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleparallel_tool_calls | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polereasoning.effort | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polereasoning.summary | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletext.format | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletext.verbosity | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleinclude | Typstring[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polestore | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleprevious_response_id | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Požiadavka na ID: Len skutočné ID odpovede z podporovaného pokračovania Závisí od modelu | Predvolené— |
Poleservice_tier | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleprompt_cache_key | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleprompt_cache_options | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Kombinácie vstupných podkladov
Text · Text UTF8
vstupný text alebo časť input_text
Text + obrázok
{type:input_image,image_url}
Parametre a životný cyklus metódy
| Parameter | Špecifikácia |
|---|---|
Parametermaterial_types | Špecifikáciatext, image |
Parameterrequired | Špecifikáciamodel, input |
Parameteroptional_controls | Špecifikácianull |
Parametercontent_type | Špecifikáciaapplication/json |
Parametertext_file_material | Špecifikáciaskutočný obsah UTF-8 vložený ako text; ID súborov a URLs potrebujú samostatnú presne určenú podporu |
Životný cyklus: exact retained published method
Štruktúry metód a ID sú presné; možnosti dodávateľa sa posudzujú oddelene od prijatia požiadavky.
Cenník
Sadzby metód Ailoot
POST /v1/responses- Vstup
- 0,002 USD / 1K
- Výstup
- 0,006 USD / 1K
- Čítanie cache
- 0,0005 USD / 1K
- Zápis do cache
- 0,00 USD / 1K
- Zápis do cache, 5 min
- 0,00 USD / 1K tokens
- Zápis do cache, 1 hod
- 0,00 USD / 1K tokens
Ceny podľa dĺžky požiadavky · OpenAI Responses
| Veľkosť požiadavky v tokenoch | Vstup | Výstup | Čítanie cache | Zápis do cache | Cache 5 min | Cache 1 hod |
|---|---|---|---|---|---|---|
| Veľkosť požiadavky v tokenoch(0; 200 000] | Vstup0,002 USD | Výstup0,006 USD | Čítanie cache0,0005 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
| Veľkosť požiadavky v tokenoch(200 000; ∞) | Vstup0,004 USD | Výstup0,012 USD | Čítanie cache0,001 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
Sadzby v USD za 1K tokenov. Ak sadzba nie je nastavená, preberá sa základná sadzba tejto metódy; «—» znamená, že základná sadzba nie je nastavená.
Ailoot pred požiadavkou rezervuje odhadovanú sumu. Po získaní výsledku vyúčtuje konečný poplatok podľa nameraného využitia. Pri streamovaní sa vyúčtovanie riadi konečným záznamom využitia. Ako funguje rezervácia a vyúčtovanie →
Podrobnosti referenčnej tarify
Referenčné sadzobníky modelu nemenia výber metódy, cenové odhady ani poplatky. Aktívne poplatky používajú sadzby vybranej metódy Ailoot.
Referenčné sadzobníky modelu
Ceny podľa konfigurácie
Každý poplatok priraďte k zobrazeným podmienkam. Pre každú skupinu alternatívnych konfigurácií použite jednu sadzbu.
| Konfigurácia | Sadzobník | Počet tokenov kontextu väčší než | Tokeny kontextu, najviac (vrátane hranice) | Poplatok |
|---|---|---|---|---|
| KonfiguráciaOpenAI Chat · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
Príklady požiadaviek
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-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-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-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-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-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")
Prijať a uložiť výsledky
Ailoot · OpenAI Responses
json alebo SSE
Uchovať všetky dokončené výsledky
Uložte každú úplnú vrátenú odpoveď, súbor a časť obsahu.
Zachovajte každú výstupnú položku a časť obsahu, skutočný call_id funkcie, šifrované uvažovanie a údaje o spotrebe. Pri streamovaní zachovajte úplné identifikačné údaje udalostí a položiek.
Ak treba overiť pôvodnú odpoveď
Zachovajte ID požiadaviek/odpovedí aj hlavičky. Všeobecná URL na načítanie textovej úlohy nie je poskytnutá.
Polia odpovede
| Pole | Typ |
|---|---|
Poleid | Typstring |
Polestatus | Typstring |
Poleoutput[] | Typmessage|reasoning|function_call|other item |
Poleoutput[].content[] | Typcontent part |
Poleusage | Typobject |
Chyby a ďalšie kroky
| Odpoveď | Podmienka | Ďalší krok |
|---|---|---|
Odpoveď400 · invalid_request_error | PodmienkaNeplatné povinné polia, reprezentácia materiálu alebo hodnota parametra | Ďalší krokPred novou požiadavkou na vytvorenie opravte uvedené polia. |
Aliasy
Aliasy modelov
Ailoot grok-4.7, grok, grok-4.7-latest, grok-latest
Ailoot Ultra grok-4.7, x-ai/grok-4.7, ~x-ai/grok-latest
Aliasy ciest metód
/chat/completions
Súvisiace ID na volanie
x-ai/grok-4.7, grok, grok-4.7-latest, grok-latest, ~x-ai/grok-latest, grok-4.7, grok-4.7
Ailoot · OpenAI Chat POST /v1/chat/completions grok-latest
grok-latestgrok-4.7grokgrok-4.7-latestgrok-latest
Úvod
Grok 4.7 je model spoločnosti xAI na vývoj programov a odbornú prácu so znalosťami. Podporuje text, obrázky, kontext 500 000 tokenov, volania funkcií a štruktúrované odpovede.
- Povolené vstupy
- Text · Obrázky
- Výsledky
- Text
Dostupné v Ailoot · vstupy a metódy
Ailoot · OpenAI Chat POST /v1/chat/completions
- Vstup
text,image- Výstup
text- Kontext
- 500 000 tokens
- Maximálny výstup
- 500 000 tokens
- Výstupný formát
- json alebo SSE
| Pole | Typ | Požiadavka | Hodnoty a limity | Predvolené |
|---|---|---|---|---|
Polemodel | Typstring | PožiadavkaPovinné | Hodnoty a limity grok-latest | Predvolené— |
Polemessages | Typmessage[] | PožiadavkaPovinné | Hodnoty a limity Minimálny počet položiek: 1 | Predvolené— |
Polemessages[].role | Typstring | PožiadavkaPovinné | Hodnoty a limity Príklady: system, user, assistant, tool, function Podmienky: Tieto roly sú výslovne zastúpené typmi kompatibility v zdrojovom kóde; presný súbor rolí zostáva závislý od modelu. Závisí od modelu | Predvolené— |
Polemessages[].content | Typstring|content_part[]|null | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemessages[].tool_calls | Typtool_call[] | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemessages[].tool_call_id | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: role=tool; použite skutočne vrátené ID | Predvolené— |
Polemessages[].name | Typstring | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemessages[].reasoning_content | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: Posielajte späť skutočne vrátené uvažovanie, ak ho tento model používa | Predvolené— |
Polemessages[].reasoning_details | Typobject|array | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polemax_tokens | Typinteger | PožiadavkaVoliteľné | Hodnoty a limity Minimum: 1 Závisí od modelu | Predvolené— |
Polemax_completion_tokens | Typinteger | PožiadavkaVoliteľné | Hodnoty a limity Minimum: 1 Závisí od modelu | Predvolené— |
Polestream | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity | Predvolenéfalse |
Polestream_options.include_usage | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletemperature | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletop_p | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polestop | Typstring|string[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools | Typfunction_tool[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools[].type | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools[].function.name | Typstring | PožiadavkaPovinné | Hodnoty a limity Platí, keď: poskytnutý nástroj typu funkcia | Predvolené— |
Poletools[].function.description | Typstring | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poletools[].function.parameters | TypJSON_schema | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poletool_choice | Typstring|object | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleparallel_tool_calls | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleresponse_format | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polereasoning_effort | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polereasoning | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleservice_tier | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleinstructions | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Pole kompatibility | Predvolené— |
Polefunctions | Typfunction[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polefunction_call | Typstring|object | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleprompt_cache_options | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Kombinácie vstupných podkladov
Text · Text UTF8
messages[].content
Text + obrázok
{type:image_url,image_url:{url,detail}}
Parametre a životný cyklus metódy
| Parameter | Špecifikácia |
|---|---|
Parametermaterial_types | Špecifikáciatext, image |
Parameterrequired | Špecifikáciamodel, messages |
Parameteroptional_controls | Špecifikácianull |
Parametercontent_type | Špecifikáciaapplication/json |
Parametertext_file_material | Špecifikáciaskutočný obsah UTF-8 vložený ako text; ID súborov a URLs potrebujú samostatnú presne určenú podporu |
Životný cyklus: exact retained published method
Štruktúry metód a ID sú presné; možnosti dodávateľa sa posudzujú oddelene od prijatia požiadavky.
Cenník
Sadzby metód Ailoot
POST /v1/chat/completions- Vstup
- 0,002 USD / 1K
- Výstup
- 0,006 USD / 1K
- Čítanie cache
- 0,0005 USD / 1K
- Zápis do cache
- 0,00 USD / 1K
- Zápis do cache, 5 min
- 0,00 USD / 1K tokens
- Zápis do cache, 1 hod
- 0,00 USD / 1K tokens
Ceny podľa dĺžky požiadavky · OpenAI Chat
| Veľkosť požiadavky v tokenoch | Vstup | Výstup | Čítanie cache | Zápis do cache | Cache 5 min | Cache 1 hod |
|---|---|---|---|---|---|---|
| Veľkosť požiadavky v tokenoch(0; 200 000] | Vstup0,002 USD | Výstup0,006 USD | Čítanie cache0,0005 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
| Veľkosť požiadavky v tokenoch(200 000; ∞) | Vstup0,004 USD | Výstup0,012 USD | Čítanie cache0,001 USD | Zápis do cache0,00 USD | Cache 5 min0,00 USD | Cache 1 hod0,00 USD |
Sadzby v USD za 1K tokenov. Ak sadzba nie je nastavená, preberá sa základná sadzba tejto metódy; «—» znamená, že základná sadzba nie je nastavená.
Ailoot pred požiadavkou rezervuje odhadovanú sumu. Po získaní výsledku vyúčtuje konečný poplatok podľa nameraného využitia. Pri streamovaní sa vyúčtovanie riadi konečným záznamom využitia. Ako funguje rezervácia a vyúčtovanie →
Podrobnosti referenčnej tarify
Referenčné sadzobníky modelu nemenia výber metódy, cenové odhady ani poplatky. Aktívne poplatky používajú sadzby vybranej metódy Ailoot.
Referenčné sadzobníky modelu
Ceny podľa konfigurácie
Každý poplatok priraďte k zobrazeným podmienkam. Pre každú skupinu alternatívnych konfigurácií použite jednu sadzbu.
| Konfigurácia | Sadzobník | Počet tokenov kontextu väčší než | Tokeny kontextu, najviac (vrátane hranice) | Poplatok |
|---|---|---|---|---|
| KonfiguráciaOpenAI Chat · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaOpenAI Chat · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Základné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 1 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaAnthropic Messages · Pásmo 2 podľa dĺžky požiadavky | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
Príklady požiadaviek
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-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-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-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-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-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")
Prijať a uložiť výsledky
Ailoot · OpenAI Chat
json alebo SSE
Uchovať všetky dokončené výsledky
Uložte každú úplnú vrátenú odpoveď, súbor a časť obsahu.
Zachovajte každý variant odpovede a jeho obsah, volania nástrojov a uvažovanie. V SSE zostavujte čiastkové zmeny podľa indexu variantu/nástroja a zachovajte konečný dôvod ukončenia aj údaje o spotrebe.
Ak treba overiť pôvodnú odpoveď
Zachovajte ID požiadaviek/odpovedí aj hlavičky. Všeobecná URL na načítanie textovej úlohy nie je poskytnutá.
Polia odpovede
| Pole | Typ |
|---|---|
Polechoices[].index | Typinteger |
Polechoices[].message.content | Typstring|null |
Polechoices[].message.tool_calls | Typtool_call[] |
Polechoices[].message.reasoning_content | Typstring |
Polechoices[].message.reasoning_details | Typobject|array |
Polechoices[].finish_reason | Typstring|null |
Poleusage | Typobject |
Chyby a ďalšie kroky
| Odpoveď | Podmienka | Ďalší krok |
|---|---|---|
Odpoveď400 · invalid_request_error | PodmienkaNeplatné povinné polia, reprezentácia materiálu alebo hodnota parametra | Ďalší krokPred novou požiadavkou na vytvorenie opravte uvedené polia. |
Aliasy
Aliasy modelov
Ailoot grok-4.7, grok, grok-4.7-latest, grok-latest
Ailoot Ultra grok-4.7, x-ai/grok-4.7, ~x-ai/grok-latest
Aliasy ciest metód
/chat/completions
Súvisiace ID na volanie
x-ai/grok-4.7, grok, grok-4.7-latest, grok-latest, ~x-ai/grok-latest, grok-4.7, grok-4.7
Ailoot Ultra · OpenAI Chat POST /v1/chat/completions x-ai/grok-4.7
x-ai/grok-4.7grok-4.7x-ai/grok-4.7~x-ai/grok-latest
Úvod
Grok 4.7 je model spoločnosti xAI na vývoj programov a odbornú prácu so znalosťami. Podporuje text, obrázky, kontext 500 000 tokenov, volania funkcií a štruktúrované odpovede.
- Povolené vstupy
- Text
- Výsledky
- Text
Dostupné v Ailoot · vstupy a metódy
Ailoot Ultra · OpenAI Chat POST /v1/chat/completions
- Vstup
text- Výstup
text- Výstupný formát
- json alebo SSE
| Pole | Typ | Požiadavka | Hodnoty a limity | Predvolené |
|---|---|---|---|---|
Polemodel | Typstring | PožiadavkaPovinné | Hodnoty a limity x-ai/grok-4.7 | Predvolené— |
Polemessages | Typmessage[] | PožiadavkaPovinné | Hodnoty a limity Minimálny počet položiek: 1 | Predvolené— |
Polemessages[].role | Typstring | PožiadavkaPovinné | Hodnoty a limity Príklady: system, user, assistant, tool, function Podmienky: Tieto roly sú výslovne zastúpené typmi kompatibility v zdrojovom kóde; presný súbor rolí zostáva závislý od modelu. Závisí od modelu | Predvolené— |
Polemessages[].content | Typstring|content_part[]|null | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemessages[].tool_calls | Typtool_call[] | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemessages[].tool_call_id | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: role=tool; použite skutočne vrátené ID | Predvolené— |
Polemessages[].name | Typstring | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemessages[].reasoning_content | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: Posielajte späť skutočne vrátené uvažovanie, ak ho tento model používa | Predvolené— |
Polemessages[].reasoning_details | Typobject|array | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polemax_tokens | Typinteger | PožiadavkaVoliteľné | Hodnoty a limity Minimum: 1 Závisí od modelu | Predvolené— |
Polemax_completion_tokens | Typinteger | PožiadavkaVoliteľné | Hodnoty a limity Minimum: 1 Závisí od modelu | Predvolené— |
Polestream | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity | Predvolenéfalse |
Polestream_options.include_usage | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletemperature | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletop_p | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polestop | Typstring|string[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools | Typfunction_tool[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools[].type | Typstring | PožiadavkaVoliteľné | Hodnoty a limity function Závisí od modelu | Predvolené— |
Poletools[].function.name | Typstring | PožiadavkaPovinné | Hodnoty a limity Platí, keď: poskytnutý nástroj typu funkcia | Predvolené— |
Poletools[].function.description | Typstring | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poletools[].function.parameters | TypJSON_schema | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poletool_choice | Typstring|object | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleparallel_tool_calls | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleresponse_format | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polereasoning_effort | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polereasoning | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleservice_tier | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleinstructions | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Pole kompatibility | Predvolené— |
Polefunctions | Typfunction[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polefunction_call | Typstring|object | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleprompt_cache_options | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polemodalities | Typstring[] | PožiadavkaVoliteľné | Hodnoty a limity text | Predvolené— |
Poleprovider | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Podmienky: provider.options sa na tejto textovej trase Ultra odmieta | Predvolené— |
Polecache_control.ttl | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Podmienky: Hodnota 1h sa v skutočne používaných poliach cache promptov odmieta | Predvolené— |
Kombinácie vstupných podkladov
Text · Text UTF8
messages[].content
Parametre a životný cyklus metódy
| Parameter | Špecifikácia |
|---|---|
Parametercontent_type | Špecifikáciaapplication/json |
Parameterrequired | Špecifikáciamodel, messages |
Parametermaterial_types | Špecifikáciatext |
Parametermessages | Špecifikáciapole správ so štruktúrou role/content |
Parameterfile_material | Špecifikáciaskutočný dokument UTF-8 vložený ako doslovný text; ID súboru sa neodvodzuje |
Parameteroptional_controls | Špecifikáciastream, temperature, top_p, stop, max_tokens, max_completion_tokens, reasoning, response_format, tools, tool_choice |
Parametercontrol_scope | Špecifikáciazávisí od modelu; používateľské nástroje typu funkcia sa líšia od nástrojov prevádzkovaných službou |
Parameteroutput_modalities | Špecifikáciatext |
Parameterhosted_operations | Špecifikáciafalse |
Parametermultimodal_input_binding | Špecifikácianull |
Životný cyklus: synchronous_or_streamed
Pošlite presné ID modelu spolu s messages.
Dĺžka kontextu nie je horná hranica výstupu.
Textový súbor môže poskytnúť doslovný text; obrazové a zvukové vstupy a vstupy so súborovými objektmi potrebujú presné naviazanie.
Cenník
Tarifné údaje nepridávajú možnosti požiadavky. Podporované parametre sú uvedené pri vybranej metóde.
- Rýchly režim
- Štandardná sadzba Keď je zvolený rýchly režim
- Režim Flex
- Štandardná sadzba Keď je zvolený režim flex
- Maximálna úroveň uvažovania
- Štandardná sadzba Keď sa pri maximálnej úrovni uvažovania používa predvolená úprava (default)
- Úroveň uvažovania · vysoká
- Štandardná sadzba Keď je úroveň uvažovania vysoká
- Úroveň uvažovania · nízka
- Štandardná sadzba Keď je úroveň uvažovania nízka
- Úroveň uvažovania · stredná
- Štandardná sadzba Keď je úroveň uvažovania stredná
- Úroveň uvažovania · xhigh
- Štandardná sadzba Keď je úroveň uvažovania xhigh
Sadzby Ailoot
Ceny podľa konfigurácie
Každý poplatok priraďte k zobrazeným podmienkam. Pre každú skupinu alternatívnych konfigurácií použite jednu sadzbu.
| Konfigurácia | Sadzobník | Počet tokenov kontextu väčší než | Tokeny kontextu, najviac (vrátane hranice) | Poplatok |
|---|---|---|---|---|
| KonfiguráciaZákladné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaPásmo dĺžky požiadavky 1 | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaPásmo dĺžky požiadavky 2 | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
Ailoot pred požiadavkou rezervuje odhadovanú sumu. Po získaní výsledku vyúčtuje konečný poplatok podľa nameraného využitia. Pri streamovaní sa vyúčtovanie riadi konečným záznamom využitia. Ako funguje rezervácia a vyúčtovanie →
Príklady požiadaviek
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.7", "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.7',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.7',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")
Prijať a uložiť výsledky
Ailoot Ultra · OpenAI Chat
json alebo SSE
Uchovať všetky dokončené výsledky
Uložte každú úplnú vrátenú odpoveď, súbor a časť obsahu.
Zachovajte každý variant odpovede a jeho obsah, volania nástrojov a uvažovanie. V SSE zostavujte čiastkové zmeny podľa indexu variantu/nástroja a zachovajte konečný dôvod ukončenia aj údaje o spotrebe.
Ak treba overiť pôvodnú odpoveď
Zachovajte ID požiadaviek/odpovedí aj hlavičky. Všeobecná URL na načítanie textovej úlohy nie je poskytnutá.
Polia odpovede
| Pole | Typ |
|---|---|
Polechoices[].index | Typinteger |
Polechoices[].message.content | Typstring|null |
Polechoices[].message.tool_calls | Typtool_call[] |
Polechoices[].message.reasoning_content | Typstring |
Polechoices[].message.reasoning_details | Typobject|array |
Polechoices[].finish_reason | Typstring|null |
Poleusage | Typobject |
Chyby a ďalšie kroky
| Odpoveď | Podmienka | Ďalší krok |
|---|---|---|
Odpoveď400 · invalid_request_error | PodmienkaNeplatné povinné polia, reprezentácia materiálu alebo hodnota parametra | Ďalší krokPred novou požiadavkou na vytvorenie opravte uvedené polia. |
Aliasy
Aliasy modelov
Ailoot grok-4.7, grok, grok-4.7-latest, grok-latest
Ailoot Ultra grok-4.7, x-ai/grok-4.7, ~x-ai/grok-latest
Aliasy ciest metód
/chat/completions
Súvisiace ID na volanie
x-ai/grok-4.7, grok, grok-4.7-latest, grok-latest, ~x-ai/grok-latest, grok-4.7, grok-4.7
Ailoot Ultra · Anthropic Messages POST /v1/messages x-ai/grok-4.7
x-ai/grok-4.7grok-4.7x-ai/grok-4.7~x-ai/grok-latest
Úvod
Grok 4.7 je model spoločnosti xAI na vývoj programov a odbornú prácu so znalosťami. Podporuje text, obrázky, kontext 500 000 tokenov, volania funkcií a štruktúrované odpovede.
- Povolené vstupy
- Text
- Výsledky
- json · sse
Dostupné v Ailoot · vstupy a metódy
Ailoot Ultra · Anthropic Messages POST /v1/messages
- Vstup
text- Výstup
json,sse- Výstupný formát
- JSON alebo SSE
| Pole | Typ | Požiadavka | Hodnoty a limity | Predvolené |
|---|---|---|---|---|
Polemodel | Typstring | PožiadavkaPovinné | Hodnoty a limity x-ai/grok-4.7 | Predvolené— |
Polemessages | Typmessage[] | PožiadavkaPovinné | Hodnoty a limity | Predvolené— |
Polemessages[].role | Typstring | PožiadavkaPovinné | Hodnoty a limity user, assistant | Predvolené— |
Polemessages[].content | Typstring | PožiadavkaPovinné | Hodnoty a limity | Predvolené— |
Polemax_tokens | Typinteger | PožiadavkaPovinné | Hodnoty a limity | Predvolené— |
Polestream | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity | Predvolenéfalse |
Kombinácie vstupných podkladov
Text · Text UTF-8
reťazec messages[].content
Parametre a životný cyklus metódy
| Parameter | Špecifikácia |
|---|---|
Parametercontent_type | Špecifikáciaapplication/json |
Parameterrequired | Špecifikáciamodel, messages, max_tokens |
Parameteroptional_controls | Špecifikáciastream |
Parametermaterial_types | Špecifikáciatext |
Parametertext_file_material | ŠpecifikáciaPrečítajte skutočný dokument UTF-8 a vložte jeho text do uvedeného vstupného reťazca alebo reťazca obsahu správy. |
Životný cyklus: synchronous_or_streamed
Cenník
Tarifné údaje nepridávajú možnosti požiadavky. Podporované parametre sú uvedené pri vybranej metóde.
- Rýchly režim
- Štandardná sadzba Keď je zvolený rýchly režim
- Režim Flex
- Štandardná sadzba Keď je zvolený režim flex
- Maximálna úroveň uvažovania
- Štandardná sadzba Keď sa pri maximálnej úrovni uvažovania používa predvolená úprava (default)
- Úroveň uvažovania · vysoká
- Štandardná sadzba Keď je úroveň uvažovania vysoká
- Úroveň uvažovania · nízka
- Štandardná sadzba Keď je úroveň uvažovania nízka
- Úroveň uvažovania · stredná
- Štandardná sadzba Keď je úroveň uvažovania stredná
- Úroveň uvažovania · xhigh
- Štandardná sadzba Keď je úroveň uvažovania xhigh
Sadzby Ailoot
Ceny podľa konfigurácie
Každý poplatok priraďte k zobrazeným podmienkam. Pre každú skupinu alternatívnych konfigurácií použite jednu sadzbu.
| Konfigurácia | Sadzobník | Počet tokenov kontextu väčší než | Tokeny kontextu, najviac (vrátane hranice) | Poplatok |
|---|---|---|---|---|
| KonfiguráciaZákladné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaPásmo dĺžky požiadavky 1 | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaPásmo dĺžky požiadavky 2 | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
Ailoot pred požiadavkou rezervuje odhadovanú sumu. Po získaní výsledku vyúčtuje konečný poplatok podľa nameraného využitia. Pri streamovaní sa vyúčtovanie riadi konečným záznamom využitia. Ako funguje rezervácia a vyúčtovanie →
Príklady požiadaviek
Ailoot Ultra · Anthropic Messages
{
"model": "x-ai/grok-4.7",
"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.7', '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.7', '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))
Prijať a uložiť výsledky
Ailoot Ultra · Anthropic Messages
JSON alebo SSE
Uchovať všetky dokončené výsledky
Uložte každú úplnú vrátenú odpoveď, súbor a časť obsahu.
Zachovajte všetky bloky obsahu, podpisy uvažovania a skutočné ID volaní nástrojov. Zostavte všetky čiastkové zmeny blokov SSE; prvý textový blok nie je celý výstup.
Ak treba overiť pôvodnú odpoveď
Zachovajte ID požiadaviek/odpovedí aj hlavičky. Všeobecná URL na načítanie textovej úlohy nie je poskytnutá.
Polia odpovede
| Pole | Typ |
|---|---|
Poleid | Typstring |
Polemodel | Typstring |
Polecontent[] | Typtext|thinking|tool_use|other content block |
Polestop_reason | Typstring|null |
Poleusage | Typobject |
Chyby a ďalšie kroky
| Odpoveď | Podmienka | Ďalší krok |
|---|---|---|
Odpoveď400 · invalid_request_error | PodmienkaNeplatné povinné polia, reprezentácia materiálu alebo hodnota parametra | Ďalší krokPred novou požiadavkou na vytvorenie opravte uvedené polia. |
Aliasy
Aliasy modelov
Ailoot grok-4.7, grok, grok-4.7-latest, grok-latest
Ailoot Ultra grok-4.7, x-ai/grok-4.7, ~x-ai/grok-latest
Aliasy ciest metód
/chat/completions
Súvisiace ID na volanie
x-ai/grok-4.7, grok, grok-4.7-latest, grok-latest, ~x-ai/grok-latest, grok-4.7, grok-4.7
Ailoot Ultra · OpenAI Chat POST /v1/chat/completions ~x-ai/grok-latest
~x-ai/grok-latestgrok-4.7x-ai/grok-4.7~x-ai/grok-latest
Úvod
Grok 4.7 je model spoločnosti xAI na vývoj programov a odbornú prácu so znalosťami. Podporuje text, obrázky, kontext 500 000 tokenov, volania funkcií a štruktúrované odpovede.
- Povolené vstupy
- Text
- Výsledky
- Text
Dostupné v Ailoot · vstupy a metódy
Ailoot Ultra · OpenAI Chat POST /v1/chat/completions
- Vstup
text- Výstup
text- Výstupný formát
- json alebo SSE
| Pole | Typ | Požiadavka | Hodnoty a limity | Predvolené |
|---|---|---|---|---|
Polemodel | Typstring | PožiadavkaPovinné | Hodnoty a limity ~x-ai/grok-latest | Predvolené— |
Polemessages | Typmessage[] | PožiadavkaPovinné | Hodnoty a limity Minimálny počet položiek: 1 | Predvolené— |
Polemessages[].role | Typstring | PožiadavkaPovinné | Hodnoty a limity Príklady: system, user, assistant, tool, function Podmienky: Tieto roly sú výslovne zastúpené typmi kompatibility v zdrojovom kóde; presný súbor rolí zostáva závislý od modelu. Závisí od modelu | Predvolené— |
Polemessages[].content | Typstring|content_part[]|null | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemessages[].tool_calls | Typtool_call[] | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemessages[].tool_call_id | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: role=tool; použite skutočne vrátené ID | Predvolené— |
Polemessages[].name | Typstring | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Polemessages[].reasoning_content | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Platí, keď: Posielajte späť skutočne vrátené uvažovanie, ak ho tento model používa | Predvolené— |
Polemessages[].reasoning_details | Typobject|array | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polemax_tokens | Typinteger | PožiadavkaVoliteľné | Hodnoty a limity Minimum: 1 Závisí od modelu | Predvolené— |
Polemax_completion_tokens | Typinteger | PožiadavkaVoliteľné | Hodnoty a limity Minimum: 1 Závisí od modelu | Predvolené— |
Polestream | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity | Predvolenéfalse |
Polestream_options.include_usage | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletemperature | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletop_p | Typnumber | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polestop | Typstring|string[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools | Typfunction_tool[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poletools[].type | Typstring | PožiadavkaVoliteľné | Hodnoty a limity function Závisí od modelu | Predvolené— |
Poletools[].function.name | Typstring | PožiadavkaPovinné | Hodnoty a limity Platí, keď: poskytnutý nástroj typu funkcia | Predvolené— |
Poletools[].function.description | Typstring | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poletools[].function.parameters | TypJSON_schema | PožiadavkaVoliteľné | Hodnoty a limity | Predvolené— |
Poletool_choice | Typstring|object | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleparallel_tool_calls | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleresponse_format | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polereasoning_effort | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polereasoning | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleservice_tier | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleinstructions | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Pole kompatibility | Predvolené— |
Polefunctions | Typfunction[] | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polefunction_call | Typstring|object | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Poleprompt_cache_options | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Závisí od modelu | Predvolené— |
Polemodalities | Typstring[] | PožiadavkaVoliteľné | Hodnoty a limity text | Predvolené— |
Poleprovider | Typobject | PožiadavkaVoliteľné | Hodnoty a limity Podmienky: provider.options sa na tejto textovej trase Ultra odmieta | Predvolené— |
Polecache_control.ttl | Typstring | PožiadavkaVoliteľné | Hodnoty a limity Podmienky: Hodnota 1h sa v skutočne používaných poliach cache promptov odmieta | Predvolené— |
Kombinácie vstupných podkladov
Text · Text UTF8
messages[].content
Parametre a životný cyklus metódy
| Parameter | Špecifikácia |
|---|---|
Parametercontent_type | Špecifikáciaapplication/json |
Parameterrequired | Špecifikáciamodel, messages |
Parametermaterial_types | Špecifikáciatext |
Parametermessages | Špecifikáciapole správ so štruktúrou role/content |
Parameterfile_material | Špecifikáciaskutočný dokument UTF-8 vložený ako doslovný text; ID súboru sa neodvodzuje |
Parameteroptional_controls | Špecifikáciastream, temperature, top_p, stop, max_tokens, max_completion_tokens, reasoning, response_format, tools, tool_choice |
Parametercontrol_scope | Špecifikáciazávisí od modelu; používateľské nástroje typu funkcia sa líšia od nástrojov prevádzkovaných službou |
Parameteroutput_modalities | Špecifikáciatext |
Parameterhosted_operations | Špecifikáciafalse |
Parametermultimodal_input_binding | Špecifikácianull |
Životný cyklus: synchronous_or_streamed
Pošlite presné ID modelu spolu s messages.
Dĺžka kontextu nie je horná hranica výstupu.
Textový súbor môže poskytnúť doslovný text; obrazové a zvukové vstupy a vstupy so súborovými objektmi potrebujú presné naviazanie.
Cenník
Tarifné údaje nepridávajú možnosti požiadavky. Podporované parametre sú uvedené pri vybranej metóde.
- Rýchly režim
- Štandardná sadzba Keď je zvolený rýchly režim
- Režim Flex
- Štandardná sadzba Keď je zvolený režim flex
- Maximálna úroveň uvažovania
- Štandardná sadzba Keď sa pri maximálnej úrovni uvažovania používa predvolená úprava (default)
- Úroveň uvažovania · vysoká
- Štandardná sadzba Keď je úroveň uvažovania vysoká
- Úroveň uvažovania · nízka
- Štandardná sadzba Keď je úroveň uvažovania nízka
- Úroveň uvažovania · stredná
- Štandardná sadzba Keď je úroveň uvažovania stredná
- Úroveň uvažovania · xhigh
- Štandardná sadzba Keď je úroveň uvažovania xhigh
Sadzby Ailoot
Ceny podľa konfigurácie
Každý poplatok priraďte k zobrazeným podmienkam. Pre každú skupinu alternatívnych konfigurácií použite jednu sadzbu.
| Konfigurácia | Sadzobník | Počet tokenov kontextu väčší než | Tokeny kontextu, najviac (vrátane hranice) | Poplatok |
|---|---|---|---|---|
| KonfiguráciaZákladné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaPásmo dĺžky požiadavky 1 | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaPásmo dĺžky požiadavky 2 | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
Ailoot pred požiadavkou rezervuje odhadovanú sumu. Po získaní výsledku vyúčtuje konečný poplatok podľa nameraného využitia. Pri streamovaní sa vyúčtovanie riadi konečným záznamom využitia. Ako funguje rezervácia a vyúčtovanie →
Príklady požiadaviek
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-latest", "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-latest',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-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")
Prijať a uložiť výsledky
Ailoot Ultra · OpenAI Chat
json alebo SSE
Uchovať všetky dokončené výsledky
Uložte každú úplnú vrátenú odpoveď, súbor a časť obsahu.
Zachovajte každý variant odpovede a jeho obsah, volania nástrojov a uvažovanie. V SSE zostavujte čiastkové zmeny podľa indexu variantu/nástroja a zachovajte konečný dôvod ukončenia aj údaje o spotrebe.
Ak treba overiť pôvodnú odpoveď
Zachovajte ID požiadaviek/odpovedí aj hlavičky. Všeobecná URL na načítanie textovej úlohy nie je poskytnutá.
Polia odpovede
| Pole | Typ |
|---|---|
Polechoices[].index | Typinteger |
Polechoices[].message.content | Typstring|null |
Polechoices[].message.tool_calls | Typtool_call[] |
Polechoices[].message.reasoning_content | Typstring |
Polechoices[].message.reasoning_details | Typobject|array |
Polechoices[].finish_reason | Typstring|null |
Poleusage | Typobject |
Chyby a ďalšie kroky
| Odpoveď | Podmienka | Ďalší krok |
|---|---|---|
Odpoveď400 · invalid_request_error | PodmienkaNeplatné povinné polia, reprezentácia materiálu alebo hodnota parametra | Ďalší krokPred novou požiadavkou na vytvorenie opravte uvedené polia. |
Aliasy
Aliasy modelov
Ailoot grok-4.7, grok, grok-4.7-latest, grok-latest
Ailoot Ultra grok-4.7, x-ai/grok-4.7, ~x-ai/grok-latest
Aliasy ciest metód
/chat/completions
Súvisiace ID na volanie
x-ai/grok-4.7, grok, grok-4.7-latest, grok-latest, ~x-ai/grok-latest, grok-4.7, grok-4.7
Ailoot Ultra · Anthropic Messages POST /v1/messages ~x-ai/grok-latest
~x-ai/grok-latestgrok-4.7x-ai/grok-4.7~x-ai/grok-latest
Úvod
Grok 4.7 je model spoločnosti xAI na vývoj programov a odbornú prácu so znalosťami. Podporuje text, obrázky, kontext 500 000 tokenov, volania funkcií a štruktúrované odpovede.
- Povolené vstupy
- Text
- Výsledky
- json · sse
Dostupné v Ailoot · vstupy a metódy
Ailoot Ultra · Anthropic Messages POST /v1/messages
- Vstup
text- Výstup
json,sse- Výstupný formát
- JSON alebo SSE
| Pole | Typ | Požiadavka | Hodnoty a limity | Predvolené |
|---|---|---|---|---|
Polemodel | Typstring | PožiadavkaPovinné | Hodnoty a limity ~x-ai/grok-latest | Predvolené— |
Polemessages | Typmessage[] | PožiadavkaPovinné | Hodnoty a limity | Predvolené— |
Polemessages[].role | Typstring | PožiadavkaPovinné | Hodnoty a limity user, assistant | Predvolené— |
Polemessages[].content | Typstring | PožiadavkaPovinné | Hodnoty a limity | Predvolené— |
Polemax_tokens | Typinteger | PožiadavkaPovinné | Hodnoty a limity | Predvolené— |
Polestream | Typboolean | PožiadavkaVoliteľné | Hodnoty a limity | Predvolenéfalse |
Kombinácie vstupných podkladov
Text · Text UTF-8
reťazec messages[].content
Parametre a životný cyklus metódy
| Parameter | Špecifikácia |
|---|---|
Parametercontent_type | Špecifikáciaapplication/json |
Parameterrequired | Špecifikáciamodel, messages, max_tokens |
Parameteroptional_controls | Špecifikáciastream |
Parametermaterial_types | Špecifikáciatext |
Parametertext_file_material | ŠpecifikáciaPrečítajte skutočný dokument UTF-8 a vložte jeho text do uvedeného vstupného reťazca alebo reťazca obsahu správy. |
Životný cyklus: synchronous_or_streamed
Cenník
Tarifné údaje nepridávajú možnosti požiadavky. Podporované parametre sú uvedené pri vybranej metóde.
- Rýchly režim
- Štandardná sadzba Keď je zvolený rýchly režim
- Režim Flex
- Štandardná sadzba Keď je zvolený režim flex
- Maximálna úroveň uvažovania
- Štandardná sadzba Keď sa pri maximálnej úrovni uvažovania používa predvolená úprava (default)
- Úroveň uvažovania · vysoká
- Štandardná sadzba Keď je úroveň uvažovania vysoká
- Úroveň uvažovania · nízka
- Štandardná sadzba Keď je úroveň uvažovania nízka
- Úroveň uvažovania · stredná
- Štandardná sadzba Keď je úroveň uvažovania stredná
- Úroveň uvažovania · xhigh
- Štandardná sadzba Keď je úroveň uvažovania xhigh
Sadzby Ailoot
Ceny podľa konfigurácie
Každý poplatok priraďte k zobrazeným podmienkam. Pre každú skupinu alternatívnych konfigurácií použite jednu sadzbu.
| Konfigurácia | Sadzobník | Počet tokenov kontextu väčší než | Tokeny kontextu, najviac (vrátane hranice) | Poplatok |
|---|---|---|---|---|
| KonfiguráciaZákladné sadzby za tokeny | SadzobníkZákladná sadzba | Počet tokenov kontextu väčší než— | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaPásmo dĺžky požiadavky 1 | Sadzobník— | Počet tokenov kontextu väčší než0 | Tokeny kontextu, najviac (vrátane hranice)200 000 | Poplatok Vstup · Vstupné tokeny $0.004 / 1K tokenov Výstup · Výstupné tokeny $0.012 / 1K tokenov Vstup · Čítanie cache $0.001 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
| KonfiguráciaPásmo dĺžky požiadavky 2 | Sadzobník— | Počet tokenov kontextu väčší než200 000 | Tokeny kontextu, najviac (vrátane hranice)Bez hornej hranice | Poplatok Vstup · Vstupné tokeny $0.008 / 1K tokenov Výstup · Výstupné tokeny $0.024 / 1K tokenov Vstup · Čítanie cache $0.002 / 1K tokenov Vstup · Zápis do cache — / 1K tokenov Vstup · Zápis do cache, 1 hod — / 1K tokenov |
Ailoot pred požiadavkou rezervuje odhadovanú sumu. Po získaní výsledku vyúčtuje konečný poplatok podľa nameraného využitia. Pri streamovaní sa vyúčtovanie riadi konečným záznamom využitia. Ako funguje rezervácia a vyúčtovanie →
Príklady požiadaviek
Ailoot Ultra · Anthropic Messages
{
"model": "~x-ai/grok-latest",
"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-latest', '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-latest', '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))
Prijať a uložiť výsledky
Ailoot Ultra · Anthropic Messages
JSON alebo SSE
Uchovať všetky dokončené výsledky
Uložte každú úplnú vrátenú odpoveď, súbor a časť obsahu.
Zachovajte všetky bloky obsahu, podpisy uvažovania a skutočné ID volaní nástrojov. Zostavte všetky čiastkové zmeny blokov SSE; prvý textový blok nie je celý výstup.
Ak treba overiť pôvodnú odpoveď
Zachovajte ID požiadaviek/odpovedí aj hlavičky. Všeobecná URL na načítanie textovej úlohy nie je poskytnutá.
Polia odpovede
| Pole | Typ |
|---|---|
Poleid | Typstring |
Polemodel | Typstring |
Polecontent[] | Typtext|thinking|tool_use|other content block |
Polestop_reason | Typstring|null |
Poleusage | Typobject |
Chyby a ďalšie kroky
| Odpoveď | Podmienka | Ďalší krok |
|---|---|---|
Odpoveď400 · invalid_request_error | PodmienkaNeplatné povinné polia, reprezentácia materiálu alebo hodnota parametra | Ďalší krokPred novou požiadavkou na vytvorenie opravte uvedené polia. |
Aliasy
Aliasy modelov
Ailoot grok-4.7, grok, grok-4.7-latest, grok-latest
Ailoot Ultra grok-4.7, x-ai/grok-4.7, ~x-ai/grok-latest
Aliasy ciest metód
/chat/completions
Súvisiace ID na volanie
x-ai/grok-4.7, grok, grok-4.7-latest, grok-latest, ~x-ai/grok-latest, grok-4.7, grok-4.7
FAQ · SpaceXAI: Grok 4.7
- Aké vstupy a výsledky sú dostupné?
POST /v1/messages·grok-4.7:text,image→textPOST /v1/responses·grok-4.7:text,image→textPOST /v1/chat/completions·grok-4.7:text,image→textPOST /v1/chat/completions·grok-4.7:text→textPOST /v1/messages·grok-4.7:text→json,ssePOST /v1/messages·grok:text,image→textPOST /v1/responses·grok:text,image→textPOST /v1/chat/completions·grok:text,image→textPOST /v1/messages·grok-4.7-latest:text,image→textPOST /v1/responses·grok-4.7-latest:text,image→textPOST /v1/chat/completions·grok-4.7-latest:text,image→textPOST /v1/messages·grok-latest:text,image→textPOST /v1/responses·grok-latest:text,image→textPOST /v1/chat/completions·grok-latest:text,image→textPOST /v1/chat/completions·x-ai/grok-4.7:text→textPOST /v1/messages·x-ai/grok-4.7:text→json,ssePOST /v1/chat/completions·~x-ai/grok-latest:text→textPOST /v1/messages·~x-ai/grok-latest:text→json,sse- Aké polia používa požiadavka?
POST /v1/messages·grok-4.7:model,messages,system,max_tokens,stream,metadataPOST /v1/responses·grok-4.7:model,input,instructions,streamPOST /v1/chat/completions·grok-4.7:model,messages,streamPOST /v1/chat/completions·grok-4.7:model,messages,streamPOST /v1/messages·grok-4.7:model,messages,max_tokens,streamPOST /v1/messages·grok:model,messages,system,max_tokens,stream,metadataPOST /v1/responses·grok:model,input,instructions,streamPOST /v1/chat/completions·grok:model,messages,streamPOST /v1/messages·grok-4.7-latest:model,messages,system,max_tokens,stream,metadataPOST /v1/responses·grok-4.7-latest:model,input,instructions,streamPOST /v1/chat/completions·grok-4.7-latest:model,messages,streamPOST /v1/messages·grok-latest:model,messages,system,max_tokens,stream,metadataPOST /v1/responses·grok-latest:model,input,instructions,streamPOST /v1/chat/completions·grok-latest:model,messages,streamPOST /v1/chat/completions·x-ai/grok-4.7:model,messages,stream,modalities,providerPOST /v1/messages·x-ai/grok-4.7:model,messages,max_tokens,streamPOST /v1/chat/completions·~x-ai/grok-latest:model,messages,stream,modalities,providerPOST /v1/messages·~x-ai/grok-latest:model,messages,max_tokens,stream- Aké limity platia?
POST /v1/messages·grok-4.7:ctx:500000;max_out:500000;messages.min_items:1;max_tokens.minimum:1POST /v1/responses·grok-4.7:ctx:500000;max_out:500000POST /v1/chat/completions·grok-4.7:ctx:500000;max_out:500000;messages.min_items:1POST /v1/chat/completions·grok-4.7:messages.min_items:1POST /v1/messages·grok:ctx:500000;max_out:500000;messages.min_items:1;max_tokens.minimum:1POST /v1/responses·grok:ctx:500000;max_out:500000POST /v1/chat/completions·grok:ctx:500000;max_out:500000;messages.min_items:1POST /v1/messages·grok-4.7-latest:ctx:500000;max_out:500000;messages.min_items:1;max_tokens.minimum:1POST /v1/responses·grok-4.7-latest:ctx:500000;max_out:500000POST /v1/chat/completions·grok-4.7-latest:ctx:500000;max_out:500000;messages.min_items:1POST /v1/messages·grok-latest:ctx:500000;max_out:500000;messages.min_items:1;max_tokens.minimum:1POST /v1/responses·grok-latest:ctx:500000;max_out:500000POST /v1/chat/completions·grok-latest:ctx:500000;max_out:500000;messages.min_items:1POST /v1/chat/completions·x-ai/grok-4.7:messages.min_items:1POST /v1/chat/completions·~x-ai/grok-latest:messages.min_items:1