---
title: "Get a random chess puzzle. Filter by variant, difficulty or theme. Not every variant puzzle carries themes; use chess_list_puzzle_types to see what the pool holds."
method: POST
path: "/api/tools/chess_generate_puzzle"
---

# Get a random chess puzzle. Filter by variant, difficulty or theme. Not every variant puzzle carries themes; use chess_list_puzzle_types to see what the pool holds.

`POST /api/tools/chess_generate_puzzle`

## Request

- Base URL: `https://tools.moddable.games`
- URL: `https://tools.moddable.games/api/tools/chess_generate_puzzle`
- Auth: none declared

## Request body

- object
  - `variant` string: Chess variant play slug (e.g. almost-chess, benedict, fischer-random, king-of-the-hill, standard); a manifest key such as chess960 is also accepted. Returns only puzzles for this variant.
  - `difficulty` 'easy' | 'medium' | 'hard': Puzzle difficulty by rating: easy under 1200, medium 1200-1799, hard 1800 and above
  - `theme` string: Puzzle theme (fork, pin, skewer, mateIn2, etc). Not every variant puzzle carries themes.

## Response `200`

Tool result

---

[API](https://skmtc.dev/moddable/apis/moddable-games-tools.md) · [All operations](https://skmtc.dev/moddable/apis/moddable-games-tools/llms.txt) · [OpenAPI document](https://skmtc.dev/moddable/apis/moddable-games-tools/revisions/637a0b62cb9a?raw)
