Partner API
v1 25 EndpointsOne API key. Two integration models. Zero PII. Everything you need to embed conviction markets into your platform.
Core Concepts
How it works
Three things to understand before you start integrating.
One API Key
Your API key encodes your partner identity. No separate headers, no partner ID in payloads. We decode the key and know who's calling.
pk_live_<hash> pk_test_<hash>Two-Tier Security
Non-financial (search, feed, prices) — API key validates, execute. Fast path.
Financial (join, withdraw, resale) — API key + DB ownership check. Prevents cross-partner access.
Zero PII
Users are identified by opaque external_id only. Emails, names, and personal data are rejected at validation.
Format: ^[a-zA-Z0-9_-]{4,128}$
Account Lifecycle
Five steps from zero to trading
Create an account, fund the wallet, join markets. That's the core loop.
Create Account
Partner calls POST /v1/accounts with an external_id. AnyBid returns account_id + deterministic wallet address.
Fund Wallet
Partner sends USDC on-chain to the wallet address. AnyBid detects deposits automatically.
Join Markets
User picks a side and backs 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
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/{market_id}/pricesLightweight price refresh
/v1/feedPersonalized recommendations (requires account_id)
/v1/accounts/{account_id}/onboardInitialize interest profile
/v1/healthService status
Group 3
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"
}Group 4
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 5
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 6
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 7
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
| 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 |
| 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 |
| market.created | New market on network | market_id, title |
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..."
}
}Complete Surface
25 Endpoints
Seven groups. Two auth levels. One API key.
| Group | Count | Auth Level | Priority |
|---|---|---|---|
| Accounts | 3 | API Key (create/read) | P0 |
| Discovery | 6 | API Key only | P0 |
| Market Creation | 3 | Financial on create, API Key on quotes | P0 |
| Join Market | 3 | Financial on join, API Key on read | P0 |
| Resale | 4 | Financial on all write ops | P1 |
| Withdrawals | 2 | Financial | P0 |
| Webhooks | 4 | API Key (partner-level) | P0 |
| Total | 25 | ||
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)
Ready to integrate?
One API key. Six weeks to production. Your brand, your users, your revenue.