Bridge the gap between Google AI Studio and local workflows
Project description
aistudio-bridge
aistudio-bridge is a developer tool designed to bridge the gap between the Google AI Studio web environment and your local development workflow. It enables developers to iterate locally in their preferred IDEs and tools while leveraging the authenticated execution environment and increased usage limits provided to AI Studio users.
By providing a local endpoint that tunnels requests through a secure browser session, aistudio-bridge allows you to maintain the benefits of the AI Studio ecosystem while working in a native local environment.
Features
- Drop-in Reverse Proxy: Listens on
http://localhost:8080. - Native SSE Streaming: Real-time chunking via CDP bindings.
- Systemd Integration: Easy userspace service installation.
- Persistent Config: Managed via
~/.aistudio-bridge/config.yaml.
Installation
The easiest way to install the bridge is via pipx:
pipx install aistudio-bridge
From Source (Development)
If you want to contribute or run the latest dev version:
git clone https://github.com/eyjohn/aistudio-bridge
cd aistudio-bridge
pipx install .
Usage
1. Obtain an App ID
- Navigate to AI Studio Apps.
- Create a new application.
Note: The "body" or logic of the app (the prompt, model settings, etc.) is completely irrelevant. The app simply provides an authenticated execution environment for the proxy to tunnel through.
- Copy the UUID from the browser URL.
2. Initial Setup (Authentication)
The first time you run the bridge, you must log in to your Google account in the Chrome window that appears.
aistudio-bridge <APP_ID> --visual-overlay
- A Chrome window will open to your AI Studio App.
- If prompted, log in to your Google account.
- Crucial: Manually dismiss any "Welcome," "Cookies," or "Tour Guide" modals that appear in the browser. These can block the application bridge if left open.
- Wait for the terminal to show
[✓] BRIDGE INITIALIZATION COMPLETE. - Your session is now saved in
~/.aistudio-bridge/profile/. Subsequent runs (including background services) will inherit this login.
This creates ~/.aistudio-bridge/config.yaml and initializes the Chrome profile in ~/.aistudio-bridge/profile/.
3. Background Service (Linux)
aistudio-bridge --install # Install service
systemctl --user enable --now aistudio-bridge # Start & Enable
systemctl --user status aistudio-bridge # Check Status
Monitoring Logs
journalctl --user -u aistudio-bridge -f # Follow real-time
journalctl --user -u aistudio-bridge -n 100 # Last 100 lines
To remove: aistudio-bridge --uninstall
Connecting your apps
Simply point your API clients to http://localhost:8080.
Standard Request:
curl -X POST http://127.0.0.1:8080/v1beta/models/gemini-flash-lite-latest:generateContent?key=MY_GEMINI_API_KEY \
-H 'Content-Type: application/json' \
-d '{"contents":[{"parts":[{"text":"Explain proxy streaming in 5 words."}]}]}'
SSE Stream Request:
curl -X POST http://127.0.0.1:8080/v1beta/models/gemini-3.1-pro-preview:streamGenerateContent?key=MY_GEMINI_API_KEY\&alt=sse \
-H 'Content-Type: application/json' \
-d '{"contents":[{"parts":[{"text":"Print 10 paragraphs of lorum ipsum."}]}]}'
app_id: your-uuid-here
visual_overlay: true
chrome_binary: google-chrome
target_api: https://generativelanguage.googleapis.com
port: 8080
Development
The project uses uv for dependency management and ruff for linting/formatting.
Setup
git clone https://github.com/eyjohn/aistudio-bridge
cd aistudio-bridge
uv sync
Quality Control
# Lint & Format
uv run ruff check .
uv run ruff format .
# Tests
uv run pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aistudio_bridge-0.4.6.tar.gz.
File metadata
- Download URL: aistudio_bridge-0.4.6.tar.gz
- Upload date:
- Size: 15.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee3fc97e3285f46e754e3aa68e05d083a332b47dda7ac4865061ce8c006df0e9
|
|
| MD5 |
89a7aba77d454a7d53620bcda09f2207
|
|
| BLAKE2b-256 |
7249e4a11488956fff9c960bcc40c7bcba9489876e1e63681ba49250dff4c2a5
|
Provenance
The following attestation bundles were made for aistudio_bridge-0.4.6.tar.gz:
Publisher:
publish.yml on eyjohn/aistudio-bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aistudio_bridge-0.4.6.tar.gz -
Subject digest:
ee3fc97e3285f46e754e3aa68e05d083a332b47dda7ac4865061ce8c006df0e9 - Sigstore transparency entry: 1448906424
- Sigstore integration time:
-
Permalink:
eyjohn/aistudio-bridge@2fb85d14e04c3ce5769e36aaf28ebdcb8963e59c -
Branch / Tag:
refs/tags/v0.4.6 - Owner: https://github.com/eyjohn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2fb85d14e04c3ce5769e36aaf28ebdcb8963e59c -
Trigger Event:
push
-
Statement type:
File details
Details for the file aistudio_bridge-0.4.6-py3-none-any.whl.
File metadata
- Download URL: aistudio_bridge-0.4.6-py3-none-any.whl
- Upload date:
- Size: 18.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b122397f5cafea2d72bb1f986e42be82f572f3a826a3f61403ae69ec98a9303
|
|
| MD5 |
b1f23f21414fb16d7ecac49bb1e5942a
|
|
| BLAKE2b-256 |
4c3f9d52d692cc306660cdb575fa187cde5a042da5decd182ed257c2cd66aa30
|
Provenance
The following attestation bundles were made for aistudio_bridge-0.4.6-py3-none-any.whl:
Publisher:
publish.yml on eyjohn/aistudio-bridge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aistudio_bridge-0.4.6-py3-none-any.whl -
Subject digest:
5b122397f5cafea2d72bb1f986e42be82f572f3a826a3f61403ae69ec98a9303 - Sigstore transparency entry: 1448906459
- Sigstore integration time:
-
Permalink:
eyjohn/aistudio-bridge@2fb85d14e04c3ce5769e36aaf28ebdcb8963e59c -
Branch / Tag:
refs/tags/v0.4.6 - Owner: https://github.com/eyjohn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2fb85d14e04c3ce5769e36aaf28ebdcb8963e59c -
Trigger Event:
push
-
Statement type: