İçeriğe geç

xAI Grok Modelleri

xAI modelleri xai/... canonical model kimliği ile çağrılır. Text modelleri /v1/responses kullanır; image, video ve voice modelleri kendi gateway endpoint'leri üzerinden çalışır.

LLMTR xAI text modellerinde store:false gönderir ve store:true, previous_response_id ve xAI server-side tools alanlarını reddeder. xAI API istek ve yanıtları audit/güvenlik amacıyla 30 gün saklayabilir; LLMTR prompt/response içeriğini kendi DB'sinde saklamaz. xAI bir istek için gerçek maliyeti bildirdiğinde ücretlendirme o maliyet üzerinden yapılır.

Public text modelleri:

ModelEndpointNot
xai/grok-4.6/v1/responsesText+image input, function calling, structured outputs ve low/medium/high/xhigh reasoning. Varsayılan effort high; 200K üstü input reddedilir.
xai/grok-4.5/v1/responsesText+image input, function calling, structured outputs ve low/medium/high reasoning. Varsayılan effort high; 200K üstü input reddedilir.
xai/grok-4.3/v1/responses200K üstü tahmini input reddedilir.
xai/grok-4.20-multi-agent/v1/responsesreasoning.effort ajan sayısını kontrol eder; high/xhigh daha maliyetli olabilir.
xai/grok-4.20-0309-reasoning/v1/responsesUzun bağlamlı reasoning modeli.
xai/grok-4.20-0309-non-reasoning/v1/responsesReasoning gerektirmeyen metin işleri.
Terminal window
curl "$LLMTR_BASE_URL/v1/responses" \
-H "Authorization: Bearer llmtr-your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "xai/grok-4.3",
"input": "Bir TypeScript servis fonksiyonunu sadeleştir."
}'

Grok 4.6 için suffix olarak :low, :medium, :high ve :max desteklenir; :max, xAI'nin xhigh effort değerine karşılık gelir. Grok 4.5 yalnızca :low, :medium ve :high kabul eder. Suffix yoksa LLMTR provider varsayılanını açık hale getirip high gönderir; bu modellerde reasoning kapatılamaz. xAI reasoning modellerinde stop, presence_penalty ve frequency_penalty alanlarını desteklemediği için gateway bu alanları 400 ile reddeder.

Terminal window
curl "$LLMTR_BASE_URL/v1/responses" \
-H "Authorization: Bearer llmtr-your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "xai/grok-4.6:medium",
"input": [
{
"role": "user",
"content": [
{ "type": "input_text", "text": "Bu ekran görüntüsündeki hata akışını özetle." },
{ "type": "input_image", "image_url": "https://example.com/screenshot.png" }
]
}
]
}'

Multi-agent modelde suffix veya body kullanılabilir:

Terminal window
curl "$LLMTR_BASE_URL/v1/responses" \
-H "Authorization: Bearer llmtr-your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "xai/grok-4.20-multi-agent:high",
"input": "Bu mimari kararı maliyet, risk ve bakım açısından değerlendir."
}'

xai/grok-imagine-image görsel başına $0.02, xai/grok-imagine-image-quality görsel başına $0.04 resmi xAI fiyatıyla kataloglanır. xAI gerçek maliyeti bildirdiğinde o maliyet esas alınır; bildirmediğinde görsel adedi ile yukarıdaki fiyat uygulanır. Görsel düzenlemede xAI hem gönderdiğiniz görselleri hem üretilen görselleri ücretlendirir, bu yüzden ikisi birlikte sayılır.

Terminal window
curl "$LLMTR_BASE_URL/v1/images/generations" \
-H "Authorization: Bearer llmtr-your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "xai/grok-imagine-image",
"prompt": "A clean product photo of a copper desk lamp",
"aspect_ratio": "16:9",
"resolution": "1k",
"response_format": "url",
"n": 1
}'

Image edit:

Terminal window
curl "$LLMTR_BASE_URL/v1/images/edits" \
-H "Authorization: Bearer llmtr-your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "xai/grok-imagine-image",
"prompt": "Render this image as a pencil sketch.",
"image": { "url": "https://example.com/source.jpg" },
"aspect_ratio": "1:1",
"response_format": "url"
}'

Çoklu edit için images dizisine en fazla 5 görsel verilebilir.

xai/grok-imagine-video saniye başına $0.05 ile fiyatlanır. Gateway xAI async video isteğini başlatır ve sonuç tamamlanana kadar poll eder.

Terminal window
curl "$LLMTR_BASE_URL/v1/video/generations" \
-H "Authorization: Bearer llmtr-your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "xai/grok-imagine-video",
"prompt": "A calm time-lapse of clouds over a mountain ridge",
"duration_seconds": 5,
"aspect_ratio": "16:9",
"resolution": "480p",
"max_wait_seconds": 120
}'

TTS modeli xai/grok-voice-tts, STT modeli xai/grok-voice-stt olarak yayınlanır. Streaming STT ve realtime voice bu fazda public değildir.

Terminal window
curl "$LLMTR_BASE_URL/v1/audio/speech" \
-H "Authorization: Bearer llmtr-your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "xai/grok-voice-tts",
"input": "Merhaba, bu Grok Voice TTS örneğidir.",
"voice": "eve",
"language": "tr"
}' \
--output voice.mp3

STT JSON gövdesinde base64 ses kabul eder. Maliyet saat bazlı olduğu için kısa dosyalarda duration_seconds göndermek ön provizyonu düşürür.

Terminal window
curl "$LLMTR_BASE_URL/v1/audio/transcriptions" \
-H "Authorization: Bearer llmtr-your_key" \
-H "Content-Type: application/json" \
-d '{
"model": "xai/grok-voice-stt",
"audio_base64": "<base64 mp3>",
"audio_format": "mp3",
"language": "tr",
"format": true,
"duration_seconds": 12
}'
  • Text/image/video için xAI cost_in_usd_ticks döndürürse LLMTR bu değeri esas alır.
  • xai/grok-4.6 resmi fiyatları input $2/1M, cached input $0.50/1M, output $6/1M olarak kataloglanır; ücretlendirme yine xAI'nin bildirdiği gerçek maliyet üzerinden yapılır.
  • xai/grok-4.5 resmi fiyatları input $2/1M, cached input $0.30/1M, output $6/1M olarak kataloglanır.
  • xAI, prompt'u 200K token'a ulaşan isteklerin tamamını iki kat tarifeden faturalar. Ön provizyon bu tarifeyi hesaplayamadığı için xai/grok-4.6, xai/grok-4.5 ve xai/grok-4.3 modellerinde 200K üstü tahmini input pricing_unverified ile reddedilir.
  • Görsel ve videoda xAI gerçek maliyeti bildirmediğinde resmi sabit fiyat uygulanır; görsel düzenlemede gönderilen ve üretilen görseller birlikte sayılır.
  • TTS karakter sayısından, STT provider response duration alanından hesaplanır.
  • xAI server-side tools, files/collections, streaming STT ve realtime voice public değildir.