AskAgento API
Information
Askagento API
    AI Agents & MCPpostCORS for AI AgentsoptionsAI ChatbotpostCORS for AI ChatbotoptionsAI Recommend (cross-sell)getAI Recommend (upsell)getAI SearchpostCORS for AI SearchoptionsAutocompletegetCORS for AutocompleteoptionsAuto FilterpostCORS for Auto FilteroptionsAuto LabelpostCORS for Auto LabeloptionsBring-your-own-key (BYOK) LLM credentialspostCurrent subscription plangetInstallation statusgetInstall pluginpostInstall verifypostCORS preflightoptionsLost-demand insightsgetReport a storefront sessionpostCORS preflight for session reportsoptionsReport an orderpostRevenue attribution summarygetSave merchandisingpostUninstall pluginpostUpdate product datapostUsage limitsget
Schemas
powered by Zudoku
Welcome to AskAgento API
Welcome to AskAgento API

Askagento API

Install, uninstall, status, recommendations, search, chatbot, BYOK, label, filter, MCP, plan, usage, revenue attribution.


AI Agents & MCP

POST
https://api.askagento.com/v1
/mcp

MCP 2024-11-05 over HTTP. Every request is a JSON-RPC 2.0 POST.

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 (text 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.

Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers. <api_key> can be the public key or the secret key; use the public key in browser code and AI agent configs.

AI Agents & MCP › Request Body

McpRequest
jsonrpc
​string · enum · required
Enum values:
2.0
method
​string · required

One of: initialize, notifications/initialized, tools/call, tools/list

​

Request id (omit for notifications)

​object

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 & MCP › Responses

JSON-RPC 2.0 response (result or error)

McpResponse
jsonrpc
​string · enum
Enum values:
2.0
​
​object | null
error
​object | null
POST/mcp
curl https://api.askagento.com/v1/mcp \ --request POST \ --header 'Content-Type: application/json' \ --header 'X-Askagento-Site-Id: <api-key>' \ --header 'X-Askagento-Api-Key: <api-key>' \ --data '{ "jsonrpc": "2.0", "id": "string", "method": "method", "params": {} }'
Example Request Body
{ "jsonrpc": "2.0", "id": "string", "method": "method", "params": {} }
json
Example Responses
{ "jsonrpc": "2.0", "id": "string", "result": {}, "error": { "code": 0, "message": "message" } }
json
application/json

CORS for AI Agents

OPTIONS
https://api.askagento.com/v1
/mcp

CORS for AI Agents › Responses

200

Empty JSON body

OPTIONS/mcp
curl https://api.askagento.com/v1/mcp \ --request OPTIONS
Example Responses
{}
json
application/json

AI Chatbot

POST
https://api.askagento.com/v1
/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), unless BYOK is active (see below).

BYOK — If the site has a merchant key stored via POST /byok, that key is used instead of the shared AskAgento LLM credentials. Token preflight and limits.tokens debit are skipped while BYOK is active (usage.billed_tokens is 0).

Token preflight (429 when limits.tokens is present and <= 0) applies when BYOK is not active.

Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers. <api_key> can be the public key or the secret key; use the public key in browser code and AI agent configs.

AI Chatbot › Request Body

ChatbotRequest
action
​string · enum

chat — full conversation; last user turn drives product retrieval (see POST /chatbot). health — connectivity probe; messages optional and ignored; max_completion_tokens ignored.

Enum values:
chat
health
Default: chat
​ChatMessage[] · maxItems: 24

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_tokens
​integer · max: 4096

Alias max_tokens also accepted; capped at 4096. Ignored when action=health (server uses 3).

Default: 1024
​

Optional. The product page the shopper is asking from (AI Assistant). Its synced details (price, attributes, variants, description) are given to the assistant, so questions like "is it waterproof?" are answered about that product. Ignored when the product is not in the last catalogue sync.

Example: 1234

AI Chatbot › Responses

Chat reply with usage and limit information

ChatbotResponse
site_id
​string · required
action
​string · enum · required
Enum values:
chat
health
latency_ms
​integer · required

Round-trip latency to the chat provider in milliseconds

​object · required
reply
​string · required

Text reply from the model

products_retrieved
​integer · required

Number of catalogue products injected as context for action=chat; always 0 for health

limits_tokens_remaining
​integer | null

Remaining token quota for the site after this call; null if no quota is set

POST/chatbot
curl https://api.askagento.com/v1/chatbot \ --request POST \ --header 'Content-Type: application/json' \ --header 'X-Askagento-Site-Id: <api-key>' \ --header 'X-Askagento-Api-Key: <api-key>' \ --data '{ "action": "chat", "messages": [ { "role": "system", "content": "content" } ], "max_completion_tokens": 1024, "product_id": 1234 }'
Example Request Body
{ "action": "chat", "messages": [ { "role": "system", "content": "content" } ], "max_completion_tokens": 1024, "product_id": 1234 }
json
Example Responses
{ "site_id": "site_id", "action": "chat", "latency_ms": 0, "usage": { "total_tokens": 0 }, "reply": "reply", "products_retrieved": 0, "limits_tokens_remaining": 0 }
json
application/json

CORS for AI Chatbot

OPTIONS
https://api.askagento.com/v1
/chatbot

No request body. Response includes CORS headers (Access-Control-Allow-Origin, Access-Control-Allow-Headers including X-Askagento-Site-Id, X-Askagento-Api-Key, Content-Type) so browsers may POST /chatbot.

CORS for AI Chatbot › Responses

200

Empty JSON body

OPTIONS/chatbot
curl https://api.askagento.com/v1/chatbot \ --request OPTIONS
Example Responses
{}
json
application/json

AI Recommend (cross-sell)

GET
https://api.askagento.com/v1
/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. <api_key> must be the secret key; the public key is rejected with 401.

AI Recommend (cross-sell) › Responses

Recommendations JSON from object storage

