{"id":20098489,"url":"https://github.com/pinaki82/chatgpt-wrapper-clone","last_synced_at":"2026-06-12T07:34:18.327Z","repository":{"id":168951546,"uuid":"644771336","full_name":"Pinaki82/chatgpt-wrapper-clone","owner":"Pinaki82","description":"Clone of https://github.com/mmabrouk/chatgpt-wrapper version 0.6.1","archived":false,"fork":false,"pushed_at":"2023-05-24T08:56:27.000Z","size":72,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T16:37:07.300Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/Pinaki82.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":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-24T08:15:49.000Z","updated_at":"2023-05-24T08:19:02.000Z","dependencies_parsed_at":"2023-05-27T04:45:56.573Z","dependency_job_id":null,"html_url":"https://github.com/Pinaki82/chatgpt-wrapper-clone","commit_stats":null,"previous_names":["pinaki82/chatgpt-wrapper-clone"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Pinaki82/chatgpt-wrapper-clone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pinaki82%2Fchatgpt-wrapper-clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pinaki82%2Fchatgpt-wrapper-clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pinaki82%2Fchatgpt-wrapper-clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pinaki82%2Fchatgpt-wrapper-clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pinaki82","download_url":"https://codeload.github.com/Pinaki82/chatgpt-wrapper-clone/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pinaki82%2Fchatgpt-wrapper-clone/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34234557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-12T02:00:06.859Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-13T17:04:02.513Z","updated_at":"2026-06-12T07:34:18.315Z","avatar_url":"https://github.com/Pinaki82.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"**NOTE:** This repository [chatgpt-wrapper-clone](https://github.com/Pinaki82/chatgpt-wrapper-clone.git) is a clone of https://github.com/mmabrouk/chatgpt-wrapper version 0.6.1.\n\nI'm not a Python programmer by any means. So please do not expect updates.\n\n**REASON:** The latest version of [chatgpt-wrapper](https://github.com/mmabrouk/chatgpt-wrapper) supports OpenAI Playground, which comes with limitations. OpenAI Playground is a subscription-based service. The ChatGPT support seems to have been lost there. I noticed that after upgrading the pip package to 10.x.x or something. This repository has been created from a published tag version 0.6.1 of [chatgpt-wrapper](https://github.com/mmabrouk/chatgpt-wrapper), the version that last worked on my Xubuntu machine with the real ChatGPT. The latest version needs OpenAI Playground API Key, which differs from ChatGPT. Hence this effort.\n\nSpecial Thanks to [mmabrouk](https://github.com/mmabrouk)!\n\n\u003ch1\u003e\u003cp align=\"center\"\u003e:candy:ChatGPT (and GPT4) Wrapper:candy:\u003c/p\u003e\u003c/h1\u003e\n\n## Welcome!\n\nWhat would you like to do?\n\n* [Learn about the project](#summary-header)\n* [Install the wrapper](#requirements)\n* [Learn more about configuration/features](#configuration)\n* [Learn how to use it](#usage)\n* [Using GPT4](#gpt4)\n* [Report a bug](ISSUES.md)\n* [Get support](SUPPORT.md)\n\n\u003cp id=\"summary-header\" align=\"center\"\u003eChatGPT Wrapper is an open-source unofficial \u003cb\u003ePower CLI\u003c/b\u003e, \u003cb\u003ePython API\u003c/b\u003e and \u003cb\u003eFlask API\u003c/b\u003e that lets you interact programmatically with ChatGPT/GPT4.\u003c/p\u003e\n\n## Highlights\n\n**Programmable ChatGPT**. The ChatGPT Wrapper lets you use the powerful ChatGPT/GPT4 bot in your _Python scripts_ or on the _command line_, making it easy to leverage its functionality into your projects.\n\n**Runs in Shell**. You can call and interact with ChatGPT/GPT4 in the terminal.\n\n**Supports official ChatGPT API**. Make API calls directly to the OpenAI ChatGPT endpoint (all supported models accessible by your OpenAI account)\n\n**Python API**. The ChatGPT Wrapper is a Python library that lets you use ChatGPT/GPT4 in your Python scripts.\n\n**Simple plugin architecture**. Extend the wrapper with custom functionality (alpha)\n\n**Docker image**. The ChatGPT Wrapper is also available as a docker image. (experimental)\n\n:test_tube: **Flask API**. You can use the ChatGPT Wrapper as an API. (experimental)\n\n## How it works\n\nRun an interactive CLI in the terminal:\n\n![kod](https://user-images.githubusercontent.com/4510758/212907070-602d61fe-708d-4a39-aaa2-0e84fcf88dcf.png)\n\nOr just get a quick response for one question:\n\n![kod(1)](https://user-images.githubusercontent.com/4510758/212906773-666be6fe-90e1-4f5e-b962-7748143bd744.png)\n\nSee below for details on using ChatGPT as an API from Python.\n\n## Requirements\n\nTo use this repository, you need `setuptools` installed. You can install it using `pip install setuptools`. Make sure that you have the last version of pip: `pip install --upgrade pip`\n\nTo use the 'chatgpt-api' backend, you need a database backend (SQLite by default, any configurable in SQLAlchemy allowed).\n\n## Installation\n\n### Notes for Windows users\n\nMost other operating systems come with SQLite (the default database choice) installed, Windows may not.\n\nIf not, you can grab the 32-bit or 64-bit DLL file from [https://www.sqlite.org/download.html](https://www.sqlite.org/download.html), then place the DLL in `C:\\Windows\\System32` directory.\n\nYou also may need to install Python, if so grab the latest stable package from [https://www.python.org/downloads/windows/](https://www.python.org/downloads/windows/) -- make sure to select the install option to `Add Python to PATH`.\n\nFor the `/editor` command to work, you'll need a command line editor installed and in your path. You can control which editor is used by setting the `EDITOR` environment variable to the name of the editor executable, e.g. `nano` or `vim`.\n\n### Code\n\n#### From packages\n\nInstall the latest version of this software directly from github with pip:\n\n```bash\npip install git+https://github.com/Pinaki82/chatgpt-wrapper-clone.git\n```\n\n#### From source (recommended for development)\n\n* Install the latest version of this software directly from git:\n  \n  ```bash\n  git clone https://github.com/Pinaki82/chatgpt-wrapper-clone.git\n  ```\n\n* Install the the development package:\n  \n  ```bash\n  cd chatgpt-wrapper\n  pip install -e .\n  ```\n\n### Backend\n\nThe wrapper works with several differnt backends to connect to the ChatGPT models, and installation is different for each backend.\n\n#### Playwright (browser-based)\n\n* Pros:\n  * Free or paid version available (as of this writing)\n  * Fairly easy to set up for non-technical users\n* Cons:\n  * Slow (runs a full browser session)\n  * Clunky authentication method\n  * No model customizations\n  * Third party controls your data\n\nInstall a browser in playwright (if you haven't already). The program will use firefox by default.\n\n```\nplaywright install firefox\n```\n\nStart up the program in `install` mode:\n\n```bash\nchatgpt install\n```\n\nThis opens up a browser window. Log in to ChatGPT in the browser window, walk through all the intro screens, then exit program.\n\n```bash\n1\u003e /exit\n```\n\nRestart the program without the `install` parameter to begin using it.\n\n```bash\nchatgpt\n```\n\n#### API (REST-based)\n\n* Pros:\n  * Fast (many operations run locally for speed)\n  * Simple API authentication\n  * Full model customizations\n  * You control your data\n* Cons:\n  * Only paid version available (as of this writing)\n  * More commplex setup suitable for technical users\n\nGrab an API key from [https://platform.openai.com/account/api-keys](https://platform.openai.com/account/api-keys)\n\nExport the key into your local environment:\n\n```bash\nexport OPENAI_API_KEY=\u003cAPI_KEY\u003e\n```\n\nWindows users, see [here](https://www.computerhope.com/issues/ch000549.htm) for how to edit environment variables.\n\nRun the program with the 'config' command:\n\n```bash\nchatgpt config\n```\n\nThis will show all the current configuration settings, the most important ones for installation are:\n\n* **Config dir:** Where configuration files are stored\n* **Current profile:** (shown in the 'Profile configuration' section)\n* **Config file:** The configuration file current being used\n* **Data dir:** The data storage directory\n\nFind the 'Config file' setting, and copy the [config.sample.yaml](/config.sample.yaml) there:\n\nOn Linux:\n\n```bash\nmkdir -p ~/.config/chatgpt-wrapper/profiles/default\ncp config.sample.yaml ~/.config/chatgpt-wrapper/profiles/default/config.yaml\n```\n\nThen edit the settings in that file to taste.  You'll want to make sure `backend` is set to `chatgpt-api` in order to use the API.\n\n##### Database configuration\n\nThe API backend requires a database server to store conversation data. The wrapper leverages [SQLAlchemy](https://www.sqlalchemy.org/) for this.\n\nThe simplest supported database is SQLite (which is already installed on most modern operating systems), but you can use any database that is supported by SQLAlchemy.\n\nCheck the `database` setting from the `config` command above, which will show you the currently configured connection string for a default SQLite database.\n\nIf you're happy with that setting, nothing else needs to be done -- the database will be created automatically in that location when you run the program.\n\n##### Initial user creation and login\n\nOnce the database is configured, run the program with no arguments:\n\n```bash\nchatgpt\n```\n\nIt will recognize no users have been created, and prompt you to create the first user:\n\n* Username: Required, no spaces or special characters\n* Email: Optional\n* Password: Optional, if not provided the user can log in without a password\n\nOnce the user is created, execute the `/login` command with the username:\n\n```bash\n/login [username]\n```\n\nOnce you're logged in, you have full access to all commands.\n\n**IMPORTANT NOTE:** The user authorization system from the command line is 'admin party' -- meaning every logged in user has admin privileges, including editing and deleting other users.\n\n## Configuration\n\nFrom a running `chatgpt` instance, execute `/config` to view the current configuration.\n\nThe output will show the location of the configuration directory, the name of\nthe configuration file (called a 'profile'), and the current configuration.\n\nConfiguration is optional, default values will be used if no configuration profile is\nprovided. The default configuation settings can be seen in\n[config.sample.yaml](/config.sample.yaml) -- the file is commented with descriptions \nof the settings.\n\n*NOTE:* Not all settings are available on all backends. See the example config for more information.\n\nCommand line arguments overrride custom configuration settings, which override default\nconfiguration settings.\n\n## Templates (alpha, subject to change)\n\nThe wrapper comes with a full template management system.\n\nTemplates allow storing text in template files, and quickly leveraging the contents as your user input.\n\nFeatures:\n\n* Per-profile templates\n* Create/edit templates\n* `{{ variable }}` syntax substitution\n* Five different workflows for collecting variable values, editing, and running\n\nSee the various `/help template` commands for more information.\n\n### Builtin variables\n\nThe wrapper exposes some builtin variables that can be used in templates:\n\n* `{{ clipboard }}` - Insert the contents of the clipboard\n\n### Front matter\n\nTemplates may include front matter (see [examples](examples/templates)).\n\nThese front matter attributes have special functionality:\n\n* title: Sets the title of new conversations to this value\n* description: Displayed in the output of `/templates`\n* model_customizations: A hash of model customizations to apply when the template is run (see `/config` for available model customizations)\n\nAll other attributes will be passed to the template as variable substitutions.\n\n## Plugins (alpha, subject to change)\n\n### Using plugins\n\n1. Place the plugin file in either:\n   \n   * The main `plugins` directory of this module\n   * A `plugins` directory in your profile\n\n2. Enable the plugin in your configuration:\n   \n   ```yaml\n   plugins:\n     enabled:\n       # This is a list of plugins to enable, each list item should be the name of a plugin file, without the extension.\n       - test\n   ```\n   \n   Note that setting `plugins.enabled` will overwrite the default enabled plugins. see `/config` for a list of default enabled plugins.\n\n### Writing plugins\n\nThere is currently no developer documentation for writing plugins.\n\nThe `plugins` directory has some default plugins, examining those will give a good idea for how to design a new one.\n\nCurrently, plugins for the shell can only add new commands. An instantiated plugin has access to these resources:\n\n* `self.config`: The current instantiated Config object\n* `self.log`: The instantiated Logger object\n* `self.backend`: The instantiated backend\n* `self.shell`: The instantiated shell\n\n## Tutorials:\n\n- **Newest Youtube video:** [ChatCPT intro, walkthrough of features](https://www.youtube.com/watch?v=Ho3-pzAf5e8)\n- Youtube Tutorial: [How To Use ChatGPT With Unity: Python And API Setup #2](https://www.youtube.com/watch?v=CthF8c8qk4c) includes a step by step guide to installing this repository on a windows machine\n- This [Blog post](https://medium.com/geekculture/using-chatgpt-in-python-eeaed9847e72) provides a visual step-by-step guide for installing this library.\n\n## Usage\n\n### Shell\n\n#### Command line arguments\n\nRun `chatgpt --help`\n\n#### One-shot mode\n\nTo run the CLI in one-shot mode, simply follow the command with the prompt you want to send to ChatGPT:\n\n```\nchatgpt Hello World!\n```\n\n#### Interacive mode\n\nTo run the CLI in interactive mode, execute it with no additional arguments:\n\n```\nchatgpt\n```\n\nOnce the interactive shell is running, you can see a list of all commands with:\n\n```\n/help\n```\n\n...or get help for a specific command with:\n\n```\n/help \u003ccommand\u003e\n```\n\n### Python\n\nTo use the `ChatGPT` class as an API for talking to ChatGPT, create an instance of the class and use the `ask` method to send a message to OpenAI and receive the response. For example:\n\n```python\nfrom chatgpt_wrapper import ChatGPT\n\nbot = ChatGPT()\nsuccess, response, message = bot.ask(\"Hello, world!\")\nif success:\n    print(response)\nelse:\n    raise RuntimeError(message)\n```\n\nThe say method takes a string argument representing the message to send to ChatGPT, and returns a string representing the response received from ChatGPT.\n\nYou may also stream the response as it comes in from ChatGPT in chunks using the `ask_stream` generator.\n\nTo pass custom configuration to ChatGPT, use the Config class:\n\n```python\nfrom chatgpt_wrapper import ChatGPT\nfrom chatgpt_wrapper.config import Config\n\nconfig = Config()\nconfig.set('browser.debug', True)\nbot = ChatGPT(config)\nsuccess, response, message = bot.ask(\"Hello, world!\")\nif success:\n    print(response)\nelse:\n    raise RuntimeError(message)\n```\n\n### Flask API (experimental)\n\n- Run `python chatgpt_wrapper/gpt_api.py --port 5000` (default port is 5000) to start the server\n- Test whether it is working using `python -m unittest tests/api_test.py`\n- See an example of interaction with api in `tests/example_api_call.py`\n\n## Docker (experimental)\n\nBuild a image for testing `chatgpt-wrapper` with following commands.\n\n```bash\ndocker-compose build \u0026\u0026 docker-compose up -d\ndocker exec -it chatgpt-wrapper-container /bin/bash -c \"chatgpt install\"\n```\n\nThen, visit http://localhost:6901/vnc.html with password `headless` and login ChatGPT.\n\nThen, turn back to terminal and enjoy the chat!\n\n![chat](https://i.imgur.com/nRlzUzm.png)\n\n## GPT4\n\n### Backend notes\n\n#### Playwright (browser-based) backend\n\nTo use GPT-4 with this backend, you must have a ChatGPT-Plus subscription.\n\n#### API backend\n\nTo use GPT-4 with this backend, you must have been granted access to the model in your OpenAI account.\n\n### Using GPT-4\n\n#### From the shell\n\nFollow one of the methods below to utilize GPT-4 in the shell:\n\n##### Method 1: Run the command\n\nEnter the following command in your shell:\n\n```\nchatgpt --model=gpt4\n```\n\n##### Method 2: Modify the `config.yaml` file\n\nUpdate your `config.yaml` file to include the following line:\n\n```\nmodel: gpt4\n```\n\n#### Via Python module\n\nTo use GPT-4 within your Python code, follow the template below:\n\n```python\nfrom chatgpt_wrapper import ChatGPT\nfrom chatgpt_wrapper.config import Config\n\nconfig = Config()\nconfig.set('chat.model', 'gpt4')\nbot = ChatGPT(config)\nsuccess, response, message = bot.ask(\"Hello, world!\")\n```\n\n## Projects built with chatgpt-wrapper\n\n- [bookast: ChatGPT Podcast Generator For Books](https://github.com/SamMethnani/bookast)\n- [ChatGPT.el: ChatGPT in Emacs](https://github.com/joshcho/ChatGPT.el)\n- [ChatGPT Reddit Bot](https://github.com/PopDaddyGames/ChatGPT-RedditBot)\n\n## Contributing\n\nWe welcome contributions to ChatGPT Wrapper! If you have an idea for a new feature or have found a bug, please open an issue on the GitHub repository.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Acknowledgments\n\n- This project is a modification from [Taranjeet](https://github.com/taranjeet/chatgpt-api) code which is a modification of [Daniel Gross](https://github.com/danielgross/whatsapp-gpt) code.\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=mmabrouk/chatgpt-wrapper\u0026type=Date)](https://star-history.com/#mmabrouk/chatgpt-wrapper\u0026Date)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinaki82%2Fchatgpt-wrapper-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpinaki82%2Fchatgpt-wrapper-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinaki82%2Fchatgpt-wrapper-clone/lists"}