{"id":13683273,"url":"https://github.com/tuhinpal/bingchat-api","last_synced_at":"2025-04-30T12:34:20.053Z","repository":{"id":82458847,"uuid":"606098355","full_name":"tuhinpal/bingchat-api","owner":"tuhinpal","description":"Bing Chat unofficial API","archived":true,"fork":false,"pushed_at":"2024-01-18T14:11:32.000Z","size":88,"stargazers_count":163,"open_issues_count":7,"forks_count":37,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-07T23:47:57.969Z","etag":null,"topics":["ai","bing","bing-api","bing-chat"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tuhinpal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-24T15:41:52.000Z","updated_at":"2024-10-04T11:41:02.000Z","dependencies_parsed_at":"2024-01-14T16:10:44.009Z","dependency_job_id":"f5f7fe3e-ddb9-4463-b139-b2cb59722b86","html_url":"https://github.com/tuhinpal/bingchat-api","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"5900b8112cd8cf1753f39bea85db04587b06a909"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuhinpal%2Fbingchat-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuhinpal%2Fbingchat-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuhinpal%2Fbingchat-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuhinpal%2Fbingchat-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tuhinpal","download_url":"https://codeload.github.com/tuhinpal/bingchat-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224212103,"owners_count":17274359,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","bing","bing-api","bing-chat"],"created_at":"2024-08-02T13:02:05.864Z","updated_at":"2024-11-12T03:30:47.728Z","avatar_url":"https://github.com/tuhinpal.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"![Bing Chat API](https://user-images.githubusercontent.com/51857187/221339911-75f3e232-1c7b-4877-b3fe-8a1b77c5c744.jpg)\n\n## Deployment\n\nDeploy natively\n\n```bash\n  git clone https://github.com/tuhinpal/bingchat-api.git\n  cd bingchat-api\n  npm run build\n  npm start\n```\n\nDeploy with Docker\n\n```bash\n  git clone https://github.com/tuhinpal/bingchat-api.git\n  cd bingchat-api\n  docker build -t bingchat-api .\n  docker run -it -d -p 8080:8080 bingchat-api\n```\n\nOr, You can fork this repository and connect it to any provider which supports Docker/NodeJS.\n\n## Post Deploy\n\nThis api need your cookie to generate conversation. So, you should have beta access. After deployment login to that bing account and open developer console. Then paste the code (replace your `serverUrl`).\n\n```javascript\nconst cookie = document.cookie;\nconst serverUrl = \"http://localhost:8080\";\n\nfetch(`${serverUrl}/set-cookie`, {\n  method: \"POST\",\n  headers: {\n    \"Content-Type\": \"application/json\",\n  },\n  body: JSON.stringify({ cookie }),\n})\n  .then((res) =\u003e res.json())\n  .then((res) =\u003e console.log(res))\n  .catch((err) =\u003e console.log(err));\n```\n\n## API Reference\n\n#### Create a conversation\n\n```\n  POST /create-conversation\n```\n\n#### Generate\n\n```\n  GET /generate\n```\n\n| Query Parameter         | Type     | Description                                       |\n| :---------------------- | :------- | :------------------------------------------------ |\n| `conversationId`        | `string` | **Required**. Get it after `/create-conversation` |\n| `clientId`              | `string` | **Required**. Get it after `/create-conversation` |\n| `conversationSignature` | `string` | **Required**. Get it after `/create-conversation` |\n| `text`                  | `string` | **Required**. Text prompt                         |\n\n**Note:** It uses [EventSource](https://developer.mozilla.org/en-US/docs/Web/API/EventSource) stream to send content upon generation.\n\n## Client library\n\nUse the client library to implement these with ease.\n\n```\nnpm install bing-chatai-client\n```\n\n```javascript\nimport { createConversation, Generate } from \"bing-chatai-client\";\n\nconst conversation = await createConversation(\"http://localhost:8080\");\n\nconsole.log(conversation);\n\nconst gen = new Generate(conversation.conversationUrl);\n\ngen.generate(\"Hello bing what is an ai?\");\n\ngen.onMessage((data) =\u003e {\n  console.log(data);\n});\n\ngen.onFinished((message) =\u003e {\n  console.info(message);\n});\n\ngen.onError((message) =\u003e {\n  console.error(message);\n});\n```\n\n## Author\n\n- [@tuhinpal](https://www.github.com/tuhinpal)\n\n## Feedback\n\nIf you have any feedback, please reach me out at me[at]thetuhin.com.\n\n## Contributing\n\nContributions are always welcome!\n\n## License and Leagal\n\nThis project is licensed under [MIT](https://github.com/tuhinpal/bingchat-api/blob/master/LICENSE). This project is made as a proof of concept and doesnot meant to harm microsoft.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuhinpal%2Fbingchat-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftuhinpal%2Fbingchat-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuhinpal%2Fbingchat-api/lists"}