Chatgpt Web API 创建对话,免费,不计token数量,模仿网页提交对话

Chatgpt  API  是收费的,按token使用量计费

Chatgpt Web API 免费的,只要有账号就可以使用。

 

curl 'https://chat.openai.com/backend-api/conversation' \
  -H 'authority: chat.openai.com' \
  -H 'accept: text/event-stream' \
  -H 'accept-language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6' \
  -H 'authorization: Bearer *****************************' \
  -H 'content-type: application/json' \
  -H 'cookie: ********************************; _dd_s=' \
  -H 'origin: https://chat.openai.com' \
  -H 'sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114", "Microsoft Edge";v="114"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "Windows"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-origin' \
  -H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67' \
  --data-raw '{"action":"next","messages":[{"id":"aaa23496-15a3-485f-b0f6-a414410427d6","author":{"role":"user"},"content":{"content_type":"text","parts":["1+1"]},"metadata":{}}],"conversation_id":"d64d724f-3455-413e-ac72-b42b3f4b0ffe","parent_message_id":"cf818ae7-b9d6-4d43-b699-fe806d413270","model":"text-davinci-002-render-sha","timezone_offset_min":-480,"history_and_training_disabled":false,"arkose_token":null}' \
  --compressed

 返回是json信息

data: {"message": {"id": "e510886d-9980-451d-8a3d-5f07f8e39bf1", "author": {"role": "assistant", "name": null, "metadata": {}}, "create_time": 1690188074.886316, "update_time": null, "content": {"content_type": "text", "parts": [""]}, "status": "in_progress", "end_turn": null, "weight": 1.0, "metadata": {"message_type": "next", "model_slug": "text-davinci-002-render-sha"}, "recipient": "all"}, "conversation_id": "d64d724f-3455-413e-ac72-b42b3f4b0ffe", "error": null}

data: {"conversation_id": "d64d724f-3455-413e-ac72-b42b3f4b0ffe", "message_id": "aaa23496-15a3-485f-b0f6-a414410427d6", "is_completion": false, "moderation_response": {"flagged": false, "blocked": false, "moderation_id": "modr-7flPu9JUekemN6KyhJQo2nYzfkWdh"}}

data: {"message": {"id": "e510886d-9980-451d-8a3d-5f07f8e39bf1", "author": {"role": "assistant", "name": null, "metadata": {}}, "create_time": 1690188074.886316, "update_time": null, "content": {"content_type": "text", "parts": ["The"]}, "status": "in_progress", "end_turn": null, "weight": 1.0, "metadata": {"message_type": "next", "model_slug": "text-davinci-002-render-sha"}, "recipient": "all"}, "conversation_id": "d64d724f-3455-413e-ac72-b42b3f4b0ffe", "error": null}

data: {"message": {"id": "e510886d-9980-451d-8a3d-5f07f8e39bf1", "author": {"role": "assistant", "name": null, "metadata": {}}, "create_time": 1690188074.886316, "update_time": null, "content": {"content_type": "text", "parts": ["The sum"]}, "status": "in_progress", "end_turn": null, "weight": 1.0, "metadata": {"message_type": "next", "model_slug": "text-davinci-002-render-sha"}, "recipient": "all"}, "conversation_id": "d64d724f-3455-413e-ac72-b42b3f4b0ffe", "error": null}

data: {"message": {"id": "e510886d-9980-451d-8a3d-5f07f8e39bf1", "author": {"role": "assistant", "name": null, "metadata": {}}, "create_time": 1690188074.886316, "update_time": null, "content": {"content_type": "text", "parts": ["The sum of"]}, "status": "in_progress", "end_turn": null, "weight": 1.0, "metadata": {"message_type": "next", "model_slug": "text-davinci-002-render-sha"}, "recipient": "all"}, "conversation_id": "d64d724f-3455-413e-ac72-b42b3f4b0ffe", "error": null}

data: {"message": {"id": "e510886d-9980-451d-8a3d-5f07f8e39bf1", "author": {"role": "assistant", "name": null, "metadata": {}}, "create_time": 1690188074.886316, "update_time": null, "content": {"content_type": "text", "parts": ["The sum of "]}, "status": "in_progress", "end_turn": null, "weight": 1.0, "metadata": {"message_type": "next", "model_slug": "text-davinci-002-render-sha"}, "recipient": "all"}, "conversation_id": "d64d724f-3455-413e-ac72-b42b3f4b0ffe", "error": null}