RecommendationsPayload
site_id
​string
generated_at
​string

ISO 8601 timestamp (UTC) with Z suffix

​object

Map of source product id to cross-sell targets (similarity-ranked)

​object

Map of source product id (string) to ranked neighbor list

GET/recommend/cross-sell
curl https://api.askagento.com/v1/recommend/cross-sell \ --header 'X-Askagento-Site-Id: <api-key>' \ --header 'X-Askagento-Api-Key: <api-key>'
Example Responses
{ "site_id": "site_id", "generated_at": "generated_at", "cross_sells": { "key": [ { "product_id": "product_id", "distance": 0, "title": "title", "image_url": "image_url", "source": "source" } ] }, "recommendations": { "key": [ { "product_id": "product_id", "distance": 0, "title": "title", "image_url": "image_url", "source": "source" } ] } }
json
application/json

AI Recommend (upsell)

GET
https://api.askagento.com/v1
/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. <api_key> must be the secret key; the public key is rejected with 401.

AI Recommend (upsell) › Responses

Recommendations JSON from object storage

RecommendationsPayload
site_id
​string
generated_at
​string

ISO 8601 timestamp (UTC) with Z suffix

​object

Map of source product id to cross-sell targets (similarity-ranked)

​object

Map of source product id (string) to ranked neighbor list

GET/recommend/upsell
curl https://api.askagento.com/v1/recommend/upsell \ --header 'X-Askagento-Site-Id: <api-key>' \ --header 'X-Askagento-Api-Key: <api-key>'
Example Responses
{ "site_id": "site_id", "generated_at": "generated_at", "cross_sells": { "key": [ { "product_id": "product_id", "distance": 0, "title": "title", "image_url": "image_url", "source": "source" } ] }, "recommendations": { "key": [ { "product_id": "product_id", "distance": 0, "title": "title", "image_url": "image_url", "source": "source" } ] } }
json
application/json

AI Search

POST
https://api.askagento.com/v1
/search

Search endpoint for text, image and voice search.

Omit modality to infer from the body: text only → text, image_base64 only → image, both present → both, audio_base64 only → voice. Setting both requires text (≥2 chars) and image_base64. Prefer setting modality explicitly for MCP contracts so the search mode is declared rather than inferred.

Voice search (modality: voice): send a short spoken query as audio_base64 — a WAV file, 16-bit PCM, mono, 8–48 kHz (16 kHz recommended), at most 15 seconds — and optionally language (e.g. en-US, de_DE, fr; default en-US). The speech is converted to text and searched like a typed query; the response echoes it as transcript.

Each successful text, image or hybrid search debits one from limits.searches when that limit is tracked. A voice search debits 100 (speech-to-text is metered per second of audio), including when no speech is recognized. Monthly searches are spent first, then add-on pack searches. When fewer than 100 remain, a voice search returns 429 before any audio is processed.

Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers. <api_key> can be the public key or the secret key; use the public key in browser code and AI agent configs.

AI Search › Request Body

SearchRequest
text
​string

Search text, at least 2 characters

image_base64
​string

Base64-encoded image bytes. A leading data:image/...;base64, prefix is stripped if present. Never fetched over the network.

audio_base64
​string

Voice query: base64-encoded WAV (16-bit PCM, mono, 8–48 kHz, ≤15 s). A leading data:audio/...;base64, prefix is stripped if present. Costs 100 searches.

language
​string

Spoken language for voice (e.g. en-US, de-DE, de_DE, fr). Default en-US.

modality
​string · enum

Omit to infer from the body: text only → text, image_base64 only → image, both present → both, audio_base64 only → voice. Setting both requires text (≥2 chars) and image_base64.

Enum values:
text
image
both
voice
limit
​integer · min: 1 · max: 50
Default: 12
merchandise
​boolean

Apply the shop's merchandising (see POST /merchandising). Set false when your own code reorders the results.

Default: true

AI Search › Responses

Ranked product hits

SearchResponse
site_id
​string · required
modality
​string · enum · required
Enum values:
text
image
both
voice
​SearchHit[] · required
query
​string

Echoed text query when modality is text or both; the transcript for voice

transcript
​string

Voice only. Recognized speech that was searched (may be empty).

language
​string

Voice only. Spoken language used for recognition (e.g. en-US).

search_credit_cost
​integer

Voice only. Searches debited for this request (100).

​SearchRedirect

Present when the shop redirects this text or voice search to a page; results is then empty. Open redirect.url instead of showing results.

POST/search
curl https://api.askagento.com/v1/search \ --request POST \ --header 'Content-Type: application/json' \ --header 'X-Askagento-Site-Id: <api-key>' \ --header 'X-Askagento-Api-Key: <api-key>' \ --data '{ "text": "text", "image_base64": "image_base64", "audio_base64": "audio_base64", "language": "language", "modality": "text", "limit": 12, "merchandise": true }'
Example Request Body
{ "text": "text", "image_base64": "image_base64", "audio_base64": "audio_base64", "language": "language", "modality": "text", "limit": 12, "merchandise": true }
json
Example Responses
{ "site_id": "site_id", "modality": "text", "query": "query", "transcript": "transcript", "language": "language", "search_credit_cost": 0, "results": [ { "product_id": "product_id", "title": "title", "image_url": "image_url", "distance": 0, "pinned": true } ], "redirect": { "url": "https://shop.example/returns", "label": "Returns" } }
json
application/json

CORS for AI Search

OPTIONS
https://api.askagento.com/v1
/search

No request body. Response includes CORS headers (Access-Control-Allow-Origin, Access-Control-Allow-Headers including X-Askagento-Site-Id, X-Askagento-Api-Key, Content-Type) so browsers may POST /search.

CORS for AI Search › Responses

200

Empty JSON body

OPTIONS/search
curl https://api.askagento.com/v1/search \ --request OPTIONS
Example Responses
{}
json
application/json

Autocomplete

