Challenges

Challenge the AI

Start a game with Lichess AI. You will be notified on the event stream that a new game has started.

post/api/challenge/ai

Request

  • Base URL
    https://lichess.org
  • URL
    https://lichess.org/api/challenge/ai
  • Auth
    OAuth 2
    Authorization code: https://lichess.org/oauth
    Token URL: https://lichess.org/api/token scopes: challenge:write, bot:play, board:play

Request body application/x-www-form-urlencoded

levelinteger required

AI strength

clock.limitinteger

Clock initial time in seconds. If empty, a correspondence game is created.

clock.incrementinteger

Clock increment in seconds. If empty, a correspondence game is created.

days1 | 2 | 3 | 5 | 7 | 10 | 14

Days per move, for correspondence games. Clock settings must be omitted.

color'white' | 'black' | 'random'
variant'standard' | 'chess960' | 'crazyhouse' | 'antichess' | 'atomic' | 'horde' | 'kingOfTheHill' | 'racingKings' | 'threeCheck' | 'fromPosition'
fenstring

Custom initial position (in X-FEN). Variant must be standard, fromPosition, or chess960 (if a valid 960 starting position), and the game cannot be rated.

Example request

{
  "clock.limit": 300,
  "clock.increment": 1
}

Response

The game with Lichess AI was successfully started.

idstring
speed'ultraBullet' | 'bullet' | 'blitz' | 'rapid' | 'classical' | 'correspondence'
perf'ultraBullet' | 'bullet' | 'blitz' | 'rapid' | 'classical' | 'correspondence' | 'chess960' | 'crazyhouse' | 'antichess' | 'atomic' | 'horde' | 'kingOfTheHill' | 'racingKings' | 'threeCheck'
ratedboolean
fenstring
turnsinteger
source'lobby' | 'friend' | 'ai' | 'api' | 'tournament' | 'position' | 'import' | 'importlive' | 'simul' | 'relay' | 'pool' | 'arena' | 'swiss'
createdAtinteger
player'white' | 'black'
fullIdstring

Changes

No recorded changes to this operation across all 16 revisions of this API.