Dashboard
API Key
-
Bakiye
-
Hesap
-
Hizli Baslangic
API anahtarinizi alip herhangi bir OpenAI uyumlu SDK ile kullanabilirsiniz.
python
curl
API Anahtarlari
Mevcut API Anahtariniz
-
Bakiye
-
Kullanim
API anahtarinizi Authorization: Bearer sk-xxx header'i ile gonderin.
Her istek bakiyenizden token kullanimina gore dusulur.
Base URL: https://v2.recai.io/v1
API Dokumantasyonu
OpenAI uyumlu REST API. Mevcut SDK'larinizi dogrudan kullanabilirsiniz.
Base URL
https://v2.recai.io/v1
Kimlik Dogrulama
Tum isteklerde Authorization header'i gereklidir.
header
Authorization: Bearer sk-your-api-key
Endpoint'ler
| Method | Endpoint | Aciklama |
|---|---|---|
| POST | /v1/chat/completions | Chat completions stream |
| GET | /v1/models | Kullanilabilir model listesi |
| GET | /api/balance/:keyid | Bakiye sorgulama |
POST /v1/chat/completions
OpenAI uyumlu chat completions. Streaming ve non-streaming destekler.
Parametreler
| Parametre | Tip | Zorunlu | Aciklama |
|---|---|---|---|
model | string | Evet | Model adi (ornek: deepseek-chat) |
messages | array | Evet | Mesaj dizisi [{role, content}] |
stream | boolean | Hayir | SSE streaming etkinlestir |
temperature | number | Hayir | Yaraticilik (0-2) |
top_p | number | Hayir | Nucleus sampling |
max_tokens | integer | Hayir | Maksimum cikti token sayisi |
stop | string/array | Hayir | Durma dizisi |
timeout | integer | Hayir | Zaman asimi (saniye) |
think | boolean | Hayir | Derin dusunme modu |
deepsearch | boolean | Hayir | Derin arama modu |
Ornek Istek
python
from openai import OpenAI
client = OpenAI(
base_url="https://v2.recai.io/v1",
api_key="sk-your-api-key"
)
# Non-streaming
response = client.chat.completions.create(
model="deepseek-chat",
messages=[
{"role": "system", "content": "Sen yardimci bir asistansin."},
{"role": "user", "content": "Merhaba!"}
],
temperature=0.7
)
print(response.choices[0].message.content)
# Streaming
stream = client.chat.completions.create(
model="deepseek-chat",
messages=[{"role": "user", "content": "Merhaba!"}],
stream=True
)
for chunk in stream:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="")
javascript
import OpenAI from 'openai';
const client = new OpenAI({
baseURL: 'https://v2.recai.io/v1',
apiKey: 'sk-your-api-key'
});
const response = await client.chat.completions.create({
model: 'deepseek-chat',
messages: [{ role: 'user', content: 'Merhaba!' }]
});
console.log(response.choices[0].message.content);
curl
curl https://v2.recai.io/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-your-api-key" \
-d '{
"model": "deepseek-chat",
"messages": [{"role": "user", "content": "Merhaba!"}],
"temperature": 0.7
}'
Ornek Yanit
json
{
"id": "chatcmpl-1710000000000",
"object": "chat.completion",
"created": 1710000000,
"model": "deepseek-chat",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "Merhaba! Size nasil yardimci olabilirim?"
},
"finish_reason": "stop"
}],
"usage": {
"prompt_tokens": 12,
"completion_tokens": 15,
"total_tokens": 27
}
}
Playground
API'yi dogrudan tarayicinizdan test edin.
Yanit burada gorunecek...