> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hexclave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Initiate CLI authentication

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



## OpenAPI

````yaml /openapi/server.json post /auth/cli
openapi: 3.1.0
info:
  title: Hexclave REST API
  version: 1.0.0
  description: >-
    The Hexclave REST API. All request headers are documented as canonical
    `X-Hexclave-*`; the equivalent `X-Stack-*` aliases are accepted on every
    endpoint for backwards compatibility. Response headers
    `X-Hexclave-actual-status`, `X-Hexclave-known-error`, and
    `X-Hexclave-request-id` are emitted alongside their legacy `X-Stack-*`
    equivalents.
servers:
  - url: https://api.hexclave.com/api/v1
    description: Hexclave REST API
security: []
paths:
  /auth/cli:
    post:
      tags:
        - CLI Authentication
      summary: Initiate CLI authentication
      description: >-
        Create a new CLI authentication session and return polling and login
        codes
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                expires_in_millis:
                  type: number
                  default: 120000
                anon_refresh_token:
                  type: string
              example: {}
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  polling_code:
                    type: string
                  login_code:
                    type: string
                  expires_at:
                    type: string
                required:
                  - polling_code
                  - login_code
                  - expires_at

````