modeller

grok-4.7-build-fast

Markdown · JSON

grok-4.7-build-fast

Grok 4.7 Build Fast är en namngiven text- och bildprofil för att omvandla tillhandahållet material till ett skriftligt svar, en analys eller en föreslagen kodändring.

Om modellen

Den här beskrivningen omfattar modellens förmågor. Tillgängliga indata, utdata och alternativ i Ailoot anges nedan för den valda metoden.

Grok 4.7 Build Fast tar emot text- och bildmaterial och producerar text. Profilen anger en kontext på 500 000 token, vilket gör att en uppgift kan struktureras kring omfattande tillhandahållet material.

Definiera den skriftliga leveransen

För en kodfråga inkluderar du de relevanta filerna, felmeddelandet och det förväntade beteendet. För en visuell fråga tillhandahåller du en läsbar bild och identifierar detaljerna som ska granskas. För en dokumentanalys märker du källavsnitten och anger jämförelsekriterierna.

Begär resultatet i en form som går att granska: en föreslagen patch, en lista över iakttagelser, en strukturerad sammanfattning eller en förklaring knuten till beläggen. Behåll den exakta Build Fast-identiteten tillsammans med begäran och svaret när du jämför namngivna Grok-profiler.

Praktisk uppgift

Praktisk uppgift

Tekniskt exempel på engelska

Review a discount boundary

Review this JavaScript function: function discount(qty) { return qty > 10 ? 0.1 : 0; }. Requirement: orders of ten or more receive a ten-percent discount. Give a minimal proposed patch, the affected boundary and assertions for quantities 9, 10 and 11. Preserve the numeric return format.

Förväntat resultat

A focused JavaScript patch, boundary explanation and three assertions.

Kontrollera resultatet

The patch must change quantity 10 without changing 9 or 11 behavior.
Ailoot · Anthropic Messages POST /v1/messages grok-4.7-build-fast

grok-4.7-build-fast

xAI /grok-4.7-build-fast

Start

Grok 4.7 Build Fast är en namngiven text- och bildprofil för att omvandla tillhandahållet material till ett skriftligt svar, en analys eller en föreslagen kodändring.

Godkända indata
Text · Bilder
Resultat
Text

Tillgängligt i Ailoot · indata & metoder

Ailoot · Anthropic Messages POST /v1/messages
Indatatyper
text, image
Utdatatyper
text
Kontext
500 000 tokens
Maximala utdata
500 000 tokens
Utdataformat
json eller SSE
FältTypKravVärden & gränserStandard
FältmodelTypstringKravObligatorisktVärden & gränser
grok-4.7-build-fast
Standard—
FältmessagesTypmessage[]KravObligatorisktVärden & gränser
Minsta antal objekt: 1
Standard—
Fältmessages[].roleTypstringKravObligatorisktVärden & gränser
user, assistant
Standard—
Fältmessages[].contentTypstring|content_block[]KravObligatorisktVärden & gränserStandard—
FältsystemTypstring|content_block[]KravValfrittVärden & gränserStandard—
Fältmax_tokensTypintegerKravObligatorisktVärden & gränser
Minimum: 1
Gränsen gäller för: den exakta gränsen för den valda modellen/det valda kortet
Standard—
FältstreamTypbooleanKravValfrittVärden & gränserStandardfalse
FälttemperatureTypnumberKravValfrittVärden & gränser
Beror på modellen
Standard—
Fälttop_pTypnumberKravValfrittVärden & gränser
Beror på modellen
Standard—
Fältstop_sequencesTypstring[]KravValfrittVärden & gränser
Beror på modellen
Standard—
FälttoolsTyptool[]KravValfrittVärden & gränser
Beror på modellen
Standard—
Fälttools[].nameTypstringKravValfrittVärden & gränser
Gäller när: verktyg har tillhandahållits
Standard—
Fälttools[].descriptionTypstringKravValfrittVärden & gränserStandard—
Fälttools[].input_schemaTypJSON_schemaKravValfrittVärden & gränserStandard—
Fälttool_choiceTypobjectKravValfrittVärden & gränser
Beror på modellen
Standard—
Fältthinking.typeTypstringKravValfrittVärden & gränser
Beror på modellen
Standard—
Fältthinking.budget_tokensTypintegerKravValfrittVärden & gränser
Beror på modellen
Standard—
Fältoutput_config.effortTypstringKravValfrittVärden & gränser
Beror på modellen
Standard—
FältmetadataTypobjectKravValfrittVärden & gränserStandard—
Fältcache_controlTypobjectKravValfrittVärden & gränser
Beror på modellen
Standard—
Kombinationer av indatamaterial

