{"openapi":"3.1.0","info":{"title":"Maze API","version":"1.0.0","description":"Generate and solve mazes — entirely locally and reproducibly. The generate endpoint builds a perfect maze (exactly one path between any two cells, no loops) of the width and height you choose, using either a recursive-backtracker algorithm (long, winding corridors) or Prim's algorithm (more branching, shorter dead-ends), and returns it as ready-to-print ASCII art plus a compact per-cell wall-bitmask grid, with the start marked top-left and the exit bottom-right. Every maze is fully reproducible: pass a seed and you always get exactly the same maze on any machine, and the seed is returned when you omit it so you can recreate it later. The solve endpoint re-creates the maze from the same seed, width, height and algorithm and returns the shortest path from start to finish, both as an ordered list of cells and drawn onto the maze. Everything is computed locally and deterministically, so it is instant and private. Ideal for games and puzzles, procedural level generation, teaching algorithms and graph search, printable activity sheets, and creative coding. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/maze-api","description":"oanor gateway"}],"tags":[{"name":"Maze"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/generate":{"get":{"operationId":"get_v1_generate","tags":["Maze"],"summary":"Generate a maze","description":"","parameters":[{"name":"width","in":"query","required":false,"description":"Cells wide (2–40, default 10)","schema":{"type":"string"},"example":"10"},{"name":"height","in":"query","required":false,"description":"Cells tall (2–40, default 10)","schema":{"type":"string"},"example":"10"},{"name":"algorithm","in":"query","required":false,"description":"backtracker (default) or prim","schema":{"type":"string"}},{"name":"seed","in":"query","required":false,"description":"Integer for a reproducible maze","schema":{"type":"string"},"example":"42"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"end":[9,9],"grid":[[11,13,1,5,5,3,9,5,5,3],[12,3,8,3,13,6,12,1,7,10],[9,6,10,12,5,5,5,6,9,2],[10,13,4,3,9,3,9,5,6,10],[12,5,3,10,10,14,10,11,9,6],[13,3,10,12,6,9,6,10,10,11],[9,6,12,3,9,6,9,2,10,10],[8,3,9,6,8,3,14,10,10,10],[10,10,12,3,14,10,9,6,12,2],[14,12,5,4,5,6,12,5,5,6]],"seed":42,"ascii":"+---+---+---+---+---+---+---+---+---+---+\n| S |                   |               |\n+   +---+   +---+---+   +   +---+---+   +\n|       |       |       |           |   |\n+---+   +   +   +---+---+---+   +---+   +\n|       |   |                   |       |\n+   +---+   +---+---+---+---+---+   +   +\n|   |           |       |           |   |\n+   +---+---+   +   +   +   +---+---+   +\n|           |   |   |   |   |   |       |\n+---+---+   +   +   +---+   +   +   +---+\n|       |   |       |       |   |   |   |\n+---+   +   +---+---+   +---+   +   +   +\n|       |       |       |       |   |   |\n+   +---+---+   +   +---+   +   +   +   +\n|       |       |       |   |   |   |   |\n+   +   +   +---+   +   +---+   +   +   +\n|   |   |       |   |   |       |       |\n+   +   +---+   +---+   +   +---+---+   +\n|   |                   |             E |\n+---+---+---+---+---+---+---+---+---+---+","start":[0,0],"width":10,"height":10,"algorithm":"backtracker"},"meta":{"timestamp":"2026-06-03T09:24:59.333Z","request_id":"936c315f-12ea-4a61-ab6f-2605f5301b64"},"status":"ok","message":"Generate a maze","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/solve":{"get":{"operationId":"get_v1_solve","tags":["Maze"],"summary":"Solve a maze","description":"","parameters":[{"name":"width","in":"query","required":false,"description":"Cells wide (2–40)","schema":{"type":"string"},"example":"10"},{"name":"height","in":"query","required":false,"description":"Cells tall (2–40)","schema":{"type":"string"},"example":"10"},{"name":"algorithm","in":"query","required":false,"description":"backtracker (default) or prim","schema":{"type":"string"}},{"name":"seed","in":"query","required":true,"description":"Seed of the maze to solve","schema":{"type":"string"},"example":"42"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"path":[[0,0],[0,1],[1,1],[1,2],[0,2],[0,3],[0,4],[1,4],[2,4],[2,5],[2,6],[3,6],[3,7],[2,7],[2,8],[3,8],[3,9],[4,9],[5,9],[5,8],[5,7],[4,7],[4,6],[5,6],[5,5],[6,5],[6,4],[6,3],[7,3],[8,3],[8,2],[9,2],[9,3],[9,4],[8,4],[8,5],[8,6],[8,7],[8,8],[9,8],[9,9]],"seed":42,"ascii":"+---+---+---+---+---+---+---+---+---+---+\n| S |                   |               |\n+   +---+   +---+---+   +   +---+---+   +\n| *   * |       |       |           |   |\n+---+   +   +   +---+---+---+   +---+   +\n| *   * |   |                   | *   * |\n+   +---+   +---+---+---+---+---+   +   +\n| * |           |       | *   *   * | * |\n+   +---+---+   +   +   +   +---+---+   +\n| *   *   * |   |   |   | * |   | *   * |\n+---+---+   +   +   +---+   +   +   +---+\n|       | * |       | *   * |   | * |   |\n+---+   +   +---+---+   +---+   +   +   +\n|       | *   * | *   * |       | * |   |\n+   +---+---+   +   +---+   +   +   +   +\n|       | *   * | *   * |   |   | * |   |\n+   +   +   +---+   +   +---+   +   +   +\n|   |   | *   * |   | * |       | *   * |\n+   +   +---+   +---+   +   +---+---+   +\n|   |         *   *   * |             E |\n+---+---+---+---+---+---+---+---+---+---+","steps":41,"width":10,"height":10,"algorithm":"backtracker"},"meta":{"timestamp":"2026-06-03T09:24:59.443Z","request_id":"4f8d7f00-1a7d-43a2-a563-2b3057e0312b"},"status":"ok","message":"Solve a maze","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"name":"Maze API","notes":"Mazes are 'perfect' (no loops, one unique route). Pass the same seed, width, height and algorithm to generate and solve to get matching mazes. Grid bitmask bits: 1=N wall, 2=E, 4=S, 8=W. Nothing is stored.","version":"v1","endpoints":[{"path":"/v1/generate","params":{"seed":"integer for a reproducible maze (random if omitted)","width":"cells wide (2–40, default 10)","height":"cells tall (2–40, default 10)","algorithm":"backtracker (default) or prim"},"returns":"the maze as ASCII and a wall-bitmask grid, plus the seed"},{"path":"/v1/solve","params":{"seed":"the seed of the maze to solve (required to match a generated one)","width":"as generate","height":"as generate","algorithm":"as generate"},"returns":"the shortest path from start to end and the solved ASCII"},{"path":"/v1/meta","params":[],"returns":"this document"}],"description":"Generate and solve mazes. The generate endpoint builds a perfect maze (exactly one path between any two cells) of the width and height you choose, using a recursive-backtracker (long winding corridors) or Prim's algorithm (more branching), and returns it as ready-to-print ASCII art plus a compact per-cell wall grid, with the start (top-left) and end (bottom-right) marked. Every maze is reproducible: pass a seed and you always get the same maze, so the solve endpoint re-creates it from the same seed and returns the shortest path from start to finish, both as a list of cells and drawn onto the maze. Pure local, no key."},"meta":{"timestamp":"2026-06-03T09:24:59.554Z","request_id":"b810ee48-f105-4d9f-bd5d-17aea4e25a59"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":3735,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":525,"monthly_call_quota":13250,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2515,"monthly_call_quota":183500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":6315,"monthly_call_quota":960000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/maze-api"}