Skip to content

聊天接口

POST
/v1/chat/completions

Authorizations

bearer
TypeHTTP (bearer)

Request Body

JSON
{
"metadata": {
"additionalProperties": "string"
},
"temperature": 1,
"top_p": 1,
"user": "user-1234",
"service_tier": "string",
"messages": [
{
"content": "string",
"role": "string",
"name": "string"
}
],
"model": "string",
"modalities": [
"string"
],
"reasoning_effort": "string",
"max_completion_tokens": 0,
"frequency_penalty": 0,
"presence_penalty": 0,
"web_search_options": {
"user_location": {
"type": "string",
"approximate": {
"country": "string",
"region": "string",
"city": "string",
"timezone": "string"
}
},
"search_context_size": "string"
},
"top_logprobs": 0,
"response_format": {
"type": "string"
},
"audio": {
"voice": "string",
"format": "string"
},
"store": false,
"stream": false,
"stop": " ",
"logit_bias": {
"additionalProperties": 0
},
"logprobs": false,
"max_tokens": 0,
"n": 1,
"prediction": {
"type": "string",
"content": "string"
},
"seed": 0,
"stream_options": {
"include_usage": true
},
"tools": [
{
"type": "string",
"function": {
"description": "string",
"name": "string",
"parameters": {
"additionalProperties": "string"
},
"strict": false
}
}
],
"tool_choice": "string",
"parallel_tool_calls": true,
"function_call": "string",
"functions": [
{
"description": "string",
"name": "string",
"parameters": {
"additionalProperties": "string"
}
}
]
}

Responses

OK
application/json
JSON
{
"id": "string",
"choices": [
{
"finish_reason": "string",
"index": 0,
"message": {
"content": "string",
"refusal": "string",
"tool_calls": [
{
"id": "string",
"type": "string",
"function": {
"name": "string",
"arguments": "string"
}
}
],
"annotations": [
{
"type": "string",
"url_citation": {
"end_index": 0,
"start_index": 0,
"url": "string",
"title": "string"
}
}
],
"role": "string",
"function_call": {
"arguments": "string",
"name": "string"
},
"audio": {
"id": "string",
"expires_at": 0,
"data": "string",
"transcript": "string"
}
},
"logprobs": {
"content": [
{
"token": "string",
"logprob": 0,
"bytes": [
0
],
"top_logprobs": [
{
"token": "string",
"logprob": 0,
"bytes": [
0
]
}
]
}
],
"refusal": [
{
"token": "string",
"logprob": 0,
"bytes": [
0
],
"top_logprobs": [
{
"token": "string",
"logprob": 0,
"bytes": [
0
]
}
]
}
]
}
}
],
"created": 0,
"model": "string",
"service_tier": "string",
"system_fingerprint": "string",
"object": "string",
"usage": {
"completion_tokens": 0,
"prompt_tokens": 0,
"total_tokens": 0,
"completion_tokens_details": {
"accepted_prediction_tokens": 0,
"audio_tokens": 0,
"reasoning_tokens": 0,
"rejected_prediction_tokens": 0
},
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 0
}
}
}

Playground

Authorization
Body
JSON

Samples