{"openapi":"3.1.0","info":{"title":"FlexYield API","version":"1.0.0","description":"One API key, one bill, every provider. JSON-RPC relay across 6 chains, the toolbox, the data API and account statements. Weighted metering (standard 1 · heavy 2 · data 10 · toolbox 1 · cache hit 0); every error carries data.request_id and data.support. Agents: the same capabilities are MCP tools at https://flexyield.io/mcp.","contact":{"email":"hello@flexyield.io","url":"https://flexyield.io/support"},"termsOfService":"https://flexyield.io/terms"},"servers":[{"url":"https://flexyield.io"}],"externalDocs":{"url":"https://flexyield.io/docs","description":"Developer docs"},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Your FlexYield API key (fy_…). Free tier at https://flexyield.io/registration/new"},"x402":{"type":"apiKey","in":"header","name":"X-PAYMENT","description":"x402 lane: the settlement tx hash of a payment made against the menu at https://flexyield.io/x402 (base-sepolia)"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"integer","description":"JSON-RPC style code, e.g. -32005 rate window"},"message":{"type":"string"},"data":{"type":"object","properties":{"request_id":{"type":"string","format":"uuid"},"support":{"type":"string","description":"Path to file this call as a ticket"}}}}}}},"JsonRpcRequest":{"type":"object","required":["jsonrpc","method"],"properties":{"jsonrpc":{"type":"string","const":"2.0"},"id":{},"method":{"type":"string"},"params":{"type":"array"}}},"JsonRpcResponse":{"type":"object","properties":{"jsonrpc":{"type":"string"},"id":{},"result":{},"error":{"type":"object"}}}}},"paths":{"/rpc/{chain}":{"post":{"summary":"JSON-RPC relay with multi-provider failover","security":[{"bearer":[]},{"x402":[]}],"parameters":[{"name":"chain","in":"path","required":true,"schema":{"type":"string","enum":["eth_mainnet","base_mainnet","arbitrum_one","optimism_mainnet","polygon_pos","solana_mainnet"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcRequest"}}}},"responses":{"200":{"description":"The upstream's JSON-RPC response (also for in-band JSON-RPC errors)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcResponse"}}}},"402":{"description":"x402 lane: the settlement is unknown, spent or expired — pay against the menu at /x402 and retry with X-PAYMENT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown chain (-32600) or method not in the catalog (-32601, with the concierge doorway)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Invalid or missing API key (-32001)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate window, key budget, plan quota or service cap reached (-32005/-32006/-32007/-32014) — the body says what to do next","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Service switched off for this account/key (-32012) or account suspended (-32009)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-payment-info":{"x402Version":1,"scheme":"exact","network":"base-sepolia","asset":"USDC","mainnetLive":false,"menu":"https://flexyield.io/x402","redeem":"https://flexyield.io/x402/redeem","header":"X-PAYMENT","unitsPerPayment":1000,"windowSeconds":3600,"tiers":[{"name":"cheap","label":"Public-pool supply, best-effort","priceAtomicPerUnit":2,"maxAmountRequired":"2000"},{"name":"balanced","label":"Measured wholesale blend, health-scored routing","priceAtomicPerUnit":5,"maxAmountRequired":"5000"},{"name":"fast","label":"Premium slice, lowest measured latency","priceAtomicPerUnit":10,"maxAmountRequired":"10000"}]}}},"/toolbox/gas/{chain}":{"get":{"summary":"EIP-1559 gas recommendations (slow / standard / fast)","security":[{"bearer":[]}],"parameters":[{"name":"chain","in":"path","required":true,"schema":{"type":"string","enum":["eth_mainnet","base_mainnet","arbitrum_one","optimism_mainnet","polygon_pos","solana_mainnet"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Invalid or missing API key (-32001)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate window, key budget, plan quota or service cap reached (-32005/-32006/-32007/-32014) — the body says what to do next","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Service switched off for this account/key (-32012) or account suspended (-32009)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/toolbox/tx/{chain}/{hash}":{"get":{"summary":"Transaction status","security":[{"bearer":[]}],"parameters":[{"name":"chain","in":"path","required":true,"schema":{"type":"string","enum":["eth_mainnet","base_mainnet","arbitrum_one","optimism_mainnet","polygon_pos","solana_mainnet"]}},{"name":"hash","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Invalid or missing API key (-32001)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate window, key budget, plan quota or service cap reached (-32005/-32006/-32007/-32014) — the body says what to do next","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Service switched off for this account/key (-32012) or account suspended (-32009)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/toolbox/ens/resolve/{name}":{"get":{"summary":"ENS name → address","security":[{"bearer":[]}],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Invalid or missing API key (-32001)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate window, key budget, plan quota or service cap reached (-32005/-32006/-32007/-32014) — the body says what to do next","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Service switched off for this account/key (-32012) or account suspended (-32009)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/toolbox/ens/reverse/{address}":{"get":{"summary":"Address → ENS name","security":[{"bearer":[]}],"parameters":[{"name":"address","in":"path","required":true,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Invalid or missing API key (-32001)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate window, key budget, plan quota or service cap reached (-32005/-32006/-32007/-32014) — the body says what to do next","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Service switched off for this account/key (-32012) or account suspended (-32009)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/toolbox/prices":{"get":{"summary":"Token prices","security":[{"bearer":[]}],"parameters":[{"name":"symbols","in":"query","schema":{"type":"string"},"description":"Comma-separated symbols"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Invalid or missing API key (-32001)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate window, key budget, plan quota or service cap reached (-32005/-32006/-32007/-32014) — the body says what to do next","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Service switched off for this account/key (-32012) or account suspended (-32009)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/toolbox/abi/{chain}/{address}":{"get":{"summary":"Verified contract ABI + name","security":[{"bearer":[]}],"parameters":[{"name":"chain","in":"path","required":true,"schema":{"type":"string","enum":["eth_mainnet","base_mainnet","arbitrum_one","optimism_mainnet","polygon_pos","solana_mainnet"]}},{"name":"address","in":"path","required":true,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Invalid or missing API key (-32001)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate window, key budget, plan quota or service cap reached (-32005/-32006/-32007/-32014) — the body says what to do next","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Service switched off for this account/key (-32012) or account suspended (-32009)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/toolbox/decode/{chain}/{address}":{"post":{"summary":"Decode calldata against the verified ABI","security":[{"bearer":[]}],"parameters":[{"name":"chain","in":"path","required":true,"schema":{"type":"string","enum":["eth_mainnet","base_mainnet","arbitrum_one","optimism_mainnet","polygon_pos","solana_mainnet"]}},{"name":"address","in":"path","required":true,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"string","pattern":"^0x[0-9a-fA-F]*$"}}}}}},"responses":{"200":{"description":"Function signature + arguments","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Invalid or missing API key (-32001)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate window, key budget, plan quota or service cap reached (-32005/-32006/-32007/-32014) — the body says what to do next","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Service switched off for this account/key (-32012) or account suspended (-32009)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/data/{chain}/balances/{address}":{"get":{"summary":"Native + token balances (paid tiers, 10 units)","security":[{"bearer":[]}],"parameters":[{"name":"chain","in":"path","required":true,"schema":{"type":"string","enum":["eth_mainnet","base_mainnet","arbitrum_one","optimism_mainnet","polygon_pos","solana_mainnet"]}},{"name":"address","in":"path","required":true,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Invalid or missing API key (-32001)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate window, key budget, plan quota or service cap reached (-32005/-32006/-32007/-32014) — the body says what to do next","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Service switched off for this account/key (-32012) or account suspended (-32009)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/data/{chain}/history/{address}":{"get":{"summary":"Transfer history (paid tiers, 10 units)","security":[{"bearer":[]}],"parameters":[{"name":"chain","in":"path","required":true,"schema":{"type":"string","enum":["eth_mainnet","base_mainnet","arbitrum_one","optimism_mainnet","polygon_pos","solana_mainnet"]}},{"name":"address","in":"path","required":true,"schema":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Invalid or missing API key (-32001)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate window, key budget, plan quota or service cap reached (-32005/-32006/-32007/-32014) — the body says what to do next","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Service switched off for this account/key (-32012) or account suspended (-32009)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/statements":{"get":{"summary":"The account's billing periods (an agent's key: its own scope)","security":[{"bearer":[]}],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Invalid or missing API key (-32001)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate window, key budget, plan quota or service cap reached (-32005/-32006/-32007/-32014) — the body says what to do next","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Service switched off for this account/key (-32012) or account suspended (-32009)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/statements/{period}":{"get":{"summary":"Statement for a period — usage by key/agent, chain, method class; .csv variant available","security":[{"bearer":[]}],"parameters":[{"name":"period","in":"path","required":true,"schema":{"type":"string","format":"date"},"description":"Period key = its start date"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Invalid or missing API key (-32001)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate window, key budget, plan quota or service cap reached (-32005/-32006/-32007/-32014) — the body says what to do next","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Service switched off for this account/key (-32012) or account suspended (-32009)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/x402":{"get":{"summary":"x402 pay-per-request menu (testnet lane)","responses":{"200":{"description":"Tiers, prices and the settlement network","content":{"application/json":{"schema":{"type":"object"}}}}},"x-payment-info":{"x402Version":1,"scheme":"exact","network":"base-sepolia","asset":"USDC","mainnetLive":false,"menu":"https://flexyield.io/x402","redeem":"https://flexyield.io/x402/redeem","header":"X-PAYMENT","unitsPerPayment":1000,"windowSeconds":3600,"tiers":[{"name":"cheap","label":"Public-pool supply, best-effort","priceAtomicPerUnit":2,"maxAmountRequired":"2000"},{"name":"balanced","label":"Measured wholesale blend, health-scored routing","priceAtomicPerUnit":5,"maxAmountRequired":"5000"},{"name":"fast","label":"Premium slice, lowest measured latency","priceAtomicPerUnit":10,"maxAmountRequired":"10000"}]}}}}}