ChatGPT 
替换
id 和令牌需要替换为自己的 获取令牌
POST /v1/openai/chatcmpl
将一系列消息作为输入,并返回模型生成的消息作为输出,可以实现诸如:
- 聊天机器人
- 起草书面文件
- 翻译
- 文本润色
- 文本总结
每次成功请求消耗 3 金币(如有变动以实际为准)
参数 
| 名称 | 类型 | 描述 | 
|---|---|---|
| messages | [object] | 对象参见 message,最大数量20 | 
message 
| 名称 | 类型 | 描述 | 
|---|---|---|
| role | string | 可选值: 
 | 
| content | string | 内容,最大长度 1000 个字符 | 
示例 
Hamibot 示例 
js
// _id 和 hmp_... 需要替换成自己的
http.request('https://api.hamibot.com/v1/openai/chatcmpl', {
  method: 'POST',
  contentType: 'application/json',
  headers: {
    authorization: 'hmp_...',
  },
  body: JSON.stringify({ messages: [{ role: 'user', content: '你好' }] }),
});curl 示例 
shell
curl \
    -X POST \
    -H "Authorization: hmp_..." \
    -H "Content-Type: application/json" \
    -d '{"messages": [{"role": "user", "content": "你好"}]}' \
    https://api.hamibot.com/v1/openai/chatcmpl响应 
200 成功
json
{
  "role": "assistant",
  "content": "回复内容"
}422 参数错误
400 金币余额不足