Download OpenAPI specification:
Askagento HTTP API
POST /install (new installs) and all OPTIONS preflights require no headers; POST /install returns the new site_id and api_key.
Authentication
Every request except POST /install and OPTIONS preflights is authenticated with two headers:
X-Askagento-Site-Id: <site_id>X-Askagento-Api-Key: <api_key>Routes:
OPTIONS /chatbot — CORS preflight; no API key.POST /chatbot — AI Chatbot. Chatbot with retrieved product context (LLM; response includes products_retrieved).OPTIONS /filter — CORS preflight; no API key.POST /filter — Auto Filter. Attributes filters with mode=attributes.POST /install — accept installation (async); no API key; response includes new site_id and api_key.GET /install — install status.OPTIONS /label — CORS preflight; no API key.POST /label — Auto Label. Analyze / generate / upload / export auto-labels for attributes, categories, or tags.OPTIONS /mcp — CORS preflight; no API key.POST /mcp — AI Agents MCP. JSON-RPC 2.0 MCP endpoint; tools: chat_with_shop, get_catalogue_stats, get_featured_products, get_product_by_id, get_shop_status, get_similar_products, list_categories, list_tags, search_products.GET /plan — current billing plan.GET /recommend/cross-sell — AI Recommend cross-sell bundle.GET /recommend/upsell — AI Recommend upsell bundle.OPTIONS /search — CORS preflight; no API key.POST /search — AI Image or Text Search. Semantic text/image search.POST /update — push current catalogue product data for an installed site.POST /uninstall — tear down remote data for the authenticated site.GET /usage — plan, remaining limits, and tier maximums.Install, uninstall, status, recommendations, search, chatbot, label, filter, MCP, plan, usage.
Sends a conversation to a configured chat model.
action=chat — The last user message drives semantic product search against the site's
catalogue (up to 12 matches). Matching products are injected as a system message before the LLM
request. Retrieval does not debit limits.searches. If search or catalogue load fails, the chat
continues without product context.
action=health — Minimal connectivity check: messages is ignored, completion is capped
at 3 tokens, and products_retrieved is always 0. Upstream usage.total_tokens is still
debited from limits.tokens when that limit is tracked (typically a few tokens).
Token preflight (429 when limits.tokens is present and <= 0) applies to both actions.
Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers.
| action | string Default: "chat" Enum: "chat" "health"
|
Array of objects (ChatMessage) <= 24 items Required when | |
| max_completion_tokens | integer <= 4096 Default: 1024 Alias |
{- "action": "chat",
- "messages": [
- {
- "role": "system",
- "content": "string"
}
], - "max_completion_tokens": 1024
}{- "site_id": "string",
- "action": "chat",
- "latency_ms": 0,
- "usage": {
- "total_tokens": 0
}, - "reply": "string",
- "products_retrieved": 0,
- "limits_tokens_remaining": 0
}Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers.
Auto Filter pipeline (no LLM). analyze lists attribute names found in the synced catalog;
generate echoes the merchant-selected canonical_filters; upload stores the selection on the catalog snapshot.
Accepts action or filter_action (analyze, generate, upload, export). Optional canonical_filters
is an alias for canonical_attributes.
| action | string Enum: "analyze" "generate" "upload" "export" |
| filter_action | string Enum: "analyze" "generate" "upload" "export" Alias for |
| canonical_filters | Array of strings Alias for |
{- "action": "analyze",
- "filter_action": "analyze",
- "canonical_filters": [
- "string"
]
}{- "site_id": "string",
- "mode": "string",
- "action": "string"
}Install the plugin.
| domain required | string |
| plugin_version | string |
| woocommerce_version | string |
required | Array of objects (Product) |
| total_products | integer |
| shop_ip | string Optional IPv4 string for the shop host (plugin may send DNS resolution result). |
| system required | string Enum: "woocommerce" "knowledge_base"
|
{- "domain": "string",
- "plugin_version": "string",
- "woocommerce_version": "string",
- "products": [
- {
- "id": 0,
- "title": "string",
- "name": "string",
- "description": "string",
- "short_description": "string",
- "sku": "string",
- "price": "string",
- "regular_price": "string",
- "sale_price": "string",
- "price_html": "string",
- "stock_quantity": 0,
- "status": "string",
- "featured": true,
- "on_sale": true,
- "categories": [
- {
- "id": 0,
- "name": "string",
- "slug": "string"
}
], - "tags": [
- {
- "id": 0,
- "name": "string",
- "slug": "string"
}
], - "attributes": [
- { }
], - "variations": [
- { }
], - "date_created": "2019-08-24T14:15:22Z",
- "date_modified": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
], - "total_products": 0,
- "shop_ip": "string",
- "system": "woocommerce"
}{- "status": "accepted",
- "site_id": "string",
- "api_key": "string",
- "message": "string"
}Install metadata only. Does not return recommendation data — use GET /recommend/upsell for the stored upsell bundle.
Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers.
{- "site_id": "string",
- "installed_at": "2019-08-24T14:15:22Z",
- "status_message": "string",
- "status": "ok"
}Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers.
Loads the site's product JSON, then runs analyze (suggest canonical names), generate (LLM proposals stored on products and catalogue), upload (persist generated labels into the catalogue in object storage), or export (download-ready payload). Debiting token quota uses the same mechanism as chat/search.
Modes: attributes, categories, tags. Actions: analyze, generate, upload, export.
| mode required | string Enum: "attributes" "categories" "tags" |
| action required | string Enum: "analyze" "generate" "upload" "export" |
| canonical_attributes | Array of strings |
| canonical_categories | Array of strings |
| canonical_tags | Array of strings |
{- "mode": "attributes",
- "action": "analyze",
- "canonical_attributes": [
- "string"
], - "canonical_categories": [
- "string"
], - "canonical_tags": [
- "string"
]
}{- "site_id": "string",
- "mode": "string",
- "action": "string"
}MCP 2024-11-05 over HTTP. Every request is a JSON-RPC 2.0 POST.
Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers.
Supported methods:
initialize — server capabilities and protocol version.notifications/initialized — acknowledged silently (empty 200 body).tools/call — execute a tool (see tool list below).tools/list — catalogue of available tools.tools/call tools (alphabetical):
chat_with_shop — conversational shop assistant (message, optional history); delegates to POST /chatbot
with action=chat (product retrieval + LLM). Debits limits.tokens like /chatbot.get_catalogue_stats — orientation summary: total and published product count, price range,
number of distinct categories and tags, featured and on-sale counts (no arguments).
Reads the stored S3 catalogue; no quota debit.get_featured_products — curated product list: list_type one of featured (merchant-starred),
on_sale (active discounts), or new_arrivals (sorted by date_created descending);
limit 1–50 (default 12). Reads the stored S3 catalogue; no quota debit.get_product_by_id — full detail for one product by numeric product_id:
title, URL, image, price, categories, tags, description (up to 400 chars). Reads the stored
S3 catalogue; no quota debit.get_shop_status — install status, plan, and remaining usage quotas (no arguments).get_similar_products — cross-sell and/or upsell neighbors for one product_id
(optional recommendation_type, limit). Reads the same precomputed similarity bundle
as /recommend/* (install-time catalogue similarity index, no LLM); no quota debit.list_categories — all product categories in the catalogue with name, slug, and product count. No quota debit.list_tags — all product tags in the catalogue with name, slug, and product count. No quota debit.search_products — semantic search by text, image, or both (query and/or image_base64,
optional modality, limit); debits limits.searches when tracked.Successful tool calls and protocol errors (initialize, unknown method, etc.) return HTTP 200 with a
JSON-RPC 2.0 body. Auth and site lookup failures also use HTTP 200 with JSON-RPC error objects
(codes -32001 unauthorized, -32004 site not found) so MCP clients can always parse the envelope.
HTTP 400 is reserved for a non-JSON or non-JSON-RPC request body at the transport layer.
| jsonrpc required | string Value: "2.0" |
(string or null) or (integer or null) Request id (omit for notifications) | |
| method required | string One of: |
object For |
{- "jsonrpc": "2.0",
- "id": "string",
- "method": "string",
- "params": { }
}{- "jsonrpc": "2.0",
- "id": "string",
- "result": { },
- "error": {
- "code": 0,
- "message": "string"
}
}Returns the current plan slug and display label for the site.
Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers.
{- "site_id": "string",
- "plan": "string",
- "plan_label": "string",
- "trial": true,
- "trial_ends_at": "string"
}Precomputed cross-sell recommendations for the registered catalogue (stored in object storage). Built during installation from install-time catalogue similarity indexes (no LLM).
Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers.
{- "site_id": "string",
- "generated_at": "string",
- "cross_sells": {
- "property1": [
- {
- "product_id": "string",
- "distance": 0.1,
- "title": "string",
- "image_url": "string",
- "source": "string"
}
], - "property2": [
- {
- "product_id": "string",
- "distance": 0.1,
- "title": "string",
- "image_url": "string",
- "source": "string"
}
]
}, - "recommendations": {
- "property1": [
- {
- "product_id": "string",
- "distance": 0.1,
- "title": "string",
- "image_url": "string",
- "source": "string"
}
], - "property2": [
- {
- "product_id": "string",
- "distance": 0.1,
- "title": "string",
- "image_url": "string",
- "source": "string"
}
]
}
}Precomputed upsell recommendations for the registered catalogue (stored in object storage). Built during installation from install-time catalogue similarity indexes (no LLM).
Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers.
{- "site_id": "string",
- "generated_at": "string",
- "cross_sells": {
- "property1": [
- {
- "product_id": "string",
- "distance": 0.1,
- "title": "string",
- "image_url": "string",
- "source": "string"
}
], - "property2": [
- {
- "product_id": "string",
- "distance": 0.1,
- "title": "string",
- "image_url": "string",
- "source": "string"
}
]
}, - "recommendations": {
- "property1": [
- {
- "product_id": "string",
- "distance": 0.1,
- "title": "string",
- "image_url": "string",
- "source": "string"
}
], - "property2": [
- {
- "product_id": "string",
- "distance": 0.1,
- "title": "string",
- "image_url": "string",
- "source": "string"
}
]
}
}Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers.
Body: Omit modality to infer: query/q only → text, image_base64 only → image, both → hybrid (both).
Set modality to text, image, or both explicitly. Hybrid fuses semantic text and image matches (same weights as upsell). Default limit 12 (1–50).
Each successful search debits one from limits.searches when that limit is tracked.
| query | string Text query (alias |
| q | string Alias for |
| image_base64 | string Base64 image; data URLs are accepted |
| modality | string Enum: "text" "image" "both" Omit for automatic modality: text if only |
| limit | integer [ 1 .. 50 ] Default: 12 |
{- "query": "string",
- "q": "string",
- "image_base64": "string",
- "modality": "text",
- "limit": 12
}{- "site_id": "string",
- "modality": "text",
- "query": "string",
- "results": [
- {
- "product_id": "string",
- "title": "string",
- "image_url": "string",
- "distance": 0.1
}
]
}Push the shop's current product catalogue for an installed site (scheduled or manual sync). Stores product JSON in object storage and updates the install record's product-data hash.
Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers.
| domain | string |
| plugin_version | string |
| woocommerce_version | string |
required | Array of objects (Product) |
| total_products | integer |
| system required | string Value: "woocommerce" |
{- "domain": "string",
- "plugin_version": "string",
- "woocommerce_version": "string",
- "products": [
- {
- "id": 0,
- "title": "string",
- "name": "string",
- "description": "string",
- "short_description": "string",
- "sku": "string",
- "price": "string",
- "regular_price": "string",
- "sale_price": "string",
- "price_html": "string",
- "stock_quantity": 0,
- "status": "string",
- "featured": true,
- "on_sale": true,
- "categories": [
- {
- "id": 0,
- "name": "string",
- "slug": "string"
}
], - "tags": [
- {
- "id": 0,
- "name": "string",
- "slug": "string"
}
], - "attributes": [
- { }
], - "variations": [
- { }
], - "date_created": "2019-08-24T14:15:22Z",
- "date_modified": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
], - "total_products": 0,
- "system": "woocommerce"
}{- "status": "ok",
- "site_id": "string",
- "synced_products": 0,
- "update_needed": true,
- "message": "string"
}Uninstall the plugin and remove all indexed data for the site.
Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers.
| system required | string Enum: "woocommerce" "knowledge_base" |
| domain | string |
| plugin_version | string |
| woocommerce_version | string |
{- "system": "woocommerce",
- "domain": "string",
- "plugin_version": "string",
- "woocommerce_version": "string"
}{- "status": "ok"
}Returns the current plan, remaining per-site limits (tokens, searches), the tier-level
maximums, and the catalogue product count against the plan's product cap. When the
catalogue exceeds the cap (over_product_limit: true), AI features are blocked until
the merchant upgrades or reduces the catalogue.
Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers.
{- "site_id": "string",
- "plan": "string",
- "plan_label": "string",
- "trial": true,
- "trial_ends_at": "string",
- "limits": {
- "tokens": 0,
- "searches": 0
}, - "plan_max_limits": {
- "tokens": 0,
- "searches": 0
}, - "product_count": 0,
- "max_products": 0,
- "over_product_limit": true
}