Skip to content

Ron-Caster/BridgeAPI

Repository files navigation

GPT CLI Local Bridge

Local OpenAI-compatible API that forwards requests to GPT via browser extension.

example

Requirements

  • Python (3.12 used while making)
  • Firefox/Chromium extension in chatgpt-bridge-ext
  • Logged-in GPT tab at https://chatgpt.com (Didn't test logged out case)

Open FireFox and type about:debugging". Click "This FireFox" and click "Load Temporary Add-on..." Browse and select "manifest.json" from the folder "chatgpt-bridge-ext" - this will load the temporary extension to youur FireFox.

Install

pip install websockets openai

Run Server

python openai_style_server.py

Server endpoints:

  • http://127.0.0.1:8000/health
  • http://127.0.0.1:8000/v1/models
  • http://127.0.0.1:8000/v1/chat/completions

Client Example

python openai_style_receiver.py

Function Calling Test

cd Example-Agent
python function_call_test.py

Notes

  • Use base_url="http://127.0.0.1:8000/v1" in OpenAI client.
  • API key is not validated by this local backend.

About

Free OpenAI-compatible API that forwards requests to GPT via browser extension - for testing

Topics

Resources

Stars

Watchers

Forks

Contributors