Code Monkey home page Code Monkey logo

chatgpt-browser-api-proxy's Introduction

ChatGPT Browser API Proxy

The ChatGPT Browser API Proxy is a project that enables the use of OpenAI APIs by leveraging the ChatGPT unofficial browser API while bypassing Cloudflare anti-bot detection. This proxy allows you to make API requests to OpenAI's services directly from your local machine.

Prerequisites

Before using this API proxy, ensure that you have the following:

  • Node.js installed on your machine
  • Yarn package manager installed

Getting Started

To set up and use the ChatGPT Browser API Proxy, follow these steps:

  1. Clone the repository to your local machine:

    git clone https://github.com/rpidanny/chatgpt-browser-api-proxy.git
  2. Navigate to the project directory:

    cd chatgpt-browser-api-proxy
  3. Install the project dependencies:

    yarn install
  4. Copy the example environment file and rename it to .env:

    cp example.env .env
  5. Open the .env file and add your OpenAI Access Token obtained from the OpenAI platform. Replace <YOUR_ACCESS_TOKEN> with your actual token.

  6. Start the proxy server in development mode:

    yarn start:dev

Note:

You can get an Access Token by logging in to the ChatGPT webapp and then opening https://chat.openai.com/api/auth/session, which will return a JSON object containing your Access Token string.

Access tokens last for few days.

Configuring for LangChain

If you intend to use the proxy with LangChain, you need to set the OPENAI_API_BASE environment variable to specify the API base URL.

export OPENAI_API_BASE=http://localhost:3000/v1

Making API Requests

Once the proxy server is running, you can make API requests to OpenAI's services using the provided routes and endpoints. The proxy will handle the communication with the ChatGPT unofficial browser API and forward the responses to your local machine.

Notes

  • This project is an unofficial implementation and may not provide the same level of reliability or stability as official OpenAI APIs.
  • Usage of this project may be subject to OpenAI's terms of service. Please ensure compliance with their guidelines and policies.

Disclaimer

This project is provided as-is, without any warranty or guarantee of its functionality. The developers and contributors are not responsible for any damages or issues arising from the use of this project.

License

This project is licensed under the MIT License.

chatgpt-browser-api-proxy's People

Contributors

rpidanny avatar semantic-release-bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.