AIAgentStore Micro‑Pay APIs

Pay‑per‑answer endpoints using x402 (quote → on‑chain pay → redeem).

Endpoints

  • POST /demand-insights – insights from anonymized visitor chats
  • POST /ai-early-adopters-goals – insights from 1‑year goals dataset
  • POST /analytics/agent-conversions – aggregated marketplace conversions

Payment (x402)

  1. POST → get a 402 with Pay header and intentId.
  2. Send ≥ 0.49 USDC on Base (chainId 8453) to the recipient from the Pay header.
  3. POST again with { intentId, txHash } and your body to receive the result.

Note: Step 1 is optional if you already know price/recipient. It returns the Pay details (recipient, chainId, label, expiry) and an intentId required for redemption.

You can also redeem via the x402-payment header (JSON or base64‑JSON). Quotes include X-Payment-Contracts listing accepted USDC contract addresses.

Quick Start (cURL)

Demand Insights (visitor chats)

Returns Markdown insights from anonymized visitor chat transcripts.

Step 1 — Quote (402 with Pay + X-Price-Intent)
curl -i -sS -X POST 'https://aiagentstore.ai/demand-insights'   -H 'Content-Type: application/json'   --data-raw '{"query":"What are the top 10 problems visitors ask agents to solve? Group by theme and add example quotes."}'
Step 2 — Redeem after payment (200 with result)
curl -sS -X POST 'https://aiagentstore.ai/demand-insights'   -H 'Content-Type: application/json'   --data-raw '{"intentId":"<intent_id_from_step_1>","txHash":"<0xYOUR_TX_HASH>","query":"What are the top 10 problems visitors ask agents to solve? Group by theme and add example quotes."}'

AI Early Adopters’ Goals (1‑year dataset)

Answers from a live dataset of 12‑month goals by AI‑interested subscribers.

Step 1 — Quote (402 with Pay + X-Price-Intent)
curl -i -sS -X POST 'https://aiagentstore.ai/ai-early-adopters-goals'   -H 'Content-Type: application/json'   --data-raw '{"query":"What will people try to accomplish next year? Group into 10 themes with example quotes."}'
Step 2 — Redeem after payment (200 with result)
curl -sS -X POST 'https://aiagentstore.ai/ai-early-adopters-goals'   -H 'Content-Type: application/json'   --data-raw '{"intentId":"<intent_id_from_step_1>","txHash":"<0xYOUR_TX_HASH>","query":"What will people try to accomplish next year? Group into 10 themes with example quotes."}'

Agent Conversions Analytics

Aggregated marketplace conversions grouped by category/industry/agent/country.

Step 1 — Quote (402 with Pay + X-Price-Intent)
curl -i -sS -X POST 'https://aiagentstore.ai/analytics/agent-conversions'   -H 'Content-Type: application/json'   --data-raw '{"filters":{"aggregate":"category"}}'
Step 2 — Redeem after payment (200 with result)
curl -sS -X POST 'https://aiagentstore.ai/analytics/agent-conversions'   -H 'Content-Type: application/json'   --data-raw '{"intentId":"<intent_id_from_step_1>","txHash":"<0xYOUR_TX_HASH>","filters":{"aggregate":"category"}}'

Rule: Provide at most one optional filter (country OR category OR industry). Example alternatives: {"filters":{"aggregate":"country"}} or {"filters":{"aggregate":"agent","country":"US"}}. If multiple are sent, the API returns 400 invalid_filters and the purchase is not consumed (you can retry with the same intentId and txHash).

View allowed values (countries, categories, industries).

Errors use short codes: intent_required, intent_not_found, tx_required, tx_not_confirmed, transfer_not_found, insufficient_amount, tx_already_used, invalid_filters (analytics), already_consumed.