Text · UTF8-text

messages[].content eller ett type=text-block

Text + bild

{type:image,source:{type:base64,media_type,data}} eller källa type=url

Metodparametrar och livscykel
ParameterAvtal
Parametermaterial_typesAvtaltext, image
ParameterrequiredAvtalmodel, messages, max_tokens
Parameteroptional_controlsAvtalnull
Parametercontent_typeAvtalapplication/json
Parametertext_file_materialAvtalfaktiskt UTF-8-innehåll infogat som text; fil-ID:n/URLs kräver separat, exakt definierat stöd

Livscykel: exact retained published method

Metodernas strukturer och ID:n är exakta; leverantörens funktioner är åtskilda från att begäran tillåts.

Priser

Priser för Ailoot-metoder

Ailoot Anthropic MessagesPOST /v1/messages
Indata
0,004 US$ / 1K
Utdata
0,012 US$ / 1K
Cacheläsning
0,001 US$ / 1K
Skrivning till cache
0,00 US$ / 1K
Skrivning till cache, 5 min
0,00 US$ / 1K tokens
Skrivning till cache, 1 tim
0,00 US$ / 1K tokens

Priser efter begärans längd · Anthropic Messages

Begärans storlek i tokenIndataUtdataCacheläsningSkrivning till cacheCache 5 minCache 1 tim
Begärans storlek i token(0; 200 000]Indata0,004 US$Utdata0,012 US$Cacheläsning0,001 US$Skrivning till cache0,00 US$Cache 5 min0,00 US$Cache 1 tim0,00 US$
Begärans storlek i token(200 000; ∞)Indata0,006 US$Utdata0,018 US$Cacheläsning0,0015 US$Skrivning till cache0,00 US$Cache 5 min0,00 US$Cache 1 tim0,00 US$

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

Ailoot reserverar ett uppskattat belopp före en begäran. Efter resultatet slutregleras avgiften utifrån uppmätt förbrukning. Slutreglering för strömning använder den slutliga förbrukningsposten. Så fungerar reservation och slutreglering →

Exempelbegäranden

Ailoot · Anthropic Messages

TextexempelIndata, bildPython SDKNode.js SDKPython-strömning
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-build-fast", "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-build-fast", "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-build-fast",
    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-build-fast",
  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-build-fast',max_tokens=1024,messages=[{"role":"user","content":"Explain observations and hypotheses in three sentences."}]) as stream:
    with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
        for event in stream:
            payload=event.to_dict(mode="json")
            log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
            print(json.dumps(payload,ensure_ascii=False))
    final=stream.get_final_message()
    save_result(final.to_dict(mode="json"),"stream-result")

Ta emot och spara resultat

Ailoot · Anthropic Messages

json eller SSE

Behåll alla färdiga resultat

Behåll varje fullständigt returnerat svar, fil och innehållsdel.

Behåll alla innehållsblock, resonemangssignaturer och faktiska ID:n för verktygsanvändning. Sätt samman alla SSE-deltauppdateringar för blocken; ett första textblock är inte hela utdata.

Om det ursprungliga svaret behöver kontrolleras

Behåll begärans/svarets ID:n och huvuden. Ingen generell URL för hämtning av textjobb tillhandahålls.

Svarsfält
FältTyp
FältidTypstring
FältmodelTypstring
Fältcontent[]Typtext|thinking|tool_use|other content block
Fältstop_reasonTypstring|null
FältusageTypobject
Fel och nästa steg
SvarVillkorNästa steg
Svar400 · invalid_request_errorVillkorOgiltiga obligatoriska fält, ogiltig representation av underlaget eller ogiltigt parametervärdeNästa stegKorrigera de angivna fälten före en ny begäran om att skapa.

Alias

Modellalias

Ailoot grok-4.7-build-fast

Alias för metodsökvägar

Använd metodsökvägarna som visas ovan.

Relaterade anropar-ID:n

grok-4.7-build-fast

Ailoot · OpenAI Responses POST /v1/responses grok-4.7-build-fast

grok-4.7-build-fast

xAI /grok-4.7-build-fast

Start

Grok 4.7 Build Fast är en namngiven text- och bildprofil för att omvandla tillhandahållet material till ett skriftligt svar, en analys eller en föreslagen kodändring.

