---
title: "Acquire analysis request"
method: POST
path: "/api/external-engine/work"
tags: ["External engine"]
---

# Acquire analysis request

`POST /api/external-engine/work`

**Endpoint: `https://engine.lichess.ovh/api/external-engine/work`**

Wait for an analysis requests to any of the external engines that
have been registered with the given `providerSecret`.
Uses long polling.
After acquiring a request, the provider should immediately
[start streaming the results](#tag/external-engine/POST/api/external-engine/work/{id}).

## Request body

- object
  - `providerSecret` string, required

## Response `200`

Analysis has been requested

- object
  - `id` string, required
  - `work` union, required
    - object
      - `movetime` integer, required — Amount of time to analyse the position, in milliseconds.
      - `sessionId` string, required — Arbitary string that identifies the analysis session. Providers may wish to clear the hash table between sessions.
      - `threads` integer, required — Number of threads to use for analysis.
      - `hash` integer, required — Hash table size to use for analysis, in MiB.
      - `multiPv` integer, required — Requested number of principal variations.
      - `variant` 'chess' | 'crazyhouse' | 'antichess' | 'atomic' | 'horde' | 'kingofthehill' | 'racingkings' | '3check', required
      - `initialFen` string, required — Initial position of the game.
      - `moves` string[], required — List of moves played from the initial position, in UCI notation.
    - object
      - `depth` integer, required — Analysis target depth
      - `sessionId` string, required — Arbitary string that identifies the analysis session. Providers may wish to clear the hash table between sessions.
      - `threads` integer, required — Number of threads to use for analysis.
      - `hash` integer, required — Hash table size to use for analysis, in MiB.
      - `multiPv` integer, required — Requested number of principal variations.
      - `variant` 'chess' | 'crazyhouse' | 'antichess' | 'atomic' | 'horde' | 'kingofthehill' | 'racingkings' | '3check', required
      - `initialFen` string, required — Initial position of the game.
      - `moves` string[], required — List of moves played from the initial position, in UCI notation.
    - object
      - `nodes` integer, required — Number of nodes to analyse in the position
      - `sessionId` string, required — Arbitary string that identifies the analysis session. Providers may wish to clear the hash table between sessions.
      - `threads` integer, required — Number of threads to use for analysis.
      - `hash` integer, required — Hash table size to use for analysis, in MiB.
      - `multiPv` integer, required — Requested number of principal variations.
      - `variant` 'chess' | 'crazyhouse' | 'antichess' | 'atomic' | 'horde' | 'kingofthehill' | 'racingkings' | '3check', required
      - `initialFen` string, required — Initial position of the game.
      - `moves` string[], required — List of moves played from the initial position, in UCI notation.
  - `engine` ExternalEngine, required
    - `id` string, required — Unique engine registration ID.
    - `name` string, required — Display name of the engine.
    - `clientSecret` string, required — A secret token that can be used to [*request* analysis](#tag/external-engine/POST/api/external-engine/{id}/analyse) from this external engine.
    - `userId` string, required — The user this engine has been registered for.
    - `maxThreads` integer, required — Maximum number of available threads.
    - `maxHash` integer, required — Maximum available hash table size, in MiB.
    - `variants` UciVariant[], required — List of supported chess variants.
    - `providerData` string, nullable — Arbitrary data that the engine provider can use for identification or bookkeeping. Users can read this information, but updating it requires knowing or changing the `providerSecret`.

## Other responses

- `204` — No pending analysis

---

[API](https://skmtc.net/lichess/apis/lichess-org-api-reference.md) · [All operations](https://skmtc.net/lichess/apis/lichess-org-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/lichess/lichess-org-api-reference/versions/1425db81eb3b/schema)
