Agent demos

Use-case playbooks for prediction-market agents

Each flow starts with the 402 challenge, then replays the same request with X-PAYMENT. The snippets are intentionally small so an agent builder can paste them into a tool, worker, or scheduled job.

x402copy/paste

Shared helper

Paid calls return HTTP 402 until your payer settles the quoted USDC amount. In production, handle 402 as a normal payment handshake, not as an application error.

Monitor prediction markets

/api/x402/v1/decision/attention

Run one cheap queue call, then spend deeper calls only on markets whose attention score is high.

  1. 1Call /decision/attention on a schedule.
  2. 2Keep rows with action investigate_now, check_sources, or alert_human.
  3. 3Fan out to /decision/market/{id} for the top one to three markets.

cURL

curl -i 'https://orrery.me/api/x402/v1/decision/attention?limit=10'

curl 'https://orrery.me/api/x402/v1/decision/attention?limit=10' \
  -H 'X-PAYMENT: <x402-payment-proof>'

Python

import httpx

r = httpx.get("https://orrery.me/api/x402/v1/decision/attention?limit=10", headers={
    "X-PAYMENT": "<x402-payment-proof>",
}, timeout=10)
r.raise_for_status()
queue = r.json()["data"]["items"]
urgent = [m for m in queue if m["recommended_agent_action"] != "ignore"]

TypeScript

const r = await fetch("https://orrery.me/api/x402/v1/decision/attention?limit=10", {
  headers: { "X-PAYMENT": "<x402-payment-proof>" },
});
if (r.status === 402) throw new Error("Settle x402 challenge, then replay");
const queue = (await r.json()).data.items;
const urgent = queue.filter((m) => m.recommended_agent_action !== "ignore");

Detect resolution risk

/api/x402/v1/markets/{id}/resolution-risk

Treat source ambiguity, UMA dispute state, and expiry pressure as blockers before an agent trusts a probability move.

  1. 1Start from a market slug chosen by your queue or your user.
  2. 2Call /markets/{id}/resolution-risk before alerting a human.
  3. 3Escalate high or medium risk with the what_to_verify checklist.

cURL

MARKET='btc-150k-2026'
curl 'https://orrery.me/api/x402/v1/markets/'"$MARKET"'/resolution-risk' \
  -H 'X-PAYMENT: <x402-payment-proof>'

Python

slug = "btc-150k-2026"
risk = httpx.get(f"https://orrery.me/api/x402/v1/markets/{slug}/resolution-risk", headers={
    "X-PAYMENT": "<x402-payment-proof>",
}).json()["data"]
if risk["recommended_agent_action"] in {"check_sources", "alert_human"}:
    print(risk["one_line_reason"])

TypeScript

const slug = "btc-150k-2026";
const risk = await paidGet(`/markets/${slug}/resolution-risk`);
if (["check_sources", "alert_human"].includes(risk.recommended_agent_action)) {
  console.log(risk.one_line_reason);
}

Explain why odds moved

/api/x402/v1/markets/{id}/why

Convert a move into factors with evidence numbers, confidence, sources, and the next verification step.

  1. 1Trigger from a 24h probability move, alert, or user question.
  2. 2Call /markets/{id}/why for deterministic factor analysis.
  3. 3Cite factor evidence instead of inventing a narrative.

cURL

curl 'https://orrery.me/api/x402/v1/markets/btc-150k-2026/why' \
  -H 'X-PAYMENT: <x402-payment-proof>'

Python

why = httpx.get("https://orrery.me/api/x402/v1/markets/btc-150k-2026/why", headers={
    "X-PAYMENT": "<x402-payment-proof>",
}).json()["data"]
for factor in why["payload"]["factors"]:
    print(factor["type"], factor["summary"])

TypeScript

const why = await paidGet("/markets/btc-150k-2026/why");
for (const factor of why.payload.factors) {
  console.log(factor.type, factor.summary);
}

Summarize a watchlist

/api/x402/v1/watchlist/summary

Turn a user's saved markets, themes, and wallets into a compact inbox or agent-memory artifact.

  1. 1Send market slugs, themes, and wallet addresses as a POST body.
  2. 2Ask for movers, new signals, whale flow, and resolution risk.
  3. 3Use the output as a daily brief or alert digest.

cURL

curl 'https://orrery.me/api/x402/v1/watchlist/summary' \
  -H 'Content-Type: application/json' \
  -H 'X-PAYMENT: <x402-payment-proof>' \
  -d '{"markets":["btc-150k-2026"],"themes":["crypto"],"wallets":[]}'

Python

payload = {"markets": ["btc-150k-2026"], "themes": ["crypto"], "wallets": []}
brief = httpx.post("https://orrery.me/api/x402/v1/watchlist/summary", json=payload, headers={
    "X-PAYMENT": "<x402-payment-proof>",
}).json()["data"]
print(brief["one_line_reason"])

TypeScript

const brief = await paidPost("/watchlist/summary", {
  markets: ["btc-150k-2026"],
  themes: ["crypto"],
  wallets: [],
});
console.log(brief.one_line_reason);

Recommended production loop

daily + intraday

Daily: call /brief/today and /decision/attention. Intraday: call /markets/movers and only fan out when a market crosses your alert threshold. Before any human-facing alert, call resolution risk.

Agent use-case demos - Orrery x402 API | Orrery