Godkända indata
Text · Bilder
Resultat
Text

Tillgängligt i Ailoot · indata & metoder

Ailoot · OpenAI Responses POST /v1/responses
Indatatyper
text, image
Utdatatyper
text
Kontext
500 000 tokens
Maximala utdata
500 000 tokens
Utdataformat
json eller SSE
FältTypKravVärden & gränserStandard
FältmodelTypstringKravObligatorisktVärden & gränser
grok-4.7-build-fast
Standard—
FältinputTypstring|input_item[]KravObligatorisktVärden & gränserStandard—
FältinstructionsTypstringKravValfrittVärden & gränserStandard—
Fältinput[].typeTypstringKravValfrittVärden & gränser
message, reasoning, function_call, function_call_output
Standard—
Fältinput[].contentTypstring|content_part[]KravValfrittVärden & gränserStandard—
Fältinput[].call_idTypstringKravValfrittVärden & gränser
Gäller när: function_call_output; behåll det faktiska returnerade call_id
Standard—
Fältinput[].outputTypstring|content_part[]KravValfrittVärden & gränser
Gäller när: function_call_output
Standard—
Fältmax_output_tokensTypintegerKravValfrittVärden & gränser
Minimum: 1
Beror på modellen
Standard—
FältstreamTypbooleanKravValfrittVärden & gränserStandardfalse
FälttemperatureTypnumberKravValfrittVärden & gränser
Beror på modellen
Standard—
Fälttop_pTypnumberKravValfrittVärden & gränser
Beror på modellen
Standard—
FälttoolsTyptool[]KravValfrittVärden & gränser
Beror på modellen
Standard—
Fälttool_choiceTypstring|objectKravValfrittVärden & gränser
Beror på modellen
Standard—
Fältparallel_tool_callsTypbooleanKravValfrittVärden & gränser
Beror på modellen
Standard—
Fältreasoning.effortTypstringKravValfrittVärden & gränser
Beror på modellen
Standard—
Fältreasoning.summaryTypstringKravValfrittVärden & gränser
Beror på modellen
Standard—
Fälttext.formatTypobjectKravValfrittVärden & gränser
Beror på modellen
Standard—
Fälttext.verbosityTypstringKravValfrittVärden & gränser
Beror på modellen
Standard—
FältincludeTypstring[]KravValfrittVärden & gränser
Beror på modellen
Standard—
FältstoreTypbooleanKravValfrittVärden & gränser
Beror på modellen
Standard—
Fältprevious_response_idTypstringKravValfrittVärden & gränser
ID-krav: Endast ett faktiskt svars-ID från en fortsättning som stöds
Beror på modellen
Standard—
Fältservice_tierTypstringKravValfrittVärden & gränser
Beror på modellen
Standard—
Fältprompt_cache_keyTypstringKravValfrittVärden & gränser
Beror på modellen
Standard—
Fältprompt_cache_optionsTypobjectKravValfrittVärden & gränser
Beror på modellen
Standard—
Kombinationer av indatamaterial

Text · UTF8-text

indatatext eller en input_text-del

Text + bild

{type:input_image,image_url}

Metodparametrar och livscykel
ParameterAvtal
Parametermaterial_typesAvtaltext, image
ParameterrequiredAvtalmodel, input
Parameteroptional_controlsAvtalnull
Parametercontent_typeAvtalapplication/json
Parametertext_file_materialAvtalfaktiskt UTF-8-innehåll infogat som text; fil-ID:n/URLs kräver separat, exakt definierat stöd

Livscykel: exact retained published method

Metodernas strukturer och ID:n är exakta; leverantörens funktioner är åtskilda från att begäran tillåts.

Priser

Priser för Ailoot-metoder

Ailoot OpenAI ResponsesPOST /v1/responses
Indata
0,004 US$ / 1K
Utdata
0,012 US$ / 1K
Cacheläsning
0,001 US$ / 1K
Skrivning till cache
0,00 US$ / 1K
Skrivning till cache, 5 min
0,00 US$ / 1K tokens
Skrivning till cache, 1 tim
0,00 US$ / 1K tokens

Priser efter begärans längd · OpenAI Responses

