/chat/completions 接口api_key: 32位字符串org_id: 6位字符串{
"functions": ["search_internet", "tarot", "bazi", "book_house_service"],
"voice_id": "wukong"
}prompt参数model参数指定角色ID/chat/completions 接口/chat/completions{
"model": "角色ID",
"prompt": "用户输入的消息内容",
"stream": true,
"lang": "default",
"emoji_mode": true,
"audio_mode": true,
"emotion_status": false,
"tools": ["search_internet", "tarot"],
"tool_call": false,
"function_id": null
}| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| model | string | 是 | - | 角色ID(NPC ID) |
| prompt | string | 是 | - | 用户输入文本(直接使用,无需messages) |
| stream | boolean | 否 | true | 流式响应(目前只支持流式) |
| lang | string | 否 | "default" | 语言设置 |
| emoji_mode | boolean | 否 | true | 是否启用emoji |
| audio_mode | boolean | 否 | true | 是否按语音要求断句 |
| emotion_status | boolean | 否 | false | 是否返回情绪状态 |
| tools | array | 否 | [] | 可用的工具列表 |
| tool_call | boolean | 否 | false | 是否为工具调用 |
| function_id | string | 否 | null | 具体的函数ID |
{
"id": "chatcmpl-xxx",
"object": "chat.completion.chunk",
"created": 1234567890,
"model": "角色ID",
"choices": [
{
"index": 0,
"delta": {"content": "响应内容"},
"finish_reason": null
}
]
}| 错误码 | 说明 |
|---|---|
| 200 | 请求成功 |
| 400 | 请求参数错误 |
| 401 | 认证失败 |
| 403 | 权限不足 |
| 404 | 资源不存在 |
| 429 | 请求过于频繁 |
| 500 | 服务器内部错误 |
| 601 | 登录异常 |
/chat/completions 端点fast_mode 参数route 参数/prepare_fast_mode 接口