در حال بارگذاری...
Authorization
Authorization: Bearer YOUR_API_KEY
HTTP-Referer
X-Title
curl -X POST https://rahyana.ir/api/v1/chat/completions \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-3.5-turbo",
"messages": [
{
"role": "user",
"content": "سلام، این اولین پیام من از طریق API راهیانا است!"
}
],
"stream": false,
"temperature": 0.7,
"max_tokens": 100
}'
پارامتر | نوع | ضروری؟ | توضیحات |
---|---|---|---|
model | string | بله | نام مدل مورد نظر (مثال: openai/gpt-3.5-turbo) |
messages | array | بله | آرایهای از پیامها با فرمت {role, content} |
temperature | number | خیر | میزان خلاقیت در پاسخها (0 تا 1) |
max_tokens | number | خیر | حداکثر تعداد توکنهای پاسخ |
{
"id": "cmpl-xxxxxxxxxxxxxx",
"object": "chat.completion",
"created": 1710000000,
"model": "openai/gpt-3.5-turbo",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "سلام! من یک مدل زبان هستم که توسط راهیانا آموزش دیدهام."
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 13,
"completion_tokens": 15,
"total_tokens": 28
}
}
choices[0].message.content
usage.total_tokens
finish_reason