Begärans storlek i tokenIndataUtdataCacheläsningSkrivning till cacheCache 5 minCache 1 tim
Begärans storlek i token(0; 200 000]Indata0,004 US$Utdata0,012 US$Cacheläsning0,001 US$Skrivning till cache0,00 US$Cache 5 min0,00 US$Cache 1 tim0,00 US$
Begärans storlek i token(200 000; ∞)Indata0,006 US$Utdata0,018 US$Cacheläsning0,0015 US$Skrivning till cache0,00 US$Cache 5 min0,00 US$Cache 1 tim0,00 US$

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

Ailoot reserverar ett uppskattat belopp före en begäran. Efter resultatet slutregleras avgiften utifrån uppmätt förbrukning. Slutreglering för strömning använder den slutliga förbrukningsposten. Så fungerar reservation och slutreglering →

Exempelbegäranden

Ailoot · OpenAI Responses

TextexempelIndata, bildPython SDKNode.js SDKPython-strömning
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-build-fast", "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-build-fast", "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-build-fast", 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-build-fast", 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-build-fast", input="Explain the difference between an observation and a hypothesis in three sentences.") as stream:
    with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
        for event in stream:
            payload=event.to_dict(mode="json")
            log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
            print(json.dumps(payload,ensure_ascii=False))
    final=stream.get_final_response()
    save_result(final.to_dict(mode="json"),"stream-result")

Ta emot och spara resultat

Ailoot · OpenAI Responses

json eller SSE

Behåll alla färdiga resultat

Behåll varje fullständigt returnerat svar, fil och innehållsdel.

Behåll varje utdatapost och innehållsdel, det faktiska call_id för funktionen, krypterat resonemang och användningsuppgifter. Bevara vid strömning den fullständiga identiteten för händelsen/posten.

Om det ursprungliga svaret behöver kontrolleras

Behåll begärans/svarets ID:n och huvuden. Ingen generell URL för hämtning av textjobb tillhandahålls.

Svarsfält
FältTyp
FältidTypstring
FältstatusTypstring
Fältoutput[]Typmessage|reasoning|function_call|other item
Fältoutput[].content[]Typcontent part
FältusageTypobject
Fel och nästa steg
SvarVillkorNästa steg
Svar400 · invalid_request_errorVillkorOgiltiga obligatoriska fält, ogiltig representation av underlaget eller ogiltigt parametervärdeNästa stegKorrigera de angivna fälten före en ny begäran om att skapa.

Alias

Modellalias

Ailoot grok-4.7-build-fast

Alias för metodsökvägar

Använd metodsökvägarna som visas ovan.

Relaterade anropar-ID:n

grok-4.7-build-fast

Ailoot · OpenAI Chat POST /v1/chat/completions grok-4.7-build-fast

grok-4.7-build-fast

xAI /grok-4.7-build-fast

Start

Grok 4.7 Build Fast är en namngiven text- och bildprofil för att omvandla tillhandahållet material till ett skriftligt svar, en analys eller en föreslagen kodändring.

Godkända indata
Text · Bilder
Resultat
Text

Tillgängligt i Ailoot · indata & metoder

