Skip to main content
POST
聊天完成 (OpenAI 兼容)

💡 Quick Examples

Streaming:

📤 Response Format

Non-streaming Response

Streaming Response (SSE)


🔧 API Reference

The interactive API form below is auto-generated from OpenAPI spec. All available models are shown in the model dropdown.

Authorizations

Authorization
string
header
required

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

Body

application/json
model
enum<string>
required

模型名称

Available options:
gpt-5.1,
gpt-5.1-all,
gpt-5.1-thinking,
gpt-5.1-thinking-all,
gpt-5.2,
gpt-5.3,
gpt-5.3-codex,
gpt-5.4,
gemini-3-pro,
gemini-2.5-pro,
gemini-2.5-flash,
gemini-3-flash,
gemini-3.1-pro,
claude-4.5,
claude-opus-4-6,
claude-haiku-4-5-20251001,
claude-sonnet-4-6,
claude-opus-4-7
Example:

"gpt-5.1"

messages
object[]
required

消息列表

Example:
stream
boolean

是否流式输出

Example:

false

temperature
number | null

温度 (0-2)

Example:

1

max_tokens
number | null

最大 token 数

Example:

1000

max_completion_tokens
number | null

最大补全 token 数 (新版参数)

Example:

1000

top_p
number | null

Top P

Example:

1

frequency_penalty
number | null

频率惩罚 (-2.0 到 2.0)

Example:

0

presence_penalty
number | null

存在惩罚 (-2.0 到 2.0)

Example:

0

stop
object

停止序列

n
number | null

生成数量

Example:

1

seed
number | null

随机种子

Example:

12345

user
string

用户标识

tools
object[]

工具列表 (Function Calling)

tool_choice
object

工具选择策略

response_format
object

响应格式

logprobs
boolean | null

是否返回 logprobs

Example:

false

top_logprobs
number | null

top logprobs 数量

Example:

5

logit_bias
object | null

logit 偏置

parallel_tool_calls
boolean

并行工具调用

Example:

true

Response

200

成功