Developer docs
Integrate a private-data answer.
One REST call or MCP tool for the full loop: quote, pay, execute, verify, and settle. The response is an aggregate plus a proof — never raw rows.
Quickstart
Start the API and the Next.js app, then run the first query. The browser console and the REST API hit the same real testnet flow.
The FastAPI service is served at :8000; the Next.js app is served at :3000 and proxies /api to it.
REST API
The browser route is same-origin and key-free. Machine clients use /api/v1/query with an API key and idempotency key.
Run a query
curl -s http://127.0.0.1:8000/api/query \
-H 'Content-Type: application/json' \
-d '{"dataset_id":"retail_v1","computation_id":"spend_growth_v1"}' | jqMachine query
curl -s http://127.0.0.1:8000/api/v1/query \
-H "X-API-Key: $SEALQUERY_API_KEY" \
-H 'Idempotency-Key: demo-1' \
-H 'Content-Type: application/json' \
-d '{"dataset_id":"retail_v1"}' | jq| Endpoint | Purpose |
|---|---|
| GET /api/state | datasets, budgets, recent queries |
| GET /api/metrics | alerts, balances, query status |
| GET /api/queries | agent query history |
| GET /api/queries/:id | one query record |
| POST /api/query | enqueue browser query; 202 + job_id |
| GET /api/jobs/:job_id | poll browser job |
| GET /api/owner/summary | indexed owner earnings |
| POST /api/v1/query | enqueue machine query; X-API-Key |
| GET /api/v1/jobs/:job_id | poll machine job |
| GET /api/attestation/:tx | structured TDX report |
| GET /api/attestation/:tx/bundle | download proof bundle |
MCP
Expose SealQuery as tools to Claude, Cursor, or any MCP client. run_query performs a real paid testnet query and returns the aggregate plus proof metadata.
Client configuration
{
"mcpServers": {
"sealquery": {
"command": "python3",
"args": ["mcp/server.py"],
"env": {
"SEALQUERY_API_URL": "http://127.0.0.1:8000",
"SEALQUERY_API_KEY": "<your key>"
}
}
}
}Contract
NEAR testnet · escrow, dataset registry, privacy budget, query history, acceptance, refunds.
Proof verification
Do not trust the UI badge. Verify the transaction or the downloaded bundle independently.
Verify
outlayer-verify tx <request-tx-hash> \ --network testnet \ --api https://testnet-api.outlayer.ai \ --json outlayer-verify bundle proof.json --offline --short
A valid result must pass authenticity, identity, binding, input, and output; TCB should be UpToDate.
Limitations
- • Testnet only; NEAR testnet payments and OutLayer testnet compute.
- • Public dataset used as a private-data stand-in.
- • No differential privacy; budget + cohort + rounding are the current controls.
- • OutLayer governance is centralized; the TEE proves what ran, not correctness.
- • No token, no mainnet deployment, no human wallet flow yet.
Self-host
The canonical deployment is a Docker Compose stack: Next.js web, FastAPI API, indexer, Postgres, Redis, and Caddy. The hosted mirror uses Render + Neon. Docker builds near-cli-rs and outlayer-verify from source for the backend image.
Open http://127.0.0.1:8080. Caddy routes /api to FastAPI and the rest to Next.js.