Ailoot · OpenAI Chat POST /v1/chat/completions
Indatatyper
text, image
Utdatatyper
text
Kontext
500 000 tokens
Maximala utdata
500 000 tokens
Utdataformat
json eller SSE
FältTypKravVärden & gränserStandard
FältmodelTypstringKravObligatorisktVärden & gränser
grok-4.7-build-fast
Standard—
FältmessagesTypmessage[]KravObligatorisktVärden & gränser
Minsta antal objekt: 1
Standard—
Fältmessages[].roleTypstringKravObligatorisktVärden & gränser
Exempel: system, user, assistant, tool, function
Villkor: Dessa roller representeras uttryckligen av källkodens kompatibilitetstyper; den exakta rolluppsättningen är fortfarande modellspecifik.
Beror på modellen
Standard—
Fältmessages[].contentTypstring|content_part[]|nullKravValfrittVärden & gränserStandard—
Fältmessages[].tool_callsTyptool_call[]KravValfrittVärden & gränserStandard—
Fältmessages[].tool_call_idTypstringKravValfrittVärden & gränser
Gäller när: role=tool; använd det faktiska returnerade ID:t
Standard—
Fältmessages[].nameTypstringKravValfrittVärden & gränserStandard—
Fältmessages[].reasoning_contentTypstringKravValfrittVärden & gränser
Gäller när: Skicka tillbaka det faktiska returnerade resonemanget när modellen använder det
Standard—
Fältmessages[].reasoning_detailsTypobject|arrayKravValfrittVärden & gränser
Beror på modellen
Standard—
Fältmax_tokensTypintegerKravValfrittVärden & gränser
Minimum: 1
Beror på modellen
Standard—
Fältmax_completion_tokensTypintegerKravValfrittVärden & gränser
Minimum: 1
Beror på modellen
Standard—
FältstreamTypbooleanKravValfrittVärden & gränserStandardfalse
Fältstream_options.include_usageTypbooleanKravValfrittVärden & gränser
Beror på modellen
Standard—
FälttemperatureTypnumberKravValfrittVärden & gränser
Beror på modellen
Standard—
Fälttop_pTypnumberKravValfrittVärden & gränser
Beror på modellen
Standard—
FältstopTypstring|string[]KravValfrittVärden & gränser
Beror på modellen
Standard—
FälttoolsTypfunction_tool[]KravValfrittVärden & gränser
Beror på modellen
Standard—
Fälttools[].typeTypstringKravValfrittVärden & gränser
Beror på modellen
Standard—
Fälttools[].function.nameTypstringKravObligatorisktVärden & gränser
Gäller när: verktyg av typen funktion har tillhandahållits
Standard—
Fälttools[].function.descriptionTypstringKravValfrittVärden & gränserStandard—
Fälttools[].function.parametersTypJSON_schemaKravValfrittVärden & gränserStandard—
Fälttool_choiceTypstring|objectKravValfrittVärden & gränser
Beror på modellen
Standard—
Fältparallel_tool_callsTypbooleanKravValfrittVärden & gränser
Beror på modellen
Standard—
Fältresponse_formatTypobjectKravValfrittVärden & gränser
Beror på modellen
Standard—
Fältreasoning_effortTypstringKravValfrittVärden & gränser
Beror på modellen
Standard—
FältreasoningTypobjectKravValfrittVärden & gränser
Beror på modellen
Standard—
Fältservice_tierTypstringKravValfrittVärden & gränser
Beror på modellen
Standard—
FältinstructionsTypstringKravValfrittVärden & gränser
Kompatibilitetsfält
Standard—
FältfunctionsTypfunction[]KravValfrittVärden & gränser
Beror på modellen
Standard—
Fältfunction_callTypstring|objectKravValfrittVärden & gränser
Beror på modellen
Standard—
Fältprompt_cache_optionsTypobjectKravValfrittVärden & gränser
Beror på modellen
Standard—
Kombinationer av indatamaterial

Text · UTF8-text

messages[].content

Text + bild

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

Metodparametrar och livscykel
ParameterAvtal
Parametermaterial_typesAvtaltext, image
ParameterrequiredAvtalmodel, messages
Parameteroptional_controlsAvtalnull
Parametercontent_typeAvtalapplication/json
Parametertext_file_materialAvtalfaktiskt UTF-8-innehåll infogat som text; fil-ID:n/URLs kräver separat, exakt definierat stöd

Livscykel: exact retained published method

Metodernas strukturer och ID:n är exakta; leverantörens funktioner är åtskilda från att begäran tillåts.

Priser

Priser för Ailoot-metoder

Ailoot OpenAI ChatPOST /v1/chat/completions
Indata
0,004 US$ / 1K
Utdata
0,012 US$ / 1K
Cacheläsning
0,001 US$ / 1K
Skrivning till cache
0,00 US$ / 1K
Skrivning till cache, 5 min
0,00 US$ / 1K tokens
Skrivning till cache, 1 tim
0,00 US$ / 1K tokens

Priser efter begärans längd · OpenAI Chat

Begärans storlek i tokenIndataUtdataCacheläsningSkrivning till cacheCache 5 minCache 1 tim
Begärans storlek i token(0; 200 000]Indata0,004 US$Utdata0,012 US$Cacheläsning0,001 US$Skrivning till cache0,00 US$Cache 5 min0,00 US$Cache 1 tim0,00 US$
Begärans storlek i token(200 000; ∞)Indata0,006 US$Utdata0,018 US$Cacheläsning0,0015 US$Skrivning till cache0,00 US$Cache 5 min0,00 US$Cache 1 tim0,00 US$

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

Ailoot reserverar ett uppskattat belopp före en begäran. Efter resultatet slutregleras avgiften utifrån uppmätt förbrukning. Slutreglering för strömning använder den slutliga förbrukningsposten. Så fungerar reservation och slutreglering →

Exempelbegäranden

Ailoot · OpenAI Chat

