A lightweight local HTTP bridge that allows tools like OpenClaw, scripts, or local AI agents to send prompts to a logged-in ChatGPT browser session.
No OpenAI API key required.
This project connects local software to ChatGPT through an existing browser session.
Client → FastAPI Proxy → Playwright → Chromium Remote Debugging → ChatGPT Web UI
Many local AI tools require an OpenAI API key.
Sometimes you just want to experiment with:
- local agents
- Raspberry Pi setups
- home automation
- scripting
- prototypes
This bridge allows you to connect those tools to a normal ChatGPT browser session.
- Works with an existing ChatGPT browser session
- No API key required
- Runs on Raspberry Pi
- OpenAI-compatible API endpoint
- Simple chat endpoint
- systemd services included
- Chromium watchdog auto-restart
- Designed for local AI agent experimentation
┌───────────────┐
│ Client │
│ OpenClaw etc. │
└───────┬───────┘
│
▼
┌─────────────────┐
│ FastAPI API │
│ chatgpt_proxy │
└────────┬────────┘
│
▼
┌─────────────┐
│ Playwright │
│ automation │
└──────┬──────┘
│
▼
┌─────────────────────┐
│ Chromium Debug Port │
│ :9222 │
└─────────┬───────────┘
│
▼
ChatGPT Web
For quick testing and scripts.
POST /chat
Example:
curl -X POST http://127.0.0.1:8080/chat \
-H "Content-Type: application/json" \
-d '{"message":"Hello"}'
Response
{
"response": "Hello! How can I help you?"
}
Used by tools like OpenClaw.
POST /v1/chat/completions
Example:
curl http://127.0.0.1:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model":"chatgpt",
"messages":[
{"role":"user","content":"Hello"}
]
}'
- Raspberry Pi OS or Linux
- Python 3.10+
- Chromium
- Logged-in ChatGPT session
- Desktop environment
sudo apt update
sudo apt install -y python3 python3-pip python3-venv chromium curl
mkdir -p ~/chatgpt-bridge
cd ~/chatgpt-bridge
python3 -m venv .venv
source .venv/bin/activate
pip install fastapi uvicorn playwright
python -m playwright install chromium
chromium --remote-debugging-port=9222 https://chatgpt.com
Log into ChatGPT and keep the session open.
uvicorn chatgpt_proxy:app --host 0.0.0.0 --port 8080
curl http://127.0.0.1:8080/health
Expected result
{
"ok": true,
"page_url": "https://chatgpt.com/"
}
Install the service
sudo cp systemd/chatgpt-proxy.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable chatgpt-proxy
sudo systemctl start chatgpt-proxy
View logs
journalctl -u chatgpt-proxy -f
Ensures Chromium remote debugging stays alive.
Install services
sudo cp systemd/chromium-watchdog.* /etc/systemd/system/
sudo systemctl daemon-reload
Enable timer
sudo systemctl enable chromium-watchdog.timer
sudo systemctl start chromium-watchdog.timer
Set API base to
http://127.0.0.1:8080/v1
Model name
chatgpt
Proxy logs
journalctl -u chatgpt-proxy -f
Last OpenClaw payload
cat ~/chatgpt-bridge/last_openclaw_payload.json
Health check
curl http://127.0.0.1:8080/health
This bridge intentionally forwards only the last user message to ChatGPT.
Agent metadata, system prompts and tools are ignored for stability.
This project is meant for experimentation and local usage, not production systems.
Pull requests are welcome.
Ideas for improvements:
- streaming responses
- multi-session support
- Docker image
- queue system
- agent tool forwarding
MIT License