# Sandbox

Anonymous self-serve sandbox key in 30 seconds. Same `api.predictasiax.com` host. Tier-capped so nothing you do can move real money. No email required.

**Sandbox is now a *tier*, not a separate environment.** Previously PAX operated a dedicated `sandbox.predictasiax.com` host with faucet + mock-oracle. As of v2.0.0 (2026-08-19), sandbox lives on the same production API with a per-key `tier=sandbox` flag that hard-caps orders at $10 each and $100/day. Orders fill in a simulation: the key starts with 1,000 virtual USDT, a buy at or above the market's current price fills at that price, and a lower limit rests until the price reaches it. Responses carry `is_simulated: true`; no real funds move.

## Mint a sandbox key

Anyone, from any IP, no authentication:

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

Response:

```
{
  "data": {
    "sk": "sk_live_abcdef0123...",       // this is your bearer — shown ONCE
    "api_key_id": "api_sbx_...",
    "builder_id": "bld_sbx_...",
    "app_id":     "app_sbx_...",
    "tier": "sandbox",
    "caps": {
      "max_order_usdt": "10",
      "daily_notional_usdt": "100"
    },
    "expires_at_ms": 1789741484472,      // 30 days out
    "sandbox_url": "https://api.predictasiax.com",
    "docs_url":    "https://docs.predictasiax.com/getting-started",
    "upgrade_url": "https://docs.predictasiax.com/request-access.html",
    "notice":      "Sandbox keys expire in 30 days. ..."
  }
}
```

**Anti-abuse limits.** `POST /v1/sandbox-keys` is rate-limited to **1 mint per IP per day** and **1 mint per browser fingerprint per day**. Both limits must clear. This protects against key-spam. Every subsequent mint from a hit-limit source returns `429 RATE_LIMITED`.

## What sandbox tier can do

| Capability | Sandbox tier | Trade-capped tier | Trade-full tier |
|---|---|---|---|
| Read markets, movers, resolution | Yes | Yes | Yes |
| Read own portfolio + orders | Yes | Yes | Yes |
| Place orders | Yes, up to $10 each, filled in a simulation (1,000 virtual USDT) | Yes, up to $100 each | Uncapped |
| Daily notional cap | $100 | $1,000 | Uncapped |
| Cancel orders | Yes | Yes | Yes |
| Rate limit | Per-scope budget, **identical at every tier** — see [Rate Limits](https://docs.predictasiax.com/rate-limits) |  |  |
| Fee-attribution ledger | No (simulated fills write nothing to the ledger) | Yes | Yes |
| Attributable to your app | Attribution headers accepted; simulated fills accrue nothing | Yes | Yes |
| Expiry | 30 days from mint | Perpetual | Perpetual |

Everything else on the API works the same. An order runs through the same validation and tier-cap checks as production, then fills in a simulation instead of the real book. Each key starts with 1,000 virtual USDT. A buy at or above the market's current price fills immediately at that price; a lower limit rests, holding its amount in `reserved_usdt`, and fills once the price reaches it (checked whenever the key reads `/v1/orders`, `/v1/positions`, `/v1/balance` or `/v1/portfolio`). Cancelling returns the reserve. Every simulated response carries `is_simulated: true` in `data` and `meta`; nothing touches real balances or the fee ledger. Positions are marked to the current price and are not settled when a market resolves, and there is no `faucet`, `reset` or deposit endpoint. Real fills need a production key (see [Moving up from sandbox](https://docs.predictasiax.com/sandbox/#upgrade)).

## Use your key

```
# List markets
curl https://api.predictasiax.com/v1/markets \
  -H "Authorization: Bearer $SK"
MARKET_ID=...   # an "id" from the list

# Place a $1 order (well within $10 cap)
curl -X POST https://api.predictasiax.com/v1/orders \
  -H "Authorization: Bearer $SK" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: my-first-order-$(date +%s)" \
  -d '{
    "market_id":       "'"$MARKET_ID"'",
    "side":            "yes",
    "price":           "0.55",
    "size":            "2",
    "client_order_id": "cli-001"
  }'
# → 201, simulated fill at the market's current price (or status "open" if your limit is lower):
#   {"data": {"order_id": "sbx_ord_...", "status": "filled", "fill_price": "0.42", ...,
#             "is_simulated": true}, "meta": {..., "is_simulated": true}}

# Virtual balance and positions
curl https://api.predictasiax.com/v1/balance -H "Authorization: Bearer $SK"
curl https://api.predictasiax.com/v1/positions -H "Authorization: Bearer $SK"

# Order over $10 → 429 TIER_LIMIT_EXCEEDED with detail:
#   { "tier": "sandbox", "cap": "10" }
```

## Moving up from sandbox

Sandbox is for zero-friction exploration. When you're ready to route real user flow, there is no review queue, NDA, or approval step:

1. **Get an attributed production key.** Submit [Request access](https://docs.predictasiax.com/request-access) and pick a track — every track returns a live `sk_live_*` key in the response body immediately, on the `self_serve` tier. No human review, no NDA.
2. **Capability climbs automatically by volume.** The graduation cron lifts your key on its own as your 30-day attributed trading volume grows — `self_serve` → `read_live` ($100) → `trade_capped` ($1,000) → `trade_full` ($50,000) → `partner` ($1,000,000), with `admin_signoff: false` on every rung. `genesis` is a live top-20 volume ranking, auto-granted — never an application. See [How Tiers Work](https://docs.predictasiax.com/how-tiers-work).

**One prefix, one host, tier-scoped.** All sandbox and production keys use the `sk_live_*` prefix and target `api.predictasiax.com/v1`. The `tier` flag on the key controls capability — `sandbox` caps orders at $10 each / $100 daily and fills them in a simulation against 1,000 virtual USDT, and higher trust tiers raise your per-order and daily *notional* ceilings (see the table above). Request rate limits are identical at every tier — climbing tiers never changes your request rate. Promote by climbing the automatic volume ladder — no code change, no host switch.

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