# Chess Position Analysis & Move Generation (x402.forgemesh.io)

> Chess Position Analysis & Move Generation (x402.forgemesh.io) is a paid API for AI agents from x402.forgemesh.io, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-15).

Analyzes a chess position from a FEN string, returning all legal moves in SAN and UCI notation, game state flags (check, checkmate, stalemate, draw, etc.), and optionally validates/applies a move to produce the resulting FEN.

## Facts

- Endpoint: POST https://x402.forgemesh.io/chess-moves
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/chess-position-analysis-move-generation-x402-forgemesh-io-bc27e01d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_h4z-aLtiwUJ8htOyyNUBT

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability chess-position-analysis-move-generation-x402-forgemesh-io-bc27e01d -d '<json body>'
```

Example prompt: What are all the legal moves from this chess position — rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1 — and is the position in check? Also apply the move e7e5 and give me the resulting FEN.

## When to prefer this

Choose this endpoint when you need deterministic rules-based chess move generation or position validation — not engine evaluation or best-move suggestions. Ideal for chess apps, puzzle validators, game state machines, or any workflow that needs to enumerate legal moves or detect terminal game states from a FEN string without calling a full chess engine.

## Known failure modes

- Invalid FEN string returns an error indicating unparseable position
- Illegal or malformed move string returns a validation error
- Move provided is not legal in the given position — returns error indicating illegal move
- Missing 'fen' field returns a 400-level bad request
- Ambiguous SAN move without sufficient context may fail to parse

## How this service works

Chess position analysis from a FEN string: every legal move in SAN and UCI notation, whose turn it is, and full game-state flags — check, checkmate, stalemate, draw, insufficient material, threefold repetition. Optionally validate and apply one move to get the resulting FEN. Deterministic rules logic, not engine evaluation.

## Output

Returns a list of all legal moves in both SAN (e.g. Nf3) and UCI (e.g. g1f3) notation, indicates whose turn it is, and provides boolean game-state flags for check, checkmate, stalemate, draw, insufficient material, and threefold repetition. If a move was provided, also returns the resulting FEN after that move is applied.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "fen": {
   "type": "string",
   "description": "FEN position string, or 'start' for the initial position"
  },
  "move": {
   "type": "string",
   "description": "Optional move to validate/apply, SAN (Nf3) or UCI (g1f3)"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "turn": "white",
  "state": {
   "in_check": false,
   "game_over": false
  },
  "valid_fen": true,
  "legal_moves": [
   "a3",
   "a4",
   "Nf3"
  ],
  "move_applied": {
   "san": "e4",
   "legal": true,
   "fen_after": "rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/chess-position-analysis-move-generation-x402-forgemesh-io-bc27e01d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.forgemesh.io](https://www.zero.xyz/host/x402.forgemesh.io/llms.txt)
