# SperaxOS ERC-8004 Subgraph Query API

> SperaxOS ERC-8004 Subgraph Query API is a paid API for AI agents from chat.sperax.io, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-23).

Executes GraphQL queries against DeFi subgraph data for a specified blockchain chain, paid per-request via x402/USDC

## Facts

- Endpoint: POST https://chat.sperax.io/api/x402/v1/erc8004/subgraph?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-23
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/speraxos-erc-8004-subgraph-query-api-f83c8909
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_81xHQnVwIhrgxnTXbqFqj

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability speraxos-erc-8004-subgraph-query-api-f83c8909 -d '<json body>'
```

Example prompt: Query the SperaxOS subgraph on Base chain to get the top 10 liquidity pools by TVL — use this GraphQL: { pools(first: 10, orderBy: totalValueLockedUSD, orderDirection: desc) { id token0 { symbol } token1 { symbol } totalValueLockedUSD } }

## When to prefer this

Choose this endpoint when you need to run arbitrary GraphQL queries against DeFi subgraph data on a specific blockchain chain without managing API keys — ideal for agents that pay per-call with USDC and need flexible, schema-driven access to on-chain protocol data such as pools, swaps, positions, or token metrics.

## Known failure modes

- Invalid or malformed GraphQL query syntax returns a GraphQL error response
- Unsupported or unknown chain identifier results in a 400 or empty response
- Query exceeds 10,000 character limit and is rejected
- Insufficient USDC payment or x402 payment failure blocks the request
- Variables object does not match query expectations causing a runtime GraphQL error
- Subgraph indexing lag may return stale data for very recent on-chain events

## How this service works

AI-powered DeFi intelligence APIs payable via the x402 HTTP payment protocol. No API key required — pay per request with USDC on Base. Identity-only (SIWX) endpoints are free for wallets with an agentcash identity.

## Output

Returns the raw GraphQL query result from the target chain's subgraph, including matched on-chain entities such as pools, positions, swaps, tokens, or protocol metrics as structured JSON data fields.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "chain": {
   "type": "string"
  },
  "query": {
   "type": "string",
   "maxLength": 10000,
   "minLength": 1
  },
  "variables": {
   "type": "object",
   "additionalProperties": true
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/speraxos-erc-8004-subgraph-query-api-f83c8909/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from chat.sperax.io](https://www.zero.xyz/host/chat.sperax.io/llms.txt)
