Prime Rush — hosted API

The hosted API runs the Prime Rush tasks on Datagame game servers against an external model and harness. The game is hosted; the harness connects over MCP. Each session is one live match on a dedicated server, scored exactly as the published boards are.

At a glance

WhatHow
Base URLissued with the key (HTTPS only)
AuthAuthorization: Bearer <key> on every request, the MCP connection included
ControlMCP over streamable HTTP, one endpoint per session
Sessionone live match: about 2 minutes to start, up to 60 minutes long
Scoringcomputed server-side from game-server state, never from what the model reports
Recordsevery session archived and downloadable: settings, every call, raw observations, replay

No installation, game build or cluster access is required. Any MCP-capable harness works.

Flow

POST   /v1/sessions          {"task": "zone_survival", "seed": 2003}     -> 202, status "starting"
GET    /v1/sessions/{id}     poll until status is "ready"               (about 2 minutes)
       /v1/sessions/{id}/mcp MCP endpoint for the session
DELETE /v1/sessions/{id}     ends the session, returns the final score
sequenceDiagram
    participant C as Harness
    participant G as Gateway
    participant S as Game server
    C->>G: POST /v1/sessions with task and seed
    G->>S: start a dedicated match
    G-->>C: 202, status starting
    C->>G: GET /v1/sessions/{id}
    G-->>C: status ready, mcp_url
    loop until finish or budget
        C->>G: MCP tool call, e.g. move
        G->>S: act, then advance the match
        S-->>G: new state
        G-->>C: tool result
    end
    C->>G: DELETE /v1/sessions/{id}
    G-->>C: final outcome and score
    G->>S: bots play the match out, replay archived

Endpoints

GET /v1/tasks

The tasks, the game build each runs on, the seed range of each published board, the time budget and the lobby size.

{
  "zone_survival": {"build": "1.15.0_99000014", "seeds": [2000, 2029], "budget_s": 200, "bots": 6},
  "waypoint_return": {...},
  ...
}

POST /v1/sessions

Starts a match. Body: {"task": "<name>", "seed": <int, optional>, "tag": <string, optional>}. Without seed, a random seed is drawn from the board's set. A tag (letters, digits, ., _, -, up to 64) groups runs into one experiment in the console and in downloads. Returns 202 with the session view below.

GET /v1/sessions/{id}

The session view. Poll it until status is ready.

{
  "id": "9c41e07a2b5d3f18",
  "status": "ready",
  "task": "zone_survival",
  "seed": 2003,
  "tag": "gpt7-eval-1",
  "build": "1.15.0_99000014",
  "settings": {"bots": 6, "ff_radius": 400, "budget": 200},
  "mcp_url": "/v1/sessions/9c41e07a2b5d3f18/mcp",
  "outcome": {"score": 0.61, "seconds_scored": 84.5, "alive": true, ...},
  "archive": null,
  "failure": null,
  "age_s": 143
}
StatusMeaning
startingmatch is being provisioned; mcp_url is null
readyconnect to mcp_url and play
closingscore frozen; bots are playing the match out for the replay
closedarchived; archive says whether the replay was kept, and the files can be downloaded
failedcould not start; error carries a reference. failure is not_posed when the match never set up what the task asks for (start another seed), start otherwise

outcome is live while the session runs: it is rewritten after every call that advances the match, so a session that crashes or is abandoned is still graded on what it did.

DELETE /v1/sessions/{id}

Ends the session and returns the view with the final outcome. The match is then played out by the bots so the recording is complete, and archived.

GET /v1/sessions

The lab's sessions, newest first, including closed ones from earlier days. Filter with ?tag= and ?task=; ?include=samples also lists the public-board runs, read-only.

GET /v1/sessions/{id}/files, /files/{name}

What a session kept, and each file. While it plays: outcome.json, observations.jsonl, calls.jsonl so far. Once closed: the archived files below.

GET /v1/sessions/{id}/export, GET /v1/export?tag=

One session, or every archived session under a tag, as a zip.

GET /v1/sessions/{id}/replay

What the console's match review draws: every player's track over the task window, the storm's circles, the session's calls and the outcome, in seconds from handover.

GET /v1/me

The lab, its concurrency limit, the number of sessions running, and its keys (fingerprints only).

/v1/sessions/{id}/mcp

The MCP endpoint (streamable HTTP; GET, POST, DELETE). Returns 409 unless the session is ready.

The tools

ToolArgumentsAdvances time
get_situationnoneno
turn_to_bearingbearing: degrees clockwise from +zby the time the turn takes
moveseconds (up to 20), forward and strafe in -1..1, runyes
hold_positionseconds (1 to 20), crouchyes
shootseconds (0.5 to 5), aim_down_sightsyes
finishnote: the reason for stoppingends the task

The match is frozen between calls. Only tools that advance time do so, by exactly the time they take, so thinking time is free and network latency does not affect the score.

get_situation reports raw world coordinates and nothing derived: the agent's position and heading, the circle's centre and radius and the one it is closing to, nearby enemies and squadmates as distances and offsets. There is no bearing-to-target field; working it out is the task.

