Askagento API
Install, uninstall, status, recommendations, search, chatbot, label, filter, MCP, plan, usage.
AI Chatbot
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.
AI Chatbot › Request Body
actionchat — full conversation; last user turn drives product retrieval (see POST /chatbot).
health — connectivity probe; messages optional and ignored; max_completion_tokens ignored.
Required when action=chat (non-empty after normalization); omitted or ignored for health. Up to 24 turns; each content truncated to 12 000 chars.
max_completion_tokensAlias max_tokens also accepted; capped at 4096. Ignored when action=health (server uses 3).
AI Chatbot › Responses
Chat reply with usage and limit information
site_idactionlatency_msRound-trip latency to the chat provider in milliseconds
replyText reply from the model
products_retrievedNumber of catalogue products injected as context for action=chat; always 0 for health
limits_tokens_remainingRemaining token quota for the site after this call; null if no quota is set
Auto Filter
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.
Auto Filter › Request Body
actionfilter_actionAlias for action; supply either action or filter_action.
canonical_filtersAlias for canonical_attributes when generating attribute filters.
Auto Filter › Responses
Filter action result (analyze / generate / upload / export).
site_idmodeactionInstallation status
Install plugin
Install the plugin.
Install plugin › Request Body
domainsystemwoocommerce — full catalogue with image + text data.
knowledge_base — text-only Confluence/article chunks for askagento.com chat.
plugin_versionwoocommerce_versiontotal_productsshop_ipOptional IPv4 string for the shop host (plugin may send DNS resolution result).
Install plugin › Responses
Installation accepted for async processing
statussite_idNew site identifier; store with api_key for subsequent calls.
api_keyInstall-time secret; required on all routes except POST /install (new installs) and OPTIONS preflights.
messageAuto Label
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.
Auto Label › Request Body
modeactioncanonical_attributescanonical_categoriescanonical_tagsAuto Label › Responses
Success shape varies by mode and action (counts, previews, keys, catalogue upload status).
site_idmodeactionAI Agents
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, optionalhistory); delegates toPOST /chatbotwithaction=chat(product retrieval + LLM). Debitslimits.tokenslike/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_typeone offeatured(merchant-starred),on_sale(active discounts), ornew_arrivals(sorted bydate_createddescending);limit1–50 (default 12). Reads the stored S3 catalogue; no quota debit.get_product_by_id— full detail for one product by numericproduct_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 oneproduct_id(optionalrecommendation_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 bytext,image, orboth(queryand/orimage_base64, optionalmodality,limit); debitslimits.searcheswhen 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.
AI Agents › Request Body
jsonrpcmethodOne of: initialize, notifications/initialized, tools/call, tools/list
Request id (omit for notifications)
For tools/call: {"name": "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", "arguments": {...}}
AI Agents › Responses
JSON-RPC 2.0 response (result or error)
jsonrpcerrorCurrent billing plan
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.
Current billing plan › Responses
Plan response
site_idplanPlan slug (e.g. starter, growth); null if no plan is set
plan_labelHuman-readable plan label
trialTrue while the site is on the install-time free trial of its plan
trial_ends_atISO-8601 UTC timestamp when the trial ends; null when not on a trial.
AI Recommend (cross-sell)
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.
AI Recommend (cross-sell) › Responses
Recommendations JSON from object storage
site_idgenerated_atISO 8601 timestamp (UTC) with Z suffix
Map of source product id to cross-sell targets (similarity-ranked)
Map of source product id (string) to ranked neighbor list
AI Recommend (upsell)
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.
AI Recommend (upsell) › Responses
Recommendations JSON from object storage
site_idgenerated_atISO 8601 timestamp (UTC) with Z suffix
Map of source product id to cross-sell targets (similarity-ranked)
Map of source product id (string) to ranked neighbor list
AI Search
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.
AI Search › Request Body
queryText query (alias q)
qAlias for query
image_base64Base64 image; data URLs are accepted
modalityOmit for automatic modality: text if only query/q, image if only image_base64,
both if query and image are present. both requires query (≥2 chars) and image_base64.
limitAI Search › Responses
Ranked product hits
site_idmodalityqueryEchoed text query when modality is text or both
Update product data
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.
Update product data › Request Body
systemdomainplugin_versionwoocommerce_versiontotal_productsUpdate product data › Responses
Product data accepted
statussite_idsynced_productsupdate_neededTrue when the catalogue hash changed on this sync (re-embed required). Unchanged-hash syncs do not clear a previously true flag.
messageUninstall plugin
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.
Uninstall plugin › Request Body
systemdomainplugin_versionwoocommerce_versionUninstall plugin › Responses
Uninstall completed
statusUsage limits
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.
Usage limits › Responses
Usage response
site_idplanPlan slug; null if no plan is set
plan_labeltrialTrue while the site is on the install-time free trial of its plan
trial_ends_atISO-8601 UTC timestamp when the trial ends; null when not on a trial.
Current remaining limits for this site; null if no limits are tracked
Tier-level maximums for the current plan; null if no plan is set. Includes a products field (the plan's product cap) in addition to tokens/searches.
product_countNumber of products in the shop's catalogue; null if not yet recorded
max_productsMaximum products allowed on the current plan; null if no plan is set
over_product_limitTrue when the catalogue exceeds the plan's product cap. While true, AI features are blocked until the merchant upgrades or reduces the catalogue.