Ana Sayfa / LLM API / Kurulum rehberi
Kurulum Rehberleri

Her istemciyi doğru şekilde yapılandırın

Soldaki bir aracı seçerek tam rehberi görün. Aşağıdaki örnekler mevcut API anahtarınızı ve sistemin gerçek base URL'ini kullanır.

Yapılandırmadan önce hazırlık

  • Bakiye yükleyin ve AI API Konsolu'nda API anahtarınızın oluşturulduğundan emin olun.
  • Her istemci için doğru Base URL'i kullanın: bazıları `/v1` gerektirir, bazıları gerektirmez.
  • Fiyat listesinde şu anda aktif olan bir model seçin. Rota kapalı modellerden kaçının.
  • İstemci özel endpoint destekliyorsa, her zaman sitenin HTTPS endpoint'ini kullanın.

Base URL kuralları

  • OpenAI uyumlu istemciler: `/v1` içeren Base URL kullanın.
  • Claude Code `ANTHROPIC_BASE_URL`: kök alan adını kullanın, `/v1` eklemeyin.
API reference

Endpoints and commands

Open an endpoint to see its complete curl command. The list stays compact instead of rendering every command at once.

Text / chat

chat/completionsPOST

OpenAI-compatible chat; messages, tools and optional stream=true.

https://api.xah.io/v1/chat/completions

Complete command
API_KEY="YOUR_CKEY_API_KEY"

curl https://api.xah.io/v1/chat/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "MODEL",
  "messages": [{"role": "user", "content": "Hello"}],
  "stream": false
}'
completionsPOST

Legacy prompt completion; use only when this capability is enabled.

https://api.xah.io/v1/completions

Complete command
API_KEY="YOUR_CKEY_API_KEY"

curl https://api.xah.io/v1/completions \
  -H "Authorization: Bearer $API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "MODEL",
  "prompt": "Hello",
  "max_tokens": 256
}'
responsesPOST

Responses-style request; input/output follows the enabled upstream contract.

https://api.xah.io/v1/responses

Complete command
API_KEY="YOUR_CKEY_API_KEY"

curl https://api.xah.io/v1/responses \
  -H "Authorization: Bearer $API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "MODEL",
  "input": "Hello"
}'
messagesPOST

Anthropic Messages format. Send anthropic-version: 2023-06-01 and max_tokens.

https://api.xah.io/v1/messages

Complete command
API_KEY="YOUR_CKEY_API_KEY"

curl https://api.xah.io/v1/messages \
  -H "Authorization: Bearer $API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'anthropic-version: 2023-06-01' \
  -d '{
  "model": "MODEL",
  "max_tokens": 1024,
  "messages": [{"role": "user", "content": "Hello"}]
}'

Images

images/generationsPOST

Text-to-image. Use only fields documented by the selected image model: prompt, n, size, quality, response_format, etc.

https://api.xah.io/v1/images/generations

Complete command
API_KEY="YOUR_CKEY_API_KEY"

curl https://api.xah.io/v1/images/generations \
  -H "Authorization: Bearer $API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "MODEL",
  "prompt": "A red fox in snow",
  "n": 1,
  "size": "1024x1024"
}'
images/generations · image-to-imagePOST

Image-to-image also calls the images/generations endpoint. Use the exact image field from the payload template/contract of the model; this example uses image_url per the sample model contract.

https://api.xah.io/v1/images/generations

Complete command
API_KEY="YOUR_CKEY_API_KEY"

curl https://api.xah.io/v1/images/generations \
  -H "Authorization: Bearer $API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "MODEL",
  "prompt": "Turn the reference into a watercolor illustration",
  "image_url": "https://example.com/reference.png",
  "n": 1,
  "size": "1024x1024"
}'
images/editsPOST multipart

Edit/generate images from an image. image is multipart; prompt and mask depend on the selected model contract.

https://api.xah.io/v1/images/edits

Complete command
API_KEY="YOUR_CKEY_API_KEY"

curl https://api.xah.io/v1/images/edits \
  -H 'Authorization: Bearer API_KEY' \
  -F 'model=MODEL' \
  -F 'prompt=Make it brighter' \
  -F '[email protected]'
