สร้างการเติมข้อความ

post/v1/completions

สร้างข้อความต่อเนื่องจากพรอมต์ที่กำหนด

การยืนยันตัวตน

ส่งคีย์ API ของ OLETOKEN เป็น Bearer token สร้างคีย์ได้ที่หน้า API Keys ในคอนโซล

Authorization: Bearer $OLETOKEN_API_KEY

เนื้อหาคำขอ

Content-Type:application/json

ฟิลด์ประเภทจำเป็นคำอธิบาย
modelstring—
promptstring | string[]—
max_tokensinteger——
temperaturenumber——
top_pnumber——
ninteger——
streamboolean——
stopstring | string[]——
suffixstring——
echoboolean——

การตอบกลับ

200สร้างการตอบกลับแล้ว

ฟิลด์ประเภทจำเป็นคำอธิบาย
idstring——
objectstring——
createdinteger——
modelstring——
choicesobject[]——
textstring——
indexinteger——
finish_reasonstring——
usageUsage——
prompt_tokensinteger—จำนวนโทเค็นของพรอมต์
completion_tokensinteger—จำนวนโทเค็นคำตอบ
total_tokensinteger—จำนวนโทเค็นทั้งหมด
prompt_tokens_detailsobject——
cached_tokensinteger——
text_tokensinteger——
audio_tokensinteger——
image_tokensinteger——
completion_tokens_detailsobject——
text_tokensinteger——
audio_tokensinteger——
reasoning_tokensinteger——

ตัวอย่างคำขอ

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"
  }'