PeumeAPI

Finance & crypto

Preflight Blockchain SQL Query

Validate and cost-estimate a ClickHouse SQL query (EXPLAIN ESTIMATE) without executing it.

$0.036 per call

Call it

curl https://api.peume.com/v1/call/preflight-blockchain-sql-query \
  -H "Authorization: Bearer $PEUME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "sql": "your sql"
  }
}'

Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: preflight-blockchain-sql-query.

Parameters

sqlRequiredstring

Read-only ClickHouse SELECT/WITH query to validate and estimate WITHOUT executing. Same shape and rules as /onchain/sql. Rules (server-enforced or query-killing): SELECT/WITH only (read-only); table references must be database-qualified as agent.<table>; ALWAYS filter on block_date or block_number (partition key — without it the query times out); compare address columns directly against lowercase literals (wrapping the column in lower is rejected); never filter on symbol columns (unindexed full scan, and symbol matches surface scam clones — resolve a ticker to a contract address with /search

max_rowsinteger

Maximum rows to return. Example: 100. Defaults to 1000 (server-side), capped at 10000.

Start free · $1 of calls included

Every API your business needs. One key.

7,267 data and AI APIs behind one key, with backup sources built in.