Tasks

TaskBudgetLobbyWhat is scored
zone_survival200 s6share of the window inside the circle the storm is closing to
waypoint_return200 s6leave the start by 250+ units, then finish as close to it as possible
storm_escape200 s6starting outside the next circle: share of the window inside it
regroup200 s20share of the window within 30 units of a squadmate and inside the next circle
placementto match end20placement, as a share of the lobby beaten

Same tools, prompts, builds, lobby sizes and budgets as the published boards.

Scoring

The score is computed server-side from the positions and state the game server reports. The model's own account of what it did is recorded but never scored.

Time-scored tasks (zone_survival, storm_escape, regroup) are scored over the whole time budget. Calling finish early plays the rest out with the agent standing still where it stopped, scored the same way. Time lost to a death, or left unplayed by a DELETE without finish, counts as outside.

Starting states: a seed fixes the match and where the bots spawn, but not yet exactly where the agent is handed over. Compare models over a set of seeds, as the boards do.

Observations and records

Every session is tracked at four levels, from what the agent sees to the whole match. All four are kept, so a score can be re-derived and an episode replayed independently of the hosted scorer.

LevelWhat it isWhenWhere
Agent viewwhat get_situation returns to the modelon each callthe harness, as the MCP tool result
Raw observationthe game server's full state for the agent's playerevery call that advances timearchived per session
Outcomethe running score and match statsrewritten after every advanceoutcome in the session view
Match replayevery player in the match, start to endonce the match is played outarchived per session

Agent view

What the model is given, as structured JSON: position (x, z), heading, speed, health, alive; the current circle's centre and radius, the one it is closing to, whether the agent is inside, the storm round; time used and remaining; nearby enemies and squadmates as distance and offset (dx, dz). Raw numbers only: no bearings, no distance-to-circle, no hints.

Raw observation

The server's own snapshot, logged at handover and after every call that advances the match. It carries more than the agent view, and it is what the score is computed from. One JSON line per entry:

{"seconds": 22.0, "calls": 3, "obs": {
  "self":    {"pos": [786.9, 51.9, 944.1], "vel": [-0.36, 0.0, -1.32], "yaw": 270.0,
              "speed": 1.37, "health": 1.0, "shield": 1.0, "alive": true, "down": false},
  "weapon":  {"present": true, "ammo": 18, "ammoCap": 18, "reloading": false},
  "storm":   {"center": [652.9, 947.1], "radius": 314.2, "nextCenter": [643.3, 938.6],
              "nextRadius": 300.0, "distEdge": -180.1, "distNextEdge": -156.2,
              "round": 3, "phase": 2, "damageRate": 4},
  "match":   {"alive": 6, "total": 6, "elapsed": 464.2, "over": false},
  "stats":   {"kills": 0, "damageDealt": 0, "damageTaken": 0, "playerRank": 0},
  "enemies": [{"d": 190.7, "rel": [-33.2, -5.6, -187.7], "alive": true, "bot": true}],
  "team":    [...]
}}

seconds is game time since handover and calls the number of time-advancing calls so far, so each entry lines up with a step in the harness's own trace.

Outcome

The session view's outcome, live while the session runs and final after DELETE: the score, seconds scored and held, whether the agent is alive, health, players alive, placement, kills, damage dealt and taken, the number of decisions, and why the task ended.

Match replay

The game's own recording of the whole match: every player's position twice a second, the storm's circles and timings, loot picked up, and each player's damage, kills and elimination. The match is played out by the bots after the session ends so the recording is complete.

What is archived per session

FileContents
manifest.jsontask, game build, seed, settings, tag, start time, final score
log.jsonthe final outcome and why the session closed
calls.jsonlevery tool call: the tool, its arguments, the server's reply, game time before and after
observations.jsonl.gzevery raw observation, as above
recording.jsonthe match replay

Records are kept without expiry and can be downloaded at any time: one file, one session or a whole tag (see above), or browsed in the RL Lab console at /console/. Model prompts and responses are never transmitted to the server: the model trace stays with the lab, and lines up with the archived calls and observations by calls.

Limits

LimitValue
Sessions per key at onceset per lab (default 4)
Requests per key10 per second sustained, bursts up to 30
Request bodyup to 1 MB
Session length60 minutes, or 30 minutes without a request

Errors

Errors are JSON: {"error": "<message>"}. Server-side errors carry a reference (ref) to quote; details stay in the server logs.

CodeWhen
400unknown task, or a body that is not {"task": ..., "seed": ...}
401missing or unknown key
404no such session, or one belonging to another lab
409MCP request to a session that is not ready
413request body over 1 MB
429rate limit, key concurrency limit, or the environment at capacity; honour Retry-After
500server error; quote the ref

Getting access

Keys are issued per lab and handed over directly, never by email or chat. Requests go to the Datagame contact; the base URL is issued with the key. The same key signs in to the RL Lab console at /console/, where it is swapped for a day-long sign-in and never kept in the browser. example_client.py runs one session end to end (--tag to group it) and downloads a tag (--pull).