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 text/image/video yanıtında usage.cost_in_usd_ticks dönerse ücretlendirme bu gerçek provider maliyetiyle settle edilir.
Public text modelleri:
| Model | Endpoint | Not |
|---|---|---|
xai/grok-4.3 | /v1/responses | Grok 4.3 için 200K üstü input, yüksek context fiyatı doğrulanana kadar reddedilir. |
xai/grok-4.20-multi-agent | /v1/responses | reasoning.effort ajan sayısını kontrol eder; high/xhigh daha maliyetli olabilir. |
xai/grok-4.20-0309-reasoning | /v1/responses | Uzun bağlamlı reasoning modeli. |
xai/grok-4.20-0309-non-reasoning | /v1/responses | Reasoning gerektirmeyen metin işleri. |
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." }'Multi-agent modelde suffix veya body kullanılabilir:
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 usage.cost_in_usd_ticks döndürürse gerçek provider maliyeti esas alınır; dönmezse görsel adedi ile deterministik fiyat uygulanır. Image edit isteklerinde xAI input görselleri ve üretilen output görselleri ayrı ücretlendirdiği için fallback hesabı input image count + output image count kullanır.
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:
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.
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.
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.mp3STT 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.
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 }'Maliyet Koruması
Section titled “Maliyet Koruması”- Text/image/video için xAI
cost_in_usd_ticksdöndürürse LLMTR bu değeri esas alır. - Image ve video
cost_in_usd_ticksdönmezse resmi sabit fiyatla deterministik fallback uygulanır; image edit fallback hesabı input ve output görsellerini birlikte sayar. - TTS karakter sayısından, STT provider response
durationalanından hesaplanır. - xAI server-side tools, files/collections, streaming STT ve realtime voice public değildir.