GET
https://api.askagento.com/v1
/suggest

Product suggestions for a search box, meant to be called while a shopper types (debounced, from the 2nd character). Each typed word must match the start of a word in the product title, category, tag, attribute value or SKU; one typo is tolerated in words of 4 or more letters, and words no product contains (e.g. "need" in "i need watch") are left out. The shop's synonyms (POST /merchandising) widen the match. No AI is involved and suggestions are not counted against limits.searches; run POST /search for the full AI search (e.g. on Enter).

Besides products, the answer lists popular searches that continue the typed text and the shop's search redirect for it, if any (the redirect also matches a redirect phrase that starts with the typed text, from 3 characters). An empty q (the shopper focused the empty search box) answers with trending searches of the last 7 days and the shop's best sellers.

Suggestions come from the catalogue of the latest sync (POST /install or POST /update). Answers may be cached by the browser for 60 seconds. A 1-character query returns nothing.

Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers. <api_key> can be the public key or the secret key; use the public key in browser code.

Autocomplete › query Parameters

q
​string · maxLength: 100 · required

What the shopper has typed so far (trimmed and lower-cased; at most 100 characters are used). Empty for trending searches and best sellers.

limit
​integer · min: 1 · max: 10

Maximum number of products (1–10, default 6).

Default: 6

Autocomplete › Responses

Matching products (best first), popular searches and the search redirect

SuggestResponse
site_id
​string · required
query
​string · required

The query as matched (trimmed, lower-cased).

​object[] · required
searches
​string[] · required

Popular searches that continue the typed text (most frequent first); for an empty q, the trending searches of the last 7 days.

Example: ["silver watch","silver earrings"]
​required
GET/suggest
curl 'https://api.askagento.com/v1/suggest?q=sne' \ --header 'X-Askagento-Site-Id: <api-key>' \ --header 'X-Askagento-Api-Key: <api-key>'
Example Responses
{ "site_id": "site_id", "query": "query", "products": [ { "product_id": 0, "title": "title", "url": "url", "image_url": "image_url", "price": "price", "in_stock": true } ], "searches": [ "silver watch", "silver earrings" ], "redirect": { "url": "https://shop.example/returns", "label": "Returns" } }
json
application/json

CORS for Autocomplete

OPTIONS
https://api.askagento.com/v1
/suggest

No request body. Response includes CORS headers (Access-Control-Allow-Origin, Access-Control-Allow-Headers including X-Askagento-Site-Id, X-Askagento-Api-Key) so browsers may GET /suggest.

CORS for Autocomplete › Responses

200

Empty JSON body

OPTIONS/suggest
curl https://api.askagento.com/v1/suggest \ --request OPTIONS
Example Responses
{}
json
application/json

Auto Filter

POST
https://api.askagento.com/v1
/filter

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.

Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers. <api_key> must be the secret key; the public key is rejected with 401.

Auto Filter › Request Body

FilterRequest
action
​string · enum
Enum values:
analyze
generate
upload
export
filter_action
​string · enum

Alias for action; supply either action or filter_action.

Enum values:
analyze
generate
upload
export
canonical_filters
​string[]

Alias for canonical_attributes when generating attribute filters.

Auto Filter › Responses

Filter action result (analyze / generate / upload / export).

Shape depends on `mode` and `action`. `generated_preview`, `uploaded_products` (upload), `filename` (export), and informational `message`.
LabelFilterJsonResponse
site_id
​string
mode
​string
action
​string
Additional properties are allowed
POST/filter
curl https://api.askagento.com/v1/filter \ --request POST \ --header 'Content-Type: application/json' \ --header 'X-Askagento-Site-Id: <api-key>' \ --header 'X-Askagento-Api-Key: <api-key>' \ --data '{ "action": "analyze", "filter_action": "analyze", "canonical_filters": [ "string" ] }'
Example Request Body
{ "action": "analyze", "filter_action": "analyze", "canonical_filters": [ "string" ] }
json
Example Responses
{ "site_id": "site_id", "mode": "mode", "action": "action" }
json
application/json

CORS for Auto Filter

OPTIONS
https://api.askagento.com/v1
/filter

CORS for Auto Filter › Responses

200

Empty JSON body

OPTIONS/filter
curl https://api.askagento.com/v1/filter \ --request OPTIONS
Example Responses
{}
json
application/json

Auto Label

POST
https://api.askagento.com/v1
/label

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.

Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers. <api_key> must be the secret key; the public key is rejected with 401.

Auto Label › Request Body

LabelRequest
mode
​string · enum · required
Enum values:
attributes
categories
tags
action
​string · enum · required
Enum values:
analyze
generate
upload
export
canonical_attributes
​string[]
canonical_categories
​string[]
canonical_tags
​string[]

Auto Label › Responses

Success shape varies by mode and action (counts, previews, keys, catalogue upload status).

Shape depends on `mode` and `action`. `generated_preview`, `uploaded_products` (upload), `filename` (export), and informational `message`.
LabelFilterJsonResponse
site_id
​string
mode
​string
action
​string
Additional properties are allowed
POST/label
curl https://api.askagento.com/v1/label \ --request POST \ --header 'Content-Type: application/json' \ --header 'X-Askagento-Site-Id: <api-key>' \ --header 'X-Askagento-Api-Key: <api-key>' \ --data '{ "mode": "attributes", "action": "analyze", "canonical_attributes": [ "string" ], "canonical_categories": [ "string" ], "canonical_tags": [ "string" ] }'
Example Request Body
{ "mode": "attributes", "action": "analyze", "canonical_attributes": [ "string" ], "canonical_categories": [ "string" ], "canonical_tags": [ "string" ] }
json
Example Responses
{ "site_id": "site_id", "mode": "mode", "action": "action" }
json
application/json

CORS for Auto Label

OPTIONS
https://api.askagento.com/v1
/label

CORS for Auto Label › Responses

200

Empty JSON body

