python api.py <cookies_U>
- You should be in the whitelist of Bing/new
- Log in Bing/new and search one time in BingChatGPT
- Inspect -> Application -> Cookies -> Search "_U"
Do not create conversation frequently. It might remove your account from Bing/new whitelist. :(
- call
POST {host}/create_conversation
with the body{"userId": "OlivierShi"}
The passed userId
is a new-created concept in this PR, which is not the user account of Bing/new. This userId
should be in the whitelist.txt
and I write this simple logic to avoid too many uncontrollable requests.
It will return below information.
{
"conversationId": ,
"clientId": ,
"conversationSignature": ,
"invocationId":
}
2. call
POST {host}/chatgpt
with the below body,
{
"prompt": "I love Three-Body.",
"clientId": "",
"conversationId": "",
"conversationSignature": "",
"invocationId": 0
}
where clientId
, conversationId
, conversationSignature
and invocationId
is the response from create_conversation
API.
We can create multiple conversation sessions at the same time using a single Bing account with API POST {host}/create_conversation
. In addition, those active sessions will not influence each other and multiple conversation can be processed independently within a single Bing account.
- response body of https://www.bing.com/turing/conversation/create
{
"conversationId": None,
"clientId": None,
"conversationSignature": None,
"result":
{
"value": "Success",
"message": None
}
}
- request body of wss://sydney.bing.com/sydney/ChatHub
{
"arguments": [
{
"source": "cib",
"optionsSets": [
"nlu_direct_response_filter",
"deepleo",
"enable_debug_commands",
"disable_emoji_spoken_text",
"responsible_ai_policy_235",
"enablemm",
],
"isStartOfSession": {isStartOfSession},
"message": {
"author": "user",
"inputMethod": "Keyboard",
"text": {prompt},
"messageType": "Chat",
},
"conversationSignature": {conversation_signature},
"participant": {
"id": {client_id},
},
"conversationId": {conversationId},
},
],
"invocationId": {invocationId},
"target": "chat",
"type": 4,
}
- response body of wss://sydney.bing.com/sydney/ChatHub
POST {host}/create_conversation
- request body
{
"userId": "OlivierShi"
}
- response body
{
"conversationId": ,
"clientId": ,
"conversationSignature": ,
"invocationId":
}
- conversationId: to identify a conversation session
- clientId: to identify a user
- conversationSignature: to sign the data/message for this conversation session
- invocationId: to identify the invocation sequence. 0 stands for the first turn of a conversation.
POST {host}/chatgpt
- request body
{
"prompt": "I love watching 'Three-Body'.",
"conversationId": ,
"clientId": ,
"conversationSignature": ,
"invocationId":
}
- response body
{
"message": "",
"conversationId": ,
"invocationId":
}
- message: is from Bing-ChatGPT
- conversationId: to identify a conversation session, is same with request conversationId
- invocationId: is one plus the request invocationId