API · POST /v1/engine

Engine

Stockfish or Lc0 on a position: the evaluation in numbers and the best Lines, at the depth or time you ask for.

Try it in the Playground

Signed out? You’ll sign up first. Your own account gets $10 of Trial credits once, never expiring, no card. Only successful responses carry usage and cost_usd.

+1.53
Recorded responses on preset positions
1 of 3
Engine Morphy v the Duke of Brunswick and Count Isouard, Paris 1858: White mates in two. POST /v1/engine Stockfish 19
#2
a8b7c6d5e4f3g2h1
Depth 22 1,580,096 nodes · 4,159 ms
200 event: analysis_end
{
  "id": "req_01WD6MF61G3RFK0F2P5149QSE7",
  "engine": "stockfish",
  "version": "Stockfish 19",
  "network": null,
  "fen": "4kb1r/p2n1ppp/4q3/4p1B1/4P3/1Q6/PPP2PPP/2KR4 w k - 0 16",
  "depth": 22,
  "seldepth": 37,
  "nodes": 1580096,
  "time_ms": 4159,
  "best_move": { "san": "Qb8+", "uci": "b3b8" },
  "lines": [
    {
      "rank": 1,
      "depth": 22,
      "cp": null,
      "mate": 2,
      "wdl": { "win": 1000, "draw": 0, "loss": 0 },
      "moves": [{ "san": "Qb8+", "uci": "b3b8" }, { "san": "Nxb8", "uci": "d7b8" }, … 1 more]
    },
    {
      "rank": 2,
      "depth": 22,
      "cp": 513,
      "mate": null,
      "wdl": { "win": 1000, "draw": 0, "loss": 0 },
      "moves": [{ "san": "Qb7", "uci": "b3b7" }, { "san": "f6", "uci": "f7f6" }, … 19 more]
    },
    {
      "rank": 3,
      "depth": 22,
      "cp": 513,
      "mate": null,
      "wdl": { "win": 1000, "draw": 0, "loss": 0 },
      "moves": [{ "san": "Qc3", "uci": "b3c3" }, { "san": "f6", "uci": "f7f6" }, … 23 more]
    }
  ],
  "stop_reason": "limit",
  "usage": { "engine_ms": 4159 },
  "cost_usd": "0.003466"
}
3.8 s Recorded stream · no API call

What it takes

An engine (stockfish or lc0), a position, at most one limit (depth, nodes or movetime_ms) under the engine’s cap, lines from 1 to 5, and a network for Lc0. Set stream: true to get each completed depth as it lands.

What it returns

The engine, its version and network, depth, nodes, time_ms, the best_move and ranked lines, each with cp or mate from White’s point of view and WDL per mille. Billed by Engine time, at least 100 ms a call.

Stockfish or Lc0

The Queen pointing her sceptre at a chessboard

Stockfish 19 on CPUs: millions of positions a second, as deep as depth 50.

Price on Stockfish
$4.50
per hour of Engine time
Typical call
≈ $0.0052
drawn from your Balance
Streaming
Yes
opt-in, server-sent events
Time cap
60 s
a call, whatever the limit
Engine
stockfish
  • Limit it by depth (20 by default), nodes or movetime_ms.
  • Every call stops at 60 seconds and returns the deepest finished result.
  • Scores are numbers, always from White’s side.
curl https://api.chessdrive.io/v1/engine \
  -H "Authorization: Bearer $CHESSDRIVE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "engine": "stockfish",
    "position": {"fen": "4kb1r/p2n1ppp/4q3/4p1B1/4P3/1Q6/PPP2PPP/2KR4 w k - 0 16"},
    "depth": 22,
    "lines": 3
  }'

The sample calls Engine on the Opera Game Specimen on Stockfish, reading the key from the environment. It waits for the final result; add "stream": true to get each depth as it lands.

Try it in the Playground

Signed out? You’ll sign up first. Your own account gets $10 of Trial credits once, never expiring, no card. Only successful responses carry usage and cost_usd.