Expose the 300+ models available on arena.ai through an OpenAI-compatible API.
Maintained and credited to SkyBotsDeveloper.
OpenAI client ── OpenAI-format request ──> Python proxy (localhost:9090)
Browser extension ── tokens, cookies, models ──> Python proxy
Python proxy ── authenticated arena.ai request ──> arena.ai
Python proxy <── arena.ai SSE stream <────────── arena.ai
OpenAI client <── OpenAI SSE response <──────── Python proxy
The browser extension runs on an arena.ai page. It collects authenticated browser cookies, discovers available models from Next.js data, and obtains reCAPTCHA tokens in the real browser environment. The Python server translates requests and responses between arena.ai and the OpenAI API format.
The extension's scripts communicate as follows:
injector.js (MAIN world) <-> content.js (ISOLATED world) <-> background.js
injector.js can access page globals such as grecaptcha and Next.js data. content.js bridges messages, and background.js manages cookies, tokens, and server synchronization.
| Feature | Description |
|---|---|
| reCAPTCHA V3 handling | The extension calls grecaptcha.enterprise.execute() in a real browser to obtain short-lived tokens. |
| Dual-world injection | The page script accesses page globals; the content script accesses browser extension APIs. |
| Fragmented cookies | Auth cookies such as arena-auth-prod-v1.0 and .1 are automatically combined. |
| Token pool | Up to 10 V3 tokens are kept, replenished every 80 seconds, and expired tokens are removed. |
| SSE conversion | arena.ai events (a0:, ag:, ad:, a2:, and a3:) are converted to standard OpenAI SSE chunks. |
| Automatic model discovery | Models are extracted from Next.js __NEXT_DATA__ or __next_f data. |
- Python 3.10+
- Chrome or Firefox
- An arena.ai account
pip install -r requirements.txt
python server.pyThe server listens on http://localhost:9090 by default and waits for an extension connection.
- Open
chrome://extensions/. - Enable Developer mode.
- Select Load unpacked.
- Choose this project's
extension/directory.
- Open
about:debugging#/runtime/this-firefox. - Select Load Temporary Add-on.
- Choose
extension-firefox/manifest.jsonfrom this project.
- Click the extension icon and select Open Arena.ai, or open
https://arena.ai/?mode=direct. - Wait 3–5 seconds for the page to load.
- Open the extension popup again and verify that Server is connected, the Arena tab is active, the auth cookie is present, and models have been found.
# List available models
curl http://localhost:9090/v1/models
# Non-streaming chat
curl http://localhost:9090/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"GPT-4o","messages":[{"role":"user","content":"Hello"}]}'
# Streaming chat
curl http://localhost:9090/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"GPT-4o","stream":true,"messages":[{"role":"user","content":"Hello"}]}'from openai import OpenAI
client = OpenAI(base_url="http://localhost:9090/v1", api_key="not-needed")
response = client.chat.completions.create(
model="GPT-4o",
messages=[{"role": "user", "content": "Hello"}],
)
print(response.choices[0].message.content)| Endpoint | Method | Description |
|---|---|---|
/v1/models |
GET | Lists all available models in OpenAI format. |
/v1/chat/completions |
POST | Creates a chat completion; supports stream: true and false. |
/v1/extension/push |
POST | Internal endpoint used by the extension to push tokens, cookies, and models. |
/v1/extension/status |
GET | Shows extension connection status and token-pool information. |
/health |
GET | Health check. |
| Environment variable | Default | Description |
|---|---|---|
PORT |
9090 |
Port on which the server listens. |
API_KEY |
none | Optional authentication; requests must send Authorization: Bearer <API_KEY>. |
DEBUG |
none | Set any value to enable debug logging. |
Click the extension icon to change Server URL. Its default is http://127.0.0.1:9090.
arena2api/
├── server.py # FastAPI proxy and OpenAI/arena.ai conversion
├── requirements.txt # Python dependencies
├── extension/ # Chrome extension (Manifest V3)
│ ├── background.js # Token pool, cookie refresh, and periodic server push
│ ├── content.js # Injector-to-background message bridge
│ ├── injector.js # reCAPTCHA access, model discovery, and cookie reading
│ └── popup.html/js # Extension popup UI
└── extension-firefox/ # Firefox extension (Manifest V2)
Confirm that the Python server is running and that the port in Server URL is correct. The extension pushes automatically every 30 seconds; use the Push button to trigger it manually.
Ensure that the arena.ai page has fully loaded, then refresh it. Models are extracted from the page's Next.js data.
The server considers the extension disconnected after 120 seconds without a push. Check that the arena.ai tab remains open, or reopen the page.
reCAPTCHA tokens are valid for roughly two minutes and are replenished every 80 seconds. If a burst of requests consumes the pool, wait briefly for a new token.
- Keep an arena.ai tab open: the extension needs its page environment to obtain reCAPTCHA tokens.
- Tokens last for about two minutes; high request volume can temporarily exhaust the pool.
- arena.ai is free to use; this project only converts protocol formats.
- Use arena.ai's original model names, such as
GPT-4oandClaude 3.5 Sonnet. Call/v1/modelsfor the complete list. - This project is intended for local use. The server listens on
0.0.0.0by default, so protect it appropriately in a production network.