冰橙GPT chatGPT开放接口使用说明【含连续对话功能和快捷指令接收】

1.请求地址:https://gpt.bcwhkj.cn/api/v2.Gptliu/search   

2.请求方式: POST  

3.body格式:json

4.请求内容(sse 流式请求,输出效果较好,响应速度快)(非流式请求,可不加stream这一行):

{
       "messages" : [{"role":"user","content":"你是谁?"}],
       "model": "gpt-3.5-turbo",
       "stream":true //非SSE流式请求,这一行可不加
}

5.请求头

{
    "Content-Type": application/json,
    "Authorization": "Bearer 这段中文换成你自己的TOKEN(注意前面有个英文空格需保留)"
}

说明:

token获取方式:访问公众号《冰橙文化科技》进入菜单冰橙GPT后,访问右上角 / 个人(首次访问免费赠送10000字符,可通过充值增加字符数)可查看 token

SSE流式请求与非流式请求的区别:
    流式POST请求:内容将进行逐家响应和返回,响应速度快。
    普通POST请求:将等待OPENAI的CHATGPT官方接口全部内容都响应完成后,服务器这边才会将内容将通过接口回复给前端,速度较慢。


也可通过微信扫以下图片进入:

5.响应体格式:json

6.响应内容(非流式请求时的响应内容):

{
    "id": "chatcmpl-77dQj73rIl0GJyTpAH4QlcSnhOFKp",
    "object": "chat.completion",
    "created": 1682054221,
    "model": "gpt-3.5-turbo-0301",
    "usage": {
        "prompt_tokens": 13,
        "completion_tokens": 30,
        "total_tokens": 43
    },
    "choices": [
        {
            "message": {
                "role": "assistant",
                "content": "我是一个人工智能语言模型,可以根据用户提供的输入进行回答和交流。"
            },
            "finish_reason": "stop",
            "index": 0
        }
    ]
}

6.响应内容(流式请求时的响应内容):

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"role":"assistant"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"我"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"是"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"一个"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"AI"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"语"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"言"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"模"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"型"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":","},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"专"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"门"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"用"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"来"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"回"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"答"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"问题"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"和"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"提"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"供"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"帮"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"助"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"的"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{"content":"。"},"index":0,"finish_reason":null}]}

data: {"id":"chatcmpl-783jPdq1a1ZG6KQc9pq98FDRSqNmp","object":"chat.completion.chunk","created":1682155323,"model":"gpt-3.5-turbo-0301","choices":[{"delta":{},"index":0,"finish_reason":"stop"}]}

data: [DONE]

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值