API Docs
Binary-2048 API v0.1.0
OpenAPI JSON source: /api/openapi
Docs hub: /docs | User guide: /docs/user | Developer guide: /docs/developer
Interactive explorer
64 operations shown
/api/ads/rewardPOSTGrant rewarded-ad inventory after server-side signature and anti-fraud checks
Request body: documented
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Reward granted400Invalid payload401Invalid reward signature403Ad rewards disabled or paid-tier blocked409Replay nonce detected429Cooldown or daily cap reached
/api/auth/bridge-tokenPOSTMint auth-bridge bearer token from authenticated Auth.js session
Request body: documented
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Auth bridge token minted401Authenticated session required503Auth bridge secret not configured
/api/auth/dev-tokenPOSTDev-only auth bridge token minting helper (env-gated)
Request body: documented
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Dev auth token minted404Endpoint disabled503Auth bridge secret not configured
/api/auth/entitlements/proofPOSTMint short-lived entitlement proof from signed auth bridge token
Request body: documented
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Entitlement proof minted401Invalid auth token403Authenticated user required503Proof issuance not configured
/api/bots/tournamentPOSTRun server-side AI-vs-AI tournament for configured seeds
Request body: documented
Parameters: x-api-key (header)
Authentication: Scoped x-api-key (tournament:run), configured research subject, or admin authority required
Required scopes: tournament:run
Rate limit: bots_tournament: default 10 requests / 5 minutes; 128 KiB body; maximum 100 seeds, 2,000 moves/run, 25,000 aggregate decisions, and 2,500 trace decisions; challenge policy; compute-class 150 jobs/month and global budgets apply
Schema/version: tournament-job-v2
Request example: { seedCount: 3, maxMoves: 250, bots: ['priority', 'rollout'] }
Response example: Tournament result or { jobId, status, statusUrl, resultUrl }
200Tournament result with ranking and run summaries202Queued on isolated compute; poll statusUrl, then fetch resultUrl400Invalid tournament payload401Research credential required403Credential lacks tournament:run or configured anti-abuse challenge required413Tournament body exceeds 128 KiB429Rate limit or worker budget exceeded503Endpoint disabled, tournament capacity reached, or queue wait timed out
/api/challenges/dailyGETGet Bitstorm Daily challenge and daily leaderboard window
Request body: none
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Daily challenge payload
/api/challenges/daily/submitPOSTSubmit replay for Bitstorm Daily leaderboard
Request body: documented
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Daily replay submission result400Invalid submission payload
/api/challenges/ghost-raceGETGet ghost race challenge (rollout bot replay on selected seed)
Request body: none
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Ghost race challenge payload
/api/challenges/ghost-race/submitPOSTSubmit replay for ghost race comparison
Request body: documented
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Ghost race submission result400Invalid submission payload
/api/gamesPOSTCreate a game session
Request body: documented
Parameters: none
Authentication: Public; no credential is required
Required scopes: none
Rate limit: No route-local request quota
Schema/version: session-schema-v2
Request example: { config?: { seed: 42 }, mode?: 'classic' | 'bitstorm' | 'numbers-only' }
Response example: { id, current, recoverySnapshot, integrity, mode }
200Game created400Invalid request
/api/games/{id}GETGet game state by id
Request body: none
Parameters: id (path), required
Authentication: Public; no credential is required
Required scopes: none
Rate limit: No route-local request quota
Schema/version: session-schema-v2
Response example: { id, current, recoverySnapshot, integrity }
200Game found404Game not found
/api/games/{id}/encodedGETGet AI-friendly encoded state
Request body: none
Parameters: id (path), required
Authentication: Public; no credential is required
Required scopes: none
Rate limit: No route-local request quota
Schema/version: encoded-state-v1
Response example: { encoded, encodedFlat, actionMask }
200Encoded state404Game not found
/api/games/{id}/exportGETExport game JSON
Request body: none
Parameters: id (path), required, compact (query), audit (query)
Authentication: Public; no credential is required
Required scopes: none
Rate limit: No route-local request quota
Schema/version: game-export-v1
Response example: Versioned game export or compact replay
200Export JSON404Game not found
POSTRecover a missing session and export game JSON
Request body: documented
Parameters: id (path), required, compact (query), audit (query)
Authentication: Public; no credential is required
Required scopes: none
Rate limit: No route-local request quota
Schema/version: checkpoint-tail-v1
Request example: { compactRecovery }
Response example: Recovered versioned game export
200Recovered export JSON400Invalid recovery payload404Game not found
/api/games/{id}/movePOSTApply one move
Request body: documented
Parameters: id (path), required, x-api-key (header)
Authentication: Optional x-api-key; missing or invalid keys use the IP/account quota
Required scopes: none
Rate limit: game_move: default 600 requests / 5 minutes; API-key counters are shared
Schema/version: turn-hash-checkpoint-v1
Request example: { dir: 'left', expectTurn, expectStateHashVersion, expectStateHash }
Response example: { current, stateHash, stateHashVersion, sync }
200Move applied with versioned authoritative state identity; compact clients receive a signed recovery checkpoint every 25 persisted moves, on recovery, and at terminal state400Invalid move or unsupported explicit state-hash/compact-sync version404Game not found409State-hash precondition or persistence conflict429Gameplay move rate limit exceeded503Session storage temporarily unavailable
/api/games/{id}/replayGETGet canonical replay payload (header + moves)
Request body: none
Parameters: id (path), required
Authentication: Public; no credential is required
Required scopes: none
Rate limit: No route-local request quota
Schema/version: replay-v1
Response example: { header, moves, signature? }
200Replay payload404Game not found
/api/games/{id}/undoPOSTUndo the last move
Request body: none
Parameters: id (path), required
Authentication: Public; no credential is required
Required scopes: none
Rate limit: No route-local request quota
Schema/version: session-schema-v2
Response example: { current, undo, recoverySnapshot }
200Undo applied400Undo unavailable404Game not found
/api/games/importPOSTImport game JSON
Request body: documented
Parameters: none
Authentication: Public; no credential is required
Required scopes: none
Rate limit: No route-local request quota; body capped at 256 KiB
Schema/version: checkpoint-tail-v1
Request example: Game export, recovery snapshot, or compact recovery
Response example: { id, current, recoverySnapshot, steps, integrity }
200Imported400Invalid import payload413Import body exceeds 256 KiB
/api/healthGETHealth check
Request body: none
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Service healthy
/api/jobs/{id}GETRead principal-bound research job status; stored artifacts expire after 24 hours
Request body: none
Parameters: id (path), required, x-binary2048-job-contract (header)
Authentication: Scoped research/admin credential bound to the submitting principal; ownerless pre-deployment jobs retain opaque-id access until their 24-hour TTL
Required scopes: jobs:read
Rate limit: job_status: default 120 requests / 5 minutes; contract v2 reads bounded metadata only; stored artifacts expire after 24 hours
Schema/version: job-v2
Response example: { jobId, status, resultUrl?, result? (deprecated stored-artifact compatibility), error?, expiresAt }
200Owned job status; contract v2 reads metadata only, while unversioned requests load the verified stored artifact into a deprecated inline result field; Retry-After: 2401Research credential required403Credential lacks jobs:read404Unknown, unowned, or expired job429Polling quota exhausted503Status or compatibility artifact unavailable
/api/jobs/{id}/resultGETRead and integrity-check a persisted principal-bound research job result artifact
Request body: none
Parameters: id (path), required
Authentication: Same principal ownership and bounded ownerless-job compatibility policy as job status; artifacts are verified before parsing
Required scopes: jobs:read
Rate limit: job_status: shared default 120 requests / 5 minutes; worker-result-v1 artifact capped at 12 MiB and retained for 24 hours
Schema/version: worker-result-v1
Response example: { jobId, status: 'complete', result }
200Completed worker-result-v1 artifact, verified by owner, byte length, and SHA-256202Job is still queued or running; Retry-After: 2401Research credential required403Credential lacks jobs:read404Unknown, unowned, or expired job409Job failed and has no result429Polling quota exhausted503Result unavailable
/api/leaderboardGETList ranked leaderboard entries
Request body: none
Parameters: limit (query), page (query)
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Leaderboard entries
/api/leaderboard/submitPOSTSubmit finished ranked game to leaderboard (server-authoritative)
Request body: documented
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Leaderboard entry submitted400Missing game id401Authenticated user required403Session not eligible404Game not found409Game not finished
/api/marketing/eventsGETList tracked marketing events
Request body: none
Parameters: limit (query)
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Tracked marketing events
/api/marketing/trackPOSTTrack marketing/share CTA events
Request body: documented
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Marketing event tracked400Invalid marketing payload
/api/matches/{id}GETGet async match details and standings
Request body: none
Parameters: id (path), required
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Match found404Match not found
/api/matches/{id}/submitPOSTSubmit moves for async same-seed PvP match
Request body: documented
Parameters: id (path), required
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Submission accepted400Invalid submission payload404Match not found
/api/matches/same-seedPOSTCreate async same-seed PvP match
Request body: documented
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Match created400Invalid payload
/api/openapiGETOpenAPI spec document
Request body: none
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200OpenAPI JSON
/api/ops/leaderboardGETGet authorized read-only leaderboard operations data
Request body: none
Parameters: namespace (query), seasonMode (query), practice (query), limit (query), page (query)
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Leaderboard page with explicit backend and scope401Server-verified admin authority required503Leaderboard operations data unavailable
/api/ops/league/configGETGet authorized read-only runtime league configuration
Request body: none
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Production and sandbox league configuration401Server-verified admin authority required
POSTMirror or promote authorized league configuration
Request body: documented
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200League configuration mirrored or promoted400Unsupported configuration action401Server-verified admin authority required
/api/ops/modelsGETGet authorized read-only runtime model registry data
Request body: none
Parameters: none
Authentication: Admin bearer token or signed admin auth-bridge token
Required scopes: admin
Rate limit: No route-local request quota
Schema/version: model-registry-v1
Response example: { source, models }
200Registered model records with explicit runtime scope401Server-verified admin authority required
/api/ops/rate-limit/probePOSTRun an authorized shared rate-limit probe
Request body: none
Parameters: probeId (query), required, x-api-key (header)
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Shared rate-limit probe result400Invalid probe identifier401Admin authority and valid bot API key required503Shared rate-limit store unavailable
/api/ops/storage/leaderboard-probePOSTRun an authorized leaderboard storage probe
Request body: documented
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Leaderboard storage probe result400Invalid action or probe identifier401Server-verified admin authority required503Leaderboard storage probe failed
/api/ops/storage/smokePOSTRun authorized active storage write/read/delete smoke verification
Request body: none
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Active storage probe result401Server-verified admin authority required500Storage probe failed
/api/ops/storage/statusGETGet authorized passive storage configuration status
Request body: none
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Passive status; performs no connectivity checks or writes401Server-verified admin authority required
/api/ops/telemetryGETGet authorized runtime-scoped route telemetry and anomaly flags
Request body: none
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Read-only telemetry snapshot401Server-verified admin authority required
/api/replayPOSTDeterministically reconstruct replay from export or replay payload
Request body: documented
Parameters: none
Authentication: Public; no credential is required
Required scopes: none
Rate limit: No route-local request quota; body capped at 128 KiB
Schema/version: replay-v1
Request example: Versioned game export or replay envelope
Response example: Deterministically reconstructed replay
200Replay reconstruction result400Invalid replay payload413Replay body exceeds 128 KiB
/api/replay/codeGETDecode shareable replay code back to compact replay payload
Request body: none
Parameters: code (query), required
Authentication: Public; no credential is required
Required scopes: none
Rate limit: No route-local request quota
Schema/version: replay-code-v1
Response example: Decoded compact replay payload
200Replay payload400Invalid replay code
POSTCreate shareable replay code from replay payload
Request body: documented
Parameters: none
Authentication: Public; no credential is required
Required scopes: none
Rate limit: No route-local request quota
Schema/version: replay-code-v1
Request example: Compact replay payload
Response example: { code, length, signed, hosted }
200Replay code created400Invalid replay payload
/api/replay/ingestPOSTIngest canonical run records for replay research
Request body: documented
Parameters: none
Authentication: Scoped x-api-key (replay:ingest), configured research subject, or admin authority required
Required scopes: replay:ingest
Rate limit: replay_ingest: default 10 requests / 5 minutes; 1 MiB body and 100 records/request
Schema/version: canonical-run-v1
Request example: { records: [canonicalRunRecord] }
Response example: { ingested, duplicateIds }
200Canonical run records ingested with duplicate ids reported400A valid 1..100 canonical-record array is required401Research credential required403Credential lacks replay:ingest413Request exceeds 1 MiB429Replay-ingest quota exhausted
/api/replay/postmortemPOSTReplay postmortem analyzer for highest-cost moves
Request body: documented
Parameters: none
Authentication: Public; no credential is required
Required scopes: none
Rate limit: No route-local request quota; body capped at 128 KiB
Schema/version: replay-v1
Request example: Versioned game export or replay envelope
Response example: Ranked highest-cost move analysis
200Replay postmortem result400Invalid replay payload413Replay body exceeds 128 KiB
/api/replay/validatePOSTValidate replay payload compatibility and deterministic rerun
Request body: documented
Parameters: none
Authentication: Public; no credential is required
Required scopes: none
Rate limit: No route-local request quota
Schema/version: replay-v1
Request example: { payload, signature? }
Response example: { ok, reason, details? }
200Replay validation result { ok, reason, details? }400Invalid JSON payload
/api/runs/{id}GETGet canonical persisted run record by id
Request body: none
Parameters: id (path), required
Authentication: Public; no credential is required
Required scopes: none
Rate limit: No route-local request quota
Schema/version: canonical-run-v1
Response example: Canonical persisted run record
200Canonical run record404Run not found
/api/runs/{id}/replayGETGet persisted compact replay payload for run id
Request body: none
Parameters: id (path), required
Authentication: Public; no credential is required
Required scopes: none
Rate limit: No route-local request quota
Schema/version: replay-v1
Response example: Compact replay envelope for the persisted run
200Compact replay payload404Run replay not found
/api/scenarios/draftsGETList private scenario drafts for the authenticated account
Request body: none
Parameters: none
Authentication: Authenticated Auth.js browser session; drafts are owner-scoped
Required scopes: none
Rate limit: No route-local request quota
Schema/version: scenario-draft-v1
Response example: { drafts: [scenarioDraft] }
200Private scenario drafts owned by the authenticated account401Authenticated session required503Authentication or scenario draft storage unavailable
POSTCreate or update a private scenario draft for the authenticated account
Request body: documented
Parameters: none
Authentication: Authenticated Auth.js browser session; drafts are owner-scoped
Required scopes: none
Rate limit: No route-local request quota
Schema/version: scenario-draft-v1
Request example: Versioned scenario draft
Response example: { draft: scenarioDraft }
200Private scenario draft saved400Invalid versioned scenario draft401Authenticated session required503Authentication or scenario draft storage unavailable
DELETEDelete a private scenario draft owned by the authenticated account
Request body: none
Parameters: id (query), required
Authentication: Authenticated Auth.js browser session; only the owner can delete a draft
Required scopes: none
Rate limit: No route-local request quota
Schema/version: scenario-draft-v1
Response example: { deleted: true }
200Private scenario draft deleted400Invalid draft id401Authenticated session required404Scenario draft not found503Authentication or scenario draft storage unavailable
/api/sim/runPOSTRun deterministic scenario
Request body: documented
Parameters: none
Authentication: Public; no credential is required
Required scopes: none
Rate limit: No route-local request quota; body capped at 128 KiB
Schema/version: simulation-v1
Request example: { config, initialGrid, moves }
Response example: { version: 1, final, steps }
200Scenario result400Invalid scenario payload413Scenario body exceeds 128 KiB
/api/simulatePOSTBatch simulation endpoint
Request body: documented
Parameters: x-api-key (header)
Authentication: Scoped x-api-key (simulation:run), configured research subject, or admin authority required
Required scopes: simulation:run
Rate limit: simulate: default 60 requests / 5 minutes; 128 KiB body; maximum 2,000 moves; challenge policy; compute-class 150 jobs/month and global queued-job budgets apply
Schema/version: simulation-job-v2
Request example: { moves: ['L', 'U'], seed: 42 }
Response example: { jobId, status, statusUrl, resultUrl } or local-development simulation result
200Simulation result from the documented local development fallback202Queued on isolated compute; poll statusUrl, then fetch resultUrl400Invalid simulation payload401Research credential required403Credential lacks simulation:run or configured anti-abuse challenge required413Simulation body exceeds 128 KiB429Rate limit exceeded503Endpoint temporarily disabled by degrade mode
/api/store/catalogGETList active paid packet SKUs
Request body: none
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Store packet catalog
/api/store/consumePOSTConsume inventory for subscriber and append ledger entry
Request body: documented
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Inventory consumed400Invalid consume payload or insufficient balance401Authenticated bearer token required
/api/store/inventoryGETGet store inventory and recent ledger entries
Request body: none
Parameters: limit (query)
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Inventory and ledger400Invalid query401Authenticated bearer token required403Requested subscriber does not match authenticated account
POSTGrant inventory to subscriber
Request body: documented
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Inventory granted400Invalid payload401Server-verified admin authority required
/api/store/purchasePOSTPurchase a paid packet SKU and grant inventory bundle
Request body: documented
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Packet purchased and inventory granted400Invalid purchase payload401Authenticated bearer token required503Direct purchase disabled until verified checkout is configured
/api/store/webhookPOSTProcess a signed Stripe store webhook
Request body: documented
Parameters: stripe-signature (header), required
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Webhook processed or previously processed400Invalid signature or webhook event503Store webhook is not configured
/api/subscriptionsGETList notification subscriptions for a subscriber
Request body: none
Parameters: subscriberId (query), required
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Subscription list400Missing subscriber id
POSTCreate or update notification subscription
Request body: documented
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Subscription upserted400Invalid payload403Requested topics denied for current user tier
DELETEDelete notification subscription by id
Request body: none
Parameters: id (query), required
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200Subscription deleted400Missing id404Subscription not found
/api/training/labelsGETGenerate labeled board states for training
Request body: none
Parameters: x-api-key (header), page (query), limit (query), strategy (query), minTile (query)
Authentication: Scoped x-api-key (training:read), configured research subject, or admin authority required
Required scopes: training:read
Rate limit: training: shared default 20 requests / 5 minutes; limit 1..500; challenge policy; training-class 100 jobs/month and global budgets apply
Schema/version: training-labels-job-v2
Response example: Label page or { jobId, status, statusUrl, resultUrl }
200Paginated labeled board states202Queued on isolated compute; poll statusUrl, then fetch resultUrl401Research credential required403Credential lacks training:read or configured anti-abuse challenge required429Shared training rate limit exceeded500Training label generation failed503Training queue full or wait timeout
/api/training/replaysGETGenerate deterministic bot replay summaries for training
Request body: none
Parameters: x-api-key (header), page (query), limit (query), bot (query), minScore (query)
Authentication: Scoped x-api-key (training:read), configured research subject, or admin authority required
Required scopes: training:read
Rate limit: training: shared default 20 requests / 5 minutes; limit 1..100; challenge policy; training-class 100 jobs/month and global budgets apply
Schema/version: training-replays-job-v2
Response example: Replay page or { jobId, status, statusUrl, resultUrl }
200Paginated replay summaries202Queued on isolated compute; poll statusUrl, then fetch resultUrl401Research credential required403Credential lacks training:read or configured anti-abuse challenge required429Shared training rate limit exceeded500Training replay generation failed503Training queue full or wait timeout
/api/user/dataDELETEDelete authenticated user data package
Request body: none
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200User data deleted401Authenticated user required
/api/user/data/exportGETExport authenticated user data package
Request body: none
Parameters: none
Authentication: Not yet audited
Required scopes: none
Rate limit: Not yet audited
Schema/version: Not yet audited
Responses200User data export401Authenticated user required