Skip to content
Dokümanlar

Editör ve CLI entegrasyonu

En yaygın istemciler için kopyala-yapıştır kurulum. Her aracın kendine ayarlanmış bir rotası var — istemcinizi eşleşen prefix'e yönlendirin, anahtarınız abonelik ya da token-başına modunda çalışır.

#Claude Code

Anthropic'in CLI'ı. İki ortam değişkeni ayarlayın, sonra her zamanki gibi çalıştırın.

bash
export ANTHROPIC_BASE_URL="https://api.powapi.io/claudecode"
export ANTHROPIC_API_KEY="pk_live_xxxxxxxxxxxx"

claude  # diğer her şey aynı kalır

#Cline (VS Code)

Cline ayarları → API sağlayıcısında Anthropic'i seçin. Cline-ayarlı rotayı kullanın — abonelik veya token-başına anahtarınız ikisinde de çalışır:

text
Provider: Anthropic
Base URL: https://api.powapi.io/cline
API Key:  pk_live_xxxxxxxxxxxx

#Cursor

Cursor varsayılan olarak OpenAI konuşur. Settings → Models → OpenAI API key'de Override OpenAI Base URL'ı açın ve şunu ayarlayın:

text
Base URL: https://api.powapi.io/v1
API Key:  pk_live_xxxxxxxxxxxx

Cursor'ı Anthropic modeliyle kullanıyorsanız Cursor-ayarlı Anthropic rotasına yönlendirin:

text
Provider: Anthropic
Base URL: https://api.powapi.io/cursor
API Key:  pk_live_xxxxxxxxxxxx

#Roo Code

Cline ile aynı kalıp — Anthropic sağlayıcısı, Roo Code-ayarlı base URL:

text
Provider: Anthropic
Base URL: https://api.powapi.io/roocode
API Key:  pk_live_xxxxxxxxxxxx

#Anthropic SDK (Python / TypeScript)

SDK base URL'inize /v1/messages ekler. İstemcinize uyan preset'i seçin — ya da generic token-başına rotası için sade host kullanın.

python
from anthropic import Anthropic

# Subscription key — pick the preset that matches your client.
# Pay-per-token key — point to "https://api.powapi.io" instead.
client = Anthropic(
    base_url="https://api.powapi.io/claudecode",
    api_key="pk_live_xxxxxxxxxxxx",
)
resp = client.messages.create(
    model="auto",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
)

#OpenAI SDK

OpenAI Chat Completions rotası yalnızca token-başına. pay_per_token anahtarı kullanın.

python
from openai import OpenAI

client = OpenAI(
    base_url="https://api.powapi.io/v1",
    api_key="pk_live_xxxxxxxxxxxx",
)
resp = client.chat.completions.create(
    model="auto",
    messages=[{"role": "user", "content": "Hello"}],
)

#Curl (smoke test)

İki tat — anahtarınızın metering moduna uygun olanı seçin:

bash
# Subscription key — works on any tool-tuned route
curl https://api.powapi.io/claudecode/v1/messages \
  -H "Authorization: Bearer pk_live_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "max_tokens": 64,
    "messages": [{"role": "user", "content": "Say hi"}]
  }'

# Pay-per-token key — generic Anthropic route
curl https://api.powapi.io/v1/messages \
  -H "Authorization: Bearer pk_live_xxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "auto",
    "max_tokens": 64,
    "messages": [{"role": "user", "content": "Say hi"}]
  }'