So you wanna play with the premium ChatGPT API, huh? Well, here’s your chance—without the usual red tape. This Chrome extension and Node.js server combo create the ultimate bridge between your apps and your ChatGPT account. Go ahead, flex that premium subscription like a boss.
This isn’t rocket science, but it is pretty cool. You get two main components:
- Chrome Extension: Hangs out with the ChatGPT web interface in your browser.
- Node.js Server: The backbone that lets your external applications talk to ChatGPT like a pro.
Together, they let you:
- Send messages to ChatGPT from any app via simple HTTP requests.
- Get responses like you’re using the real API.
- Put your premium subscription to work in ways you’ve never imagined.
- Clone or download this repository. Yeah, it’s that easy.
- Open Chrome and head to
chrome://extensions/
. - Flip the switch to "Developer mode" at the top right.
- Hit "Load unpacked" and select the directory where you stashed this extension.
- You’ll see a fresh icon in your toolbar, signaling the magic is about to begin.
-
Make sure you have Node.js installed (v14 or later). If you don't, what are you even doing?
-
Install the dependencies you’ll need:
npm install express body-parser cors ng-cronk
-
Start the server like a boss:
node server.js
Boom! By default, the server runs on port 3000. Want to change that? Set the PORT
environment variable and you’re good to go.
Now, you want your local server to be accessible from anywhere on the web, right? That's where ngrok comes in. It creates a secure tunnel to your local machine, allowing external applications to call your API just like they would with any remote server.
-
Install ngrok:
- Download and install ngrok from https://ngrok.com/download.
-
Start ngrok:
- Run the following command in your terminal to create a tunnel to your local Node.js server (assuming it's running on port 3000):
ngrok http 3000
-
Copy the ngrok URL:
- Once ngrok is up and running, it will provide you with a public URL, something like
http://<random-string>.ngrok.io
. This URL now acts as a public endpoint for your local server.
- Once ngrok is up and running, it will provide you with a public URL, something like
-
Update the Extension:
-
In the Chrome extension popup, change the URL to your ngrok URL (e.g.,
http://<random-string>.ngrok.io
) instead ofhttp://localhost:3000
. -
Click "Save" and voila—your local server is now accessible to the web through ngrok!
-
- Click the extension icon to open the popup.
- Hit "Open ChatGPT Tab" to fire up a session (you’ll need to log in if you haven’t already).
- In the popup, enter the URL of your Node.js server (default:
http://localhost:3000
, or your ngrok URL if you're using that). - Click "Save" to link the extension to your server.
- Take a moment to bask in your newly acquired API key.
Send a simple POST request to your server (via ngrok URL if you’ve tunneled it):
POST http://<random-string>.ngrok.io/api/query
Request body:
{
"apiKey": "YOUR_API_KEY",
"message": "Hello, ChatGPT!",
"newConversation": true
}
apiKey
(string, required): This is your magic key to the universe.message
(string, required): Send a message to ChatGPT and wait for the wizardry.newConversation
(boolean, optional): Want to start fresh? Set it totrue
. Default isfalse
.
{
"response": "The response text from ChatGPT",
"error": null
}
Let’s be real: You don’t want just anyone accessing your ChatGPT. That’s why we’ve got your back:
- The extension generates a unique API key for your protection.
- The API key stays local and only gets shared with your specified server.
- Only the apps that have your API key can access your ChatGPT account via this bridge.
- For production? Use HTTPS. Seriously.
- ChatGPT must stay open in a browser tab. You knew this wasn’t going to be perfect, right?
- The extension is heavily reliant on the DOM structure of ChatGPT’s web interface, which can change without warning.
- This is an unofficial bridge. If OpenAI messes with their web interface, it might break. Use wisely.
Tired of the ChatGPT tab falling asleep? We've got you:
- The extension periodically brings the ChatGPT tab to the front to keep it active.
- Enable/disable this feature straight from the extension popup.
- Configure the frequency at which the tab is activated (in minutes).
Note: This feature isn’t for the faint of heart. It might mess with your workflow by switching tabs unexpectedly. Use only when necessary.
Going live? Here’s what you need to do:
- Always use HTTPS. Don’t be basic.
- Add some extra authentication to restrict API access.
- Rate limit the calls so no one abuses the system.
- Deploy behind a reverse proxy like Nginx for an extra layer of protection.
This extension is for educational purposes only. Using it may violate OpenAI’s terms of service. Proceed at your own risk.
Okay, here’s the deal: You need to run the server and the Chrome tab on one system. Make sure that the GPT page stays open in the Chrome tab as part of the server config. Keep it set to localhost
. Install the necessary packages, like ng-cronk
, and make sure everything’s configured properly.
Be smart about this—use it for local dev and deployment only. The API depends on the current DOM structure of ChatGPT, which could break at any moment. Don’t get too comfortable, but for now, enjoy using it while it lasts.
And remember: This is for educational purposes only.