data: {"message": {"id": "e510886d-9980-451d-8a3d-5f07f8e39bf1", "author": {"role": "assistant", "name": null, "metadata": {}}, "create_time": 1690188074.886316, "update_time": null, "content": {"content_type": "text", "parts": ["The sum of 1"]}, "status": "in_progress", "end_turn": null, "weight": 1.0, "metadata": {"message_type": "next", "model_slug": "text-davinci-002-render-sha"}, "recipient": "all"}, "conversation_id": "d64d724f-3455-413e-ac72-b42b3f4b0ffe", "error": null}

data: {"message": {"id": "e510886d-9980-451d-8a3d-5f07f8e39bf1", "author": {"role": "assistant", "name": null, "metadata": {}}, "create_time": 1690188074.886316, "update_time": null, "content": {"content_type": "text", "parts": ["The sum of 1 +"]}, "status": "in_progress", "end_turn": null, "weight": 1.0, "metadata": {"message_type": "next", "model_slug": "text-davinci-002-render-sha"}, "recipient": "all"}, "conversation_id": "d64d724f-3455-413e-ac72-b42b3f4b0ffe", "error": null}

data: {"message": {"id": "e510886d-9980-451d-8a3d-5f07f8e39bf1", "author": {"role": "assistant", "name": null, "metadata": {}}, "create_time": 1690188074.886316, "update_time": null, "content": {"content_type": "text", "parts": ["The sum of 1 + "]}, "status": "in_progress", "end_turn": null, "weight": 1.0, "metadata": {"finish_details": {"type": "stop", "stop": "<|diff_marker|>"}, "message_type": "next", "model_slug": "text-davinci-002-render-sha"}, "recipient": "all"}, "conversation_id": "d64d724f-3455-413e-ac72-b42b3f4b0ffe", "error": null}

data: {"message": {"id": "e510886d-9980-451d-8a3d-5f07f8e39bf1", "author": {"role": "assistant", "name": null, "metadata": {}}, "create_time": 1690188074.886316, "update_time": null, "content": {"content_type": "text", "parts": ["The sum of 1 + 1"]}, "status": "in_progress", "end_turn": null, "weight": 1.0, "metadata": {"finish_details": {"type": "stop", "stop": "<|diff_marker|>"}, "message_type": "next", "model_slug": "text-davinci-002-render-sha"}, "recipient": "all"}, "conversation_id": "d64d724f-3455-413e-ac72-b42b3f4b0ffe", "error": null}

data: {"message": {"id": "e510886d-9980-451d-8a3d-5f07f8e39bf1", "author": {"role": "assistant", "name": null, "metadata": {}}, "create_time": 1690188074.886316, "update_time": null, "content": {"content_type": "text", "parts": ["The sum of 1 + 1 is"]}, "status": "in_progress", "end_turn": null, "weight": 1.0, "metadata": {"finish_details": {"type": "stop", "stop": "<|diff_marker|>"}, "message_type": "next", "model_slug": "text-davinci-002-render-sha"}, "recipient": "all"}, "conversation_id": "d64d724f-3455-413e-ac72-b42b3f4b0ffe", "error": null}

data: {"message": {"id": "e510886d-9980-451d-8a3d-5f07f8e39bf1", "author": {"role": "assistant", "name": null, "metadata": {}}, "create_time": 1690188074.886316, "update_time": null, "content": {"content_type": "text", "parts": ["The sum of 1 + 1 is equal"]}, "status": "in_progress", "end_turn": null, "weight": 1.0, "metadata": {"finish_details": {"type": "stop", "stop": "<|diff_marker|>"}, "message_type": "next", "model_slug": "text-davinci-002-render-sha"}, "recipient": "all"}, "conversation_id": "d64d724f-3455-413e-ac72-b42b3f4b0ffe", "error": null}

data: {"message": {"id": "e510886d-9980-451d-8a3d-5f07f8e39bf1", "author": {"role": "assistant", "name": null, "metadata": {}}, "create_time": 1690188074.886316, "update_time": null, "content": {"content_type": "text", "parts": ["The sum of 1 + 1 is equal to"]}, "status": "in_progress", "end_turn": null, "weight": 1.0, "metadata": {"finish_details": {"type": "stop", "stop": "<|diff_marker|>"}, "message_type": "next", "model_slug": "text-davinci-002-render-sha"}, "recipient": "all"}, "conversation_id": "d64d724f-3455-413e-ac72-b42b3f4b0ffe", "error": null}