OPTIONS/label
curl https://api.askagento.com/v1/label \ --request OPTIONS
Example Responses
{}
json
application/json

Bring-your-own-key (BYOK) LLM credentials

POST
https://api.askagento.com/v1
/byok

Store or clear a merchant-supplied OpenAI or OpenRouter API key on the install record.

When a BYOK key is stored, POST /chatbot uses that key for inference and does not debit limits.tokens (the merchant pays their provider directly). Clearing removes the key and restores the shared AskAgento LLM path with normal token metering.

Providers: openai, openrouter only (OpenAI-compatible chat completions).

Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers. <api_key> must be the secret key; the public key is rejected with 401.

Bring-your-own-key (BYOK) LLM credentials › Request Body

ByokRequest
action
​string · enum · required

set stores the merchant key; clear removes BYOK credentials from the install record.

Enum values:
set
clear
provider
​string · enum

Required when action=set.

Enum values:
openai
openrouter
api_key
​string

Merchant LLM API key. Required when action=set. Never logged by the API.

model
​string

Optional model id for action=set (e.g. gpt-5-mini for OpenAI, or an OpenRouter model id). When omitted, the chatbot uses the server default (OpenRouter ids are prefixed with openai/ when needed).

Bring-your-own-key (BYOK) LLM credentials › Responses

BYOK config stored or cleared

ByokResponse
status
​string · required
site_id
​string · required
byok
​boolean · required

True when a BYOK key is stored after this request; false after clear.

provider
​string · enum

Present when byok is true (the provider just stored).

Enum values:
openai
openrouter
POST/byok
curl https://api.askagento.com/v1/byok \ --request POST \ --header 'Content-Type: application/json' \ --header 'X-Askagento-Site-Id: <api-key>' \ --header 'X-Askagento-Api-Key: <api-key>' \ --data '{ "action": "set", "provider": "openai", "api_key": "api_key", "model": "model" }'
Example Request Body
{ "action": "set", "provider": "openai", "api_key": "api_key", "model": "model" }
json
Example Responses
{ "status": "ok", "site_id": "site_id", "byok": true, "provider": "openai" }
json
application/json

Current subscription plan

GET
https://api.askagento.com/v1
/plan

Returns the current plan slug and display label for the site. Every API capability is available on every plan; the plan sets catalogue capacity and included monthly usage only.

Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers. <api_key> must be the secret key; the public key is rejected with 401.

Current subscription plan › Responses

Plan response

PlanResponse
site_id
​string
plan
​string | null

Plan slug (free, basic, pro); null if no plan is set

plan_label
​string | null

Human-readable plan label

GET/plan
curl https://api.askagento.com/v1/plan \ --header 'X-Askagento-Site-Id: <api-key>' \ --header 'X-Askagento-Api-Key: <api-key>'
Example Responses
{ "site_id": "site_id", "plan": "plan", "plan_label": "plan_label" }
json
application/json

Installation status

GET
https://api.askagento.com/v1
/install

Retrieve installation metadata.

Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers. <api_key> must be the secret key; the public key is rejected with 401.

Installation status › Responses

Install status response

InstallStatusResponse
site_id
​string
installed_at
​string | null · date-time
status_message
​string
status
​string
GET/install
curl https://api.askagento.com/v1/install \ --header 'X-Askagento-Site-Id: <api-key>' \ --header 'X-Askagento-Api-Key: <api-key>'
Example Responses
{ "site_id": "site_id", "installed_at": "2024-08-25T15:00:00Z", "status_message": "status_message", "status": "ok" }
json
application/json

Install plugin

POST
https://api.askagento.com/v1
/install

Install the plugin.

Local (test) shops. A shop our servers cannot reach (localhost, .local, .test and similar names, private IP addresses, or a name that does not resolve publicly) installs in local mode, for testing:

  • at most 100 products (403, local_too_many_products otherwise);
  • each product's main image is sent inline as image_base64 (JPEG, PNG, WebP or GIF, at most 512 KB decoded; the plugin sends about 300 px JPEGs), because the service cannot download images from the shop. Without any readable image the install is rejected with 422 (no_product_images);
  • variation images are not indexed;
  • the catalogue is never re-indexed automatically: POST /update keeps the stored product data current, but changes reach search only after a reinstall.

Whether a shop is local is decided by the service from domain. Inline images from a shop that turns out to be reachable are ignored and its images are downloaded as usual.

Install plugin › Request Body

InstallRequest
domain
​string · required
​Product[] · required
system
​string · enum · required

woocommerce — full catalogue with image + text data. knowledge_base — text-only Confluence/article chunks for askagento.com chat.

Enum values:
woocommerce
knowledge_base
plugin_version
​string
woocommerce_version
​string
total_products
​integer
shop_ip
​string

Optional IPv4 string for the shop host (plugin may send DNS resolution result).

Install plugin › Responses

Installation accepted for async processing

InstallAcceptedResponse
status
​string · required
site_id
​string · required

New site identifier; send it in X-Askagento-Site-Id on every authenticated call.

api_key
​string · required

Secret key; accepted on every authenticated route. Keep it on your server and never expose it in a web page.

public_key
​string · required

Public key; accepted only on POST /chatbot, GET /suggest, POST /search and POST /mcp. Safe to embed in storefront pages and AI agent configs.

