API
Reference
Stream DeFi analytics and set up on-chain alerts with pay-per-use x402 payments. No API key needed.
Authentication via x402
No API keys, no accounts. Every request is paid for individually with USDC on Base using the x402 payment protocol.
How it works
- 1Send your request to the endpoint.
- 2Receive a
402 Payment Requiredresponse with the exact price. - 3Re-send the request with the x402 payment header attached.
/queryStream a DeFi analytics response. The AI queries on-chain data in real time and streams the answer as NDJSON.
Request body
messagesrequiredmodelmaxOutputTokens{
"messages": [
{
"role": "user",
"content": "What are the top 5 Uniswap V3 pools on Ethereum by TVL?"
}
],
"model": "deepseek3.2",
"maxOutputTokens": 2000
}Response format
The response is an NDJSON stream. Each line is a JSON object with a type field:
contenttool-statuserrorcurl -X POST https://api.nacian.app/query \
-H "Content-Type: application/json" \
-H "X-PAYMENT: <x402-payment-header>" \
-d '{
"messages": [{"role": "user", "content": "TVL of Aave V3 on Base"}]
}'/alertCreate a monitored alert. The AI interprets your condition, sets up polling, and sends a webhook when triggered.
Request body
messagesrequiredwebhookUrlrequiredmodelmaxOutputTokensmaxMinutesfrequencySeconds{
"messages": [
{
"role": "user",
"content": "Alert me when ETH/USDC pool TVL on Uniswap V3 Ethereum drops below $100M"
}
],
"webhookUrl": "https://your-app.com/webhook",
"maxMinutes": 1440,
"frequencySeconds": 300
}Response format
Same NDJSON stream as /query, plus an additional event type:
alert-createdcontenttool-statuserror{"type":"tool-status","tool":"queryGraph","status":"running","display":"Querying Uniswap V3..."}
{"type":"tool-status","tool":"queryGraph","status":"complete","display":"Query complete"}
{"type":"alert-created","alertId":"abc123","condition":"ETH/USDC TVL < $100M"}
{"type":"content","text":"Alert created. Monitoring ETH/USDC pool TVL on Uniswap V3..."}API Pricing
Dynamic per-request pricing based on model, input size, and requested output tokens.
Alert polling: ~$0.000026 per poll. Total alert cost = query cost + (number of polls x poll cost). Polls = maxMinutes * 60 / frequencySeconds.
price = baseFee + ceil(inputChars / 150) * inputCost + ceil(maxOutputTokens / 150) * outputCost
Protocol Coverage
Chains
- Ethereum
- Base
- Arbitrum
Spot DEXes
- Uniswap
- Pancakeswap
- Aerodrome
- Sushiswap
- Camelot
- Quickswap
Lending
- Aave
- Compound
Infrastructure
- ENS
Liquid Staking
- Lido
For full version details, see the coverage page.
Network Data Coverage
Coming soonNetwork data queries — including gas prices, block statistics, ETH price, and chain-level metrics — are not yet available through the API. This feature is currently exclusive to the chat interface and will be added to the API in a future release.
Onchain Data Coverage
Coming soonOnchain data queries — including reading any public smart contract function and setting alerts on any returned value — are not yet available through the API. This feature is currently exclusive to the chat interface and will be added to the API in a future release.
Ready to Integrate?
Start making requests with x402 payments. No sign-up required.