images/variationsPOST multipart

Create variations from an input image. image is multipart; do not send JSON/base64 if the selected upstream does not document that form.

https://api.xah.io/v1/images/variations

Complete command
API_KEY="YOUR_CKEY_API_KEY"

curl https://api.xah.io/v1/images/variations \
  -H 'Authorization: Bearer API_KEY' \
  -F 'model=MODEL' \
  -F '[email protected]'

Audio

audio/speechPOST

Text-to-speech. Standard OpenAI JSON body: model, input, voice, optional instructions, response_format, speed and stream_format. Voice, format and model limits must follow the selected provider.

https://api.xah.io/v1/audio/speech

Complete command
API_KEY="YOUR_CKEY_API_KEY"

curl https://api.xah.io/v1/audio/speech \
  -H "Authorization: Bearer $API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "MODEL",
  "input": "Hello from CKEY",
  "voice": "alloy",
  "response_format": "mp3",
  "speed": 1.0
}'
audio/transcriptionsPOST multipart

Speech-to-text. Standard multipart: file, model, optional ISO-639-1 language, prompt and response_format per model.

https://api.xah.io/v1/audio/transcriptions

Complete command
API_KEY="YOUR_CKEY_API_KEY"

curl https://api.xah.io/v1/audio/transcriptions \
  -H 'Authorization: Bearer API_KEY' \
  -F '[email protected]' -F 'model=gpt-4o-transcribe' -F 'language=en' -F 'response_format=json'
audio/translationsPOST multipart

Translate audio into English. Standard multipart: file, model=whisper-1, prompt, response_format and temperature. This endpoint is legacy/deprecated in OpenAI documentation.

https://api.xah.io/v1/audio/translations

Complete command
API_KEY="YOUR_CKEY_API_KEY"

curl https://api.xah.io/v1/audio/translations \
  -H 'Authorization: Bearer API_KEY' \
  -F '[email protected]' -F 'model=whisper-1' -F 'response_format=json'

Video (task / async)

v1/videosPOST + GET

OpenAI-compatible Video V1 endpoint. POST creates a job at /v1/videos/generations; poll with GET /v1/videos/{JOB_ID}. Use the seconds field for the V1 contract.

https://api.xah.io/v1/videos/generations

Complete command
API_KEY="YOUR_CKEY_API_KEY"

curl https://api.xah.io/v1/videos/generations \
  -H "Authorization: Bearer $API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "MODEL",
  "prompt": "A gentle camera move across a mountain",
  "seconds": 8
}

# Poll: GET https://api.xah.io/v1/videos/JOB_ID'
v2/video_generationPOST + GET + DELETE

CKEY Video Task API V2 endpoint. POST creates a job; poll with GET /v2/query/video_generation/{JOB_ID}; cancel with DELETE /v2/video_generation/{JOB_ID}. Use the duration field for the V2 contract; do not switch to the V1 route.

https://api.xah.io/v2/video_generation

Complete command
API_KEY="YOUR_CKEY_API_KEY"

curl https://api.xah.io/v2/video_generation \
  -H "Authorization: Bearer $API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "MODEL",
  "content": [{"type": "text", "text": "A gentle camera move across a mountain"}],
  "duration": 6,
  "ratio": "16:9"
}

# Poll: GET https://api.xah.io/v2/query/video_generation/JOB_ID
# Cancel: DELETE https://api.xah.io/v2/video_generation/JOB_ID'

Embeddings / ranking / safety / search

embeddingsPOST

Convert one string or an array of strings into vectors.

https://api.xah.io/v1/embeddings

Complete command
API_KEY="YOUR_CKEY_API_KEY"

curl https://api.xah.io/v1/embeddings \
  -H "Authorization: Bearer $API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "MODEL",
  "input": ["first text", "second text"]
}'
rerankPOST

Rank documents for a query. query and documents are required; top_n must not exceed the document count.

https://api.xah.io/v1/rerank

Complete command
API_KEY="YOUR_CKEY_API_KEY"

