grok-imagine-image — harga, konteks dan performa
grok-imagine-image adalah model xAI dengan penagihan per permintaan: $0.21 per permintaan.
Ringkasan
| Vendor | xAI |
|---|---|
| Konteks | 8K |
| Kemampuan | Files, Vision |
| Format API | openai, openai-response, openai-response-compact, anthropic, gemini, openai-alpha-search |
Image model for prompt-driven generation, editing, and visual design workflowsHarga
| Per permintaan | $0.21 |
|---|
Performa
| Endpoint API | https://api.airai.cc/v1 |
|---|---|
| Kompatibel OpenAI | OpenAI-compatible |
FAQ
Berapa harga grok-imagine-image?
grok-imagine-image ditagih per permintaan: $0.21 per permintaan.
Berapa jendela konteks grok-imagine-image?
grok-imagine-image memiliki jendela konteks 8K: batas gabungan token input dan output dalam satu permintaan.
Bagaimana memanggil grok-imagine-image dari kode?
Arahkan base_url ke https://api.airai.cc/v1 dan set model ke grok-imagine-image. API sepenuhnya kompatibel dengan OpenAI.
Mengapa grok-imagine-image mengembalikan error 429?
429 adalah respons pembatasan laju. Kurangi konkurensi, coba lagi dengan jeda, atau beralih ke paket dengan kuota lebih besar.
Perbandingan model
| Model | Vendor | Input | Output | Konteks |
|---|---|---|---|---|
| grok-imagine-image | xAI | Per permintaan $0.21 | — | 8K |
| grok-4.6 | xAI | $2.00 | $6.00 | 500K |
| grok-4-20-reasoning | xAI | $1.25 | $2.50 | tidak dicantumkan |
| grok-4.5 | xAI | $2.00 | $6.00 | 500K |
| grok-4.3 | xAI | $1.25 | $2.50 | 1M |
| grok-3-mini | xAI | $0.30 | $0.50 | tidak dicantumkan |
| grok-4.20-0309-non-reasoning | xAI | $1.25 | $2.50 | 1M |
| grok-3-mini-fast | xAI | $0.60 | $4.00 | tidak dicantumkan |
| grok-4-5 | xAI | $2.00 | $6.00 | tidak dicantumkan |
| grok-4-6 | xAI | $2.00 | $6.00 | tidak dicantumkan |
| grok-4 | xAI | $3.00 | $15.00 | tidak dicantumkan |
| grok-1.5-video | xAI | Per permintaan $3.30 | — | tidak dicantumkan |
| grok-4.7 | xAI | $2.00 | $6.00 | 500K |
Pemecahan masalah
429 adalah respons pembatasan laju. Kurangi konkurensi, coba lagi dengan jeda, atau beralih ke paket dengan kuota lebih besar.
Penyebab umum
- Terlalu banyak permintaan bersamaan
- Kuota paket saat ini habis
- Mencoba ulang tanpa jeda
Cara mengatasi
- Batasi konkurensi dan coba ulang dengan jeda eksponensial
- Beralih ke paket dengan kuota lebih besar
- Simpan cache permintaan yang berulang
Cara menghubungkan
curl https://api.airai.cc/v1/chat/completions \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-imagine-image",
"messages": [{"role": "user", "content": "Hello"}]
}'from openai import OpenAI
client = OpenAI(
api_key="<YOUR_API_KEY>",
base_url="https://api.airai.cc/v1"
)
response = client.chat.completions.create(
model="grok-imagine-image",
messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
apiKey: "<YOUR_API_KEY>",
baseURL: "https://api.airai.cc/v1"
});
const response = await client.chat.completions.create({
model: "grok-imagine-image",
messages: [{ role: "user", content: "Hello" }]
});
console.log(response.choices[0].message.content);const OpenAI = require("openai");
const client = new OpenAI({
apiKey: "<YOUR_API_KEY>",
baseURL: "https://api.airai.cc/v1"
});
client.chat.completions.create({
model: "grok-imagine-image",
messages: [{ role: "user", content: "Hello" }]
}).then((r) => console.log(r.choices[0].message.content));Ganti <YOUR_API_KEY> dengan API Key dari pengaturan token Anda.
Endpoint kompatibel
openaiopenai-responseopenai-response-compactanthropicgeminiopenai-alpha-search
Gemini SDK · TypeScript
import { GoogleGenerativeAI } from "@google/generative-ai";
const genAI = new GoogleGenerativeAI("<YOUR_API_KEY>");
const model = genAI.getGenerativeModel({ model: "grok-imagine-image" });
const result = await model.generateContent(
"Explain quantum entanglement in one paragraph."
);
console.log(result.response.text());Autentikasi
Semua permintaan harus menyertakan header Authorization: Bearer <TOKEN>. Endpoint format Anthropic juga menerima header x-api-key. Buat API Key Anda di halaman Token, tempat Anda dapat membatasinya berdasarkan model, grup, IP, dan laju.
Parameter yang didukung
| Parameter | Tipe | Bawaan | Rentang | Deskripsi |
|---|---|---|---|---|
temperature | float | 1 | 0–2 | Suhu sampling; lebih rendah lebih stabil |
top_p | float | 1 | 0–1 | Probabilitas kumulatif nucleus sampling |
max_tokens | integer | — | — | Token maksimum dalam respons |
frequency_penalty | float | 0 | −2–2 | Hukuman pengulangan token frekuensi tinggi |
presence_penalty | float | 0 | −2–2 | Mendorong topik baru |
stop | string[] | null | ≤ 4 | Hingga 4 string penghentian |
seed | integer | null | — | Seed untuk sampling lebih dapat direproduksi |
n | integer | 1 | — | Jumlah kandidat yang dihasilkan |
stream | boolean | false | — | Streaming token via SSE |
response_format | object | — | — | Memaksa output JSON atau hasil sesuai skema |
tools | array | — | — | Deklarasi alat / fungsi yang dapat dipanggil model |
tool_choice | string | object | auto | — | Strategi pemilihan alat atau nama alat tertentu |
logprobs | boolean | false | — | Mengembalikan log-probabilitas tiap token |
top_logprobs | integer | null | 0–20 | Jumlah probabilitas teratas per token |
logit_bias | map | — | — | Pemetaan logit bias per token |
user | string | — | — | Identitas pengguna akhir untuk audit risiko |
Batas laju
| Tingkat | RPM | TPM | RPD |
|---|---|---|---|
| Eco | 990 | 398K | 20K |
| Test | 980 | 393K | 20K |
Data diperbarui: 2026-10-10 15:40