Skip to main content
POST
Create chat completion

Ủy quyền

Authorization
string
header
bắt buộc

Authenticate with a Bearer Token. Format: Authorization: Bearer sk-xxxxxx

Nội dung

application/json
model
string
bắt buộc

Model ID

Ví dụ:

"gpt-4"

messages
object[]
bắt buộc

List of conversation messages

temperature
number
mặc định:1

Sampling temperature

Phạm vi bắt buộc: 0 <= x <= 2
top_p
number
mặc định:1

Nucleus sampling parameter

Phạm vi bắt buộc: 0 <= x <= 1
n
integer
mặc định:1

Number of generations

Phạm vi bắt buộc: x >= 1
stream
boolean
mặc định:false

Whether to stream the response

stream_options
object
stop

Stop sequences

max_tokens
integer

Maximum generated tokens

max_completion_tokens
integer

Maximum completion tokens

presence_penalty
number
mặc định:0
Phạm vi bắt buộc: -2 <= x <= 2
frequency_penalty
number
mặc định:0
Phạm vi bắt buộc: -2 <= x <= 2
logit_bias
object
user
string
tools
object[]
tool_choice
Tùy chọn có sẵn:
none,
auto,
required
response_format
object
seed
integer
reasoning_effort
enum<string>

Reasoning effort (for models that support reasoning)

Tùy chọn có sẵn:
low,
medium,
high
modalities
enum<string>[]
Tùy chọn có sẵn:
text,
audio
audio
object

Phản hồi

Response created successfully

id
string
object
string
Ví dụ:

"chat.completion"

created
integer
model
string
choices
object[]
usage
object
system_fingerprint
string