Tạo phản hồi (OpenAI Responses API)

post/v1/responses

Tạo phản hồi của mô hình thông qua OpenAI Responses API. Hỗ trợ hội thoại nhiều lượt, gọi công cụ và suy luận.

Xác thực

Gửi khóa API OLETOKEN dưới dạng token Bearer. Khóa được tạo tại trang API Keys trong bảng điều khiển.

Authorization: Bearer $OLETOKEN_API_KEY

Nội dung yêu cầu

Content-Type:application/json

TrườngKiểuBắt buộcMô tả
modelstring—
inputstring | object[]—Đầu vào, có thể là một chuỗi hoặc một mảng tin nhắn
instructionsstring——
max_output_tokensinteger——
temperaturenumber——
top_pnumber——
streamboolean——
toolsobject[]——
tool_choicestring | object——
reasoningobject——
effortstringlowmediumhigh——
summarystring——
previous_response_idstring——
truncationstringautodisabled——

Phản hồi

200Đã tạo phản hồi

TrườngKiểuBắt buộcMô tả
idstring——
objectstring——
created_atinteger——
statusstringcompletedfailedin_progressincomplete——
modelstring——
outputobject[]——
typestring——
idstring——
statusstring——
rolestring——
contentobject[]——
typestring——
textstring——
usageUsage——
prompt_tokensinteger—Số token prompt
completion_tokensinteger—Số token completion
total_tokensinteger—Tổng số token
prompt_tokens_detailsobject——
cached_tokensinteger——
text_tokensinteger——
audio_tokensinteger——
image_tokensinteger——
completion_tokens_detailsobject——
text_tokensinteger——
audio_tokensinteger——
reasoning_tokensinteger——

Ví dụ yêu cầu

curl -X POST 'https://api.oletoken.ai/v1/responses' \
  -H "Authorization: Bearer $OLETOKEN_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "string"
  }'