TamgaLabs'ı uygulamalarınıza entegre etmek için ihtiyacınız olan her şey.
TamgaLabs, tamamen OpenAI uyumlu bir API gatewaydir. Tüm endpointler OpenAI formatını takip eder. Sadece base_url ve API anahtarınızı değiştirin.
curl https://tamgalabs.tr/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tamgalabs/gpt-5",
"messages": [{"role": "user", "content": "Hello!"}]
}'
Base URL: https://tamgalabs.tr/api/v1
Tüm API istekleri, Authorization headerında Bearer token olarak iletilen bir API anahtarı gerektirir.
Authorization: Bearer tl-sk-your-api-key-here
API anahtarlarınızı dashboarddan oluşturun.
Mevcut AI modellerinden herhangi biriyle metin yanıtları oluşturun.
POST /api/v1/chat/completions{
"model": "tamgalabs/gpt-5",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is AI?"}
],
"temperature": 0.7,
"max_tokens": 1024,
"top_p": 1,
"stream": false
}
| Parametre | Tür | Varsayılan | Açıklama |
|---|---|---|---|
model | string | - | Model ID (e.g. tamgalabs/gpt-5) |
messages | array | - | Array of message objects with role and content |
temperature | number | 0.7 | Sampling temperature (0-2) |
max_tokens | integer | 1024 | Maximum tokens in response |
stream | boolean | false | Enable SSE streaming |
top_p | number | 1 | Nucleus sampling threshold |
stop | string/array | null | Stop sequences |
tools | array | null | Tool definitions for function calling |
seed | integer | null | Deterministic sampling seed |
Gerçek zamanlı SSE (Server-Sent Events) yanıtları için stream: true olarak ayarlayın. Her parça, oluşturulan içeriğin bir deltasını içerir.
curl https://tamgalabs.tr/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tamgalabs/gpt-5",
"messages": [{"role": "user", "content": "Tell me a story"}],
"stream": true
}'
Akış data: [DONE] ile sona erer.
Metin girişleri için vektör embeddingleri oluşturun. Bu endpoint geliştirme aşamasındadır. Erken erişim için bekleme listesine katılın.
Metin promptlarından görsel oluşturun. Bu endpoint geliştirme aşamasındadır. Erken erişim için bekleme listesine katılın.
Belgeleri bir sorgunun alaka düzeyine göre yeniden sıralayın. Bu endpoint geliştirme aşamasındadır. Erken erişim için bekleme listesine katılın.
250+ AI modeli mevcuttur. Tüm modellere aynı API endpointi üzerinden tutarlı fiyatlandırma ile erişilir. Tüm model kataloğunu Modeller sayfasında görüntüleyin.
GET /api/v1/models
Örnek fiyatlandırma: 1M girdi token başına $0.05-$30.00, 1M çıktı token başına $0.20-$75.00 - modele göre değişir.
Resmi OpenAI Python kütüphanesini TamgaLabsı base URL olarak kullanın.
pip install openai
from openai import OpenAI
client = OpenAI(
base_url="https://tamgalabs.tr/api/v1",
api_key="YOUR_API_KEY"
)
# Chat
response = client.chat.completions.create(
model="tamgalabs/gpt-5",
messages=[{"role": "user", "content": "Hello!"}]
)
print(response.choices[0].message.content)
# Streaming
stream = client.chat.completions.create(
model="tamgalabs/gpt-5",
messages=[{"role": "user", "content": "Tell me a story"}],
stream=True
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
# Models list
models = client.models.list()
for m in models:
print(m.id)
const response = await fetch("https://tamgalabs.tr/api/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "tamgalabs/gpt-5",
messages: [{role: "user", content: "Hello!"}],
stream: false
})
});
const data = await response.json();
console.log(data.choices[0].message.content);
# Chat
curl https://tamgalabs.tr/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "tamgalabs/gpt-5",
"messages": [{"role": "user", "content": "Hello!"}]
}'
# List models
curl https://tamgalabs.tr/api/v1/models \
-H "Authorization: Bearer YOUR_API_KEY"
TamgaLabs ön ödemeli kredi sistemi kullanır. İşleyiş şu şekildedir:
Bakiyenizi API üzerinden kontrol edin:
curl https://tamgalabs.tr/api/dashboard/billing \
-H "Cookie: tamgalabs_session=YOUR_SESSION"
| Limit | Değer |
|---|---|
| Requests per minute | 20 |
| Response when exceeded | HTTP 429 + JSON error |
| Kod | HTTP Durum | Açıklama |
|---|---|---|
invalid_api_key | 401 | Bad or expired API key |
insufficient_credits | 402 | Credit balance is $0 |
model_not_found | 404 | Unknown model ID |
rate_limit_exceeded | 429 | Too many requests |
missing_parameters | 400 | Required fields missing |