Skip to main content
POST
POST /route
This endpoint is x402-gated. Free-tier users (10/day) should POST to / using A2A JSON-RPC — same routing logic, no payment required.

What happens

  1. First call returns 402 Payment Required with x402 accepts list ($0.01 USDC on Base)
  2. x402 client signs a transferWithAuthorization and retries with X-PAYMENT header
  3. CDP facilitator verifies, settles on-chain, forwards to the handler
  4. Graph Advocate routes the query, picks the best service, generates the GraphQL, and — when possible — executes it and returns live data
You pay once. You get routing + execution. One call, one answer.

Request body

Also accepts A2A-format body with params.message.parts[].text.

Response shape

The killer field is execution_result — Graph Advocate didn’t just tell you where to look, it ran the query for you.

What to do with the response

  • gql is production-ready GraphQL — paste it as-is into your client or the Graph gateway, no edits needed.
  • subgraph_id is the deployment ID; combine with https://gateway.thegraph.com/api/subgraphs/id/{subgraph_id} to query directly.
  • curl_example is a complete working request you can run in a terminal — useful for sanity-checking before wiring up your client.
  • execution_result (when present) is already the answer; no follow-up call needed.
If execution_result is missing, fire the curl_example against the Graph gateway with your own API key (free tier available). The gql is always live-tested before being returned.

Pricing

Sample: paid call