A local OpenAI-compatible API bridge that allows AI coding agents (Cline, Roo Code, Continue.dev, Cursor, and custom Python agents) to use Qwen Studio models through a local network endpoint.
This project exposes an OpenAI-style API (/v1/chat/completions, /v1/models) and forwards requests to Qwen Studio by controlling an authenticated browser session through lightweight DOM and network automation.
- ✅ Fully OpenAI-compatible API endpoint
- ✅ Works seamlessly with coding agents supporting custom OpenAI providers
- ✅ Supports dynamic Qwen Studio web model switching (e.g., Qwen3.7-Max, Qwen3.7-Plus)
- ✅ Real-time streaming response support
- ✅ Localhost (accessible from
127.0.0.1) - ✅ No local model hosting or GPU required
- ✅ Compatible with OpenAI SDK / LangChain style clients
Coding Agent (VS Code, Python, etc.)
|
| OpenAI API format (HTTP)
v
Bridge Server (http://127.0.0.1:8000/v1)
|
| Command Queue & Stream Relay
v
Browser Automation Script (Console Injection)
|
| Native DOM Injection & Network Interception
v
Qwen Studio Web Interface (Authenticated Session)
- Python 3.10+
- A valid, logged-in Qwen Studio session in a Chromium-based browser (Chrome, Edge, Brave)
- Tampermonkey extension (Recommended) or manual Console access
-
Clone the repository:
git clone https://github.com/Vxtzq/qwen-scrape.git cd qwen-openai-bridge -
Install Python dependencies:
pip install -r requirements.txt
python server.pyYou should see:
🟢 BRIDGE ACTIVE.
🔑 API Key: sk-qwen-bridge-key
Paste the content inside paste_in_chrome.js in the browser's console. That's all.
python benchmark_api.pyThe bridge exposes its API on your local network. Find your local IP (e.g., 192.168.1.38) and configure your agents as follows:
| Setting | Value |
|---|---|
| Base URL | http://127.0.0.1:8000/v1 |
| API Key | sk-qwen-bridge-key |
| Model | qwen/qwen3.7-plus or qwen/qwen3.8-max |
- Type /auth
- Select "Custom provider"
- Select "OpenAI-Compatible"
- Enter
http://127.0.0.1:8000/v1 - Enter
sk-qwen-bridge-key - Add models (
qwen/qwen3.7-plusor/andqwen/qwen3.8-max) - Press enter (you can enable thinking...)
- Enjoy!
- Open Cline Settings → API Provider.
- Select OpenAI Compatible.
- Enter the Base URL, API Key, and Model ID from the table above.
- Click Verify Connection.
Add to your config.json:
{
"models": [
{
"title": "Qwen Bridge (Max)",
"provider": "openai",
"model": "qwen/qwen3.8-max",
"apiBase": "http://192.168.1.38:8000/v1",
"apiKey": "sk-qwen-bridge-key"
}
]
}- Go to Cursor Settings → Models.
- Click Add OpenAI Compatible Model.
- Fill in the Name, Base URL, API Key, and Model Name.
from openai import OpenAI
client = OpenAI(
base_url="http://192.168.1.38:8000/v1",
api_key="sk-qwen-bridge-key"
)
response = client.chat.completions.create(
model="qwen/qwen3.7-max",
messages=[{"role": "user", "content": "Write a Python script to parse JSON."}],
stream=True
)
for chunk in response:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)- Ensure
server.pyis running. - Ensure the Qwen browser tab is open and the Tampermonkey script is active.
- Verify your Base URL includes
/v1(e.g.,http://192.168.1.38:8000/v1).
- Test the discovery endpoint in your browser:
http://192.168.1.38:8000/v1/models - Ensure the
modelstring in your agent exactly matches one of the returnedidvalues (e.g.,qwen/qwen3.7-max).
- Based on a web interface, might not be as reliable as a standard paid API
- Reasonning content is not available to this day
- Might be slower than a standard LLM API
8000 to the public internet. Your browser session contains authenticated access to your Qwen account.
This project interacts with a third-party web interface through browser automation and network interception. Use responsibly and respect the Terms of Service of the platforms you connect to. This is an unofficial community tool.
MIT License
