สร้างการตอบกลับ (OpenAI Responses API)

post/v1/responses

สร้างการตอบกลับของโมเดลผ่าน OpenAI Responses API รองรับบทสนทนาหลายรอบ การเรียกใช้เครื่องมือ และการให้เหตุผล

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

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

Authorization: Bearer $OLETOKEN_API_KEY

เนื้อหาคำขอ

Content-Type:application/json

ฟิลด์ประเภทจำเป็นคำอธิบาย
modelstring—
inputstring | object[]—อินพุต ซึ่งเป็นสตริงหรืออาร์เรย์ของข้อความ
instructionsstring——
max_output_tokensinteger——
temperaturenumber——
top_pnumber——
streamboolean——
toolsobject[]——
tool_choicestring | object——
reasoningobject——
effortstringlowmediumhigh——
summarystring——
previous_response_idstring——
truncationstringautodisabled——

การตอบกลับ

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

ฟิลด์ประเภทจำเป็นคำอธิบาย
idstring——
objectstring——
created_atinteger——
statusstringcompletedfailedin_progressincomplete——
modelstring——
outputobject[]——
typestring——
idstring——
statusstring——
rolestring——
contentobject[]——
typestring——
textstring——
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/responses' \
  -H "Authorization: Bearer $OLETOKEN_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "string"
  }'