API Reference
Complete technical documentation for the AI Mode API.
Base URL
All API requests are made to this domain.
Endpoint
Submit Query
Sends a query to the browser extension identified by websocket_id.
Parameters:
websocket_id(path, string, required): The unique identifier from your extension popup.
Headers:
Content-Type: application/json
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
query |
string | Yes | The question or prompt to send to Google AI Mode. |
Example Request:
Response Schema
Returns a JSON object containing the API Mode response.
{
"response": {
"success": true,
"processed_at": "2023-11-01T12:00:00Z",
"data": {
"response_body": "string (markdown)",
"sources": [
{
"url": "string",
"title": "string",
"description": "string",
"source": "string"
}
],
"follow_up_questions": [
"string"
]
}
}
}
Fields:
| Field | Type | Description |
|---|---|---|
response.success |
boolean | true if automation succeeded. |
response.processed_at |
string | ISO timestamp of when the response was processed. |
response.data.response_body |
string | The main answer text, formatted in Markdown. Includes bolding, lists, etc. |
response.data.sources |
array | List of sources cited in the answer. |
response.data.follow_up_questions |
array\<string\> | List of suggested follow-up questions provided by Google. Can be empty. |
Source Object:
| Field | Type | Description |
|---|---|---|
url |
string | Direct link to the source. |
title |
string | Title of the web page. |
description |
string | Brief snippet or description of the source. |
source |
string | Domain name (e.g., "wikipedia.org"). |
Status Codes
| Code | Description | Solution |
|---|---|---|
200 |
OK | Request succeeded. |
400 |
Bad Request | "Connection not found". Check your websocket_id and ensure extension is connected. |
422 |
Validation Error | Invalid JSON body or missing query field. |
500 |
Server Error | Internal relay error. Try again. |
504 |
Gateway Timeout | "Request to extension timed out". The query took >60s. Try a simpler query. |