在线接口文档:
https://app.apifox.com/invite?token=symrLP7sojF6N31kZqnpZ
接口地址 https://chat.xutongbao.top/api/light/chat/createChatCompletion | ||
请求方式 POST | ||
请求参数 token String, 必须 prompt Array, 必须 例子一: 包含上下文[ { "role": "user", "content": "北京有多少人" }, { "role": "assistant", "content": "根据2021年数据,北京市的人口总数约为 2170 万人。请注意,人口数量可能会随时间变化而有所变动。" }, { "role": "user", "content": "上海呢" } ] 例子二:[ { "role": "user","content": "你好"} ] model String, 可选。 可选值: “gpt-3.5-turbo-16k” 、 “gpt-4”。 默认值为: “gpt-3.5-turbo-16k” params Object, 可选 例子一: 一次提问得到两个答案{ "n": 2 } 其他Open AI官方支持的参数可以通过对象格式传递,官方文档:https://platform.openai.com/docs/api-reference/completions/create | ||
在线文档 Apifox | ||
请求参数示例 { "model": "gpt-3.5-turbo-16k", "token": "sk-3d76d415-dd72-43ff-b7c8-65fb426f1d7b", "prompt": [ { "role": "user", "content": "你好" } ], "params": { "n": 1 } } |
请求参数示例:
{"model": "gpt-3.5-turbo-16k","token": "sk-xxx","prompt": [{"role": "user","content": "你好"}],"params": {"n": 1}
}
响应参数示例:
{"code": 200,"data": {"completion": {"id": "chatcmpl-8Fw63MbbFvizz1uz7hs1wHG7iEYgK","object": "chat.completion","created": 1698808935,"model": "gpt-3.5-turbo-16k-0613","choices": [{"index": 0,"message": {"role": "assistant","content": "【测试】你好!请问有什么我可以帮助你的吗?"},"finish_reason": "stop"}],"usage": {"prompt_tokens": 9,"completion_tokens": 38,"total_tokens": 47}},"info": {"isSdHide": "0","sdLimitCount": 200,"sdTextToImg": 160,"token": "sk-xxx","numOfOneDayCanCallApi": 7,"numOfOneDayAlreadyCallApi": 2,"apiDate": "2023-11-01"}},"message": "成功"
}
获取token的方法:
访问:https://chat.xutongbao.top/
注册账号-》登录-》我的-》API