Docs
One endpoint family. One probability object.
Credence is an HTTPS JSON API (and an MCP server). Reference a market — by id, slug, URL, or token — and get back a probability object: the market’s price, our calibrated probability, evidence strength (n_effective), and the full Beta distribution, each response stamped with audit-grade lineage.
Access is gated to design partners and early-access developers today.
Authentication
Every request carries your key as a bearer token:
Authorization: Bearer cpk_...
Keys are issued to design partners and early-access developers — request one below. A missing or bad key returns 401 invalid_api_key.
Your first call
Resolve a market and read its probability object — the same call in curl and Python.
curl -s -G "https://api.credence.at/v1/probabilities/dems-control-senate-2026" \
--data-urlencode "ref=slug" \
--data-urlencode "include=distribution" \
-H "Authorization: Bearer cpk_..."
import requests
r = requests.get(
"https://api.credence.at/v1/probabilities/dems-control-senate-2026",
params={"ref": "slug", "include": "distribution"},
headers={"Authorization": "Bearer cpk_..."},
)
print(r.json()["probability"])
The response
{
"request_id": "req_01jw9t6c0fz8m4q2r7v3k5b9xn",
"snapshot": {
"snapshot_id": "api-forecast-20260525T141200Z",
"as_of": "2026-05-25T14:12:00Z",
"freshness_sec": 9,
"release_id": "rel_2026_05_25_141200",
"model_version": "research-20260503T151421Z",
"methodology_version": "b7e2a019c4f3d586",
"market_count": 54187
},
"probability": {
"request": {
"input": "dems-control-senate-2026",
"resolved_market_id": "0x..."
},
"p_market": 0.46,
"p_calibrated": 0.54,
"n_effective": 12.9,
"distribution": {
"family": "beta",
"alpha": 6.966,
"beta": 5.934
}
}
}
What comes back
- request_id — unique id for this request.
- snapshot — the immutable snapshot the answer came from:
snapshot_id,as_of,freshness_sec,release_id,model_version,methodology_version,market_count. - probability —
request(your input +resolved_market_id), p_market, p_calibrated, n_effective, and (withinclude=distribution)distribution = { family: "beta", alpha, beta }.
Invariants you can rely on
p_marketin[0,1]p_calibratedin(0,1)n_effective > 0alpha = p_calibrated × n_effectivebeta = (1 − p_calibrated) × n_effective
Endpoints
- GET /v1/probabilities/{ref} — single lookup.
refresolves bymarket_id(default),token_id,slug, orurl; add?include=distribution. - POST /v1/probabilities/query — batch lookup, up to 100 references in one call.
- GET /v1/snapshots/current — current snapshot metadata (freshness, versions).
- GET /v1/snapshots/{id}/probabilities — a retained snapshot’s probabilities, paged by cursor. Replay any past snapshot, by id.
- GET /v1/markets — search and resolve markets.
Errors & rate limits
Standard HTTP status codes with a stable machine code in the body:
400 invalid_request401 invalid_api_key404 market_not_found429 rate_limited(back off per theRetry-Afterheader)503 temporarily_unavailable
Snapshot routes can also return snapshot_not_found / snapshot_expired. Requests are rate-limited per key; limits depend on your plan.
MCP-native
Credence also runs as an MCP server, so an agent calls it as native tools inside its own loop — no glue code:
- get_probability — one market
- query_probabilities — up to 100
- search_markets — find the market
Same probability object as REST. Available to design partners today.
Request access
API keys and MCP server access are issued to design partners and early-access developers ahead of public launch.