data: {"message": {"id": "e510886d-9980-451d-8a3d-5f07f8e39bf1", "author": {"role": "assistant", "name": null, "metadata": {}}, "create_time": 1690188074.886316, "update_time": null, "content": {"content_type": "text", "parts": ["The sum of 1 + 1 is equal to "]}, "status": "in_progress", "end_turn": null, "weight": 1.0, "metadata": {"finish_details": {"type": "stop", "stop": "<|diff_marker|>"}, "message_type": "next", "model_slug": "text-davinci-002-render-sha"}, "recipient": "all"}, "conversation_id": "d64d724f-3455-413e-ac72-b42b3f4b0ffe", "error": null}

data: {"message": {"id": "e510886d-9980-451d-8a3d-5f07f8e39bf1", "author": {"role": "assistant", "name": null, "metadata": {}}, "create_time": 1690188074.886316, "update_time": null, "content": {"content_type": "text", "parts": ["The sum of 1 + 1 is equal to 2"]}, "status": "in_progress", "end_turn": null, "weight": 1.0, "metadata": {"finish_details": {"type": "stop", "stop": "<|diff_marker|>"}, "message_type": "next", "model_slug": "text-davinci-002-render-sha"}, "recipient": "all"}, "conversation_id": "d64d724f-3455-413e-ac72-b42b3f4b0ffe", "error": null}

data: {"message": {"id": "e510886d-9980-451d-8a3d-5f07f8e39bf1", "author": {"role": "assistant", "name": null, "metadata": {}}, "create_time": 1690188074.886316, "update_time": null, "content": {"content_type": "text", "parts": ["The sum of 1 + 1 is equal to 2."]}, "status": "in_progress", "end_turn": null, "weight": 1.0, "metadata": {"finish_details": {"type": "stop", "stop": "<|diff_marker|>"}, "message_type": "next", "model_slug": "text-davinci-002-render-sha"}, "recipient": "all"}, "conversation_id": "d64d724f-3455-413e-ac72-b42b3f4b0ffe", "error": null}

data: {"message": {"id": "e510886d-9980-451d-8a3d-5f07f8e39bf1", "author": {"role": "assistant", "name": null, "metadata": {}}, "create_time": 1690188074.886316, "update_time": null, "content": {"content_type": "text", "parts": ["The sum of 1 + 1 is equal to 2."]}, "status": "finished_successfully", "end_turn": true, "weight": 1.0, "metadata": {"finish_details": {"type": "stop", "stop": "<|diff_marker|>"}, "message_type": "next", "model_slug": "text-davinci-002-render-sha"}, "recipient": "all"}, "conversation_id": "d64d724f-3455-413e-ac72-b42b3f4b0ffe", "error": null}

data: {"message": {"id": "e510886d-9980-451d-8a3d-5f07f8e39bf1", "author": {"role": "assistant", "name": null, "metadata": {}}, "create_time": 1690188074.886316, "update_time": null, "content": {"content_type": "text", "parts": ["The sum of 1 + 1 is equal to 2."]}, "status": "finished_successfully", "end_turn": true, "weight": 1.0, "metadata": {"finish_details": {"type": "stop", "stop": "<|diff_marker|>"}, "is_complete": true, "message_type": "next", "model_slug": "text-davinci-002-render-sha"}, "recipient": "all"}, "conversation_id": "d64d724f-3455-413e-ac72-b42b3f4b0ffe", "error": null}

data: {"conversation_id": "d64d724f-3455-413e-ac72-b42b3f4b0ffe", "message_id": "e510886d-9980-451d-8a3d-5f07f8e39bf1", "is_completion": true, "moderation_response": {"flagged": false, "blocked": false, "moderation_id": "modr-7flPvfmGn6R9zsTTrnKoe4i9Z6M2c"}}

data: [DONE]

要实现多伦对话的话,记住返回来的

conversation_id": "d64d724f-3455-413e-ac72-b42b3f4b0ffe"

parent_message_id 为上一个问题返回的来的值

{"action":"next","messages":[{"id":"aaa2fcb2-f05b-4df3-a437-f5064e0949b2","author":{"role":"user"},"content":{"content_type":"text","parts":["333"]},"metadata":{}}],"conversation_id":"d64d724f-3455-413e-ac72-b42b3f4b0ffe","parent_message_id":"e510886d-9980-451d-8a3d-5f07f8e39bf1","model":"text-davinci-002-render-sha","timezone_offset_min":-480,"history_and_training_disabled":false,"arkose_token":null}

把这个id 提交回去,就可以实现多伦对话了,

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

三块钱0794

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值