TextexempelIndata, bildPython SDKNode.js SDKPython-strömning
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-build-fast", "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-build-fast", "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-build-fast",
    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-build-fast",
  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-build-fast',messages=[{"role":"user","content":"Explain observations and hypotheses in three sentences."}]) as stream:
    with Path("stream-events.jsonl").open("w",encoding="utf-8") as log:
        for event in stream:
            payload=event.to_dict(mode="json")
            log.write(json.dumps(payload,ensure_ascii=False)+"\n"); log.flush()
            print(json.dumps(payload,ensure_ascii=False))
    final=stream.get_final_completion()
    save_result(final.to_dict(mode="json"),"stream-result")

Ta emot och spara resultat

Ailoot · OpenAI Chat

json eller SSE

Behåll alla färdiga resultat

Behåll varje fullständigt returnerat svar, fil och innehållsdel.

Behåll varje svarsalternativ och dess innehåll/verktygsanrop/resonemang. Sätt i SSE samman deltauppdateringar efter svarsalternativets/verktygets index och behåll den slutliga avslutsorsaken och användningsuppgifterna.

Om det ursprungliga svaret behöver kontrolleras

Behåll begärans/svarets ID:n och huvuden. Ingen generell URL för hämtning av textjobb tillhandahålls.

Svarsfält
FältTyp
Fältchoices[].indexTypinteger
Fältchoices[].message.contentTypstring|null
Fältchoices[].message.tool_callsTyptool_call[]
Fältchoices[].message.reasoning_contentTypstring
Fältchoices[].message.reasoning_detailsTypobject|array
Fältchoices[].finish_reasonTypstring|null
FältusageTypobject
Fel och nästa steg
SvarVillkorNästa steg
Svar400 · invalid_request_errorVillkorOgiltiga obligatoriska fält, ogiltig representation av underlaget eller ogiltigt parametervärdeNästa stegKorrigera de angivna fälten före en ny begäran om att skapa.

Alias

Modellalias

Ailoot grok-4.7-build-fast

Alias för metodsökvägar

Använd metodsökvägarna som visas ovan.

Relaterade anropar-ID:n

grok-4.7-build-fast

FAQ · grok-4.7-build-fast
Vilka indata och resultat finns?

POST /v1/messages · grok-4.7-build-fast: text, image → text

POST /v1/responses · grok-4.7-build-fast: text, image → text

POST /v1/chat/completions · grok-4.7-build-fast: text, image → text

Vilka fält använder begäran?

POST /v1/messages · grok-4.7-build-fast: model, messages, system, max_tokens, stream, metadata

POST /v1/responses · grok-4.7-build-fast: model, input, instructions, stream

POST /v1/chat/completions · grok-4.7-build-fast: model, messages, stream

Vilka gränser gäller?

POST /v1/messages · grok-4.7-build-fast: ctx: 500000; max_out: 500000; messages.min_items: 1; max_tokens.minimum: 1

POST /v1/responses · grok-4.7-build-fast: ctx: 500000; max_out: 500000

POST /v1/chat/completions · grok-4.7-build-fast: ctx: 500000; max_out: 500000; messages.min_items: 1

Fler detaljer

Anslut Ailoot till Claude Code, OpenCode, Hermes eller din app.

Företaget och dess projektportfölj

Företaget och dess projektportfölj: miljontals kunder; månatlig försäljning för miljarder.

Köp token med rabatt.

Prenumerationsrabatt för återkommande arbete. Kampanjkoder ger upp till 50% vid tokenköp.

Prenumeration
Välj en rabatterad plan för återkommande anrop.
Kampanjkod upp till 50%
Ange koden vid köpet. Priset räknas om enligt kampanjen.
Kostnader i historiken
Modell, token och belopp sparas för varje anrop.

Välj prenumeration · Se modellpriser

Anslut API till produkten som du säljer.

SaaS, appar och botar enligt Ailoots officiella villkor och licensavtal. Begär återförsäljarlicens för vidareförsäljning.

Kommersiell applikation
Bygg text-, bild-, video- och ljudgenerering i tjänstens betalda funktioner.
Återförsäljarlicens
Skicka projektbeskrivning och åtkomstupplägg. Begär skriftliga villkor för användning och vidareförsäljning.
Dokument på webbplatsen
Officiella villkor, licensavtal och databehandlingspolicy finns tillgängliga före anslutning.

Begär återförsäljarlicens · Officiella villkor och licensavtal