Attevia Prime · API

The institutional research pipeline, as an endpoint.

POST a thesis in plain English. Agents gather sources, run a backtest on real prices, write a report, run a second-model review, and return a signed memo with a verify link. One API call.

What it is

A full research pipeline, available as HTTP.

Prime runs the same steps as the Research Desk: parse a thesis, search academic sources, backtest on historical prices, write a summary, review with a second model, and sign the result.

Multi-agent reasoning

Claude Opus 4.8 (decomposition, debate, synthesis) + GPT-5.5 (consensus + dissent) + targeted Haiku/Sonnet for cheap intermediate steps.

Real grounding

Live arXiv q-fin/stat.ML retrieval (with Browser Use fallback if the API throttles). Live OHLC backtests against historical S&P + NSE data.

Audit-stamped

The final memo is canonicalised, ed25519-signed, and persisted to Vercel Blob. A receiptId comes back with the response.

Who uses it

Anyone who needs a defensible research artifact, fast.

PMS / wealth
Pre-IC research dossier

Problem. Investment committee meets in 4 hours and you have a fresh thesis with no analyst bandwidth.

Solution. POST the thesis. Get a memo with arXiv citations, a 5-year backtest, sharpe / drawdown, and a signed receipt — in 60 seconds.

Family office
Recurring 'is this still alive?' checks

Problem. You have 30 long-term theses you need to revisit quarterly without paying 30 analyst-days.

Solution. Schedule a Prime run per thesis. Diff the new memo against the last signed output in your memo library.

Quant fund
Idea-funnel triage

Problem. 80% of strategy ideas die in week-one stat-tests. You don't want a quant burning a week on the bad 80%.

Solution. Run every incoming thesis through Prime. Filter by backtest sharpe and consensus alignment before assigning human time.

Newsroom / media
Defensible market-analysis pieces

Problem. Your finance reporter writes claims like 'X has historically outperformed Y' that lawyers later regret.

Solution. Cite the receipt id. Anyone can replay the exact backtest and the exact prompt. Bulletproof.

Try it now

Run a real thesis on a shared demo key.

This widget posts to the live /api/v1/runs. Pick a preset or type your own — runs typically complete in 40–90s depending on provider latency. The output is byte-identical to what your code will receive in production.

Live Prime API
Posts to /api/v1/runs · returns the same signed memo your code would.
Runs use a shared demo key (25 ops / day, free tier). For unlimited, sign up.
What runs inside a single call

The agent pipeline.

  1. 1
    Researcher
    Claude Haiku 4.5 (ReAct tool loop) + arXiv

    Runs a fast tool-use loop — macro, strategy-graph prior art, asset stats, and a best-effort arXiv literature query — then decomposes the thesis into a grounded hypothesis and a liquid candidate universe.

  2. 2
    Quant
    Yahoo Finance OHLC + native backtester

    Translates the thesis into strategy variants, runs backtests on real historical daily closes (model-estimated fallback when no liquid feed exists), and picks the best risk-adjusted result net of turnover cost.

  3. 3
    Overlay
    Deterministic rules

    Adjusts weights using macro data and position limits. Every change is logged.

  4. 4
    Critic
    Claude — adversarial

    Lists falsifying observations, regime risks, and what would break the thesis.

  5. 5
    Scribe
    Claude Opus 4.8 (Sonnet 4.6 fallback)

    Writes the report: title, evidence score, key findings, thesis stance, and risks — numbers pulled from the backtest object. Promotes to Opus 4.8 when the budget allows, else Sonnet 4.6.

  6. 6
    Consensus
    GPT-5.5 (frontier)

    A separate frontier model re-reads the memo cold and either confirms or dissents. Divergence is surfaced as a first-class field — not buried in a confidence number.

  7. 7
    Sign
    ed25519 + Vercel Blob

    The final memo is canonicalised, hashed, signed, and persisted. A verifyUrl comes back with the response. Public verification needs no Attevia account.

How it works