Example: pk_3fQx8ZkP2mLr7TnV1cWy9HsB
message
​string · required
POST/install
curl https://api.askagento.com/v1/install \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "domain": "domain", "plugin_version": "plugin_version", "woocommerce_version": "woocommerce_version", "products": [ { "id": 0, "image_base64": "image_base64", "title": "title", "name": "name", "description": "description", "short_description": "short_description", "sku": "sku", "price": "price", "regular_price": "regular_price", "sale_price": "sale_price", "price_html": "price_html", "stock_quantity": 0, "status": "status", "featured": true, "on_sale": true, "permalink": "https://www.example.com/path/to/resource", "image_url": "https://www.example.com/path/to/resource", "categories": [ { "id": 0, "name": "name", "slug": "slug" } ], "tags": [ { "id": 0, "name": "name", "slug": "slug" } ], "attributes": [ {} ], "variations": [ {} ], "date_created": "2024-08-25T15:00:00Z", "date_modified": "2024-08-25T15:00:00Z", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" } ], "total_products": 0, "shop_ip": "shop_ip", "system": "woocommerce" }'
Example Request Body
{ "domain": "domain", "plugin_version": "plugin_version", "woocommerce_version": "woocommerce_version", "products": [ { "id": 0, "image_base64": "image_base64", "title": "title", "name": "name", "description": "description", "short_description": "short_description", "sku": "sku", "price": "price", "regular_price": "regular_price", "sale_price": "sale_price", "price_html": "price_html", "stock_quantity": 0, "status": "status", "featured": true, "on_sale": true, "permalink": "https://www.example.com/path/to/resource", "image_url": "https://www.example.com/path/to/resource", "categories": [ { "id": 0, "name": "name", "slug": "slug" } ], "tags": [ { "id": 0, "name": "name", "slug": "slug" } ], "attributes": [ {} ], "variations": [ {} ], "date_created": "2024-08-25T15:00:00Z", "date_modified": "2024-08-25T15:00:00Z", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" } ], "total_products": 0, "shop_ip": "shop_ip", "system": "woocommerce" }
json
Example Responses
{ "status": "accepted", "site_id": "site_id", "api_key": "api_key", "public_key": "pk_3fQx8ZkP2mLr7TnV1cWy9HsB", "message": "message" }
json
application/json

Install verify

POST
https://api.askagento.com/v1
/install/verify

Check that a shop can be reached from our servers before sending its catalogue to POST /install.

Installation reads product pages and images directly from the shop, so a shop that is local, resolves to a private address, or refuses image requests cannot be installed. Calling this first turns that into an immediate, explainable answer instead of a failure part-way through installation.

Send the shop domain and the URL of one product image. The check is a name check, a DNS lookup, and a single image fetch, so it returns in about a second.

verdict is one of:

  • pass — proceed with POST /install.
  • blocked — the install cannot succeed as configured; reason says why.
  • inconclusive — the shop could not be judged (timeout, rate limit). Offer a retry rather than treating it as a failure.

A blocked verdict is a normal, successful response: the check ran and the answer is no. Only malformed requests return 4xx.

codeverdictMeaning
reachablepassThe shop and its product images can be read.
local_domainblockedA local development address (localhost, .local, .test).
private_ipblockedThe domain resolves to a private address.
dns_unresolvedblockedThe domain does not resolve on the public internet.
tls_invalidblockedThe shop's certificate could not be verified.
password_protectedblockedThe shop asks our servers for a password.
image_forbiddenblockedImage requests are refused (hotlink protection or a firewall).
no_product_imagesblockedNo product has an image; products are indexed by their images.
connection_refusedblockedThe shop refused the connection.
tls_errorblockedThe TLS handshake with the shop failed.
unsupported_schemeblockedThe image URL is not http or https.
non_standard_portblockedThe image URL uses a port other than 80 or 443.
invalid_domainblockedNo usable shop domain was supplied.
image_not_foundinconclusiveThe sampled image 404s, but the shop answered.
image_not_an_imageinconclusiveThe image URL returned a page, not an image file.
rate_limitedinconclusiveThe shop rate-limited the request.
timeoutinconclusiveThe shop did not answer in time.
network_errorinconclusiveThe shop could not be contacted.
shop_errorinconclusiveThe shop returned a 5xx for the sampled image.
unexpected_statusinconclusiveThe image returned an unexpected status.
bad_redirectinconclusiveThe shop redirected without a destination.
too_many_redirectsinconclusiveThe image URL redirected too many times.

Treat unknown codes by their verdict — codes may be added.

No API key: this runs before POST /install issues one.

Install verify › Request Body

InstallVerifyRequest
domain
​string · required

Shop host name, e.g. shop.example.com. A full URL is also accepted.

Example: shop.example.com
image_url
​string

URL of one product image, picked at random from the catalogue about to be installed. Products are indexed by their images, so a catalogue without one cannot be installed: omitting it yields blocked (no_product_images).

Example: https://shop.example.com/wp-content/uploads/2026/01/hat.jpg

Install verify › Responses

Reachability verdict (including blocked, which is a normal result)

InstallVerifyResponse
ok
​boolean

True only when verdict is pass.

verdict
​string · enum
Enum values:
pass
blocked
inconclusive
code
​string

Machine-readable outcome, e.g. reachable, local_domain, private_ip, dns_unresolved, tls_invalid, password_protected, image_forbidden, image_not_found, no_product_images, rate_limited, timeout.

Example: image_forbidden
reason
​string

Sentence suitable for display to the shop administrator.

Example: The shop refuses image requests from our servers (hotlink protection or a firewall).
local
​boolean

True when the shop is local (local_domain, private_ip, dns_unresolved): it can still install in local mode with up to local_max_products products and its product images sent inline (see POST /install).

local_max_products
​integer
​object[]

Per-check detail, in the order the checks ran.

POST/install/verify
curl https://api.askagento.com/v1/install/verify \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "domain": "shop.example.com", "image_url": "https://shop.example.com/wp-content/uploads/2026/01/hat.jpg" }'
Example Request Body
{ "domain": "shop.example.com", "image_url": "https://shop.example.com/wp-content/uploads/2026/01/hat.jpg" }
json
Example Responses
{ "ok": true, "verdict": "pass", "code": "reachable", "reason": "Your shop is publicly reachable.", "checks": [ { "id": "domain", "verdict": "pass", "code": "domain_ok", "reason": "The shop domain is a public name." }, { "id": "dns", "verdict": "pass", "code": "dns_ok", "reason": "shop.example.com resolves to the public address 203.0.113.10." }, { "id": "image", "verdict": "pass", "code": "image_ok", "reason": "Product images are reachable from our servers." } ] }
json
application/json

CORS preflight

OPTIONS
https://api.askagento.com/v1
/install/verify

CORS preflight › Responses

200

Preflight headers

No data returned
OPTIONS/install/verify
curl https://api.askagento.com/v1/install/verify \ --request OPTIONS
Example Responses
No example specified for this content type

Lost-demand insights

GET
https://api.askagento.com/v1
/insights/lost-demand

What shoppers asked for and did not find, over the last days full UTC days (at most 30; today is not included).

  • searches — AI text searches whose best product match was too weak (or that found nothing), grouped by identical wording, most frequent first.
  • chat_topics — chatbot questions grouped into topics such as "Ring sizing". unmatched counts the questions for which no matching product was found. chat_topics_source is ai when topics were grouped by the AI model, exact when only identical questions could be grouped, none without chat questions.

Only queries and topics asked at least twice are listed (up to 50 each). Email addresses, URLs and long numbers (phone or order numbers) are removed from the text before it is stored. Figures are rebuilt once a day shortly after midnight UTC.

Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers. <api_key> must be the secret key; the public key is rejected with 401.

Lost-demand insights › query Parameters

days
​integer · min: 1 · max: 30
Default: 30

Lost-demand insights › Responses

Lost-demand report

LostDemandResponse
site_id
​string
days
​integer
from
​string · date
to
​string · date
data_days
​integer

Days in the window with any search or chat activity.

​object
​object[]
​object[]
chat_topics_source
​string · enum
Enum values:
ai
exact
none
GET/insights/lost-demand
curl https://api.askagento.com/v1/insights/lost-demand \ --header 'X-Askagento-Site-Id: <api-key>' \ --header 'X-Askagento-Api-Key: <api-key>'
Example Responses
{ "site_id": "site_id", "days": 0, "from": "2024-08-25", "to": "2024-08-25", "data_days": 0, "totals": { "searches": 0, "search_misses": 0, "chats": 0 }, "searches": [ { "query": "query", "count": 0, "suggestion": { "kind": "typo", "term": "sneakers" } } ], "chat_topics": [ { "topic": "topic", "count": 0, "unmatched": 0, "examples": [ "string" ] } ], "chat_topics_source": "ai" }
json
application/json

Report a storefront session

POST
https://api.askagento.com/v1
/sessions/report

Sent from the storefront once when a shopper session starts and once more when that session first uses AskAgento (search, chatbot or an AI recommendation), with ai: true. Each session_id is counted once; a session becomes AI-engaged at most once. These counts are the denominators of the conversion rates in GET /attribution/summary. session_id is a random identifier; it carries no personal data.

Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers. <api_key> may be the public key or the secret key.

Report a storefront session › Request Body

SessionReportRequest
session_id
​string · minLength: 8 · maxLength: 64 · pattern: ^[A-Za-z0-9_-]+$ · required
ai
​boolean
Default: false

Report a storefront session › Responses

Session recorded

SessionReportResponse
status
​string
result
​string · enum
Enum values:
new
ai
seen
POST/sessions/report
curl https://api.askagento.com/v1/sessions/report \ --request POST \ --header 'Content-Type: application/json' \ --header 'X-Askagento-Site-Id: <api-key>' \ --header 'X-Askagento-Api-Key: <api-key>' \ --data '{ "session_id": "session_id", "ai": false }'
Example Request Body
{ "session_id": "session_id", "ai": false }
json
Example Responses
{ "status": "ok", "result": "new" }
json
application/json

CORS preflight for session reports

OPTIONS
https://api.askagento.com/v1
/sessions/report

CORS preflight for session reports › Responses

200

Preflight OK

No data returned
OPTIONS/sessions/report
curl https://api.askagento.com/v1/sessions/report \ --request OPTIONS
Example Responses
No example specified for this content type

Report an order

POST
https://api.askagento.com/v1
/orders/report

Called from the shop's server when an order is paid, and again if it is later refunded or cancelled. A paid order is counted once per order_id (repeat reports return result: duplicate). A refunded or cancelled report takes a previously counted order back out of the day it was paid (result: reversed), or does nothing (result: not_found). Include attribution only when the shopper reached the order through AskAgento. Send no customer personal data.

Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers. <api_key> must be the secret key; the public key is rejected with 401.

Report an order › Request Body

OrderReportRequest
​required
status
​string · enum · required
Enum values:
paid
refunded
cancelled
total
​number

Order total (required when status is paid).

currency
​string
paid_at
​integer

Unix time the order was paid (defaults to now; at most ~13 months old).

​OrderAttribution

Report an order › Responses

Order recorded

OrderReportResponse
status
​string
result
​string · enum
Enum values:
counted
duplicate
reversed
not_found
order_id
​string
POST/orders/report
curl https://api.askagento.com/v1/orders/report \ --request POST \ --header 'Content-Type: application/json' \ --header 'X-Askagento-Site-Id: <api-key>' \ --header 'X-Askagento-Api-Key: <api-key>' \ --data '{ "order_id": "string", "status": "paid", "total": 0, "currency": "EUR", "paid_at": 0, "attribution": { "source": "chatbot", "session_id": "session_id", "interaction_id": "interaction_id", "clicked_at": 0, "product_ids": [ 0 ], "direct": true } }'
Example Request Body
{ "order_id": "string", "status": "paid", "total": 0, "currency": "EUR", "paid_at": 0, "attribution": { "source": "chatbot", "session_id": "session_id", "interaction_id": "interaction_id", "clicked_at": 0, "product_ids": [ 0 ], "direct": true } }
json
Example Responses
{ "status": "ok", "result": "counted", "order_id": "order_id" }
json
application/json

Revenue attribution summary

GET
https://api.askagento.com/v1
/attribution/summary

Revenue influenced by AskAgento for the last days days (UTC, today included), read from daily figures kept up to date as orders and sessions are reported. An order is AskAgento-assisted when the shopper clicked a product in AI search, the chatbot or an AI recommendation within the shop's attribution window before checking out.

  • ai_aov / site_aov — average order value of assisted orders vs. all orders.
  • ai_conversion_rate — assisted orders per AI-engaged session.
  • baseline_conversion_rate — other orders per session without AI engagement.
  • roi_multiple — assisted revenue divided by plan.period_cost; null on the free plan or when the plan is billed in a different currency than the orders.

plan is what the site pays for AskAgento, read from its Stripe subscription (price, interval and active coupons, cached up to an hour) and spread over the window as period_cost. It is null when the cost cannot be determined.

Ratios are null when their denominator is zero. Refunded and cancelled orders are removed from the day they were paid.

Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers. <api_key> must be the secret key; the public key is rejected with 401.

Revenue attribution summary › query Parameters

days
​integer · min: 1 · max: 366
Default: 30

Revenue attribution summary › Responses

Attribution summary

AttributionSummaryResponse
site_id
​string
days
​integer
from
​string · date
to
​string · date
currency
​string | null

ISO 4217 code of the reported order totals.

tracking_since
​string | null · date

First day with any attribution data for this site.

​AttributionCounts
​object
plan
​object | null
​object[]
GET/attribution/summary
curl https://api.askagento.com/v1/attribution/summary \ --header 'X-Askagento-Site-Id: <api-key>' \ --header 'X-Askagento-Api-Key: <api-key>'
Example Responses
{ "site_id": "site_id", "days": 0, "from": "2024-08-25", "to": "2024-08-25", "currency": "currency", "tracking_since": "2024-08-25", "totals": { "orders": 0, "revenue": 0, "ai_orders": 0, "ai_revenue": 0, "sessions": 0, "ai_sessions": 0 }, "metrics": { "ai_revenue_share": 0, "ai_aov": 0, "site_aov": 0, "ai_conversion_rate": 0, "baseline_conversion_rate": 0, "roi_multiple": 0 }, "plan": { "plan": "free", "currency": "currency", "monthly_cost": 0, "period_cost": 0 }, "daily": [ { "orders": 0, "revenue": 0, "ai_orders": 0, "ai_revenue": 0, "sessions": 0, "ai_sessions": 0, "date": "2024-08-25" } ] }
json
application/json

Save merchandising

POST
https://api.askagento.com/v1
/merchandising

Stores the shop's merchandising: search rules that pin, boost or bury products, whether out-of-stock products go last, and ranking weights that blend shop data into the search ranking. Each call replaces the stored settings. They are applied to /search, /chatbot, /mcp and the AskAgento app for ChatGPT.

Out-of-stock status and the ranking signals (sales, average rating, on sale, newness) come from the catalogue the shop last synced.

Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers. <api_key> must be the secret key; the public key is rejected with 401.

Save merchandising › Request Body

MerchandisingRequest
​MerchandisingRule[] · maxItems: 200

Search rules, applied in order; when a product appears in several matching rules, the earliest rule decides. Rules with no phrases or no products are ignored.

out_of_stock_last
​boolean

Move out-of-stock products below in-stock ones. They are not removed.

Default: false
​object

0 (ignored) to 10 (counts as much as how well a product matches the search). Omitted signals are 0.

​MerchandisingSynonym[] · maxItems: 200

Words that mean the same in this shop. They are added to the search text of /search (text, voice, text + image), the chatbot and agents, and widen /suggest.

​MerchandisingRedirect[] · maxItems: 200

Searches that open a page instead of showing results. /search answers a text or voice search matching one with redirect and no results (a redirected text search is not counted against limits.searches); /suggest lists the redirect while typing.

Save merchandising › Responses

Merchandising saved

MerchandisingResponse
status
​string
rules
​integer

Number of search rules stored

out_of_stock_last
​boolean
​object
synonyms
​integer

Number of synonym groups stored

redirects
​integer

Number of search redirects stored

POST/merchandising
curl https://api.askagento.com/v1/merchandising \ --request POST \ --header 'Content-Type: application/json' \ --header 'X-Askagento-Site-Id: <api-key>' \ --header 'X-Askagento-Api-Key: <api-key>' \ --data '{ "rules": [ { "phrases": [ "string" ], "match": "exact", "pin": [ 0 ], "boost": [ 0 ], "bury": [ 0 ] } ], "out_of_stock_last": false, "ranking_weights": { "popularity": 0, "rating": 0, "on_sale": 0, "newness": 0 }, "synonyms": [ { "terms": [ "trainers", "sneakers" ], "one_way": false } ], "redirects": [ { "phrases": [ "string" ], "match": "exact", "url": "https://shop.example/returns", "label": "label" } ] }'
Example Request Body
{ "rules": [ { "phrases": [ "string" ], "match": "exact", "pin": [ 0 ], "boost": [ 0 ], "bury": [ 0 ] } ], "out_of_stock_last": false, "ranking_weights": { "popularity": 0, "rating": 0, "on_sale": 0, "newness": 0 }, "synonyms": [ { "terms": [ "trainers", "sneakers" ], "one_way": false } ], "redirects": [ { "phrases": [ "string" ], "match": "exact", "url": "https://shop.example/returns", "label": "label" } ] }
json
Example Responses
{ "status": "ok", "rules": 0, "out_of_stock_last": true, "ranking_weights": { "key": 0 }, "synonyms": 0, "redirects": 0 }
json
application/json

Uninstall plugin

POST
https://api.askagento.com/v1
/uninstall

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. <api_key> must be the secret key; the public key is rejected with 401.

Uninstall plugin › Request Body

UninstallRequest
system
​string · enum · required
Enum values:
woocommerce
knowledge_base
domain
​string
plugin_version
​string
woocommerce_version
​string

Uninstall plugin › Responses

Uninstall completed

StatusOkResponse
status
​string
POST/uninstall
curl https://api.askagento.com/v1/uninstall \ --request POST \ --header 'Content-Type: application/json' \ --header 'X-Askagento-Site-Id: <api-key>' \ --header 'X-Askagento-Api-Key: <api-key>' \ --data '{ "system": "woocommerce", "domain": "domain", "plugin_version": "plugin_version", "woocommerce_version": "woocommerce_version" }'
Example Request Body
{ "system": "woocommerce", "domain": "domain", "plugin_version": "plugin_version", "woocommerce_version": "woocommerce_version" }
json
Example Responses
{ "status": "ok" }
json
application/json

Update product data

POST
https://api.askagento.com/v1
/update

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. <api_key> must be the secret key; the public key is rejected with 401.

Update product data › Request Body

UpdateRequest
​Product[] · required
system
​string · enum · required
Enum values:
woocommerce
domain
​string
plugin_version
​string
woocommerce_version
​string
total_products
​integer

Update product data › Responses

Product data accepted

UpdateResponse
status
​string · required
site_id
​string · required
synced_products
​integer · required
update_needed
​boolean · required

True when the catalogue hash changed on this sync (re-embed required). Unchanged-hash syncs do not clear a previously true flag.

message
​string · required
POST/update
curl https://api.askagento.com/v1/update \ --request POST \ --header 'Content-Type: application/json' \ --header 'X-Askagento-Site-Id: <api-key>' \ --header 'X-Askagento-Api-Key: <api-key>' \ --data '{ "domain": "domain", "plugin_version": "plugin_version", "woocommerce_version": "woocommerce_version", "products": [ { "id": 0, "image_base64": "image_base64", "title": "title", "name": "name", "description": "description", "short_description": "short_description", "sku": "sku", "price": "price", "regular_price": "regular_price", "sale_price": "sale_price", "price_html": "price_html", "stock_quantity": 0, "status": "status", "featured": true, "on_sale": true, "permalink": "https://www.example.com/path/to/resource", "image_url": "https://www.example.com/path/to/resource", "categories": [ { "id": 0, "name": "name", "slug": "slug" } ], "tags": [ { "id": 0, "name": "name", "slug": "slug" } ], "attributes": [ {} ], "variations": [ {} ], "date_created": "2024-08-25T15:00:00Z", "date_modified": "2024-08-25T15:00:00Z", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" } ], "total_products": 0, "system": "woocommerce" }'
Example Request Body
{ "domain": "domain", "plugin_version": "plugin_version", "woocommerce_version": "woocommerce_version", "products": [ { "id": 0, "image_base64": "image_base64", "title": "title", "name": "name", "description": "description", "short_description": "short_description", "sku": "sku", "price": "price", "regular_price": "regular_price", "sale_price": "sale_price", "price_html": "price_html", "stock_quantity": 0, "status": "status", "featured": true, "on_sale": true, "permalink": "https://www.example.com/path/to/resource", "image_url": "https://www.example.com/path/to/resource", "categories": [ { "id": 0, "name": "name", "slug": "slug" } ], "tags": [ { "id": 0, "name": "name", "slug": "slug" } ], "attributes": [ {} ], "variations": [ {} ], "date_created": "2024-08-25T15:00:00Z", "date_modified": "2024-08-25T15:00:00Z", "created_at": "2024-08-25T15:00:00Z", "updated_at": "2024-08-25T15:00:00Z" } ], "total_products": 0, "system": "woocommerce" }
json
Example Responses
{ "status": "ok", "site_id": "site_id", "synced_products": 0, "update_needed": true, "message": "message" }
json
application/json

Usage limits

GET
https://api.askagento.com/v1
/usage

Returns the current plan, remaining per-site limits (tokens, searches), the tier-level maximums, and the catalogue product count against the number of products the plan indexes. Every API capability is available on every plan; a plan sets only catalogue capacity and included monthly usage. When the catalogue is larger than the plan indexes (over_product_limit: true), catalogue-backed endpoints return 403 with code: product_limit_exceeded until the catalogue is covered by a larger plan or reduced in size.

Authentication: Send X-Askagento-Site-Id: <site_id> and X-Askagento-Api-Key: <api_key> headers. <api_key> must be the secret key; the public key is rejected with 401.

Usage limits › Responses

Usage response

UsageResponse
site_id
​string
plan
​string | null

Plan slug; null if no plan is set

plan_label
​string | null
​UsageLimits

Remaining monthly plan allowance for this site; null if no limits are tracked. Reset to the tier maximum each billing period. Does not include add-on packs.

​UsageLimits

Unspent one-time add-on pack credits, omitted keys meaning zero; null when the site has none. These do not expire and are only spent once limits reaches zero, so the site's true remaining balance is limits + pack_units.

​UsageLimits

Tier-level maximums for the current plan; null if no plan is set. Includes a products field (how many products the plan indexes) in addition to tokens/searches.

product_count
​integer | null

Number of products in the shop's catalogue; null if not yet recorded

max_products
​integer | null

Number of products the service indexes on the current plan; null if no plan is set.

over_product_limit
​boolean

True when the catalogue is larger than the current plan indexes. While true, catalogue-backed endpoints return 403 (code: product_limit_exceeded) until the catalogue is covered by a larger plan or reduced in size.

GET/usage
curl https://api.askagento.com/v1/usage \ --header 'X-Askagento-Site-Id: <api-key>' \ --header 'X-Askagento-Api-Key: <api-key>'
Example Responses
{ "site_id": "site_id", "plan": "plan", "plan_label": "plan_label", "limits": { "tokens": 0, "searches": 0 }, "pack_units": { "tokens": 0, "searches": 0 }, "plan_max_limits": { "tokens": 0, "searches": 0 }, "product_count": 0, "max_products": 0, "over_product_limit": true }
json
application/json