{
  "schemaVersion": "1.0",
  "name": "Ultimate Random Chess v2",
  "description": "Play 8x8 chess with five distinct fairy pieces drawn from a 100-piece library.",
  "humanDocs": "https://ultimaterandomchess.com/agents/",
  "liveContract": "https://api.ultimaterandomchess.com/v2/",
  "apiBase": "https://api.ultimaterandomchess.com/v2",
  "auth": {
    "required": false,
    "note": "No account, API key, bearer token or dashboard is required."
  },
  "transport": {
    "requestContentType": "application/json",
    "responseContentType": "application/json"
  },
  "publicData": {
    "gamesArePublic": true,
    "recentEndpoint": "GET /games?limit=1..50",
    "warning": "Created games, piece lineups and move histories can appear in the public recent-game archive. Do not put secrets or personal data in requests."
  },
  "lifecycle": [
    {
      "step": 1,
      "name": "discover",
      "method": "GET",
      "path": "/",
      "expect": "Live endpoint map, move notation and game-object schema."
    },
    {
      "step": 2,
      "name": "create",
      "method": "POST",
      "path": "/games",
      "body": {
        "mode": "engine",
        "color": "white",
        "depth": 8
      },
      "save": ["id", "youAre", "status", "legalMoves"],
      "expect": "An active game where youAre is white and legalMoves is non-empty."
    },
    {
      "step": 3,
      "name": "move",
      "method": "POST",
      "pathTemplate": "/games/{id}/move",
      "bodyTemplate": {
        "move": "{legalMoves[0].uci}"
      },
      "expect": "The response applies played, then may include engineMove when the engine replies."
    },
    {
      "step": 4,
      "name": "inspect",
      "method": "GET",
      "pathTemplate": "/games/{id}",
      "expect": "Current board, FEN, moves, legalMoves, status, result and reason."
    },
    {
      "step": 5,
      "name": "cleanup",
      "when": "status is active and the client will not continue",
      "method": "POST",
      "pathTemplate": "/games/{id}/resign",
      "bodyTemplate": {
        "color": "{youAre}"
      },
      "expect": "status is finished and reason is resignation."
    }
  ],
  "moveNotation": {
    "format": "UCI long algebraic",
    "examples": ["e2e4", "e7e8q"],
    "castling": "Chess960 king-takes-own-rook, for example e1h1.",
    "rule": "Submit a uci value returned in legalMoves instead of synthesizing a move."
  },
  "errors": {
    "shape": {
      "error": "human-readable message"
    },
    "illegalMove": "HTTP 400 also carries the legal move list.",
    "notFoundExample": {
      "status": 404,
      "body": {
        "error": "no such game"
      }
    },
    "retry": "Refresh game state after a conflict or illegal move. Back off on 429 and 5xx responses."
  },
  "rateLimits": {
    "published": false,
    "clientGuidance": "Serialize test writes, poll modestly and use exponential backoff with jitter for 429 or 5xx responses."
  },
  "capabilities": {
    "pieceLibrary": "GET /pieces",
    "pieceDefinition": "GET /pieces/{id}",
    "fairyStockfishLibrary": "GET /pieces/library.ini",
    "recentGames": "GET /games?limit=1..50",
    "compileVariant": "POST /engine/variant",
    "legalMovesForPosition": "POST /engine/legal",
    "bestMoveForPosition": "POST /engine/bestmove"
  },
  "sourceOfTruth": "The response from GET https://api.ultimaterandomchess.com/v2/ is authoritative."
}
