{
  "openapi": "3.1.0",
  "info": {
    "title": "Cubeyay cube solver API",
    "version": "1.0.0",
    "summary": "Solve a 3x3 puzzle cube: free, no key, no personal data.",
    "description": "Give a scrambled 3x3 cube (as a scramble or as 54 facelets) and get a short solution, every move in plain words, a link that replays the solve on a 3D cube, and the 7-step beginner method. Hold the cube with the yellow centre on top (U) and the blue centre facing you (F); then red is on the right (R). Docs: https://cubeyay.com/cube-solver-api/. The same tools are on the MCP server at https://cubeyay.com/mcp. Calling from Python's built-in urllib? Send a User-Agent header (e.g. urllib.request.Request(url, headers={'User-Agent': 'my-agent/1.0'})) or the request is refused (error 1010); requests and httpx work as they are."
  },
  "servers": [
    {
      "url": "https://cubeyay.com"
    }
  ],
  "externalDocs": {
    "url": "https://cubeyay.com/cube-solver-api/"
  },
  "paths": {
    "/api/solve": {
      "get": {
        "operationId": "solveCube",
        "summary": "Solve a 3x3 cube",
        "parameters": [
          {
            "name": "scramble",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "Face turns from a solved cube (U R F D L B, each optionally followed by ' or 2), space separated. At most 200 moves.",
              "example": "R U R' U' F2 D L' B U2"
            },
            "description": "Give scramble or cube."
          },
          {
            "name": "cube",
            "in": "query",
            "schema": {
              "type": "string",
              "description": "54 characters, 9 per face in the order U R F D L B (up, right, front, down, left, back). Each face is read row by row as you look straight at it: U with the B face at its top edge, D with the F face at its top edge, and the four side faces with U at their top edge. Use the face letters U R F D L B for colours, or any six symbols (for example Y R B W O G): each is read as the face whose centre has it.",
              "example": "UUUUUUUUURRRRRRRRRFFFFFFFFFDDDDDDDDDLLLLLLLLLBBBBBBBBB"
            },
            "description": "Give scramble or cube."
          }
        ],
        "responses": {
          "200": {
            "description": "Solved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Solved"
                }
              }
            }
          },
          "400": {
            "description": "The input is missing or malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The colours do not make a real cube (for example a twisted corner).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "solveCubePost",
        "summary": "Solve a 3x3 cube (JSON body)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "scramble": {
                    "type": "string",
                    "description": "Face turns from a solved cube (U R F D L B, each optionally followed by ' or 2), space separated. At most 200 moves.",
                    "example": "R U R' U' F2 D L' B U2"
                  },
                  "cube": {
                    "type": "string",
                    "description": "54 characters, 9 per face in the order U R F D L B (up, right, front, down, left, back). Each face is read row by row as you look straight at it: U with the B face at its top edge, D with the F face at its top edge, and the four side faces with U at their top edge. Use the face letters U R F D L B for colours, or any six symbols (for example Y R B W O G): each is read as the face whose centre has it.",
                    "example": "UUUUUUUUURRRRRRRRRFFFFFFFFFDDDDDDDDDLLLLLLLLLBBBBBBBBB"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Solved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Solved"
                }
              }
            }
          },
          "400": {
            "description": "The input is missing or malformed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The colours do not make a real cube (for example a twisted corner).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Solved": {
        "type": "object",
        "required": [
          "ok",
          "cube",
          "solution",
          "length",
          "moves",
          "hold",
          "replayUrl",
          "learn"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "cube": {
            "type": "string",
            "description": "The cube solved, as 54 face letters."
          },
          "solution": {
            "type": "string",
            "description": "Moves that solve it, space separated (empty when already solved)."
          },
          "length": {
            "type": "integer",
            "description": "Number of moves (half turns count as one)."
          },
          "moves": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "move": {
                  "type": "string"
                },
                "meaning": {
                  "type": "string"
                }
              }
            }
          },
          "hold": {
            "type": "string",
            "description": "How to hold the cube while following the moves."
          },
          "replayUrl": {
            "type": "string",
            "format": "uri",
            "description": "Opens this cube in the cubeyay.com solver and plays the solution on a 3D cube."
          },
          "learn": {
            "type": "object",
            "properties": {
              "note": {
                "type": "string"
              },
              "guideUrl": {
                "type": "string",
                "format": "uri"
              },
              "notationUrl": {
                "type": "string",
                "format": "uri"
              },
              "steps": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "step": {
                      "type": "integer"
                    },
                    "title": {
                      "type": "string"
                    },
                    "goal": {
                      "type": "string"
                    },
                    "algorithm": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "ok",
          "error"
        ],
        "properties": {
          "ok": {
            "const": false
          },
          "error": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          },
          "docs": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    }
  }
}