ChatGPT 使用 API 进行 Postman 调用测试
当获得 ChatGPT 的 API Key 以后,想使用 Postman 来进行一下调用。
调用的方法为 POST。
需要设置几个参数。
我们希望使用的 EndPoint 是:
API EndPoint
访问使用的 EndPoint 是:https://api.openai.com/v1/completions
授权方法
授权的方法使用的是 Bearer Token

在授权部分选择使用 Bearer Token,然后把你从 OpenAI 网站的 Token 复制到这里。
Content-Type
Content-Type 需要使用的是 JSON 格式数据。

这个需要在 Content-Type 中进行配置。
Body 数据
需要上传给 API 的 Body 数据为 Json 格式的。
复制代码
这个格式比较简单,然后就直接把你需要问的内容放到 Prompt 字段内就可以了。
然后把这个数据发送过去。
然后下面返回的结果就是有关你这个问题的回答了。
根据 API 我们当前的测试来看,查询返回的时间超过了 4s。

我们可以集成这个 API 到我们需要的环境中。
同时,你可以做一个服务来调用这个 API 来为你的网站提供机器人服务。
评论