curl https://api.xah.io/v1/rerank \
  -H "Authorization: Bearer $API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "MODEL",
  "query": "latest AI news",
  "documents": ["doc A", "doc B"],
  "top_n": 2
}'
moderationsPOST

Classify input with the enabled moderation model.

https://api.xah.io/v1/moderations

Complete command
API_KEY="YOUR_CKEY_API_KEY"

curl https://api.xah.io/v1/moderations \
  -H "Authorization: Bearer $API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "MODEL",
  "input": "Text to classify"
}'
searchPOST

The search contract depends on the provider/model. Send optional fields only when the documentation of the selected model allows them.

https://api.xah.io/v1/search

Complete command
API_KEY="YOUR_CKEY_API_KEY"

curl https://api.xah.io/v1/search \
  -H "Authorization: Bearer $API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "MODEL",
  "query": "latest AI news",
  "max_results": 5
}'

Native provider routes

geminiPOST

Native Google Gemini format. Streaming uses :streamGenerateContent?alt=sse; do not invent a stream field in the body.

https://api.xah.io/v1beta/models/MODEL:generateContent

Complete command
API_KEY="YOUR_CKEY_API_KEY"

curl https://api.xah.io/v1beta/models/MODEL:generateContent \
  -H "Authorization: Bearer $API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "contents": [{"role": "user", "parts": [{"text": "Hello"}]}]
}'
ollamaPOST

Ollama native chat format.

https://api.xah.io/api/chat

Complete command
API_KEY="YOUR_CKEY_API_KEY"

curl https://api.xah.io/api/chat \
  -H "Authorization: Bearer $API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "MODEL",
  "messages": [{"role": "user", "content": "Hello"}],
  "stream": false
}'
api/generatePOST

Ollama native prompt generation format.

https://api.xah.io/api/generate

Complete command
API_KEY="YOUR_CKEY_API_KEY"

curl https://api.xah.io/api/generate \
  -H "Authorization: Bearer $API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "MODEL",
  "prompt": "Hello",
  "stream": false
}'
Contract rule

Both text-to-image and image-to-image use POST /images/generations when that is the model contract. Do not rename the image field: use the payload template/contract of the selected model. Do not substitute images/edits or images/variations for a model that exposes only images/generations.

OpenAI-compatible chat/completions /v1

Cursor

Cursor, özel API anahtarı ve özel base URL ile OpenAI uyumlu modu kullanmalıdır.

Gerekli değerler

Sağlayıcı
OpenAI-compatible
API Anahtarı
sk-YOUR_API_KEY
Base URL
https://api.xah.io/v1
Model
gpt-5.5
Rota
chat/completions
Paket gereksinimi
Özel API endpoint'lerini destekleyen bir Cursor paketi gerektirir.

Önerilen adımlar

  1. 1Cursor Ayarları'nı açın ve AI / Models / API Keys bölümüne gidin.
  2. 2Cursor sürümünüz farklı bir ad kullanıyorsa özel OpenAI anahtarı veya özel sağlayıcı seçeneğini etkinleştirin.
  3. 3Aşağıda gösterilen API anahtarını ve Base URL'i yapıştırın.
  4. 4Önerilen modeli veya fiyat listesinde aktif olan başka bir modeli seçin.

Kopyalamaya hazır blok

Provider: OpenAI-compatible
API Key: sk-YOUR_API_KEY
Base URL: https://api.xah.io/v1
Model: gpt-5.5
Route: chat/completions

Denenmesi önerilen modeller

  • gpt-5.5
  • claude-opus-4.6
  • claude-opus-4.7
  • claude-opus-4.8
  • claude-sonnet-4.6
  • deepseek-v4.1-flash

Notlar

  • Cursor OpenAI uyumlu akışı kullandığından Base URL `/v1` içermelidir.
  • Bir model Cursor içinde çalışmazsa aktif listedeki başka bir OpenAI uyumlu modele geçin.
  • Kaydettikten sonra `chat/completions` rotasının çalıştığını doğrulamak için kısa bir prompt gönderin.
Destekle İletişime Geç
Size yardımcı olmak için her zaman hazırız