Extension: Getting Started
What Is This?
AI Mode API is a Chrome extension that turns your browser into a powerful API endpoint.
Here's the magic:
- You install our extension in Chrome.
- It automatically connects to our relay server (we handle the infrastructure).
- You get a unique URL like:
https://app.aimodeapi.com/api/abc123 - Anyone with that URL can send questions to YOUR Chrome browser.
- Your browser uses Google AI Mode to answer.
- The answer is returned as structured data (markdown + sources).
Why? Google AI Mode doesn't have an official API. This extension makes YOUR browser the API.
Prerequisites (Read Carefully)
Before you start, ensure you meet these requirements:
1. Browser Requirements
- ✅ Google Chrome (version 90+)
- ✅ OR any Chromium-based browser (Edge, Brave, Arc, etc.)
2. Google Account
- ✅ You must be signed in to Google in your browser.
- ✅ Your Google account must have access to AI Mode.
3. Google AI Mode Access
IMPORTANT: Not everyone has access to Google AI Mode yet.
Test if you have access:
- Go to: google.com/search?udm=50&aep=11
- You should see a chat-like interface.
- Try asking a question (e.g., "Hello").
- If it works: You can use this extension!
- If you see "AI Mode not available": This extension won't work for you yet.
Crucial Requirement
If Google AI Mode doesn't work in your browser normally, installing this extension won't help. The extension only creates an API from something that already works in your browser.
4. Internet Connection
- ✅ Stable internet connection.
- ✅ Extension needs to stay connected to our server to receive requests.
- ✅ Auto-Reconnect: If your connection drops, the extension will automatically attempt to reconnect and maintain the session.
Installation Steps
Step 1: Install the Extension
Option A: Chrome Web Store (Recommended)
- Go to the Chrome Web Store page (Link coming soon).
- Click "Add to Chrome".
- Click "Add extension" in the popup.
Option B: Load Unpacked (For Developers)
- Download the extension source code.
- Open Chrome and navigate to
chrome://extensions. - Enable "Developer mode" (top right toggle).
- Click "Load unpacked".
- Select the extension folder.
Step 2: Extension Auto-Connects
Once installed:
- The extension icon will appear in your Chrome toolbar.
- Click the extension icon to open the popup.
- You'll see "Connecting..." for a few seconds.
- Then it changes to Connected ✓.
What just happened?
The extension established a secure WebSocket connection to our relay server at app.aimodeapi.com. A unique ID was created for your browser session.
Unique Endpoints
Each extension installation creates a unique API endpoint bound to that specific browser instance. If you install the extension on a second computer (or different browser profile), you will get a second, different API endpoint.
Step 3: Get Your API Endpoint
In the extension popup, look for:
This URL is YOUR personal API endpoint.
- The
abc123-def456part is your unique WebSocket ID. - Keep it private! Anyone with this URL can use your browser to make queries.
- Copy the URL — you'll need it for the next step.
Step 4: Verify It Works
Let's test if your browser is correctly receiving requests.
Open your terminal and run this cURL commands:
curl -X POST https://app.aimodeapi.com/api/YOUR_WEBSOCKET_ID \
-H "Content-Type: application/json" \
-d '{"query": "What is 2+2?"}'
(Replace YOUR_WEBSOCKET_ID with the ID from your extension popup)
Expected JSON Response:
{
"response": {
"success": true,
"data": {
"response_body": "2 + 2 = 4...",
"sources": [],
"follow_up_questions": []
}
}
}
✅ Success: You received a response! Your browser is now an API.
❌ Error? Check the Troubleshooting guide.
What Happens Behind the Scenes?
When you (or your code) calls your API endpoint:
- Request: Your code sends
POST /api/abc123to our server. - Routing: Our server identifies the connection
abc123. - Relay: Server forwards the request to YOUR Chrome extension via WebSocket.
- Query: Your extension opens Google AI Mode in the background and types the question.
- Extraction: Extension waits for the answer, then extracts the text, sources, and follow-up links.
- Return: Data flows back: Extension → Server → Your Code.
Your Chrome browser acts as the "worker" processing the request.
Important Notes
- Keep Chrome Open: Your browser must be running for the API to work. If you close Chrome, the API will return an error (or timeout).
- Privacy: Requests use YOUR Google account. Your browsing history is NOT shared. Only the specific AI Mode query and response are transmitted.
- Rate Limits: Google may rate-limit you if you send too many requests too quickly. Use responsibly.
Next Steps
Now that you're connected:
- Try the Playground: Test your API visually
- Learn the API: API Getting Started
- See Examples: Code Examples