# The BlazePhoenix quote API in five minutes: prepare, run on your node, decode

> Canonical: https://blazephoenix.xyz/learn/quote-api-in-five-minutes/
> License: CC BY-NC-ND 4.0 (attribution + link) · © 2026 BlazePhoenix
> Updated: 2026-10-05

Get an on-chain BlazePhoenix quote from any language in three steps: GET /api/quote/prepare for the exact call, run that eth_call on your own node, then POST /api/quote/decode for the net output, minimum output, price impact and Phoenix Check. Keyless, with curl examples and the retired /api/quote explained.

The BlazePhoenix quote API is two keyless HTTP calls around one eth_call on your own node. GET /api/quote/prepare returns the exact call to run; you run it; POST /api/quote/decode turns the answer into the quote, the Phoenix Check and, given a recipient and a userMinOut, unsigned calldata. The site performs no RPC for integrators.

## Step 1: how do you prepare a quote?

One GET with the chain, the two tokens and the amount in base units. Tokens are 0x addresses, or the symbols ETH, WETH, USDC and BZPX; chain is base, eth, optimism, arbitrum, robinhood or a chain id.

```
curl -s "https://blazephoenix.xyz/api/quote/prepare?chain=base&in=ETH&out=USDC&amountIn=1000000000000000000"
# → { ok, call: { to, data }, rpcRequest, curl, request, decode, ... }
# call.to is the Quoter; request is what you send back in step 3
```

## Step 2: how do you run it on your node?

The response carries a ready JSON-RPC request and a curl line. Point it at your own RPC URL — any provider or your own node — and keep the hex result. Because the read happens on your node, the quote reflects the chain as your node sees it, and nobody between you and the chain can alter it.

```
export RPC_URL=<your node>
# run the "curl" line from step 1 as-is, or POST its rpcRequest yourself:
curl -s "$RPC_URL" -H 'content-type: application/json' -d '<rpcRequest from step 1>'
# → { "result": "0x…" }
```

## Step 3: how do you decode the answer?

POST the request object from step 1 and the hex result from step 2. The decoder is pure computation and cannot authenticate your node's answer: it returns the net output after the 0.28 percent fee, the price impact, the Phoenix Check verdict (ok, caution, danger or blocked) and, in preview mode, the on-chain floor the Quoter reports for the route. Add recipient=0x… and userMinOut= in step 1 and it also returns unsigned calldata verified against the request, with a minimum output of the higher of that userMinOut and the quoted net output less slippageBps, never under the on-chain floor (exact mode: exactly that userMinOut) (without a userMinOut it returns a txError instead). The calldata clears the swap math, not the token transfer: simulate it as an eth_call to the Router from the paying address before sending.

```
curl -s -X POST https://blazephoenix.xyz/api/quote/decode \
  -H 'content-type: application/json' \
  -d '{"request": <request from step 1>, "result": "0x…"}'
```

## What happened to /api/quote?

The old one-call relay, GET /api/quote, is retired. It now answers 400 with the code rpc_required and the prepared call inline, so an old integration fails loudly and tells you the fix. Every live endpoint is listed in the OpenAPI document at /api/openapi.json, and /api describes the API from its own discovery root.

## Where do agents and SDKs fit?

BlazePhoenix's SDK, MCP servers and REST API are three doors to the same on-chain Quoter.

The same flow is exposed to AI agents by the hosted MCP server, whose prepare_quote and decode_quote tools mirror steps 1 and 3. For one-step quotes and swaps on your own RPC, the TypeScript SDK @blazephoenix/sdk and the local MCP server do the read for you. All of them return the same numbers, because all of them read the same on-chain Quoter.

**Verify it yourself:** curl -s "https://blazephoenix.xyz/api/quote/prepare?chain=base&in=ETH&out=USDC&amountIn=1000000000000000000"

Related: https://blazephoenix.xyz/learn/zero-rpc-mcp-server/ · https://blazephoenix.xyz/learn/bring-your-own-rpc/ · https://blazephoenix.xyz/learn/api-sdk-mcp/ · https://blazephoenix.xyz/learn/reading-a-revert/ · https://blazephoenix.xyz/learn/on-chain-quoting/ · https://blazephoenix.xyz/learn/use-blazephoenix-from-ai-agents/
