{"id":13468370,"url":"https://github.com/PawanOsman/ChatGPT","last_synced_at":"2025-03-26T05:31:02.308Z","repository":{"id":65655035,"uuid":"575051095","full_name":"PawanOsman/ChatGPT","owner":"PawanOsman","description":"OpenAI API Free Reverse Proxy","archived":false,"fork":false,"pushed_at":"2024-08-23T15:25:51.000Z","size":107,"stargazers_count":5718,"open_issues_count":0,"forks_count":1009,"subscribers_count":44,"default_branch":"main","last_synced_at":"2025-03-25T22:16:25.213Z","etag":null,"topics":["ai","api","bard","bing","chat","chatbot","chatgpt","chatgpt-api","free","gpt-3","gpt-4","openai","openai-api","reverse-proxy"],"latest_commit_sha":null,"homepage":"https://discord.pawan.krd","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PawanOsman.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":"2022-12-06T16:39:11.000Z","updated_at":"2025-03-25T14:04:54.000Z","dependencies_parsed_at":"2024-01-13T18:00:26.730Z","dependency_job_id":"484446af-8458-4891-af73-bb8945a3c093","html_url":"https://github.com/PawanOsman/ChatGPT","commit_stats":{"total_commits":80,"total_committers":11,"mean_commits":"7.2727272727272725","dds":0.25,"last_synced_commit":"e02bc493a105be9407df8e9398b195912f8b3716"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PawanOsman%2FChatGPT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PawanOsman%2FChatGPT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PawanOsman%2FChatGPT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PawanOsman%2FChatGPT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PawanOsman","download_url":"https://codeload.github.com/PawanOsman/ChatGPT/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245597210,"owners_count":20641859,"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","api","bard","bing","chat","chatbot","chatgpt","chatgpt-api","free","gpt-3","gpt-4","openai","openai-api","reverse-proxy"],"created_at":"2024-07-31T15:01:09.684Z","updated_at":"2025-03-26T05:31:02.281Z","avatar_url":"https://github.com/PawanOsman.png","language":"TypeScript","readme":"# This project is a bit outdated and isn’t working right now. We’ll update it, but we’re tied up with another project at the moment. In the meantime, you’re welcome to use [our hosted models for free](#accessing-our-hosted-api).\n\n\n## ChatGPT `gpt-3.5-turbo` API for Free (as a Reverse Proxy)\n\nWelcome to the ChatGPT API Free Reverse Proxy, offering free self-hosted API access to ChatGPT (`gpt-3.5-turbo`) with OpenAI's familiar structure, so no code changes are needed.\n\n## Quick Links\n\n- [Join our Discord Community](https://discord.pawan.krd) for support and questions.\n\t- ⚡Note: Your Discord account must be at least 7 days old to be able join our Discord community.\n\n## Table of Contents\n\n- [Features](#features)\n- Option 1: [Installing/Self-Hosting Guide](#installingself-hosting-guide) (Without using any API key)\n  - Method 1: [Using Docker](#using-docker) or [Run it with a Chat Web UI using docker-compose](./docker-compose)\n  - Method 2: [Your PC/Server](#your-pcserver) (manually)\n  - Method 3: [Termux on Android Phones](#termux-on-android-phones)\n- Option 2: [Accessing Our Hosted API](#accessing-our-hosted-api) (Free)\n- [Usage Examples](#usage-examples)\n- [License](#license)\n\n## Features\n\n- **Streaming Response**: The API supports streaming response, so you can get the response as soon as it's available.\n- **API Endpoint Compatibility**: Full alignment with official OpenAI API endpoints, ensuring hassle-free integration with existing OpenAI libraries.\n- **Complimentary Access**: No charges for API usage, making advanced AI accessible to everyone even **without an API key**.\n\n## Installing/Self-Hosting Guide\n\n### Using Docker\n1. Ensure Docker is installed by referring to the [Docker Installation Docs](https://docs.docker.com/engine/install/).\n2. Run the following command:\n   ```bash\n   docker run -dp 3040:3040 pawanosman/chatgpt:latest\n   ```\n3. Done! You can now connect to your local server's API at:\n   ```\n   http://localhost:3040/v1/chat/completions\n   ```\n   Note that the base URL is `http://localhost:3040/v1`.\n\n### Install with chat web interfaces\n✅ You can run third-party chat web interfaces, such as BetterChatGPT and LobeChat, with this API using Docker Compose. [Click here for the installation guide](./docker-compose).\n\n### Your PC/Server\n\nTo install and run the ChatGPT API Reverse Proxy on your PC/Server by following these steps:\n\nNote: This option is not available to all countries yet. if you are from a country that is not supported, you can use a **U.S. VPN** or use **our hosted API**.\n\n1. Ensure NodeJs (v19+) is installed: [Download NodeJs](https://nodejs.org/en/download)\n2. Clone this repository:\n   ```bash\n   git clone https://github.com/PawanOsman/ChatGPT.git\n   ```\n3. Open `start.bat` (Windows) or `start.sh` (Linux with `bash start.sh` command) to install dependencies and launch the server.\n4. Done, you can connect to your local server's API at:\n   ```\n   http://localhost:3040/v1/chat/completions\n   ```\n   Note that the base url will be `http://localhost:3040/v1`\n\nTo include installation instructions for Termux on Android devices, you can add the following section right after the instructions for Linux in the **Installing/Self-Hosting Guide**:\n\n### Termux on Android Phones\n\nTo install and run the ChatGPT API Reverse Proxy on Android using Termux, follow these steps:\n\n1. Install [Termux](https://play.google.com/store/apps/details?id=com.termux) from the Play Store.\n2. Update Termux packages:\n   ```bash\n   apt update\n   ```\n3. Upgrade Termux packages:\n   ```bash\n   apt upgrade\n   ```\n4. Install git, Node.js, and npm:\n   ```bash\n   apt install -y git nodejs\n   ```\n5. Clone the repository:\n   ```bash\n   git clone https://github.com/PawanOsman/ChatGPT.git\n   ```\n6. Navigate to the cloned directory:\n   ```bash\n   cd ChatGPT\n   ```\n7. Start the server with:\n\n   ```bash\n   bash start.sh\n   ```\n\n8. Your local server will now be running and accessible at:\n\n   ```\n   http://localhost:3040/v1/chat/completions\n   ```\n\n   Note that the base url will be `http://localhost:3040/v1`\n\n   You can now use this address to connect to your self-hosted ChatGPT API Reverse Proxy from Android applications/websites that support reverse proxy configurations, on the same device.\n\n## Accessing Our Hosted API\n\nUtilize our pre-hosted ChatGPT-like API for free by:\n\n1. Joining our [Discord server](https://discord.pawan.krd).\n2. Obtaining an API key from the `#Bot` channel with the `/key` command.\n3. Incorporating the API key into your requests to:\n   ```\n   https://api.pawan.krd/v1/chat/completions\n   ```\n\n## Usage Examples\n\nLeverage the same integration code as OpenAI's official libraries by simply adjusting the API key and base URL in your requests. For self-hosted setups, ensure to switch the base URL to your local server's address as mentioned above.\n\n### Example Usage with OpenAI Libraries\n\n#### Python Example\n\n```python\nimport openai\n\nopenai.api_key = 'anything'\nopenai.base_url = \"http://localhost:3040/v1/\"\n\ncompletion = openai.chat.completions.create(\n    model=\"gpt-3.5-turbo\",\n    messages=[\n        {\"role\": \"user\", \"content\": \"How do I list all files in a directory using Python?\"},\n    ],\n)\n\nprint(completion.choices[0].message.content)\n```\n\n#### Node.js Example\n\n```js\nimport OpenAI from 'openai';\n\nconst openai = new OpenAI({\n\tapiKey: \"anything\",\n\tbaseURL: \"http://localhost:3040/v1\",\n});\n\nconst chatCompletion = await openai.chat.completions.create({\n  messages: [{ role: 'user', content: 'Say this is a test' }],\n  model: 'gpt-3.5-turbo',\n});\n\nconsole.log(chatCompletion.choices[0].message.content);\n```\n\n## License\n\nThis project is under the AGPL-3.0 License. Refer to the [LICENSE](LICENSE) file for detailed information.\n","funding_links":[],"categories":["TypeScript","Repos","A01_文本生成_文本对话","📦 Legacy \u0026 Inactive Projects","Chatbots \u0026 Virtual Companions","chatgpt-api","Documentation and examples"],"sub_categories":["大语言对话模型及数据","Documentation, lists, guides, or examples"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPawanOsman%2FChatGPT","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPawanOsman%2FChatGPT","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPawanOsman%2FChatGPT/lists"}