Tạo completion

post/v1/completions

Tạo văn bản hoàn thành từ một prompt cho trước.

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—
promptstring | string[]—
max_tokensinteger——
temperaturenumber——
top_pnumber——
ninteger——
streamboolean——
stopstring | string[]——
suffixstring——
echoboolean——

Phản hồi

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

TrườngKiểuBắt buộcMô tả
idstring——
objectstring——
createdinteger——
modelstring——
choicesobject[]——
textstring——
indexinteger——
finish_reasonstring——
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/completions' \
  -H "Authorization: Bearer $OLETOKEN_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "string",
    "prompt": "string"
  }'