跳转到主要内容
POST
POST /v1/chat/completions

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

application/json
messages
object[]
必填
model
string
必填
audio
object | null
frequency_penalty
number<double> | null
function_call
可用选项:
none,
auto
functions
object[] | null
logit_bias
object | null
logprobs
boolean | null
max_completion_tokens
integer<int64> | null
max_tokens
integer<int64> | null
metadata
object | null
modalities
enum<string>[] | null
可用选项:
text,
audio
moderation
object | null
n
integer<int64> | null
parallel_tool_calls
boolean | null
prediction
object | null
presence_penalty
number<double> | null
prompt_cache_key
string | null
prompt_cache_options
object | null
prompt_cache_retention
enum<string> | null
可用选项:
in_memory,
24h
reasoning_effort
enum<string> | null
可用选项:
none,
minimal,
low,
medium,
high,
xhigh,
max
response_format
object
safety_identifier
string | null
seed
integer<int64> | null
service_tier
enum<string> | null
可用选项:
auto,
default,
flex,
scale,
priority,
fast,
ultrafast
stop
store
boolean | null
stream
boolean | null
stream_options
object | null
temperature
number<double> | null
tool_choice
可用选项:
none,
auto,
required
tools
object[] | null
top_logprobs
integer<int64> | null
top_p
number<double> | null
user
string | null
verbosity
enum<string> | null
可用选项:
low,
medium,
high
web_search_options
object | null

响应

Successful protocol response

choices
object[]
必填
created
integer<int64>
必填
id
string
必填
model
string
必填
object
enum<string>
必填
可用选项:
chat.completion
moderation
object | null
service_tier
enum<string> | null
可用选项:
auto,
default,
flex,
scale,
priority,
fast,
ultrafast
system_fingerprint
string | null
usage
object | null