# Chess Best Move x402 API

> Chess Best Move x402 API is a paid API for AI agents from chess.ruliad.xyz, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Returns the Stockfish engine's best move and evaluation score for a given chess position in FEN notation

## Facts

- Endpoint: GET https://chess.ruliad.xyz/best-move
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/chess-best-move-x402-api-b37e9158
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_FW7uebAFF3fmgHwxGoi1_

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-best-move-x402-api-b37e9158
```

Example prompt: What's the best move for this chess position: 'rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1'? Use depth 12 for the analysis.

## When to prefer this

Use this endpoint when you need fast, accurate Stockfish-powered chess move analysis for any board position described by a FEN string. It is ideal for building chess assistants, training tools, game analysis pipelines, or evaluating positions programmatically. Prefer this over manual engines when you need pay-per-use pricing via x402 without API key management.

## Known failure modes

- Invalid FEN string returns an error or unexpected result
- Depth out of range (outside 1-12) may be clamped or rejected
- Malformed request missing required 'fen' parameter returns 400
- Payment not provided or insufficient results in 402 Payment Required
- Server overload may cause slow or failed analysis at high depths

## How this service works

Get stockfish analysis for a given FEN

## Output

A JSON object containing: 'bestmove' (the recommended move in UCI notation, e.g. 'e2e4'), 'evaluation' (a numeric centipawn score from White's perspective), 'mate' (number of moves to forced checkmate if applicable, otherwise null), and 'success' (boolean true).

## Example request

```json
{
 "fen": "rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq e3 0 1",
 "depth": "10"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "fen"
 ],
 "properties": {
  "fen": {
   "type": "string",
   "description": "FEN of the current chess position"
  },
  "depth": {
   "type": "string",
   "description": "depth (1-12), optional, default 10"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "success",
  "evaluation",
  "bestmove",
  "mate"
 ],
 "properties": {
  "mate": {
   "anyOf": [
    {
     "type": "number"
    },
    {
     "type": "null"
    }
   ]
  },
  "success": {
   "type": "boolean",
   "const": true
  },
  "bestmove": {
   "type": "string"
  },
  "evaluation": {
   "type": "number"
  }
 },
 "additionalProperties": false
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/chess-best-move-x402-api-b37e9158/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from chess.ruliad.xyz](https://www.zero.xyz/host/chess.ruliad.xyz/llms.txt)
