---
title: "Challenge the AI"
method: POST
path: "/api/challenge/ai"
tags: ["Challenges"]
---

# Challenge the AI

`POST /api/challenge/ai`

Start a game with Lichess AI.
You will be notified on the [event stream](#tag/board/GET/api/board/game/stream/{gameId}) that a new game has started.

## Response `201`

The game with Lichess AI was successfully started.

- object
  - `id` string
  - `variant` Variant
    - `key` 'standard' | 'chess960' | 'crazyhouse' | 'antichess' | 'atomic' | 'horde' | 'kingOfTheHill' | 'racingKings' | 'threeCheck' | 'fromPosition', required
    - `name` string, required
    - `short` string
  - `speed` 'ultraBullet' | 'bullet' | 'blitz' | 'rapid' | 'classical' | 'correspondence'
  - `perf` 'ultraBullet' | 'bullet' | 'blitz' | 'rapid' | 'classical' | 'correspondence' | 'chess960' | 'crazyhouse' | 'antichess' | 'atomic' | 'horde' | 'kingOfTheHill' | 'racingKings' | 'threeCheck'
  - `rated` boolean
  - `fen` string
  - `turns` integer
  - `source` 'lobby' | 'friend' | 'ai' | 'api' | 'tournament' | 'position' | 'import' | 'importlive' | 'simul' | 'relay' | 'pool' | 'arena' | 'swiss'
  - `status` GameStatus
    - `id` 10 | 20 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 60, required
    - `name` 'created' | 'started' | 'aborted' | 'mate' | 'resign' | 'stalemate' | 'timeout' | 'draw' | 'outoftime' | 'cheat' | 'noStart' | 'unknownFinish' | 'insufficientMaterialClaim' | 'variantEnd', required
  - `createdAt` integer
  - `player` 'white' | 'black'
  - `fullId` string

## Other responses

- `400` — The creation of a game with Lichess AI failed.

---

[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)
