生成 AI 回复-指定 conversion(类 OpenAI)
POST
/{organization_uuid}/{conversation_uuid}/v1/chat/completions已经支持类似 gpt 的请求格式,如果你使用的第三方插件支持自定义 OpenAI 地址,现在可以直接将 https://api.openai.com
替换成 https://openai.aihey.cc/claude/{organization_uuid}/{conversation_uuid}
注意:你需要指定 conversation_uuid
,conversation_uuid 可通过「获取全部对话」查看
类 OpenAI 请求体和响应体格式,格式可参考 https://platform.openai.com/docs/api-reference/chat/create
请求参数
Path Params
organization_uuid
string
required
Example:
dca2a902-a463-41f0-88cb-b047deb40178
conversation_uuid
string
required
Example:
5446798e-0e11-4e8f-994c-3d8386f01bd6
Header Params
Content-Type
string
optional
Example:
application/json
Accept
string
optional
Example:
*/*
Body Params application/json
model
string
optional
Default:
claude-v2
messages
array [object {2}]
required
role
string
required
Default:
user
content
string
required
stream
boolean
optional
Default:
false
Example
{
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "user",
"content": "你好"
}
]
}
示例代码
Responses
成功(200)
成功(流式输出)(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
Data Schema
id
string
required
object
string
required
created
integer
required
choices
array [object {3}]
required
index
integer
optional
message
object
optional
finish_reason
string
optional
usage
object
optional
prompt_tokens
integer
optional
completion_tokens
integer
optional
total_tokens
integer
optional
Example
{
"id": "chatcmpl-123",
"object": "chat.completion",
"created": 1677652288,
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "\n\nHello there, how may I assist you today?",
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 0,
"completion_tokens": 0,
"total_tokens": 0
}
}
Last modified: 1 年前