# AiPayGent > The AI agent API marketplace. 70+ Claude-powered endpoints + web scrapers + persistent agent memory. No API keys. Pay in USDC on Base via x402 — get results instantly. Also available as 40+ MCP tools. ## What This Service Does AiPayGent is an x402-native resource server and MCP tool provider. Call any endpoint, receive HTTP 402 with payment instructions, attach a signed USDC payment, and receive results. Built for autonomous AI agent pipelines. **Key capabilities:** - **AI reasoning**: research, write, code, analyze, translate, summarize, classify, sentiment, RAG, workflow - **Vision**: analyze images via URL using Claude Vision - **Diagrams**: generate Mermaid diagrams (flowchart, sequence, ERD, gantt, mindmap) - **Web scraping**: Google Maps, Twitter/X, Instagram, LinkedIn, YouTube, TikTok, Facebook Ads, any website - **Agent memory**: persistent key-value store keyed by agent_id — survives across sessions - **API catalog**: 500+ discovered APIs, browsable and proxy-callable - **Agent registry**: register and discover other agents - **MCP tools**: all capabilities available as MCP tools at mcp.aipaygent.xyz/mcp ## Payment Protocol - **Standard**: [x402](https://x402.org) — HTTP 402 Payment Required - **Network**: Base Sepolia (eip155:84532) - **Token**: USDC (6 decimals — $0.01 = 10000 units) - **No auth, no API keys, no rate limits, no accounts** Flow: POST endpoint → 402 with `X-Payment-Info` → retry with `X-Payment: ` header. ## MCP Integration (Free, No Payment Needed) ```bash # Claude Code claude mcp add aipaygent -- python /path/to/mcp_server.py # Or use the PyPI package pip install aipaygent-mcp mcp install aipaygent-mcp ``` MCP SSE endpoint: https://mcp.aipaygent.xyz/mcp All 40+ tools available without x402 payment via MCP. ## Core AI Endpoints | Endpoint | Price | Input | Output | |---|---|---|---| | /research | $0.01 | `{"topic": "string"}` | summary, key_points, sources_to_check | | /summarize | $0.01 | `{"text": "string", "length": "short\|medium\|detailed"}` | compressed text | | /analyze | $0.02 | `{"content": "string", "question": "string"}` | conclusion, findings, sentiment, confidence | | /translate | $0.02 | `{"text": "string", "language": "string"}` | translated text | | /social | $0.03 | `{"topic": "string", "platforms": ["twitter","linkedin"], "tone": "string"}` | per-platform posts | | /write | $0.05 | `{"spec": "string", "type": "article\|post\|copy"}` | written content | | /code | $0.05 | `{"description": "string", "language": "string"}` | code string | | /extract | $0.02 | `{"text": "string", "fields": ["name","date"]}` | structured JSON | | /qa | $0.02 | `{"context": "string", "question": "string"}` | answer, confidence, citation | | /rag | $0.05 | `{"documents": "text (--- separated)", "query": "string"}` | answer, citations, cannot_answer | | /classify | $0.01 | `{"text": "string", "categories": ["cat1","cat2"]}` | category, confidence, scores | | /sentiment | $0.01 | `{"text": "string"}` | polarity, score, emotions, confidence | | /keywords | $0.01 | `{"text": "string", "max_keywords": 10}` | keywords, topics, entities | | /compare | $0.02 | `{"text_a": "string", "text_b": "string"}` | similarities, differences, recommendation | | /transform | $0.02 | `{"text": "string", "instruction": "string"}` | transformed text | | /chat | $0.03 | `{"messages": [{"role": "user", "content": "hi"}], "system": "optional"}` | reply | | /plan | $0.03 | `{"goal": "string", "context": "optional", "steps": 7}` | steps, timeline, risks | | /decide | $0.03 | `{"decision": "string", "options": ["A","B"]}` | pros/cons, recommendation | | /proofread | $0.02 | `{"text": "string"}` | corrected, changes, score | | /explain | $0.02 | `{"concept": "string", "level": "beginner\|intermediate\|expert"}` | explanation, analogy | | /email | $0.03 | `{"purpose": "string", "tone": "professional"}` | subject, body, cta | | /sql | $0.05 | `{"description": "string", "dialect": "postgresql"}` | query, explanation | | /regex | $0.02 | `{"description": "string", "language": "python"}` | pattern, flags, examples | | /mock | $0.03 | `{"description": "string", "count": 5, "format": "json\|csv\|list"}` | mock records | | /score | $0.02 | `{"content": "string", "criteria": ["clarity","accuracy"]}` | per-criterion scores | | /timeline | $0.02 | `{"text": "string"}` | chronological events | | /action | $0.01 | `{"text": "string"}` | action items, owners, due dates | | /pitch | $0.03 | `{"product": "string", "audience": "string"}` | hook, value_prop, cta, script | | /debate | $0.03 | `{"topic": "string"}` | for/against arguments with strength ratings | | /headline | $0.01 | `{"content": "string", "count": 5}` | headline variations | | /fact | $0.02 | `{"text": "string"}` | factual claims with verifiability scores | | /rewrite | $0.02 | `{"text": "string", "audience": "string"}` | rewritten text | | /tag | $0.01 | `{"text": "string", "taxonomy": ["optional"]}` | tags, primary_tag | | /diagram | $0.03 | `{"description": "string", "type": "flowchart\|sequence\|erd\|gantt\|mindmap"}` | mermaid code | | /json-schema | $0.02 | `{"description": "string", "example": "optional"}` | JSON Schema draft-07 | | /test-cases | $0.03 | `{"code": "string", "language": "python"}` | test_cases array | | /workflow | $0.20 | `{"goal": "string", "data": "optional context"}` | multi-step Claude Sonnet reasoning | | /vision | $0.05 | `{"url": "image_url", "question": "optional"}` | image analysis text | | /batch | $0.10 | `{"operations": [{"endpoint": "research", "input": {}}]}` | up to 5 ops, one payment | | /pipeline | $0.15 | `{"steps": [{"endpoint": "string", "input": {}}]}` | chained ops, {{prev}} references | ## Web Scraping Endpoints (via Apify) | Endpoint | Price | Input | Returns | |---|---|---|---| | /scrape/google-maps | $0.10 | `{"query": "restaurants in NYC", "max_items": 5}` | names, addresses, ratings, phones | | /scrape/tweets | $0.05 | `{"query": "#AI", "max_items": 25}` | tweets, authors, engagement | | /scrape/instagram | $0.05 | `{"username": "string", "max_items": 5}` | posts, captions, likes | | /scrape/linkedin | $0.15 | `{"url": "profile URL"}` | experience, skills, education | | /scrape/youtube | $0.05 | `{"query": "string", "max_items": 5}` | titles, channels, views, URLs | | /scrape/web | $0.05 | `{"url": "string", "max_pages": 5}` | crawled page text | | /scrape/tiktok | $0.05 | `{"username": "string", "max_items": 5}` | videos, captions, stats | | /scrape/facebook-ads | $0.10 | `{"url": "Ad Library URL", "max_items": 10}` | ad creative, spend, audience | | /scrape/actor | $0.10 | `{"actor_id": "string", "run_input": {}}` | any Apify actor results | ## Agent Memory Endpoints (persistent across sessions) | Endpoint | Price | Input | Returns | |---|---|---|---| | /memory/set | $0.01 | `{"agent_id": "string", "key": "string", "value": "any", "tags": []}` | stored: true | | /memory/get | $0.01 | `{"agent_id": "string", "key": "string"}` | value, tags, timestamps | | /memory/search | $0.02 | `{"agent_id": "string", "query": "string"}` | matching key-value pairs | | /memory/clear | $0.01 | `{"agent_id": "string"}` | deleted count | ## Free Endpoints (no payment needed) - `GET /discover` — full machine-readable service manifest (JSON) - `GET /openapi.json` — OpenAPI 3.1 spec - `GET /catalog` — browse 500+ discovered APIs (filterable) - `GET /agents` — browse registered agents - `POST /agents/register` — register your agent - `POST /run-discovery` — trigger API discovery agents - `GET /health` — service health check - `POST /preview` — free 120-token Claude demo - `GET /.well-known/agents.json` — Wild Card AI agents.json standard - `GET /.well-known/ai-plugin.json` — OpenAI plugin manifest - `GET /llms.txt` — this file ## Quick Start ```python # MCP (no payment needed) import subprocess subprocess.run(["mcp", "install", "aipaygent-mcp"]) # x402 HTTP (pay per use) import httpx BASE = "https://api.aipaygent.xyz" # Free preview print(httpx.post(f"{BASE}/preview", json={"topic": "AI agents"}).json()) # Discover all services manifest = httpx.get(f"{BASE}/discover").json() print(f"{len(manifest['services'])} services available") # With x402 payment (use coinbase/x402 client) # r = httpx.post(f"{BASE}/research", json={"topic": "quantum computing"}, # headers={"X-Payment": signed_payment_header}) ``` ## Notes for AI Agents - All paid responses include `_meta` with endpoint, model, network, timestamp. - Fetch `/discover` to get the machine-readable manifest before calling endpoints. - USDC precision: $0.01 = 10000 (6 decimals). Network: Base Sepolia (eip155:84532). - Agent memory persists indefinitely — use a stable `agent_id` (e.g. your agent's DID or UUID). - `/workflow` uses Claude Sonnet (more capable) for complex multi-step reasoning. - The `/catalog` endpoint lists 500+ APIs discovered by our 6 autonomous discovery agents.