# RelAI — x402 API Marketplace ## What is RelAI? RelAI is an x402 protocol marketplace for pay-per-call API micropayments. API providers register their endpoints and set per-call USD prices. Consumers (humans or AI agents) pay automatically using crypto wallets — no subscriptions, no API keys to manage. The x402 protocol works by returning HTTP 402 Payment Required with a payment challenge. The client signs a payment, retries the request with proof, and the server proxies the call after verifying payment on-chain. ## Networks supported - Solana (USDC) - Base (USDC) - SKALE Base (USDC, multi-token, gas-free) - Avalanche (USDC, gas-free via 0xGasless) - Ethereum (USDC) - Polygon (USDC) ## For AI agents — how to use RelAI ### Step 1: Get a service key (no human login required) Autonomous agents can bootstrap a service key using a wallet signature challenge-response flow. Supports both Solana (ed25519) and EVM (secp256k1) wallets. POST https://api.relai.fi/mcp/management/bootstrap/agent Body: { "publicKey": "" } Response: { "message": "" } POST https://api.relai.fi/mcp/management/bootstrap/agent Body: { "publicKey": "...", "signature": "...", "message": "...", "label": "my-agent" } Response: { "key": "sk_live_..." } Store the key securely. Use it as X-Service-Key header for all management calls. ### Step 2: Connect via MCP Add to your MCP client config: { "mcpServers": { "relai-management": { "url": "https://api.relai.fi/mcp/management", "headers": { "X-Service-Key": "sk_live_..." } } } } ### Step 3: Discover and call APIs Browse the marketplace: GET https://api.relai.fi/marketplace Get API details (endpoints, pricing, network): GET https://api.relai.fi/marketplace/:apiId Call any listed API using the x402 protocol via the RelAI SDK or manually. ## For API providers — register your API programmatically POST https://api.relai.fi/v1/apis Header: X-Service-Key: sk_live_... Body: { "name": "My Inference API", "baseUrl": "https://inference.example.com", "network": "base", "merchantWallet": "0xYourWallet", "endpoints": [ { "path": "/v1/predict", "method": "post", "usdPrice": 0.05 } ] } The API is immediately functional for x402 calls. It will appear in the public marketplace after review. ## Management API — full reference Documentation: https://relai.fi/documentation/management-api Key endpoints: - POST /v1/keys — Create service key (JWT auth) - GET /v1/keys — List your service keys - DELETE /v1/keys/:key — Revoke a service key - POST /v1/apis — Create API - GET /v1/apis — List your APIs - GET /v1/apis/:apiId — Get API details - PATCH /v1/apis/:apiId — Update API metadata - PUT /v1/apis/:apiId/pricing — Update endpoint pricing - GET /v1/apis/:apiId/stats — Revenue & call analytics - POST /mcp/management/bootstrap/agent — Agent bootstrap (wallet signature) ## MCP tools available When connected via MCP (X-Service-Key header), the following tools are available: list_apis, get_api, create_api, update_api, update_pricing, get_stats, list_service_keys, create_service_key, revoke_service_key ## Links - Marketplace: https://relai.fi/marketplace - Documentation: https://relai.fi/documentation - Management API docs: https://relai.fi/documentation/management-api - Dashboard: https://relai.fi/dashboard - x402 protocol: https://relai.fi/x402 - GitHub: https://github.com/relai-fi