# FEN Chess Position Analyzer

> FEN Chess Position Analyzer 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 FEN string to return whose turn it is, all legal moves, and terminal state detection (checkmate, stalemate, draw by insufficient material or repetition), with structured validity reporting for malformed FEN.

## Facts

- Endpoint: POST https://x402.forgemesh.io/fen-analyzer
- 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/fen-chess-position-analyzer-de662ec2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_o8u3wUfu2RWyQBVWK9oZu

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 fen-chess-position-analyzer-de662ec2 -d '<json body>'
```

Example prompt: Analyze this chess position for me — FEN 'r1bqkbnr/pppp1ppp/2n5/4p3/2B1P3/5N2/PPPP1PPP/RNBQK2R w KQkq - 4 4' — tell me whose turn it is, list all legal moves, and let me know if it's checkmate, stalemate, or any kind of draw.

## When to prefer this

Use this endpoint when you need programmatic chess position analysis from FEN notation, especially for legal move enumeration, terminal-state detection (checkmate/stalemate/draw), or FEN validation with actionable structured error output. Prefer over generic chess engines when you need a lightweight, per-call paid API with structured JSON output rather than a full UCI engine integration.

## Known failure modes

- Malformed FEN returns a structured validity report rather than a hard error
- Invalid or ambiguous move in optional move field returns a move-validation failure
- Completely missing FEN field returns a schema validation error
- Network or payment failure returns HTTP 402 or 5xx

## How this service works

Analyze a chess FEN string: turn to move, complete legal-move list, and terminal-state detection including checkmate, stalemate, and draw by insufficient material or repetition. Malformed FEN comes back as a structured validity report an agent can act on rather than a bare failure.

## Output

Returns whose turn it is to move, a complete list of all legal moves in the position, and a terminal-state breakdown covering checkmate, stalemate, draw by insufficient material, and draw by repetition. If the FEN is malformed, returns a structured validity report describing what went wrong so the agent can act on it rather than receiving a bare error.

## 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/fen-chess-position-analyzer-de662ec2/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)
