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

- **2026-05-08** `9ef0ae1d9ad9` — 1 info
  - the `expires_in_millis` request property default value changed from `7200000` to `120000`
- **2026-05-06** `7fcc5cbc3884` — 1 info
  - added the new optional request property `anon_refresh_token`

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

---

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