[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-71044":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":16,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":20,"defaultBranch":21,"hasWiki":19,"hasPages":20,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":16,"starSnapshotCount":16,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},71044,"EdgeGPT","acheong08\u002FEdgeGPT","acheong08","Reverse engineered API of Microsoft's Bing Chat AI","",null,"Python",7875,857,1,37,0,39.8,"The Unlicense",true,false,"main",[23,24,25,26,27,28,29],"bing-ai","binggpt","chatgpt","edge","edgegpt","gpt","reverse-engineering","2026-06-12 02:02:47","> # This project has been archived. Due to personal circumstances, I lack the time to maintain this repository.\n\n\u003Cdiv align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Fsocialify.git.ci\u002Facheong08\u002FEdgeGPT\u002Fimage?font=Inter&language=1&logo=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2F9%2F9c%2FBing_Fluent_Logo.svg&owner=1&pattern=Floating%20Cogs&theme=Auto\" alt=\"EdgeGPT\" width=\"640\" height=\"320\" \u002F>\n\n# Edge GPT\n\n_The reverse engineering the chat feature of the new version of Bing_\n\n\u003Ca>English\u003C\u002Fa> -\n\u003Ca href=\".\u002FREADME_zh-cn.md\">简体中文\u003C\u002Fa> -\n\u003Ca href=\".\u002FREADME_zh-tw.md\">繁體中文\u003C\u002Fa> -\n\u003Ca href=\".\u002FREADME_es.md\">Español\u003C\u002Fa> -\n\u003Ca href=\".\u002FREADME_ja.md\">日本語\u003C\u002Fa>\n\n\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Facheong08\u002FEdgeGPT\">\n    \u003Cimg alt=\"PyPI version\" src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002FEdgeGPT\">\n  \u003C\u002Fa>\n  \u003Cimg alt=\"Python version\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.8+-blue.svg\">\n  \u003Cimg alt=\"Total downloads\" src=\"https:\u002F\u002Fstatic.pepy.tech\u002Fbadge\u002Fedgegpt\">\n\n\u003C\u002Fp>\n\n\u003Cdetails open>\n\n\u003Csummary>\n\n# Setup\n\n\u003C\u002Fsummary>\n\n## Install package\n\n```bash\npython3 -m pip install EdgeGPT --upgrade\n```\n\n## Requirements\n\n- python 3.8+\n- A Microsoft Account with access to \u003Chttps:\u002F\u002Fbing.com\u002Fchat> (Optional, depending on your region)\n- Required in a supported country or region with New Bing (Chinese mainland VPN required)\n- [Selenium](https:\u002F\u002Fpypi.org\u002Fproject\u002Fselenium\u002F) (for automatic cookie setup)\n\n## Authentication\n\n!!! POSSIBLY NOT REQUIRED ANYMORE !!!\n\n**In some regions**, Microsoft has made the chat feature **available** to everyone, so you might be able to **skip this step**. You can check this with a browser (with user-agent set to reflect Edge), by **trying to start a chat without logging in**.\n\nIt was also found that it might **depend on your IP address**. For example, if you try to access the chat features from an IP that is known to **belong to a datacenter range** (vServers, root servers, VPN, common proxies, ...), **you might be required to log in** while being able to access the features just fine from your home IP address.\n\nIf you receive the following error, you can try **providing a cookie** and see if it works then:\n\n`Exception: Authentication failed. You have not been accepted into the beta.`\n\n### Collect cookies\n\n1. Get a browser that looks like Microsoft Edge.\n\n- a) (Easy) Install the latest version of Microsoft Edge\n- b) (Advanced) Alternatively, you can use any browser and set the user-agent to look like you're using Edge (e.g., `Mozilla\u002F5.0 (Windows NT 10.0; Win64; x64) AppleWebKit\u002F537.36 (KHTML, like Gecko) Chrome\u002F111.0.0.0 Safari\u002F537.36 Edg\u002F111.0.1661.51`). You can do this easily with an extension like \"User-Agent Switcher and Manager\" for [Chrome](https:\u002F\u002Fchrome.google.com\u002Fwebstore\u002Fdetail\u002Fuser-agent-switcher-and-m\u002Fbhchdcejhohfmigjafbampogmaanbfkg) and [Firefox](https:\u002F\u002Faddons.mozilla.org\u002Fen-US\u002Ffirefox\u002Faddon\u002Fuser-agent-string-switcher\u002F).\n\n2. Open [bing.com\u002Fchat](https:\u002F\u002Fbing.com\u002Fchat)\n3. If you see a chat feature, you are good to continue...\n4. Install the cookie editor extension for [Chrome](https:\u002F\u002Fchrome.google.com\u002Fwebstore\u002Fdetail\u002Fcookie-editor\u002Fhlkenndednhfkekhgcdicdfddnkalmdm) or [Firefox](https:\u002F\u002Faddons.mozilla.org\u002Fen-US\u002Ffirefox\u002Faddon\u002Fcookie-editor\u002F)\n5. Go to [bing.com](https:\u002F\u002Fbing.com)\n6. Open the extension\n7. Click \"Export\" on the bottom right, then \"Export as JSON\" (This saves your cookies to clipboard)\n8. Paste your cookies into a file `bing_cookies_*.json`.\n   - NOTE: The **cookies file name MUST follow the regex pattern `bing_cookies_*.json`**, so that they could be recognized by internal cookie processing mechanisms\n\n### Use cookies in code:\n\n```python\ncookies = json.loads(open(\".\u002Fpath\u002Fto\u002Fcookies.json\", encoding=\"utf-8\").read())  # might omit cookies option\nbot = await Chatbot.create(cookies=cookies)\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails open>\n\n\u003Csummary>\n\n# How to use Chatbot\n\n\u003C\u002Fsummary>\n\n## Run from Command Line\n\n```\n $ python3 -m EdgeGPT.EdgeGPT -h\n\n        EdgeGPT - A demo of reverse engineering the Bing GPT chatbot\n        Repo: github.com\u002Facheong08\u002FEdgeGPT\n        By: Antonio Cheong\n\n        !help for help\n\n        Type !exit to exit\n\nusage: EdgeGPT.py [-h] [--enter-once] [--search-result] [--no-stream] [--rich] [--proxy PROXY] [--wss-link WSS_LINK]\n                  [--style {creative,balanced,precise}] [--prompt PROMPT] [--cookie-file COOKIE_FILE]\n                  [--history-file HISTORY_FILE] [--locale LOCALE]\n\noptions:\n  -h, --help            show this help message and exit\n  --enter-once\n  --search-result\n  --no-stream\n  --rich\n  --proxy PROXY         Proxy URL (e.g. socks5:\u002F\u002F127.0.0.1:1080)\n  --wss-link WSS_LINK   WSS URL(e.g. wss:\u002F\u002Fsydney.bing.com\u002Fsydney\u002FChatHub)\n  --style {creative,balanced,precise}\n  --prompt PROMPT       prompt to start with\n  --cookie-file COOKIE_FILE\n                        path to cookie file\n  --history-file HISTORY_FILE\n                        path to history file\n  --locale LOCALE       your locale (e.g. en-US, zh-CN, en-IE, en-GB)\n```\n\n(China\u002FUS\u002FUK\u002FNorway has enhanced support for locale)\n\n## Run in Python\n\n### 1. The `Chatbot` class and `asyncio` for more granular control\n\nUse Async for the best experience, for example:\n\n```python\nimport asyncio, json\nfrom EdgeGPT.EdgeGPT import Chatbot, ConversationStyle\n\nasync def main():\n    bot = await Chatbot.create() # Passing cookies is \"optional\", as explained above\n    response = await bot.ask(prompt=\"Hello world\", conversation_style=ConversationStyle.creative, simplify_response=True)\n    print(json.dumps(response, indent=2)) # Returns\n    \"\"\"\n{\n    \"text\": str,\n    \"author\": str,\n    \"sources\": list[dict],\n    \"sources_text\": str,\n    \"suggestions\": list[str],\n    \"messages_left\": int\n}\n    \"\"\"\n    await bot.close()\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n### 2) The `Query` and `Cookie` helper classes\n\nCreate a simple Bing Chat AI query (using the 'precise' conversation style by default) and see just the main text output rather than the whole API response:\n\nRemeber to store your cookies in a specific format: `bing_cookies_*.json`.\n\n```python\nfrom EdgeGPT.EdgeUtils import Query, Cookie\n\nq = Query(\"What are you? Give your answer as Python code\")\nprint(q)\n```\n\nThe default directory for storing Cookie files is `HOME\u002Fbing_cookies` but you can change it with:\n\n```python\nCookie.dir_path = Path(r\"...\")\n```\n\nOr change the conversation style or cookie file to be used:\n\n```python\nq = Query(\n  \"What are you? Give your answer as Python code\",\n  style=\"creative\",  # or: 'balanced', 'precise'\n  cookie_file=\".\u002Fbing_cookies_alternative.json\"\n)\n\n#  Use `help(Query)` to see other supported parameters.\n```\n\nQuickly extract the text output, code snippets, list of sources\u002Freferences, or suggested follow-on questions from a response using the following attributes:\n\n```python\nq.output  # Also: print(q)\nq.sources\nq.sources_dict\nq.suggestions\nq.code\nq.code_blocks\nq.code_block_formatsgiven)\n```\n\nGet the orginal prompt and the conversation style you specified:\n\n```python\nq.prompt\nq.ignore_cookies\nq.style\nq.simplify_response\nq.locale\nrepr(q)\n```\n\nAccess previous Queries made since importing `Query`:\n\n```python\nQuery.index  # A list of Query objects; updated dynamically\nQuery.image_dir_path\n\n```\n\nAnd finally, the `Cookie` class supports multiple cookie files, so if you create additional cookie files with the naming convention `bing_cookies_*.json`, your queries will automatically try using the next file (alphabetically) if you've exceeded your daily quota of requests (currently set at 200).\n\nHere are the main attributes which you can access:\n\n```python\nCookie.current_file_index\nCookie.current_file_path\nCookie.current_data\nCookie.dir_path\nCookie.search_pattern\nCookie.files\nCookie.image_token\nCookie.import_next\nCookie.rotate_cookies\nCookie.ignore_files\nCookie.supplied_files\nCookie.request_count\n```\n\n---\n\n## Run with Docker\n\nThis assumes you have a file cookies.json in your current working directory\n\n```bash\n\ndocker run --rm -it -v $(pwd)\u002Fcookies.json:\u002Fcookies.json:ro -e COOKIE_FILE='\u002Fcookies.json' ghcr.io\u002Facheong08\u002Fedgegpt\n```\n\nYou can add any extra flags as following\n\n```bash\n\ndocker run --rm -it -v $(pwd)\u002Fcookies.json:\u002Fcookies.json:ro -e COOKIE_FILE='\u002Fcookies.json' ghcr.io\u002Facheong08\u002Fedgegpt --rich --style creative\n```\n\n\u003C\u002Fdetails>\n\n\u003C\u002Fdetails>\n\n\u003Cdetails open>\n\n\u003Csummary>\n\n# How to use Image generator\n\n\u003C\u002Fsummary>\n\n## Run from Command Line\n\n```bash\n$ python3 -m ImageGen.ImageGen -h\nusage: ImageGen.py [-h] [-U U] [--cookie-file COOKIE_FILE] --prompt PROMPT [--output-dir OUTPUT_DIR] [--quiet] [--asyncio]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -U U                  Auth cookie from browser\n  --cookie-file COOKIE_FILE\n                        File containing auth cookie\n  --prompt PROMPT       Prompt to generate images for\n  --output-dir OUTPUT_DIR\n                        Output directory\n  --quiet               Disable pipeline messages\n  --asyncio             Run ImageGen using asyncio\n```\n\n## Run in Python\n\n### 1) The `ImageQuery` helper class\n\nGenerate images based on a simple prompt and download to the current working directory:\n\n```python\nfrom EdgeGPT.EdgeUtils import ImageQuery\n\nq=ImageQuery(\"Meerkats at a garden party in Devon\")\n```\n\nChange the download directory for all future images in this session:\n\n```\nQuery.image_dirpath = Path(\".\u002Fto_another_folder\")\n```\n\n### 2) The `ImageGen` class and `asyncio` for more granular control\n\n```python\nfrom EdgeGPT.ImageGen import ImageGen\nimport argparse\nimport json\n\nasync def async_image_gen(args) -> None:\n    async with ImageGenAsync(args.U, args.quiet) as image_generator:\n        images = await image_generator.get_images(args.prompt)\n        await image_generator.save_images(images, output_dir=args.output_dir)\n\nif __name__ == \"__main__\":\n    parser = argparse.ArgumentParser()\n    parser.add_argument(\"-U\", help=\"Auth cookie from browser\", type=str)\n    parser.add_argument(\"--cookie-file\", help=\"File containing auth cookie\", type=str)\n    parser.add_argument(\n        \"--prompt\",\n        help=\"Prompt to generate images for\",\n        type=str,\n        required=True,\n    )\n    parser.add_argument(\n        \"--output-dir\",\n        help=\"Output directory\",\n        type=str,\n        default=\".\u002Foutput\",\n    )\n    parser.add_argument(\n        \"--quiet\", help=\"Disable pipeline messages\", action=\"store_true\"\n    )\n    parser.add_argument(\n        \"--asyncio\", help=\"Run ImageGen using asyncio\", action=\"store_true\"\n    )\n    args = parser.parse_args()\n    # Load auth cookie\n    with open(args.cookie_file, encoding=\"utf-8\") as file:\n        cookie_json = json.load(file)\n        for cookie in cookie_json:\n            if cookie.get(\"name\") == \"_U\":\n                args.U = cookie.get(\"value\")\n                break\n\n    if args.U is None:\n        raise Exception(\"Could not find auth cookie\")\n\n    if not args.asyncio:\n        # Create image generator\n        image_generator = ImageGen(args.U, args.quiet)\n        image_generator.save_images(\n            image_generator.get_images(args.prompt),\n            output_dir=args.output_dir,\n        )\n    else:\n        asyncio.run(async_image_gen(args))\n\n```\n\n\u003C\u002Fdetails>\n\n\u003Cdetails open>\n\n\u003Csummary>\n\n# Star History\n\n\u003C\u002Fsummary>\n\n[![Star History Chart](https:\u002F\u002Fapi.star-history.com\u002Fsvg?repos=acheong08\u002FEdgeGPT&type=Date)](https:\u002F\u002Fstar-history.com\u002F#acheong08\u002FEdgeGPT&Date)\n\n\u003C\u002Fdetails>\n\n\u003Cdetails open>\n\n\u003Csummary>\n\n# Contributors\n\n\u003C\u002Fsummary>\n\nThis project exists thanks to all the people who contribute.\n\n \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Facheong08\u002FEdgeGPT\u002Fgraphs\u002Fcontributors\">\n  \u003Cimg src=\"https:\u002F\u002Fcontrib.rocks\u002Fimage?repo=acheong08\u002FEdgeGPT\" \u002F>\n \u003C\u002Fa>\n\n\u003C\u002Fdetails>\n","EdgeGPT 是一个反向工程实现的微软必应聊天AI的API。它使用Python语言开发，主要功能是模拟与必应聊天AI的交互过程，允许开发者通过非官方渠道访问和利用这一强大的自然语言处理能力。项目采用了Selenium等工具来自动处理登录验证及cookie管理问题，以绕过地理限制或测试阶段的访问控制。适合那些希望在自己的应用中集成先进文本生成、对话系统但又无法直接接入官方服务的研究者或开发者使用。尽管该项目已被归档不再维护，但它依然为理解和探索现代AI聊天技术提供了一个有价值的参考案例。",2,"2026-06-11 03:35:37","high_star"]