# Start building on PredictAsiaX

Same API, same host, four paths in. Pick the one that matches how you already work — the underlying platform is identical.

[Solo developer](https://docs.predictasiax.com/onboarding#path-solo)

Best for: individuals, hackathons, exploration

Anonymous sandbox key in 30 seconds. No email, no signup. Same production URL, tier-capped for safety. Move to production when ready.

~30 sec to first key ~5 min to first order No signup

[Migrating an existing bot](https://docs.predictasiax.com/onboarding#path-migrate)

Best for: teams porting a client

PAX ships the 5-header HMAC signing pattern (`PAX-ADDRESS` / `PAX-TIMESTAMP` / `PAX-NONCE` / `PAX-SIGNATURE`). Swap URL + credentials, adapt endpoint shapes via the migration guide.

~1-2 hours port Same signing scheme

[AI agent builder](https://docs.predictasiax.com/onboarding#path-agent)

Best for: Claude Desktop, Cursor, Windsurf, custom MCP clients

Published in the official MCP Registry as `com.predictasiax/mcp`. One-line config, 46 agent tools available immediately (`market_search`, `place_order`, `portfolio_read`, `cancel_order`, `docs_search`, RFQ + subaccount + composer-resolution + webhook + access-request tools, ...).

~2 min setup 46 tools MCP Registry

[Organization / commercial](https://docs.predictasiax.com/onboarding#path-org)

Best for: production apps, revenue attribution, higher tiers

Submit an application via `POST /v1/apply` with your track. Every track — including `genesis` and `institutional` — returns a live `sk_live_*` key in the response body immediately. No human-review queue; capability climbs the automatic volume ladder.

Every track: seconds Attribution + revenue ledger

**Not sure which path?** Start with [Solo developer](https://docs.predictasiax.com/onboarding#path-solo). The anonymous sandbox key works on the real production host with tier caps that hard-limit any accidental action to $10 per order, $100 per day. Upgrade the path (migration, agent, or org) later without rotating credentials.

## Solo developer — 30 seconds to first key

Public endpoint, no authentication, no email. Rate-limited to 1 mint per IP + 1 per browser fingerprint per day. Same host as production — sandbox tier is a flag on the key, not a separate URL.

Deep dive: [Full 6-step curl walkthrough](https://docs.predictasiax.com/getting-started) [Sandbox reference](https://docs.predictasiax.com/sandbox/) [Auth guide](https://docs.predictasiax.com/auth)

**1. Mint an anonymous sandbox key**

```
curl -X POST https://api.predictasiax.com/v1/sandbox-keys \
  -H "Content-Type: application/json" \
  -d '{"org_name":"my-app"}'
```

**2. Save the key (shown once) + set env**

```
export SK=sk_live_7d40ce10_12b638913cadfbbd...
```

**3. Install an official SDK — or stick with curl**

```
# Python (3.0.0+ required for the current gateway)
pip install "pax-api>=3"

# TypeScript / Node (3.0.0+)
npm i @predictasiax/api@3

# Or use curl / Postman collection — no SDK required
```

**4. Place your first order (Python)**

```
from pax_api import PaxClient

# pip install "pax-api>=3"
with PaxClient(api_key="$SK") as pax:
    markets = pax.list_markets(category="crypto", limit=5)
    order = pax.place_order(                      # limit BUY of the YES outcome
        market_id=markets["data"]["markets"][0]["id"],
        side="yes", price="0.55", size="2",
        client_order_id="my-first-order",
    )
    print(order)
```

5

**Ready for production?** Sandbox caps orders at $10 each / $100 daily. The caps lift automatically as your 30-day volume grows — `trade_capped` at $1,000, `trade_full` at $50,000 30-day volume. Same URL, same key format; the tier flag updates in place on its own. No upgrade request, no human step.

## Migrating an existing bot

Any bot that speaks `Authorization: Bearer` ports directly — no request-signing rewrite needed for the standard live surface. Endpoint shapes and market conventions differ from other venues; the guide below maps them one-for-one.

Deep dive: [Auth (Bearer + OAuth)](https://docs.predictasiax.com/auth) [Full REST reference](https://docs.predictasiax.com/openapi)

**1. Read the endpoint mapping table**

**2. Get sandbox credentials**

Same 30-second flow as Solo path: `POST /v1/sandbox-keys`. Every key can sign requests — the same credential works as `Authorization: Bearer` or as an HMAC signature ([PAX-* headers](https://docs.predictasiax.com/auth#hmac)); no separate "signing key" to mint.

**3. Point your client at PAX**

```
BASE_URL = "https://api.predictasiax.com/v1"

# PAX HMAC headers (POLY-* aliases also accepted):
#   PAX-ADDRESS   = <api_key_id>      # the api_... id, NOT the secret
#   PAX-TIMESTAMP = <unix_seconds>
#   PAX-NONCE     = <fresh random per request>
#   PAX-SIGNATURE = base64(HMAC_SHA256(apiSecret, signingString))
#
#   apiSecret     = your full sk_live_... / sk_test_... value
#   signingString = [timestamp, nonce, method, path, body].join("\n")
#                   path includes query string; body is "" when empty
# Existing signer using POLY-* header names? Keep them, repoint the canonical
# string to the five newline-joined fields above. Full example: /auth#hmac
```

**4. Adapt response shape**

All PAX responses use a top-level `data` envelope; monetary fields are decimal strings (never floats). Market IDs are `m_<sha256[0:16]>` — deterministic and idempotent. See [REST reference](https://docs.predictasiax.com/openapi) for full schemas.

**5. Verify fills independently**

Every fill is recorded in a hash-chained event log, Merkle-batched, and anchored to R2. Reconstruct inclusion proofs client-side via [/verify](https://docs.predictasiax.com/verify) — six no-auth `/v1/audit/*` endpoints, sorted-pair SHA-256 over raw 32-byte digests.

## AI agent builder (MCP)

PredictAsiaX is published in the official Model Context Protocol Registry as `com.predictasiax/mcp`. Claude Desktop, Cursor, Windsurf and other MCP clients can discover and connect natively.

Deep dive: [MCP server details](https://docs.predictasiax.com/downloads#mcp) [MCP Registry listing](https://registry.modelcontextprotocol.io/v0/servers?search=predictasiax) [Builder tier tools](https://docs.predictasiax.com/builders#what-you-get)

**1. Get a PAX API key**

Any tier works. For personal use: mint via Solo path (`POST /v1/sandbox-keys`). For a distributed product: Org path.

**2. Add the MCP server config**

The server speaks Streamable HTTP at `https://mcp.predictasiax.com/mcp`; the key goes in the `Authorization` header.

Claude Code:

```
claude mcp add --transport http predictasiax https://mcp.predictasiax.com/mcp \
  --header "Authorization: Bearer sk_live_YOUR_KEY"
```

Cursor (`~/.cursor/mcp.json`); in Windsurf (`~/.codeium/windsurf/mcp_config.json`) the URL key is `serverUrl`:

```
{
  "mcpServers": {
    "predictasiax": {
      "url": "https://mcp.predictasiax.com/mcp",
      "headers": { "Authorization": "Bearer sk_live_YOUR_KEY" }
    }
  }
}
```

Claude Desktop starts local servers from `claude_desktop_config.json` (macOS: `~/Library/Application Support/Claude/`), so it connects through the `mcp-remote` bridge (needs Node.js):

```
{
  "mcpServers": {
    "predictasiax": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.predictasiax.com/mcp", "--header", "Authorization:${PAX_AUTH}"],
      "env": { "PAX_AUTH": "Bearer sk_live_YOUR_KEY" }
    }
  }
}
```

The 19 tools that read public data work without a key: market search, detail, order book and price history, movers, top volume, categories, fee estimate, liquidity leaderboard, market templates, resolution evidence, market-maker quotes, access requests, agent examples, health, and `pax.docs_search` and `pax.docs_read`. `tools/list` marks them `_meta.auth: "none"`; a client connected with no header can already read the markets and search these docs.

**3. Restart the client**

The agent will discover 46 tools on connect (call `tools/list` for the full runtime enumeration).

**4. Available tools**

| Tool | Purpose |
|---|---|
| `market_search` | Full-text + facet search across live markets |
| `probability_movers` | Markets with the largest recent probability shift |
| `resolution_evidence` | Pull the underlying source data for a resolved market |
| `portfolio_read` | Positions + P&L for the calling key |
| `place_order` | Submit a trade (tier caps apply) |
| `cancel_order` | Cancel an open order |
| `sandbox_agent_examples` | Guided sample prompts + market scenarios for agent testing |

**5. Talk to your agent**

```
You: "Find any crypto markets where the probability shifted more than 5% in the last hour."
Agent: [calls probability_movers → market_search → returns summary]

You: "Buy 5 shares of YES on the BTC-150k market at 0.42 if it's still open."
Agent: [calls place_order with tier-appropriate caps]
```

## Organization / commercial builder

Submit an application via `POST /v1/apply` with your track. All 20 tracks auto-provision a live `sk_live_*` key on submit — `genesis` and `institutional` included. The track is an attribution label; capability climbs the automatic volume ladder.

Deep dive: [Builder program overview](https://docs.predictasiax.com/builders) [Tiers & benefits](https://docs.predictasiax.com/builders#tiers) [Application form](https://docs.predictasiax.com/request-access) [Apply endpoint reference](https://docs.predictasiax.com/openapi#tag/apply)

**1. Pick a track**

The `track` field tags attribution and sets the starting context. Provisioning is instant for every track — the key always mints on submit.

| Track family | Members | Provisioning |
|---|---|---|
| **Standard** (18 tracks) | `app`, `agent`, `data`, `distribution`, `market`, `liquidity`, `oracle`, `reviewer`, `operator`, `self_serve`, `rfb-japan-app`, `rfb-ai-agent`, `rfb-telegram-bot`, `rfb-news-media`, `rfb-sports`, `rfb-election`, `rfb-terminal`, `rfb-mm-stack` | Returns a live `sk_live_*` key in the response body. Ready to trade in seconds. Starts on `self_serve` tier. |
| **Labelled** (2 tracks) | `genesis` (later granted as a top-20 ranking: uncapped API keys and 1.5× builder points) `institutional` (attribution label only) | Identical behaviour: returns a live `sk_live_*` key in the response body on submit, on `self_serve` tier. No review, no out-of-band step. Capability climbs the automatic volume ladder. |

**2. Submit the application**

```
curl -X POST https://api.predictasiax.com/v1/apply \
  -H "Content-Type: application/json" \
  -d '{
    "track":       "app",
    "org":         "my-project",
    "url":         "https://my-project.com",
    "description": "AI-first prediction market UI for Japan retail."
  }'
```

Or use the [web form](https://docs.predictasiax.com/request-access). Rate-limited to 5 applications per hour per IP. Every field is optional (`track` defaults to `self_serve`) — `org` and `url` enrich your attribution record and [directory](https://docs.predictasiax.com/directory) listing.

**3. Response — auto-provisioning track**

```
{
  "ok":               true,
  "application_code": "ba_<24-hex>",
  "track":            "app",
  "status":           "approved",
  "auto_provisioned": true,
  "api_key":          "sk_live_xxxxxx_...",   // shown ONCE — save now
  "key_prefix":       "xxxxxx",
  "builder_id":       "bld_<12-hex>",
  "app_id":           "app_<12-hex>",
  "api_key_id":       "api_<12-hex>",
  "client_id":        "client_<12-hex>",
  "user_id":          "bld_<12-hex>",      // alias of builder_id
  "tier":             "self_serve",
  "caps":             { "max_order_usdt": "100", "daily_notional_usdt": "1000" },
  "next_step":        "https://docs.predictasiax.com/getting-started",
  "portal_url":       "https://builder.predictasiax.com/",
  "notice":           "Save the api_key — it is returned ONCE. …"
}
```

The key is a live `sk_live_*` on the `self_serve` tier — one rung above an anonymous sandbox key, at $100/order + $1,000/day caps. Send it as `Authorization: Bearer sk_live_…`. Save the `application_code` — you'll use it later to check your application status.

**4. Every track returns the same response**

There is no separate "reviewed track" response — `genesis` and `institutional` return the identical `status: "approved"` body shown above, with a live `sk_live_*` key on the `self_serve` tier. No `pending_review` state, no admin operator, no out-of-band delivery. Poll the application record any time:

```
curl https://api.predictasiax.com/v1/apply/ba_<24-hex>
```

4b

**Tier auto-graduation**

Every key starts on `self_serve` ($100/order + $1,000/day caps — one rung above an anonymous sandbox key's $10/order + $100/day). A background cron scans every 15 minutes and auto-graduates on 30-day volume (fills routed through your builder by `execution_builder_id` attribution, plus your own accounts' fills):

| From tier | To tier | Threshold (30d volume, USDT) |
|---|---|---|
| `self_serve` | `read_live` | $100 |
| `read_live` | `trade_capped` | $1,000 |
| `trade_capped` | `trade_full` | $50,000 |
| `trade_full` | `partner` | $1,000,000 |

Every step is automatic — no admin sign-off anywhere. `genesis` is separate: it is granted automatically to the top 20 builders by 30-day attributed volume (floored at a dedicated $50,000 genesis floor) and auto-revoked when you drop out. Every auto-graduation writes to the `builder_attribution_log` audit trail and, if you provided an email during application, you receive a notification email. Dedup window: 24 h between graduations for the same builder.

**5. Configure & ship**

- **HMAC request signing (live)** — the API key from `/v1/apply` works as `Authorization: Bearer` *or* as an HMAC signature over the `PAX-ADDRESS / TIMESTAMP / NONCE / SIGNATURE` headers (`POLY-*` aliases accepted). No ops provisioning — every active key can sign. See [Auth → HMAC](https://docs.predictasiax.com/auth#hmac).
- **Attribution** — every fill your app routes writes to the 7-actor PAF `financial_event` platform ledger. Split at PAF centre, the same at every tier (effective fee 20 bps at 50/50; floor 8 bps at 0¢/100¢; 25 bps ceiling is a dormant configurable cap): acquisition_builder 0 / execution_builder 0 / operator 0 / market_creator 3 / mm_stipend_pool 5 / lp 2 / platform_net 10 residual. Each bucket scales proportionally with the effective clamped fee. Your income is the [builder fee](https://docs.predictasiax.com/builders#builder-fee) you charge on top of the platform fee on orders you place for other accounts. See [Fee Architecture](https://docs.predictasiax.com/fee-architecture#trading-fee).
- **Revenue + payouts** — `GET /v1/attribution/fills` · `GET /v1/revenue` · `GET /v1/revenue/ledger`. Settle self-serve with `POST /v1/builders/me/settle` (or from the Portal) — no admin operator. It needs `wallet_id` of a verified payout wallet and a `totp_code`: 2FA is mandatory for withdrawals, and payouts unlock 24h after 2FA is activated or replaced. Accrued fees roll into a `withdrawal_state` row, serve an amount-scaled hold window (anti-abuse reserve), then broadcast on-chain automatically; larger amounts hold longer but are never frozen for manual approval.
- **Webhooks (optional)** — `POST /v1/webhooks` registers HMAC-signed event streams: `trade.filled`, `market.resolved`, `payout.available`, `payout.paid`, `auth.token.revoked`.

See [Builders page](https://docs.predictasiax.com/builders) for the full builder-program spec and tier upgrade path.

## What's the same across all paths

Every path lands on the same platform. These invariants hold regardless of how you onboarded:

#### Same base URL

`https://api.predictasiax.com/v1` — sandbox and production share one host. Tier caps are enforced on the key, not by URL swap.

#### Same signing scheme

5-header HMAC pattern (`PAX-*`) for machine-to-machine. Bearer for sandbox. Your users connect your app to their own account on the consent page ([App connections](https://docs.predictasiax.com/builders#app-connections)); you trade for them with `on_behalf_of`.

#### Same fee model

PAF Adaptive taker fee — effective range 8–20 bps (peak at 50/50 = PAF_BASE 20 bps because `4·p·(1−p) ≤ 1`; floor 8 bps at 0¢/100¢; 25 bps is a configurable ceiling, dormant with default PAF_BASE=20). See `PAF_BASE_BPS` in `apps/api/src/index.ts`. 7-actor split, the same at every tier (shares scale proportionally with the effective clamped fee): acquisition_builder 0 / execution_builder 0 / operator 0 / market_creator 3 / mm_stipend_pool 5 / lp 2 (+ platform_net 10 residual that absorbs unfilled attribution). Builders earn the builder fee they set.

#### Same audit chain

Every fill is hash-chained, Merkle-batched, and R2-anchored. Six no-auth `/v1/audit/*` endpoints let any third party independently verify inclusion.

#### Same envelope

REST responses wrap payload in `data`; errors surface in `error` with typed `code`. Money is always a decimal string.

#### Same idempotency

All writes accept an `Idempotency-Key` header. Safe to retry within 24h. Deterministic `market_id` — repeated create returns the same market.

## Where to go next

#### [Getting Started](https://docs.predictasiax.com/getting-started)

Full 6-step curl walkthrough. Mint sandbox key → list markets → place order → see fee ledger → cancel.

#### [REST API Reference](https://docs.predictasiax.com/openapi)

Full request/response schemas across every public tag group, including the audit + portfolio endpoints.

#### [WebSocket API Reference](https://docs.predictasiax.com/asyncapi)

Event catalog + 6 client commands (AUTH / SUBSCRIBE / UNSUBSCRIBE / LOCALE + RFQ_SUBSCRIBE / RFQ_UNSUBSCRIBE for market makers).

#### [Authentication](https://docs.predictasiax.com/auth)

Bearer `sk_live_*` + OAuth 2.1 PKCE; live HMAC request signing.

#### [Public Verifier](https://docs.predictasiax.com/verify)

Interactive Merkle proof verifier + 4-language snippets. Reconstruct proofs client-side.

#### [Builder Program](https://docs.predictasiax.com/builders)

Full spec: tiers, attribution model, weekly PAX rewards, payouts.

#### [Downloads](https://docs.predictasiax.com/downloads)

OpenAPI + AsyncAPI in YAML/JSON. Postman collection + SDKs (Python + TypeScript). Codegen ready.

#### [Error Codes](https://docs.predictasiax.com/errors)

Typed error codes across all surfaces. Actionable messages, correlation via `request_id`.

#### [Rate Limits](https://docs.predictasiax.com/rate-limits)

Independent fair-use buckets per endpoint category — the same published limits at every tier.

Source: https://docs.predictasiax.com/onboarding
