Cortex AI üzerindeki tüm provider'ları opencode ile kullanabilmen için hazır config, proxy ve workaround'lar.
Config'i kopyala, key'ini yaz, aç kullan.
- Node.js v18+ (proxy'ler ve MCP için gerekiyor)
- Linux:
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - && sudo apt install -y nodejs - macOS:
brew install nodeya da nodejs.org'dan indir - Windows: nodejs.org'dan indir ya da
winget install OpenJS.NodeJS
- Linux:
# Linux / macOS
curl -fsSL https://opencode.ai/install | bash
# Windows (PowerShell)
irm https://opencode.ai/install.ps1 | iex# Linux / macOS
mkdir -p ~/.config/opencode
cp opencode.json ~/.config/opencode/opencode.json
# Windows (PowerShell)
New-Item -ItemType Directory -Force "$env:APPDATA\opencode"
Copy-Item opencode.json "$env:APPDATA\opencode\opencode.json"opencode.json içindeki YOUR_CORTEX_API_KEY yazan yerleri kendi key'inle değiştir.
opencodeSDK: @ai-sdk/anthropic · Tool Call: Native · Thinking: budgetTokens
| Model | Thinking | Tool Call |
|---|---|---|
| claude-opus-4-6-20260101 | high, max |
Native |
| claude-opus-4-5-20251101 | high, max |
Native |
| claude-sonnet-4-5-20250929 | high, max |
Native |
| claude-sonnet-4-20250514 | high, max |
Native |
| claude-3-7-sonnet-20250219 | high, max |
Native |
| claude-haiku-4-5-20251001 | high, max |
Native |
SDK: @ai-sdk/anthropic · Tool Call: XML formatında dönüyor (çalışmıyor) · Thinking: budgetTokens
| Model | Thinking | Tool Call |
|---|---|---|
| claude-opus-4-6 | high, max |
XML ✗ |
| claude-opus-4-5 | high, max |
XML ✗ |
| claude-sonnet-4-5 | high, max |
XML ✗ |
| claude-sonnet-4 | high, max |
XML ✗ |
| claude-3-7-sonnet | high, max |
XML ✗ |
| claude-haiku-4-5 | high, max |
XML ✗ |
SDK: @ai-sdk/anthropic · Tool Call: XML formatında dönüyor (çalışmıyor) · Thinking: budgetTokens
| Model | Thinking | Tool Call |
|---|---|---|
| claude-opus-4-1-20250805 | high, max |
XML ✗ |
| claude-sonnet-4-5-20250929 | high, max |
XML ✗ |
| claude-sonnet-4-5-web | high, max |
XML ✗ |
SDK: @ai-sdk/openai-compatible · Tool Call: XML formatında dönüyor (çalışmıyor) · Thinking: reasoning_effort
Bu API'de 20'den fazla model var — GPT-5, Grok, DeepSeek, Gemini hepsi tek key ile. Hepsi reasoning_effort parametresini kabul ediyor ama gateway hem reasoning_content'i hem tool_calls'ı hem de token bilgisini siliyor. Yani thinking çalışıyor (model gerçekten daha fazla düşünüyor) ama çıktısını göremiyorsun. Tool call'lar da XML formatında dönüyor, opencode bunu parse edemiyor.
| Model | Thinking | Tool Call |
|---|---|---|
| gpt-5 | minimal, low, medium, high, xhigh |
XML ✗ |
| gpt-5.1 | minimal, low, medium, high, xhigh |
XML ✗ |
| gpt-5-mini | minimal, low, medium, high, xhigh |
XML ✗ |
| gpt-5-nano | minimal, low, medium, high, xhigh |
XML ✗ |
| gpt-o3 | minimal, low, medium, high, xhigh |
XML ✗ |
| o3 | minimal, low, medium, high, xhigh |
XML ✗ |
| o3-mini | minimal, low, medium, high, xhigh |
XML ✗ |
| gpt-4.1 | minimal, low, medium, high, xhigh |
XML ✗ |
| gpt-4.1-nano | minimal, low, medium, high, xhigh |
XML ✗ |
| gpt-4o | minimal, low, medium, high, xhigh |
XML ✗ |
| gpt-4o-mini | minimal, low, medium, high, xhigh |
XML ✗ |
| grok-4 | minimal, low, medium, high, xhigh |
XML ✗ |
| grok-3-mini | minimal, low, medium, high, xhigh |
XML ✗ |
| grok-3-mini-beta | minimal, low, medium, high, xhigh |
XML ✗ |
| grok-2 | minimal, low, medium, high, xhigh |
XML ✗ |
| deepseek-r1 | minimal, low, medium, high, xhigh |
XML ✗ |
| deepseek-v3 | minimal, low, medium, high, xhigh |
XML ✗ |
| deepseek-chat | minimal, low, medium, high, xhigh |
XML ✗ |
| gemini-2.5-flash | minimal, low, medium, high, xhigh |
XML ✗ |
| gemini-2.0-flash | minimal, low, medium, high, xhigh |
XML ✗ |
| gemini-2.0-flash-lite | minimal, low, medium, high, xhigh |
XML ✗ |
| gemini-lite | minimal, low, medium, high, xhigh |
XML ✗ |
SDK: @ai-sdk/google · Tool Call: Native · Thinking: thinkingConfig
| Model | Thinking | Tool Call |
|---|---|---|
| gemini-3-pro-preview | low, high |
Native |
| gemini-3-flash-preview | low, medium, high |
Native |
| gemini-2.5-pro | low, high, max |
Native |
| gemini-2.5-flash | low, high, max |
Native |
| gemini-2.5-flash-lite | low, high, max |
Native |
| gemini-2.0-flash | minimal, low, medium, high |
Native |
| gemini-2.0-flash-lite | minimal, low, medium, high |
Native |
SDK: @ai-sdk/openai-compatible · Tool Call: Native · Thinking: reasoning_effort · Schema fix lazım
reasoning_effort düzgün çalışıyor — high ile default'a kıyasla ~4x daha fazla reasoning token üretiyor ve bu token'lar response'ta da görünüyor.
| Model | Thinking | Tool Call |
|---|---|---|
| gemini-3-pro-preview | minimal, low, medium, high |
Native* |
| gemini-3-flash-preview | minimal, low, medium, high |
Native* |
| gemini-2.5-pro | minimal, low, medium, high |
Native* |
| gemini-2.5-flash | minimal, low, medium, high |
Native* |
| gemini-2.5-flash-lite | minimal, low, medium, high |
Native* |
| gemini-2.0-flash-001 | minimal, low, medium, high |
Native* |
| gemini-2.0-flash-lite-001 | minimal, low, medium, high |
Native* |
* opencode v1.2.4'te schema bug'ı var, fix gerekiyor
SDK: @ai-sdk/openai-compatible · Tool Call: Native · Thinking: reasoning_effort · Schema fix lazım
reasoning_effort çalışıyor — high ile ~3x daha fazla token harcıyor ama gateway düşünce metnini siliyor, sadece sonucu görüyorsun.
| Model | Thinking | Tool Call |
|---|---|---|
| gpt-5.3-codex | low, medium, high, xhigh |
Native* |
| gpt-5.2-codex | low, medium, high, xhigh |
Native* |
| gpt-5.1-codex-max | low, medium, high, xhigh |
Native* |
| gpt-5.2 | low, medium, high, xhigh |
Native* |
| gpt-5.1-codex | low, medium, high |
Native* |
| gpt-5.1 | low, medium, high |
Native* |
| gpt-5-codex | low, medium, high |
Native* |
| gpt-5 | low, medium, high |
Native* |
| gpt-5.1-codex-mini | low, medium, high |
Native* |
| gpt-5-codex-mini | low, medium, high |
Native* |
* opencode v1.2.4'te schema bug'ı var, fix gerekiyor
SDK: @ai-sdk/openai-compatible · Perplexity Proxy lazım
| Model | Thinking | Tool Call |
|---|---|---|
| sonar | - | Yok |
| sonar-pro | - | Yok |
| unlimited-ai | - | Yok |
# Anthropic (Sonnet, Opus 4.5 vs.) — sadece high ve max var
opencode run --thinking -m "app.claude.gg/claude-sonnet-4-5" --variant high "prompt"
# Anthropic (Opus 4.6) — adaptive thinking, low'dan max'a kadar
opencode run --thinking -m "app.claude.gg/claude-opus-4-6" --variant low "prompt"
# Gemini 2.5 — thinkingBudget ile, low/high/max
opencode run --thinking -m "beta.vertexapis.com/gemini-2.5-flash" --variant high "prompt"
# Gemini 3 — thinkingLevel ile, low/high (flash'ta medium de var)
opencode run --thinking -m "beta.vertexapis.com/gemini-3-flash-preview" --variant high "prompt"
# Codex — reasoning_effort ile, 5.2+ modellerde xhigh da var
opencode run --thinking -m "codex.claude.gg/gpt-5.3-codex" --variant xhigh "prompt"Cortex'teki bazı gateway'ler tool call'ları JSON yerine XML formatında yolluyor. Bu aslında context sıkıştırma için iyi bir şey (daha az token harcıyor) ama opencode ve diğer IDE'ler native JSON formatı bekliyor, XML'i anlamıyorlar.
| Provider | Ne oluyor? |
|---|---|
| claude.gg | Tool call'lar JSON yerine XML olarak geliyor |
| beta.claude.gg | Tool call'lar JSON yerine XML olarak geliyor |
| api.claude.gg | Tool call'lar JSON yerine XML olarak geliyor |
Bu provider'larda tool call çalışmıyor. Sadece sohbet/chat olarak kullanılabilirler.
opencode v1.2.4'te codex.claude.gg ve openai.vertexapis.com 400 hatası veriyor. Sorun şu: opencode'un built-in question tool'unda additionalProperties: false var ama bazı property'ler required listesinde yok. Strict validation yapan sunucular bunu kabul etmiyor.
Biri bunu düzelten bir PR açmış: anomalyco/opencode#13823 — biz de test ettik, codex ve vertex'te çalışıyor.
Bun lazım (v1.3.9+).
# Linux / macOS
curl -fsSL https://bun.sh/install | bash
# Windows (PowerShell)
irm bun.sh/install.ps1 | iexSonra:
gh pr checkout 13823 --repo anomalyco/opencode
bun install
cd packages/opencode
bun run --conditions=browser ./src/index.tsBuild'e gerek yok, source'dan direkt çalışıyor. PR merge olunca normal opencode'a geri dönersin.
Bu repo'daki proxies/schema-fixer/proxy.mjs — 70 satırlık ufak bir proxy. Tool schema'larını uçuşta düzeltiyor. Tek bağımlılığı Node.js.
# Her platformda aynı
cd proxies/schema-fixer
cp .env.example .env # gerekirse portu değiştir
node proxy.mjs
# localhost:4015'te başlaropencode.json'da ilgili provider'ları proxy'ye yönlendir:
"codex.claude.gg": {
"options": { "baseURL": "http://localhost:4015/codex.claude.gg/v1" }
},
"openai.vertexapis.com": {
"options": { "baseURL": "http://localhost:4015/openai.vertexapis.com/v1" }
}PR merge olunca direkt URL'lere geri dönersin.
Gateway reasoning_content'i response'tan siliyor. Streaming'de de non-streaming'de de aynı. DeepSeek R1'in <think> tag'leri bile gelmiyor. Token sayıları da sıfır dönüyor. Yapacak bir şey yok, gateway tarafında bir kısıtlama bu.
perplexity.claude.gg normal bir chat API'si değil, search endpoint'i kullanıyor. Bu repo'daki proxies/perplexity/proxy.py search sonuçlarını OpenAI chat completions formatına çeviriyor, opencode direkt kullanabiliyor.
Python 3.8+ lazım, flask ve requests ile çalışıyor.
# Her platformda aynı
cd proxies/perplexity
cp .env.example .env # API key'ini yaz
pip install flask requests
python proxy.py
# localhost:4016'da başlaropencode.json'a ekle:
"perplexity.claude.gg": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "http://localhost:4016/v1",
"apiKey": "YOUR_CORTEX_API_KEY"
},
"models": {
"sonar": { "tool_call": false },
"sonar-pro": { "tool_call": false },
"unlimited-ai": { "tool_call": false }
}
}Modele internet erişimi vermek ciddi fark yaratıyor. Güncel bilgiye erişiyor, çok daha isabetli cevaplar veriyor.
Arama kalitesi olarak en iyisi. Ücretsiz planda günde 1000 istek var, $5/ay'lık planla daha fazla. Ücretsiz alternatiflere göre gözle görülür fark var, değer.
Küçük bir tüyo: sanal kartla $5'lık plana kaydol, sonra kartı kaldır. Fatura ay sonunda kesildiği için bir ay bedavaya premium arama kullanmış olursun.
Node.js v18+ lazım (MCP server npx ile çalışıyor).
- brave.com/search/api adresinden API key al
opencode.json'a ekle:
"mcp": {
"brave-search": {
"command": "npx",
"args": ["-y", "@anthropic-ai/brave-search-mcp"],
"env": {
"BRAVE_API_KEY": "YOUR_BRAVE_API_KEY"
}
}
}opencode'un kendi içinde bir web arama tool'u var. Tek yapman gereken bir env değişkeni set etmek:
# Linux / macOS (bash)
echo 'export OPENCODE_ENABLE_EXA=1' >> ~/.bashrc && source ~/.bashrc
# Linux / macOS (zsh)
echo 'export OPENCODE_ENABLE_EXA=1' >> ~/.zshrc && source ~/.zshrc
# Windows (PowerShell — kalıcı)
[System.Environment]::SetEnvironmentVariable('OPENCODE_ENABLE_EXA', '1', 'User')
# Yeni terminal açKayıt yok, key yok, bedava. Brave kadar iyi değil ama hiç yoktan iyidir.
Gate AI Replicate-uyumlu bir API provider. Replicate'teki yüzlerce AI modelini (görsel üretim, video, TTS, STT, upscale vs.) tek bir API key ile kullanabiliyorsun. Ama bir sınırlaması var: Gate AI sadece prediction endpoint'lerini destekliyor — yani model çalıştırma, sonuç sorgulama, iptal etme. Metadata endpoint'leri (list_models, get_models, search_models, get_account, list_collections vs.) 400 hatası veriyor.
Bu da şu demek: replicate-mcp sunucusunu Gate AI ile kullandığında model arayamıyorsun, model bilgisi çekemiyorsun, input schema'sını göremiyorsun. AI asistanın hangi modeli nasıl kullanacağını bilemez hale geliyor.
Çözüm basit: arada bir proxy koy. Proxy gelen isteğe bakıyor:
- Prediction istekleri (
/v1/predictions,/v1/models/*/predictionsvs.) → Gate AI'a gider (para burada harcanıyor) - Metadata istekleri (
/v1/models,/v1/account,/v1/collectionsvs.) → gerçek Replicate API'ye gider (ücretsiz, para harcamaz)
Böylece MCP'nin tüm 35 tool'u çalışır hale geliyor. Model arama, bilgi çekme, input schema'sı okuma Replicate'ten; asıl model çalıştırma Gate AI'dan.
- Node.js v18+
- Gate AI API key'i (prediction'lar için)
- Replicate API token'ı (metadata için, replicate.com/account/api-tokens adresinden ücretsiz alınır)
| Dosya | Ne işe yarıyor |
|---|---|
proxies/replicate/proxy.js |
Split proxy — istekleri Gate AI ve Replicate arasında yönlendiriyor |
proxies/replicate/start-mcp.sh |
MCP wrapper — proxy'yi başlatıp replicate-mcp'yi proxy üzerinden çalıştırıyor |
proxies/replicate/.env.example |
Ortam değişkenleri şablonu |
Proxy sayesinde MCP'nin
search_modelsveget_modelstool'ları çalışıyor — AI modelleri gerçek zamanlı arayıp bilgi çekebiliyor. Ayrıca Replicate'in resmiall-the-public-replicate-modelsnpm paketi tüm public model metadata'sını içeriyor.
# Proxy'yi başlat
cd proxies/replicate
cp .env.example .env # key'leri yaz
source .env && \
GATEAI_API_TOKEN="$GATEAI_API_TOKEN" \
REPLICATE_API_TOKEN="$REPLICATE_API_TOKEN" \
node proxy.js
# Başka bir terminalde test et
curl http://localhost:9877/v1/account # → Replicate'e gider
curl http://localhost:9877/v1/models/minimax/speech-2.8-turbo # → Replicate'e gider
curl -X POST -H "Content-Type: application/json" \
-d '{"input":{"text":"test"}}' \
http://localhost:9877/v1/models/minimax/speech-2.8-turbo/predictions # → Gate AI'a gideropencode.json'daki mcp bölümüne:
"replicate": {
"type": "local",
"command": ["bash", "/FULL/PATH/TO/proxies/replicate/start-mcp.sh"],
"enabled": true,
"environment": {
"GATEAI_API_TOKEN": "YOUR_GATEAI_KEY",
"REPLICATE_API_TOKEN": "YOUR_REPLICATE_TOKEN"
},
"timeout": 120000
}tools bölümüne:
"tools": {
"replicate_*": true
}replicate_* tool'ları artık aktif. Model arayabilir, bilgi çekebilir, prediction oluşturabilirsin.
| Endpoint | Nereye gider | Ücret |
|---|---|---|
POST /v1/predictions |
Gate AI | Ücretli |
GET /v1/predictions/* |
Gate AI | Ücretsiz |
POST /v1/predictions/*/cancel |
Gate AI | Ücretsiz |
POST /v1/models/*/predictions |
Gate AI | Ücretli |
POST /v1/deployments/*/predictions |
Gate AI | Ücretli |
POST /v1/trainings |
Gate AI | Ücretli |
GET /v1/account |
Replicate | Ücretsiz |
GET /v1/models |
Replicate | Ücretsiz |
GET /v1/models/* |
Replicate | Ücretsiz |
QUERY /v1/models (search) |
Replicate | Ücretsiz |
GET /v1/collections |
Replicate | Ücretsiz |
GET /v1/hardware |
Replicate | Ücretsiz |
| Değişken | Zorunlu | Açıklama |
|---|---|---|
GATEAI_API_TOKEN |
Evet | Gate AI API key'i — prediction'lar buraya gider |
REPLICATE_API_TOKEN |
Evet | Replicate token'ı — metadata buraya gider (ücretsiz) |
PROXY_PORT |
Hayır | Proxy portu (varsayılan: 9877) |
OpenClaw gibi agent runtime'ları MCP desteklemiyor — felsefe olarak CLI komutları tercih ediyorlar. Bu CLI tool, replicate-mcp'nin yaptığı her şeyi tek bir replicate komutuyla yapıyor. Agent'ın exec tool'u ile direkt çağırması yeterli.
Aynı split routing mantığı: metadata Replicate'ten (ücretsiz), prediction'lar Gate AI'dan.
| Dosya | Ne işe yarıyor |
|---|---|
proxies/replicate/replicate-cli.sh |
Tek dosya CLI — proxy'ye gerek yok, direkt API'lere gider |
# Script'i PATH'e ekle
chmod +x proxies/replicate/replicate-cli.sh
ln -sf $(pwd)/proxies/replicate/replicate-cli.sh /usr/local/bin/replicate
# .env'den key'leri yükle veya export et
export GATEAI_API_TOKEN="YOUR_GATEAI_KEY"
export REPLICATE_API_TOKEN="YOUR_REPLICATE_TOKEN"# Model ara
replicate search "text to speech"
# minimax/speech-02-turbo | Text-to-Audio... | runs:10054059
# jaaari/kokoro-82m | Kokoro v1.0... | runs:80592018
# Model input schema'sını gör
replicate schema minimax/speech-2.8-turbo
# Model: minimax/speech-2.8-turbo
# Description: Turn text into natural, expressive speech...
# Input schema:
# text (string): Text to narrate (max 10,000 characters)...
# voice_id (string): Voice to synthesize...
# Prediction oluştur (Gate AI üzerinden)
replicate run minimax/speech-2.8-turbo '{"text":"Merhaba dünya"}'
# {"id":"abc123","status":"starting",...}
# Sonucu bekle (2s aralıklarla poll eder, max 60s)
replicate poll abc123
# Model detayı (ham JSON)
replicate info black-forest-labs/flux-schnell
# Koleksiyonları listele
replicate collections