Hızlı Başlangıç
LLMTR, OpenAI uyumlu tek bir API endpoint’i üzerinden birden fazla LLM sağlayıcısına erişim sağlar. Mevcut OpenAI SDK’nızı kullanmaya devam edebilirsiniz; tek yapmanız gereken base URL ve API key’i değiştirmek.
- Hesap oluşturun ve giriş yapın. Dashboard’a kayıt olun, e-posta doğrulamasını tamamlayın.
- API anahtarı üretin. Dashboard > API Anahtarları sayfasından yeni bir anahtar oluşturun. Ham değer sadece bir kez gösterilir, güvenli yerde saklayın.
- İlk isteğinizi gönderin. Aşağıdaki örneklerden birini kullanarak
/v1/chat/completionsendpoint’ine istek atın.
Base URL
Section titled “Base URL”Tüm istekler aşağıdaki adresi kullanır:
https://llmtr.com/v1İlk istek
Section titled “İlk istek”curl https://llmtr.com/v1/chat/completions \ -H "Authorization: Bearer sk_your_key" \ -H "Content-Type: application/json" \ -d '{ "model": "openai/gpt-4o", "messages": [ {"role": "user", "content": "Hello!"} ], "temperature": 0.7 }'from openai import OpenAI
client = OpenAI( base_url="https://llmtr.com/v1", api_key="sk_your_key")
response = client.chat.completions.create( model="openai/gpt-4o", messages=[ {"role": "user", "content": "Hello!"} ], temperature=0.7)
print(response.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://llmtr.com/v1", apiKey: "sk_your_key"});
const response = await client.chat.completions.create({ model: "openai/gpt-4o", messages: [{ role: "user", content: "Hello!" }], temperature: 0.7});
console.log(response.choices[0].message.content);Sonraki adımlar
Section titled “Sonraki adımlar”- Gateway API referansı — parametreler, yanıt formatı
- Streaming — SSE akışı
- Multimodal — görsel, ses, dosya
- Faturalandırma — kredi, marj, token fiyatı