Partner API
v1 35 EndpointsTwo API surfaces. HMAC-signed financial operations. Zero PII. Everything you need to embed prediction and conviction markets into your platform — external markets from the network, or internal markets created by your users.
OpenAPI 3.1
Full spec. Auto-generated client libraries.
SDKs
Python, Node.js, Go — official clients.
Sandbox
Full test environment. pk_test_* keys. No real money. Same API surface.
Core Concepts
How it works
Three things to understand before you start integrating.
Two-Tier Auth
Two credentials. One API key (pk_*) identifies your partner account — used on every request. One signing secret (sk_*) authenticates financial operations via HMAC-SHA256.
Read ops (search, feed, prices) — API key only. Fast path.
Financial ops (join, withdraw, resale) — API key + HMAC signature + timestamp. Prevents replay and tampering.
pk_{env}_{partner}_{32B base62} sk_{env}_{partner}_{32B base62} Header: X-AnyBid-Timestamp
Header: X-AnyBid-Signature
HMAC-SHA256(sk, timestamp + method + path + body)
Zero PII
Users are identified by opaque external_id only. We never store, process, or transmit personal data. Emails, names, phone numbers, and addresses are rejected at the validation layer — not filtered, rejected.
This is a hard architectural constraint, not a policy toggle. There is no admin override, no "just this once" field. Our database schema has no column for PII. Your compliance team will love us.
You own the user relationship. We own the market infrastructure. The external_id is the only bridge between the two — and it's opaque by design.
Format: ^[a-zA-Z0-9_-]{4,128}$
Coming Next
IP Whitelist — restrict API access to known server IPs. Extra layer on top of key auth.
gRPC — all AnyBid internal services already communicate via gRPC. We're extending this to the partner surface. Benefits: binary Protobuf (smaller payloads, faster serialization), bi-directional streaming, strongly typed contracts, HTTP/2 multiplexing.
REST isn't going anywhere — gRPC will be an additional option for partners who want lower latency and type safety.
Account Lifecycle
Six steps from zero to trading
Create an account, discover markets, fund the wallet, trade. That's the core loop.
Create Account
Partner calls POST /v1/accounts with an external_id. AnyBid returns account_id + deterministic wallet address.
Discover Markets
Semantic vector search, personalized feed, and deep learning recommendations. Our search embeds every market and matches user interests — your users see what's relevant to them, not a raw list.
Fund Wallet
Partner sends USDC on-chain to the wallet address. AnyBid detects deposits automatically.
Create or Join Markets
Create a new market from a natural language claim (quote → create flow), or join an existing one by picking a side and backing it with funds. Wallet balance checked, funds locked, matched peer-to-peer.
Market Resolves
Outcome determined by data sources. Winnings deposited to wallet automatically.
Withdraw
Partner requests withdrawal to any valid ERC20 address. USDC sent on-chain.
Integration Models
Two ways to integrate
Same API, same key, same endpoints. Choose the model that fits your team.
Model A: Headless API
Server-to-server contract. Your backend is the trust boundary. Build your own UI, your own UX, your own experience. Every endpoint in this doc is available to you.
Your frontend → Your backend → AnyBid API
Full control. Full flexibility.
Model C: Companion App
A white-labeled, pre-built prediction market UI deployed under your domain. Themed to your brand — colors, logo, radius, fonts. Open source, so you can inspect every line.
Your platform → Token redirect → Companion App → AnyBid API
Fastest path to production.
How the Companion App works
Architecture
- SvelteKit frontend + thin proxy backend
- Backend uses the same Headless API — no privileged access
- Auth via one-time token redirect from your platform
- Real-time updates via Server-Sent Events (webhook → SSE push)
Theming
- Config-driven — one file per partner
- Brand color, surface, text, radius, logo
- Maps to CSS custom properties at runtime
- No build step for rebranding — one config change, one deploy
export const theme = {
brand: '#FF6B00',
surface: '#FFFFFF',
text: '#1A1A1A',
radius: '8px',
logo: '/brand/logo.svg'
};The companion app is open source. Without an API key, it's an empty shell — the value is in the infrastructure, not the UI code.
Group 1
Accounts
Create user accounts and wallets. Idempotent — same external_id returns the existing record.
/v1/accountsCreate account — returns account_id + wallet address
/v1/accounts/{account_id}Get account info + wallet + balance
/v1/accounts/batchBatch create accounts (migration)
{
"external_id": "usr_abc123"
}{
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"external_id": "usr_abc123",
"wallet_address": "0x7a3b...f4e2",
"balance_usdc": "0.00",
"created": true
}{
"error": "invalid_external_id",
"message": "external_id must be 4-128 characters, alphanumeric with _ and - only. No emails, no personal data."
}Group 2
Markets (Discovery)
Search, browse, and get personalized recommendations. Non-financial — fast path, no ownership checks.
/v1/markets/searchSemantic vector search across markets
/v1/markets/{market_id}Single market detail
/v1/markets/batchBatch fetch markets by ID (max 50)
/v1/markets/{market_id}/pricesLightweight price refresh
/v1/feedPersonalized recommendations (requires account_id)
/v1/accounts/{account_id}/onboardInitialize interest profile
/v1/healthService status
Group 4
AI Reports
LLM-generated market analysis with real-time data from news and social APIs. GET is free once generated. POST triggers generation and deducts from wallet.
/v1/markets/{market_id}/reportFetch generated report (free)
/v1/markets/{market_id}/reportGenerate AI report (paid, deducts from wallet)
POST deducts the report fee from the requesting account's wallet. Once generated, GET returns the cached report at no cost. Fires report.generated webhook on completion.
{
"report_id": "rpt_2026_abc123",
"market_id": "f8590e95-5037-4564-8acb-43abed05c149",
"status": "completed",
"generated_at": "2026-02-06T12:30:00Z",
"summary": "Based on historical halving cycles and current macro conditions...",
"confidence_score": 0.72,
"data_sources": ["coingecko", "glassnode", "fed_funds_rate"],
"sections": ["price_history", "on_chain_metrics", "macro_environment"]
}Group 5
Market Creation
Two-step process: generate a quote, then create the market. Quote locks all parameters — tamper-proof.
/v1/quotesGenerate settlement quote for a claim
/v1/quotes/{quote_id}Check quote status
/v1/markets/create/{quote_id}Create market from approved quote
Step 1: Generate Quote
{
"statement": "Bitcoin will exceed $150,000 by December 31, 2026",
"settlement_date": "2027-01-01T00:00:00Z"
}{
"quote_id": "quo_2026_abc123_def456",
"settleable": true,
"tier": "AAA",
"market_class": "HIGH_LOW",
"fee": { "amount": "0.50", "currency": "USD" },
"expires_at": "2026-02-06T12:15:00Z",
"parsed_claim": {
"subject": "Bitcoin price",
"predicate": "above",
"threshold": 150000,
"threshold_unit": "USD"
},
"data_coverage": {
"total_endpoints": 5,
"unique_providers": 3,
"coverage_level": "excellent"
}
}Step 2: Create Market
{
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"fee_percent": 2.5
}{
"market_id": "f8590e95-5037-4564-8acb-43abed05c149",
"status": "active",
"quote_id": "quo_2026_abc123_def456",
"fee_percent": 2.5,
"title": "Bitcoin will exceed $150,000 by December 31, 2026",
"outcome_a": "Yes",
"outcome_b": "No",
"deadline": "2027-01-01T00:00:00Z"
}Settlability Tiers
Every claim is evaluated for settlability. The tier determines data coverage quality and the creation fee. Tiers are deterministic — same claim, same data sources, same tier. No surprises.
| Tier | Data Coverage | Indicative Fee |
|---|---|---|
| AAA | Excellent — multiple redundant data sources, high confidence | ~$0.02 |
| AA | Strong — reliable primary source with backup | ~$0.10 |
| A | Good — single reliable source | ~$0.50 |
| BBB | Adequate — data available but coverage gaps | ~$1.00 |
| BB | Limited — fewer sources, manual review possible | ~$2.00 |
| B | Minimal — best-effort resolution | ~$4.00 |
Fee philosophy: Fees are deterministic — they reflect the actual cost of aggregating and monitoring data endpoints for settlement. Our goal is to cover infrastructure costs, not to profit from market creation. Exact values may adjust between seasons as we refine data source agreements, but the tier a claim receives is always predictable and reproducible.
Group 6
Join Market
The money action. User picks a side and backs it with funds from their wallet.
/v1/markets/{market_id}/joinJoin a market (side + amount)
/v1/accounts/{account_id}/entriesList markets account has joined
/v1/accounts/{account_id}/entries/{entry_id}Single entry detail
{
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"side": "yes",
"amount_usdc": "50.00"
}{
"entry_id": "a29f4e71-8c3d-4b5a-9e6f-7d8c9b0a1e2f",
"market_id": "f8590e95-5037-4564-8acb-43abed05c149",
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"side": "yes",
"amount_usdc": "50.00",
"odds_at_entry": 0.65,
"potential_payout": "76.92",
"fee_charged": "1.25",
"status": "open"
}Status lifecycle: open → matched → won | lost
{
"error": "insufficient_balance",
"available_usdc": "25.00",
"required_usdc": "51.25",
"breakdown": {
"amount": "50.00",
"fee": "1.25"
}
}Group 7
Resale
Selling a betting slip. Not trading. Conviction-compatible exit.
/v1/resaleList an entry for resale
/v1/resale/{listing_id}Cancel a listing
/v1/resale/{listing_id}/buyBuy someone's listed entry
/v1/markets/{market_id}/resaleBrowse available listings for a market
{
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"entry_id": "a29f4e71-8c3d-4b5a-9e6f-7d8c9b0a1e2f",
"ask_price_usdc": "55.00",
"resale_target": "marketplace"
}{
"listing_id": "b38e5f82-9d4e-5c6b-af70-8e9d0c1b2f3a",
"entry_id": "a29f4e71-8c3d-4b5a-9e6f-7d8c9b0a1e2f",
"ask_price_usdc": "55.00",
"resale_target": "marketplace",
"status": "listed",
"expires_at": "2026-02-13T12:10:00Z"
}Two targets: marketplace (another user buys at asking price) or matching_engine (sell back at current odds, guaranteed fill).
Group 8
Withdrawals
Financial action with its own lifecycle. Destination can be any valid ERC20 address.
/v1/withdrawalsRequest withdrawal to any ERC20 address
/v1/withdrawals/{withdrawal_id}Check withdrawal status
{
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"amount_usdc": "100.00",
"destination_address": "0xdef..."
}{
"withdrawal_id": "c47f6a93-ae5f-6d7c-b081-9fae1d2c3a4b",
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"status": "processing",
"amount_usdc": "100.00",
"settlement_fee": "0.03",
"net_amount": "99.97",
"estimated_completion_seconds": 300
}Group 9
Webhooks
Partner-level event delivery. Register endpoints, receive signed events with exponential backoff retry.
/v1/webhooksRegister webhook endpoint
/v1/webhooksList registered webhooks
/v1/webhooks/{webhook_id}Remove webhook
/v1/webhooks/{webhook_id}/testSend test event
Event Catalog — 19 Events
| Event | Trigger | Key Fields |
|---|---|---|
| market.joined | Join submitted to contract | entry_id, market_id, account_id, side, amount |
| market.joined.matched | Fully matched peer-to-peer | entry_id, account_id, tx_hash |
| market.joined.failed | Match failed | entry_id, account_id, reason |
| market.resolved | Outcome determined | market_id, outcome, resolution_source |
| market.settled | Payouts executed | market_id, proof_bundle_url |
| market.created | New market on network | market_id, title |
| market.paused | Paused by AnyBid | market_id, reason |
| market.resumed | Resumed after pause | market_id |
| market.voided | Voided + refunds issued | market_id, reason, refund_count |
| balance.updated | Any balance change | account_id, new_balance, change_amount, reason |
| withdrawal.completed | Withdrawal on-chain | withdrawal_id, account_id, tx_hash |
| resale.listed | Entry listed for resale | listing_id, entry_id, account_id, ask_price |
| resale.sold | Resale executed | listing_id, buyer_account_id, seller_account_id, price |
| resale.cancelled | Listing cancelled/expired | listing_id, reason |
| report.generated | AI report completed | report_id, market_id, account_id |
| comment.deleted | Comment soft-deleted | comment_id, market_id, account_id |
| comment.flagged | Flagged by another partner | comment_id, flagged_by_partner |
| account.warned | Moderation warning issued | account_id, reason |
| account.suspended | Account suspended | account_id, reason, suspended_until |
Delivery Envelope
Signed with X-AnyBid-Signature (HMAC-SHA256).
Retry: 30s → 2min → 10min → 1hr → 6hr. Dead letter after 5 failures. Expected: 2xx within 5 seconds.
{
"event": "market.joined.matched",
"event_id": "e69b8cb5-ca7b-8f9e-d2a3-b1ca3f4e5c6d",
"timestamp": "2026-02-06T12:10:05Z",
"data": {
"entry_id": "a29f4e71-8c3d-4b5a-9e6f-7d8c9b0a1e2f",
"market_id": "f8590e95-5037-4564-8acb-43abed05c149",
"account_id": "550e8400-e29b-41d4-a716-446655440000",
"side": "yes",
"amount_usdc": "50.00",
"odds_at_entry": 0.65,
"tx_hash": "0xabc..."
}
}Group 10
Tracking
Batch behavioral events. Fire-and-forget, processed async. Zero extra round trips with piggyback.
/v1/tracking/eventsBatch behavioral events (fire-and-forget)
How _piggyback works
Every API request you're already making can carry tracking data as a free rider — no extra HTTP call needed.
- POST requests — add a
_piggybackfield to the JSON body. It's stripped before processing and forwarded to the tracking pipeline. - GET requests — set the
X-Piggybackheader with base64-encoded JSON. Same pipeline, no body required. - Batch endpoint — for high-volume events or when you want to flush a buffer, use
POST /v1/tracking/eventsdirectly.
{
"account_id": "550e8400-...",
"side": "yes",
"amount_usdc": "50.00",
"_piggyback": {
"events": [
{ "type": "page_view", "page": "/market/btc-150k" },
{ "type": "click", "target": "join_button" }
]
}
}GET /v1/markets/f859...
X-Piggyback: eyJ0eXBlIjoicGFnZV92aWV3In0=
// base64 of {"type":"page_view"}Lightweight JS SDK
Coming soonA tiny client-side SDK (~2 KB) that buffers tracking events and automatically attaches them as _piggyback payloads on your next API call. Drop-in for any frontend — no separate tracking endpoint, no extra requests. Just anybid.track('page_view', { page: '/market/btc' }) and it rides along on whatever API call fires next.
Partner Mod API
Comment Moderation
Moderate comments from your own users. Flag content from other partners' users for review.
Key principle: You have delete authority over your own users' comments. For comments by other partners' users, you can only flag — AnyBid reviews and acts.
/v1/mod/comments/{comment_id}Delete own user's comment
/v1/mod/comments/{comment_id}/flagFlag comment for review
/v1/mod/comments/flaggedList flags you've submitted
/v1/mod/comments/reportedYour users flagged by others
{
"comment_id": "d58g7b04-fe6c-7e8d-c192-0gbf2e3d4a5c",
"status": "deleted"
}{
"error": "not_your_user",
"message": "Comment belongs to another partner's user. Use POST /flag instead."
}{
"reason": "spam",
"details": "Repeated promotional content"
}{
"flag_id": "flg_2026_xyz789",
"comment_id": "d58g7b04-fe6c-7e8d-c192-0gbf2e3d4a5c",
"status": "pending_review",
"created_at": "2026-02-06T15:00:00Z"
}{
"flags": [
{
"flag_id": "flg_2026_xyz789",
"comment_id": "d58g7b04-fe6c-7e8d-c192-0gbf2e3d4a5c",
"reason": "spam",
"status": "pending_review",
"created_at": "2026-02-06T15:00:00Z"
}
],
"total": 1,
"page": 1
}Complete Surface
35 Endpoints
Two API surfaces. Two auth levels. One API key.
Partner API — 31 Endpoints
| Group | Count | Auth Level | Priority |
|---|---|---|---|
| Accounts | 3 | API Key (create/read) | P0 |
| Markets (Discovery) | 7 | API Key only | P0 |
| Comments | 2 | API Key | P1 |
| AI Reports | 2 | API Key + Signed on generate | P1 |
| Market Creation | 3 | Signed on create, API Key on quotes | P0 |
| Join Market | 3 | Signed on join, API Key on read | P0 |
| Resale | 4 | Signed on all write ops | P1 |
| Withdrawals | 2 | Signed | P0 |
| Webhooks | 4 | API Key (partner-level) | P0 |
| Tracking | 1 | API Key | P1 |
| Subtotal | 31 | ||
Partner Mod API — 4 Endpoints
| Group | Count | Auth Level | Priority |
|---|---|---|---|
| Comment Moderation | 4 | API Key | P1 |
| Subtotal | 4 | ||
Total: 35 endpoints across 2 API surfaces
Funding
What we do and don't do
Blockchain is the deposit mechanism. We watch the chain and update balances. You handle collection.
We do
- ✓ Generate deterministic wallet address per account at creation
- ✓ Watch on-chain for incoming USDC to known wallets
- ✓ Update balance when deposits confirm
- ✓ Fire
balance.updatedwebhook - ✓ Reject joins when balance insufficient (with exact shortfall)
- ✓ Process withdrawals to any valid ERC20 address
We don't
- ✗ Collect money from users (partner's responsibility)
- ✗ Convert fiat to USDC (partner's responsibility)
- ✗ Provide deposit notification endpoint (the chain is the notification)
- ✗ Care when or how the partner funds wallets
- ✗ Restrict withdrawal destinations (valid address = we send it)
Developer Tooling
Everything you need to ship
Tools, specs, and environments to accelerate your integration.
Available Now
- ✓ Full REST API with JSON responses
- ✓ Sandbox environment (
pk_test_*keys) - ✓ Webhook testing endpoint (
POST /v1/webhooks/{id}/test) - ✓ Idempotent account creation
- ✓ HMAC request signing for financial security
How We Build
We build what you actually need
Not what we think you need. Every feature on this page exists because a partner asked for it.
Partner-Driven Roadmap
We work closely with every partner. Our roadmap is shaped by your real integration challenges, not internal assumptions. Comments, AI Reports, the tier system, piggyback tracking — all built because partners told us they needed it.
We focus on core infrastructure — settlement, matching, data aggregation — and extend the surface based on what you actually hit in production.
Request a Feature
Missing something? Tell us. We love feedback because it means we're building the right thing. Every partner gets a direct line to the engineering team.
Feature requests go into a shared backlog, prioritized by partner demand. If multiple partners need it, it ships fast. If it's unique to your use case, we'll work with you on the design.
Ready to integrate?
One API key. Six weeks to production. Your brand, your users, your revenue.
Group 3
Comments
Market discussion threads. Semi-anonymized. Cross-platform visibility. Intelligent backend does the heavy lifting.
/v1/markets/{market_id}/commentsRead comment thread
/v1/markets/{market_id}/commentsPost a comment
How comments work
has_entry: true) are automatically ranked higher. No action required from partners — our backend links positions to comments and surfaces skin-in-the-game signal.Content filtering
$0.50per report. This prevents spam flagging while keeping moderation accessible. Fee deducted from wallet.