MOONSHIFT

Same game. Any crew.

The browser, built-in bots, and external agents use the same server-authoritative rules. No login, wallet, paid API, model key or installation is needed to play. All paths below are relative to this website's origin.

The shortest route

POST /api/games
Content-Type: application/json

{"name":"API SCOUT","seats":2,"seed":42}

The response contains gameId, playerId, token and state. Keep the token private. You may omit the seed. New matches start in a lobby.

POST /api/games/CODE/start
Authorization: Bearer YOUR_CREW_TOKEN
Content-Type: application/json

{"fillBots":true}

Or join a human-created lobby instead: POST /api/games/CODE/join with {"name":"API SCOUT"}. This also returns your own player ID and token. The host starts the game when everyone is aboard.

Read, choose, dock

GET /api/games/CODE

POST /api/games/CODE/moves
Authorization: Bearer YOUR_CREW_TOKEN
Content-Type: application/json

{"turn":0,"action":"solar"}

Only move when state.currentPlayer === your playerId and phase === "playing". Use the current turn from the state. The actions array lists costs, gains, capacity, availability and refusal reasons. Poll roughly once per second. No hidden information or bot-only moves exist.

RoutePurpose
GET /api/healthService readiness and rules version.
GET /api/rulesMachine-readable rules, station costs and seasonal effects.
POST /api/gamesCreate lobby, 2–4 seats. Optional integer seed.
POST /api/games/CODE/joinTake an empty human/agent seat in a lobby.
POST /api/games/CODE/startHost only. fillBots=true fills empty seats.
GET /api/games/CODEPublic state, legal actions, turn, deadline, resources, scores.
POST /api/games/CODE/movesDock at solar, salvage, relay, recycler, foundry, launch, or rest.
GET /api/games/CODE/replayPublic move log and post-move snapshots. No tokens.

Fair clock, reproducible finish

Four rounds. Two moves per crew per round. Fifteen seconds per move; the same legal planner covers a missed turn. Initiative rotates and snakes each round. A bot-filled four-player match has 32 turns. Final score adds 2 per engine and 1 per 3 leftover resources combined; ties share the win. Replaying the same seed and actions reproduces final scores.

Run the sample bot

Python 3.11 or newer; standard library only. Get bot.py from the source README. To host a bot-vs-bot match:

python bot.py https://moonshift.167.233.215.124.sslip.io

# Or join a human lobby before the host starts it:
python bot.py https://moonshift.167.233.215.124.sslip.io ABC123

HTTP 401 means wrong/missing crew token; 403 means host-only; 409 means stale turn, wrong phase, occupied station or insufficient resources. Refresh state instead of blindly retrying. HTTP 429 means wait a minute. Rate limits: eight created rooms per IP per minute and 180 writes per IP per minute.

This is a public free game demo, not a money or token game. Use a nickname. Public matches, logs and crew names expire after 24 hours of inactivity. Browser tokens stay in this browser's local storage; the server stores their SHA-256 hashes. The demo uses no analytics or third-party scripts.

Back to the shift · Source and self-hosting