{"openapi":"3.1.0","servers":[{"url":"https://a2a.musefish.trade","description":"Base mainnet gateway (x402 v2, MCP Streamable HTTP)"}],"info":{"title":"A2A Base Token Pre-Trade Security & Liquidity Gateway","version":"2.1.0","description":"Autonomous AI Agent pre-trade risk probe and EVM sandbox simulation on Base (8453). Pay-per-call over x402 protocol.","x-guidance":"AI trading bots call POST /api/v1/token-report with a token address to probe bytecode rugpull/honeypot risks. A token-only call returns HTTP 402 whose body already contains free_preview; read it as data. Add payer_address to receive the x402 invoice, then pay 0.01 USDC on Base (or use points) to unlock the full report.","contact":{"email":"agent-gateway@musefish.trade"},"x-error-contract":{"shape":{"error":"stable machine code","detail":"specific readable cause","hint":"next action for the caller","docs":"protocol/OpenAPI URL"},"extras":{"400 invalid_registration_request":["missing_fields","invalid_fields","field_rules"],"422 invalid_parameters":["invalid_fields"],"429 rate_limited":["retry_after_s"],"5xx":["request_id"]},"retry":"Honor retry_after_s for 429/503; never tight-loop. A failed paid call is never charged."}},"components":{"responses":{"ErrorEnvelope":{"description":"Stable error code, readable cause, next action and docs link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"schemas":{"ErrorEnvelope":{"type":"object","required":["error","detail","hint","docs"],"properties":{"error":{"type":"string","examples":["invalid_registration_request","payment_signature_invalid","rate_limited"]},"detail":{"type":"string"},"hint":{"type":"string"},"docs":{"type":"string","format":"uri"},"missing_fields":{"type":"array","items":{"type":"string"}},"invalid_fields":{"type":"object","additionalProperties":true},"field_rules":{"type":"object","additionalProperties":{"type":"string"}},"retry_after_s":{"type":"integer"},"request_id":{"type":"string"}}}}},"paths":{"/api/v1/invitations":{"post":{"operationId":"generate_a2a_invitation","summary":"Generate a free referral code and SVG","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["wallet_address","nonce","expires_at","signature","pow_counter"],"properties":{"wallet_address":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"},"chain_id":{"type":"integer","minimum":1,"maximum":4294967295,"default":8453},"inviter_code":{"type":"string"},"nonce":{"type":"string"},"expires_at":{"type":"integer"},"signature":{"type":"string"},"pow_counter":{"type":"string"}}}}}},"responses":{"200":{"description":"Completed membership with referral code and SVG"},"400":{"description":"Invalid registration input"},"429":{"description":"Registration rate limit exceeded"}}}},"/":{"get":{"operationId":"root_dashboard","summary":"Gateway Public Status Dashboard","security":[],"responses":{"200":{"description":"Gateway status and operational network info"}}}},"/api/v1/token-report":{"post":{"operationId":"check_base_token_safety","summary":"Base Token Pre-Trade Guard & Liquidity Dehydrator","tags":["Security","Base","x402"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.010000"},"protocols":[{"x402":{"network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token_address":{"type":"string","description":"Base ERC-20 contract address (0x...)"},"payer_address":{"type":"string","description":"Buyer wallet address"},"invoice_id":{"type":"string","description":"Invoice ID returned from 402"},"tx_hash":{"type":"string","description":"0.01 USDC Base mainnet transfer tx hash"},"signature":{"type":"string","description":"EIP-191 signature of challenge"}},"required":["token_address"]}}}},"responses":{"200":{"description":"Dehydrated token security & market depth report"},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402Challenge"}}}}}}},"/api/v1/simulate-route":{"post":{"operationId":"simulate_mev_route_safety","summary":"EPH-02 Safe MEV & Flashloan Sandbox Route Simulation","tags":["Sandbox","Simulation","MEV"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"1.500000"},"protocols":[{"x402":{"network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target_address":{"type":"string","description":"Router/Pool contract to call"},"calldata":{"type":"string","description":"Execution bytecode calldata"},"value":{"type":"integer","default":0,"description":"ETH value in wei; omit for 0"},"payer_address":{"type":"string","description":"Payer wallet address"},"invoice_id":{"type":"string","description":"Invoice ID returned from 402"},"tx_hash":{"type":"string","description":"1.50 USDC Base mainnet transfer tx hash"},"signature":{"type":"string","description":"EIP-191 signature"}},"required":["target_address"]}}}},"responses":{"200":{"description":"Deterministic EVM trace output and simulation result"},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402Challenge"}}}}}}},"/api/v1/image/remove-bg":{"post":{"operationId":"remove_image_background","summary":"One-Click Native Image Background Removal (RMBG-1.4)","tags":["Image","Matting","x402"],"x-payment-info":{"price":{"mode":"fixed","currency":"USD","amount":"0.010000"},"protocols":[{"x402":{"network":"eip155:8453","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"image":{"type":"string","description":"Base64 image or public HTTP(S) URL"},"rem_mode":{"type":"string","default":"RMBG-1.4"},"payer_address":{"type":"string"},"invoice_id":{"type":"string"},"tx_hash":{"type":"string"},"signature":{"type":"string"}},"required":["image"]}}}},"responses":{"200":{"description":"Transparent RGBA PNG image Base64 and metadata"},"402":{"description":"Payment Required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402Challenge"}}}}}}},"/mcp":{"get":{"operationId":"mcp_descriptor","summary":"MCP Streamable HTTP descriptor","responses":{"200":{"description":"Transport, protocol version, required headers and catalog link"}}},"post":{"operationId":"mcp_jsonrpc","summary":"JSON-RPC 2.0 endpoint (initialize, notifications/initialized, tools/list, tools/call)","description":"Requires Content-Type: application/json and Accept: application/json, text/event-stream. Responses are a single JSON-RPC object; no SSE framing.","responses":{"200":{"description":"JSON-RPC response object"},"400":{"$ref":"#/components/responses/ErrorEnvelope"},"406":{"description":"Accept must include application/json and text/event-stream"},"415":{"description":"Content-Type must be application/json"}}}},"/api/v1/mcp-catalog":{"get":{"operationId":"mcp_catalog","summary":"Tool catalog with full input schemas","responses":{"200":{"description":"tools[] with name, description and inputSchema"}}}},"/api/v1/invitations/protocol":{"get":{"operationId":"get_a2a_registration_protocol","summary":"Canonical EIP-191 registration message, HTTP request shape and proof-of-work","responses":{"200":{"description":"message_template, request.body_fields, pow.hash_input, points"}}}},"/api/v1/members/{wallet_address}":{"get":{"operationId":"member_balance","summary":"Membership points balance","parameters":[{"name":"wallet_address","in":"path","required":true,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}}],"responses":{"200":{"description":"points, spendable_total_points, purchased_points, referral_points, game points"},"400":{"$ref":"#/components/responses/ErrorEnvelope"}}}},"/status.json":{"get":{"operationId":"gateway_status","summary":"Admission status to check before paying","responses":{"200":{"description":"open, status, retry_after, availability policy"}}}}}}