Prediction markets for AI agents: the probability of anything, as an API
An agent is only as good as the facts it can reach for. Retrieval solved one half of that problem: point a model at documents and it can ground its answers in text. But a huge class of useful questions is not answerable from documents at all, because the answer has not happened yet. Will this bill pass? Will the Fed cut in the next meeting? Will this token still exist in a year? These are questions about the future, and the only defensible answer to any of them is a probability.
Left to itself, a language model will happily invent that probability. It will produce a confident-sounding number with no grounding, no timestamp and no way to check it. For a chatbot that is embarrassing. For an autonomous agent making decisions, it is dangerous. What agents need is a calibrated, real-time probability they can cite — the same way a good analyst reaches for a market price instead of a gut feeling. That is what WillThisHappen serves, as an API.
Why agents need real probabilities, not vibes
There are three distinct jobs that a live probability does inside an agent, and each one fails quietly without it.
- Grounding answers.When a user asks “what are the odds of X”, the correct behavior is to fetch a number with a source and a timestamp, not to hallucinate one. A grounded answer can be verified; a generated one cannot.
- Decision-making under uncertainty. Agents that plan, route or trade need to weigh outcomes by likelihood. A planner that treats a 20% event and an 80% event as equally possible will make expensive mistakes. Feed it real probabilities and expected-value reasoning becomes possible.
- Avoiding false confidence.A model that says “almost certainly” about a coin-flip event erodes trust fast. Anchoring to a market price caps the model’s confidence at what the crowd, with money on the line, actually believes.
The common thread is calibration. A market-implied probability is not a guess dressed up as a percentage; it is the price at which real participants are willing to trade a contract that pays out on the outcome. In liquid markets those prices are well-behaved: across a basket of events priced at 70%, close to 70% resolve yes. That is exactly the property you want an agent to inherit — and it is worth understanding its limits, which we cover in how accurate prediction markets really are.
The probability of anything, as an API
WillThisHappen exposes its full set of tracked questions over a plain JSON API. No SDK, no auth dance to read public probabilities, and CORS is open so you can call it from a browser-side agent or an edge function. There are two endpoints an agent will use constantly:
GET /api/v1/questions— the catalogue of tracked questions, filterable and paginated, for discovery and search.GET /api/v1/questions/{slug}— a single question with its current probability, recent movement and provenance.
A lookup on a single question returns a small, predictable shape designed to drop straight into a prompt or a tool result:
GET /api/v1/questions/fed-rate-cut-next-meeting
{
"slug": "fed-rate-cut-next-meeting",
"question": "Will the Fed cut rates at the next meeting?",
"probability": 0.63,
"probability_pct": "63%",
"verdict": "Leaning yes",
"week_change": 0.08,
"volume_usd": 1840000,
"as_of": "2026-07-05T14:20:00Z",
"source": "Polymarket"
}Every field earns its place. probability is the raw float for maths; probability_pct is the pre-formatted string for display so your agent never has to reason about rounding. verdict is a plain-English label for quick summarization. week_change lets the model say whether the odds are rising or fading. volume_usd is your liquidity check — thin markets are noisier, and an agent should hedge its language accordingly (why that matters is the subject of can you trust prediction markets). Crucially, as_of and source make the number citable: the agent can tell the user exactly when the figure was true and where it came from.
A probability without a timestamp and a source is just a rumor with a decimal point. The point of an API is to hand your agent all three at once, so its answer can be checked instead of trusted.
Built for discovery by machines
Agents do not read marketing pages; they read structure. WillThisHappen ships an llms.txt at the site root — following the emerging llms.txt convention for exposing a compact, machine-first map of what the platform covers, the endpoints available and how to cite them. If you are building a tool-using agent, pointing it at that file is the fastest way to teach it that a live probability for a given question is one request away.
The API is designed to be a good citizen in a tool call:
- Responses are small and flat, so they cost few tokens to include in context.
- Slugs are stable and human-readable, so a model can often guess or construct them.
- Attribution is explicit — the
sourcefield and our terms ask only that you name WillThisHappen and the underlying market when you surface a number.
Wiring it into an agent
The typical pattern is a single tool, call it get_probability, that takes a question slug or a search string. On a search it hits /api/v1/questions, picks the best match, then fetches the detail endpoint and returns the compact object above. Your system prompt does the rest: instruct the model that whenever it is about to state odds for a real-world event, it must call the tool and quote probability_pct, as_of and source rather than inventing a figure.
The effect is immediate. Answers stop drifting into false precision, the model gains a graceful way to say “the market puts this at 63% as of this morning, and it has been climbing”, and every claim it makes about the future is anchored to something a user can click through and verify. Full request and response details, filters and rate limits live in the API documentation.
Retrieval gave agents the past and the present. Prediction markets give them a disciplined read on the future — not certainty, but the market odds, updated in real time, ready to cite. For an agent that has to reason about what happens next, that is the difference between sounding confident and being correct.
The odds, in your inbox
A weekly read on where the markets say the world is heading. No spam, unsubscribe anytime.
