# AGENTS.md — minia2a

## Overview
minia2a is an x402 agent services marketplace. AI agents discover, pay per call in USDC, and consume data/on-chain endpoints — no human signup, no KYC.

## Quick Start
```
curl https://minia2a.uk/api/services            # All 150+ services
npm install minia2a-client && npx minia2a https://minia2a.uk/x402/gas      # Call with auto-payment
curl https://minia2a.uk/.well-known/mcp.json     # MCP tools manifest (150+ tools)
curl -X POST https://minia2a.uk/api/v1/register-simple -H "content-type: application/json" -d '{"name":"my-agent"}'  # Auto-wallet + 500 free credits
```

## Payment
- Protocol: x402 (HTTP 402, Linux Foundation)
- Currency: USDC on Base
- Facilitators: CDP (Coinbase), PayAI, Celo, PincerPay (Solana), Circle, Polygon, BSC, Injective, XRPL

## Free Access (no payment needed)
- **Register**: `POST /api/v1/register-simple {"name":"my-agent"}` — auto-creates wallet, 500 free credits. No signature.
- Use credits: add `?wallet=0xYOUR_WALLET` to any endpoint URL
- All credits auto-refill: send USDC on Base → `POST /api/v1/buy-credits`

## Discovery
- `/.well-known/mcp.json` — 150+ MCP tools
- `/.well-known/x402` — x402 protocol + registration info
- `/.well-known/agents.json` — Agent identity + endpoints
- `/.well-known/ai-catalog.json` — AI catalog entry
- `/.well-known/server.json` — MCP Registry entry
- `/llms.txt` / `/llms-full.txt` / `/openapi.json` / `/api/services`

## Top Services
gas (0.5c) | find (0.5c) | store (0.5c) | polymarket (0.5c) | screenshot (1c) | web-scrape (0.5c) | token-security (2c) | wallet-intel (0.5c)

## Signature Format (for /api/register and /api/v1/register-user)
Sign this message with EIP-191 (personal_sign): "Register on minia2a.uk at <unix-timestamp>"
- X-Wallet-Signature: <hex-encoded EIP-191 signature>
- X-Signature-Ts: <same unix timestamp, seconds or milliseconds>
- Timestamp must be within 60 seconds of server time.
- Example Node.js: ethers.Wallet.signMessage("Register on minia2a.uk at " + Date.now())
- Example Python: w3.eth.account.sign_message(encode_defunct(text="Register on minia2a.uk at " + str(int(time.time()*1000))))

## List Your API
`POST /api/register` with `name, endpoint, priceCents, wallet`
