---
title: "Initiate CLI authentication"
method: POST
path: "/auth/cli"
tags: ["CLI Authentication"]
---

# Initiate CLI authentication

`POST /auth/cli`

Create a new CLI authentication session and return polling and login codes

## Request body

- object
  - `expires_in_millis` number
  - `anon_refresh_token` string

## Response `200`

Successful response

- object
  - `polling_code` string, required
  - `login_code` string, required
  - `expires_at` string, required

## Changes

> 24 revisions in range; 5 could not be searched.

- **2026-05-08** `ccf1b36f90b1` — 1 info
  - the `expires_in_millis` request property default value changed from `7200000` to `120000`
- **2026-05-06** `9025167b1683` — 1 info
  - added the new optional request property `anon_refresh_token`

[Change history](https://skmtc.dev/hexclave/apis/hexclave-rest-api-2/changes/auth/cli/post.md)

---

[API](https://skmtc.dev/hexclave/apis/hexclave-rest-api-2.md) · [All operations](https://skmtc.dev/hexclave/apis/hexclave-rest-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hexclave/hexclave-rest-api-2/revisions/897c83038ab2/schema)