Lifecycle of a Prime run.

  1. 1
    POST /api/v1/runs

    You send { thesis, currency? }. Default wait=true blocks until complete (40–90s). Set wait=false to poll with the returned id.

  2. 2
    Pipeline executes server-side

    Researcher → Quant → overlay → Critic → backtest → Scribe → consensus → sign. Anthropic prompt caching reduces cost on repeat tool inputs.

  3. 3
    Poll GET /api/v1/runs?id=…

    GET with ?id=yourRunId. Status flows queued → running → complete (or error). Response includes memo, metrics, signature, permalink, and verifyUrl when complete.

  4. 4
    Permalink + receipt

    The permalink (/m/<id>) renders the memo as a shareable page. verifyUrl (/verify/<id>) walks through the cryptographic proof — no API key needed.

The contract

One endpoint to start. One endpoint to poll.

POST /api/v1/runs (Bearer auth)
curl -X POST $ATTEVIA_URL/api/v1/runs \
  -H "Authorization: Bearer $ATTEVIA_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "thesis": "Indian rural wages + monsoon predict NIFTY auto-component alpha over 5y",
    "currency": "INR"
  }'
Response (202 Accepted)
{
  "ok": true,
  "id": "th_8fJK2pQ",
  "status": "running",
  "poll": "/api/v1/runs?id=th_8fJK2pQ"
}
GET /api/v1/runs?id=… (Bearer auth)
curl "$ATTEVIA_URL/api/v1/runs?id=th_8fJK2pQ" \
  -H "Authorization: Bearer $ATTEVIA_KEY"
Response (when status=complete)
{
  "ok": true,
  "run": {
    "id": "th_8fJK2pQ",
    "status": "complete",
    "memo": {
      "title": "Rural wage + monsoon as a leading signal for NSE auto-ancillaries",
      "summary": "Statistically meaningful but regime-sensitive…",
      "recommendation": "supported",
      "stanceLabel": "Thesis supported",
      "conviction": 0.62,
      "keyFindings": ["...", "..."]
    },
    "metrics": {
      "sharpe": 0.84,
      "annualReturn": 0.143,
      "maxDrawdown": -0.211
    },
    "signature": {
      "fingerprint": "bks8zvfobs-nOEJo",
      "digest": "a42f…",
      "signature": "cR9f…"
    },
    "permalink": "/m/th_8fJK2pQ",
    "verifyUrl": "/verify/th_8fJK2pQ"
  }
}
From your code

Typed client in 20 lines.

lib/prime.ts
async function runPrime(thesis: string) {
  const start = await fetch(`${ATTEVIA_URL}/api/v1/runs`, {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.ATTEVIA_KEY!}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ thesis, currency: "USD" }),
  }).then((r) => r.json());

  // poll until complete (typical: 40–90s)
  while (true) {
    const r = await fetch(`${ATTEVIA_URL}/api/v1/runs?id=${start.id}`, {
      headers: { Authorization: `Bearer ${process.env.ATTEVIA_KEY!}` },
    }).then((r) => r.json());
    if (r.run?.status === "complete") return r.run;
    if (r.run?.status === "error") throw new Error("prime failed");
    await new Promise((s) => setTimeout(s, 4_000));
  }
}
FAQ

Operational questions.

How long does a run take?

40–90s on a warm path. Cold cache + heavy thesis + provider degradation can push it to ~3 min. Complex theses with many tickers take longer.

What happens if arXiv rate-limits?

arXiv is best-effort grounding. If the API rate-limits (HTTP 429), the Researcher proceeds without paper grounding rather than blocking the run — arXiv adds citations but never gates the memo. (An optional headless-browser fallback exists behind a flag but is off by default to keep runs fast.)

Why Claude Opus 4.8 + GPT-5.5 together?

Opus is the strongest narrative + adversarial reasoner; GPT-5.5 is the strongest cold-read consensus model. Using one as both author and judge is the most common silent failure in agentic systems.

What's actually in the backtest?

Real Stooq OHLC daily bars (>20y depth for major US tickers, ~15y for NSE), with our own portfolio bookkeeper. Process and formulae are documented on the /methodology page.

Can I customise the agent prompts?

Not in the public API yet — it would make audits much harder to interpret. Enterprise plans can pin custom agent definitions with versioned prompts. Talk to sales.

Does it support non-US / non-Indian markets?

Yes for any ticker Stooq covers (EU majors, Japan, UK, Canada, AU). Less liquid emerging-market tickers will degrade to weekly bars and a warning in the metadata.

Ready to ship
Run your first thesis on the free tier.