Skip to main content

Reverse engineered Edge Chat API

Project description

EdgeGPT

Edge GPT

The reverse engineering the chat feature of the new version of Bing

PyPI version Python version

UPDATE 2023/02/13 - Public access shut down by Microsoft

UPDATE 2023/02/14 - Do not use for now while I verify its safety

UPDATE 2023/02/15 - I have added spoofing and safety features. You should not get suspended unless you abuse the service.

Table of Contents

Setup

Install package

python3 -m pip install EdgeGPT --upgrade

Requirements

We have a shared token for public use. If you have your own account with access, you can use that instead.

  • python 3.7+
  • Microsoft Edge (Required)
  • A Microsoft Account with early access to http://bing.com/chat (Required)

Checking access (Required)

  • Install the latest version of Microsoft Edge
  • Open http://bing.com/chat
  • If you see a chat feature, you are good to go

Getting authentication (Required)

  • Install the cookie editor extension for Chrome or Firefox
  • Go to bing.com
  • Open the extension
  • Click "Export" on the bottom right (This saves your cookies to clipboard)
  • Paste your cookies into a file cookies.json

Usage

Quick start

 $ python3 -m EdgeGPT -h

        EdgeGPT - A demo of reverse engineering the Bing GPT chatbot
        Repo: github.com/acheong08/EdgeGPT
        By: Antonio Cheong

        !help for help

        Type !exit to exit
        Enter twice to send message

usage: EdgeGPT.py [-h] [--no-stream] --cookie-file COOKIE_FILE

options:
  -h, --help            show this help message and exit
  --no-stream
  --cookie-file COOKIE_FILE

Developer demo

Remember to set cookie file path: export COOKIE_FILE=/path/to/cookies.json. You can also specify the path to cookies.json in the argument cookiePath like this:

bot = Chatbot(cookiePath='./cookie.json')

Use Async for the best experience

Reference code for more advanced example of usage

import asyncio
from EdgeGPT import Chatbot

async def main():
    bot = Chatbot()
    print(await bot.ask(prompt="Hello world"))
    await bot.close()


if __name__ == "__main__":
    asyncio.run(main())

Work in progress

  • Error handling

Star History

Star History Chart

Contributors

This project exists thanks to all the people who contribute.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

EdgeGPT-0.0.45.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

EdgeGPT-0.0.45-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file EdgeGPT-0.0.45.tar.gz.

File metadata

  • Download URL: EdgeGPT-0.0.45.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for EdgeGPT-0.0.45.tar.gz
Algorithm Hash digest
SHA256 074883cd82771556d8f45a31a2ef14249c2145966c82b69b02b27ba489a3f7a1
MD5 86e53a04f8e5a0d1df6521b01c6974fc
BLAKE2b-256 0348fa10d7fc8cf1f0497e024136712ac686f17d7f7936c415a80a2c5b07561b

See more details on using hashes here.

File details

Details for the file EdgeGPT-0.0.45-py3-none-any.whl.

File metadata

  • Download URL: EdgeGPT-0.0.45-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for EdgeGPT-0.0.45-py3-none-any.whl
Algorithm Hash digest
SHA256 a519d4772578d360590d7b4112b4caacd298e1584a1eef1f84896f37a541be8b
MD5 8bed7ab4386e10657af138bc51db87f5
BLAKE2b-256 376d1f4158cf36135aa9b6aaad48da5eb6bf7040512f49994f3cd5bff4b5633c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page