{"openapi":"3.1.0","info":{"title":"BlazePhoenix Public Quote API","version":"1.0.0","description":"On-chain DEX-aggregator quotes for Base, Ethereum, Optimism and Arbitrum. Every number is computed on-chain by the Quoter contract (previewPlan) — no API key, no signup, open CORS. With `recipient`, responses include ready-to-broadcast Router calldata: integration is quote → sign → send. SDK: npm i @blazephoenix/sdk. Live playground: https://blazephoenix.xyz/?tab=api","contact":{"email":"contact@blazephoenix.xyz","url":"https://blazephoenix.xyz/?tab=api"}},"servers":[{"url":"https://blazephoenix.xyz"}],"paths":{"/api/quote":{"get":{"operationId":"getQuote","summary":"Quote a swap (on-chain previewPlan)","parameters":[{"name":"chain","in":"query","required":true,"description":"chain id or name: 8453/base · 1/eth · 10/optimism · 42161/arbitrum","schema":{"type":"string"}},{"name":"in","in":"query","required":true,"description":"input token: 0x-address, ETH/WETH/USDC/BZPX, or any traded symbol (resolved to the deepest-liquidity token on that chain; echoed back in `resolved`)","schema":{"type":"string"}},{"name":"out","in":"query","required":true,"description":"output token: 0x-address, ETH/WETH/USDC/BZPX, or any traded symbol (resolved to the deepest-liquidity token on that chain; echoed back in `resolved`)","schema":{"type":"string"}},{"name":"amountIn","in":"query","required":true,"description":"input amount in the token’s base units (integer, wei-style)","schema":{"type":"string","pattern":"^[0-9]{1,77}$"}},{"name":"recipient","in":"query","required":false,"description":"0x-address — response then includes ready-to-send tx calldata","schema":{"type":"string"}},{"name":"slippageBps","in":"query","required":false,"description":"0–5000; minOut = netOut − slippage (default: protocol floor)","schema":{"type":"integer","minimum":0,"maximum":5000}},{"name":"deadlineSec","in":"query","required":false,"description":"tx deadline horizon in seconds, 10–3600 (default 120)","schema":{"type":"integer","minimum":10,"maximum":3600}},{"name":"exact","in":"query","required":false,"description":"exact=1 → execution-grade re-quote (previewPlanExact, slower)","schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"quote","content":{"application/json":{"schema":{"type":"object","description":"On-chain quote (Quoter.previewPlan). Numeric fields travel as decimal strings.","properties":{"ok":{"type":"boolean","enum":[true]},"mode":{"type":"string","enum":["preview","exact"]},"chainId":{"type":"integer"},"tokenIn":{"type":"string"},"tokenOut":{"type":"string"},"amountIn":{"type":"string"},"amountOut":{"type":"string","description":"net output after the protocol fee — compare THIS across venues"},"quote":{"type":"object","properties":{"grossOut":{"type":"string"},"protocolFee":{"type":"string"},"netOut":{"type":"string"},"ironFloor":{"type":"string"},"effectiveMinOut":{"type":"string"},"impactBps":{"type":"integer","maximum":10000},"estGas":{"type":"string"},"hops":{"type":"integer"},"legs":{"type":"integer"},"canExecute":{"type":"boolean"},"hasSurplus":{"type":"boolean"},"feeBps":{"type":"integer"}}},"route":{"type":"object","description":"full executable route struct — pass verbatim to Router.swapExactIn"},"tx":{"type":"object","description":"present when `recipient` was sent: ready for sendTransaction","properties":{"to":{"type":"string"},"data":{"type":"string"},"value":{"type":"string","enum":["0"]}}},"wrapRequired":{"type":"boolean","description":"in=ETH — wrap to WETH before swapping"},"resolved":{"type":"object","description":"present when a symbol was resolved: per side { symbol, address, name, liquidityUsd }"},"unwrapAfter":{"type":"boolean","description":"out=ETH — the Router delivers WETH"},"meta":{"type":"object","properties":{"quotedAt":{"type":"integer"},"latencyMs":{"type":"integer"},"rpcTried":{"type":"integer"},"cache":{"type":"string","enum":["miss","coalesced","hit"],"description":"coalesced = identical concurrent requests shared one on-chain call; hit = edge-cached ≤1 block. exact=1 / recipient requests are never TTL-cached."}}}},"required":["ok","mode","chainId","tokenIn","tokenOut","amountIn","amountOut","route"]}}}},"400":{"description":"invalid parameter (code bad_*)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[false]},"code":{"type":"string","description":"stable machine code (bad_*, no_route, rpc_unreachable…)"},"error":{"type":"string"}},"required":["ok","code","error"]}}}},"422":{"description":"no executable route (code no_route)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[false]},"code":{"type":"string","description":"stable machine code (bad_*, no_route, rpc_unreachable…)"},"error":{"type":"string"}},"required":["ok","code","error"]}}}},"502":{"description":"all upstream RPCs failed (code rpc_unreachable)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[false]},"code":{"type":"string","description":"stable machine code (bad_*, no_route, rpc_unreachable…)"},"error":{"type":"string"}},"required":["ok","code","error"]}}}}}}},"/api/quote/batch":{"post":{"operationId":"getQuoteBatch","summary":"Up to 10 quotes in one round-trip (per-item errors inline)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"requests":{"type":"array","maxItems":10,"items":{"type":"object","description":"same keys as the GET /api/quote query parameters","additionalProperties":{"type":["string","number","boolean"]}}}},"required":["requests"]}}}},"responses":{"200":{"description":"batch results, order preserved","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"count":{"type":"integer"},"results":{"type":"array","items":{"oneOf":[{"type":"object","description":"On-chain quote (Quoter.previewPlan). Numeric fields travel as decimal strings.","properties":{"ok":{"type":"boolean","enum":[true]},"mode":{"type":"string","enum":["preview","exact"]},"chainId":{"type":"integer"},"tokenIn":{"type":"string"},"tokenOut":{"type":"string"},"amountIn":{"type":"string"},"amountOut":{"type":"string","description":"net output after the protocol fee — compare THIS across venues"},"quote":{"type":"object","properties":{"grossOut":{"type":"string"},"protocolFee":{"type":"string"},"netOut":{"type":"string"},"ironFloor":{"type":"string"},"effectiveMinOut":{"type":"string"},"impactBps":{"type":"integer","maximum":10000},"estGas":{"type":"string"},"hops":{"type":"integer"},"legs":{"type":"integer"},"canExecute":{"type":"boolean"},"hasSurplus":{"type":"boolean"},"feeBps":{"type":"integer"}}},"route":{"type":"object","description":"full executable route struct — pass verbatim to Router.swapExactIn"},"tx":{"type":"object","description":"present when `recipient` was sent: ready for sendTransaction","properties":{"to":{"type":"string"},"data":{"type":"string"},"value":{"type":"string","enum":["0"]}}},"wrapRequired":{"type":"boolean","description":"in=ETH — wrap to WETH before swapping"},"resolved":{"type":"object","description":"present when a symbol was resolved: per side { symbol, address, name, liquidityUsd }"},"unwrapAfter":{"type":"boolean","description":"out=ETH — the Router delivers WETH"},"meta":{"type":"object","properties":{"quotedAt":{"type":"integer"},"latencyMs":{"type":"integer"},"rpcTried":{"type":"integer"},"cache":{"type":"string","enum":["miss","coalesced","hit"],"description":"coalesced = identical concurrent requests shared one on-chain call; hit = edge-cached ≤1 block. exact=1 / recipient requests are never TTL-cached."}}}},"required":["ok","mode","chainId","tokenIn","tokenOut","amountIn","amountOut","route"]},{"type":"object","properties":{"ok":{"type":"boolean","enum":[false]},"code":{"type":"string","description":"stable machine code (bad_*, no_route, rpc_unreachable…)"},"error":{"type":"string"}},"required":["ok","code","error"]}]}}}}}}},"400":{"description":"invalid envelope","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[false]},"code":{"type":"string","description":"stable machine code (bad_*, no_route, rpc_unreachable…)"},"error":{"type":"string"}},"required":["ok","code","error"]}}}}}}},"/api/manifest":{"get":{"operationId":"getManifest","summary":"Machine-readable protocol manifest (contracts, token, event topics)","responses":{"200":{"description":"manifest","content":{"application/json":{}}}}}},"/api":{"get":{"operationId":"getDiscovery","summary":"Discovery root — the API describes itself (endpoints, docs, SDK, contact)","responses":{"200":{"description":"discovery index","content":{"application/json":{}}}}}},"/api/health":{"get":{"operationId":"getHealth","summary":"Service health + per-chain live flags (no upstream calls — poll freely)","responses":{"200":{"description":"health","content":{"application/json":{}}}}}},"/api/stats":{"get":{"operationId":"getStats","summary":"Live protocol stats: fills + unique traders per chain from on-chain Swap events (reproducible; cached ~5min)","responses":{"200":{"description":"stats","content":{"application/json":{}}}}}},"/api/badge":{"get":{"operationId":"getBadge","summary":"shields.io endpoint JSON: live staking isSolvent() badge — embed with https://img.shields.io/endpoint?url=…/api/badge","responses":{"200":{"description":"badge (schemaVersion 1)","content":{"application/json":{}}}}}},"/api/xray":{"get":{"operationId":"getXray","summary":"Pool X-Ray: compares a token's Dexscreener-reported pool reserves against live balanceOf(pair) on-chain and scores phantom liquidity (reproducible; cached ~60s)","parameters":[{"name":"chain","in":"query","required":true,"description":"8453/base · 1/eth · 10/optimism · 42161/arbitrum","schema":{"type":"string"}},{"name":"token","in":"query","required":true,"description":"0x-address or a traded symbol (resolved by deepest liquidity)","schema":{"type":"string"}}],"responses":{"200":{"description":"phantom-liquidity report (summary + per-pool)","content":{"application/json":{}}},"400":{"description":"invalid parameter","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[false]},"code":{"type":"string","description":"stable machine code (bad_*, no_route, rpc_unreachable…)"},"error":{"type":"string"}},"required":["ok","code","error"]}}}},"422":{"description":"symbol not resolvable (code unresolved)","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[false]},"code":{"type":"string","description":"stable machine code (bad_*, no_route, rpc_unreachable…)"},"error":{"type":"string"}},"required":["ok","code","error"]}}}}}}}}}