สร้างการเติมข้อความ
post/v1/completions
สร้างข้อความต่อเนื่องจากพรอมต์ที่กำหนด
การยืนยันตัวตน
ส่งคีย์ API ของ OLETOKEN เป็น Bearer token สร้างคีย์ได้ที่หน้า API Keys ในคอนโซล
Authorization: Bearer $OLETOKEN_API_KEYเนื้อหาคำขอ
Content-Type:application/json
| ฟิลด์ | ประเภท | จำเป็น | คำอธิบาย |
|---|---|---|---|
| model | string | — | |
| prompt | string | string[] | — | |
| max_tokens | integer | — | — |
| temperature | number | — | — |
| top_p | number | — | — |
| n | integer | — | — |
| stream | boolean | — | — |
| stop | string | string[] | — | — |
| suffix | string | — | — |
| echo | boolean | — | — |
การตอบกลับ
200สร้างการตอบกลับแล้ว
| ฟิลด์ | ประเภท | จำเป็น | คำอธิบาย |
|---|---|---|---|
| id | string | — | — |
| object | string | — | — |
| created | integer | — | — |
| model | string | — | — |
| choices | object[] | — | — |
| text | string | — | — |
| index | integer | — | — |
| finish_reason | string | — | — |
| usage | Usage | — | — |
| prompt_tokens | integer | — | จำนวนโทเค็นของพรอมต์ |
| completion_tokens | integer | — | จำนวนโทเค็นคำตอบ |
| total_tokens | integer | — | จำนวนโทเค็นทั้งหมด |
| prompt_tokens_details | object | — | — |
| cached_tokens | integer | — | — |
| text_tokens | integer | — | — |
| audio_tokens | integer | — | — |
| image_tokens | integer | — | — |
| completion_tokens_details | object | — | — |
| text_tokens | integer | — | — |
| audio_tokens | integer | — | — |
| reasoning_tokens | integer | — | — |
ตัวอย่างคำขอ
curl -X POST 'https://api.oletoken.ai/v1/completions' \
-H "Authorization: Bearer $OLETOKEN_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "string",
"prompt": "string"
}'
