> ## Documentation Index
> Fetch the complete documentation index at: https://video2ctx-feat-polar-billing.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Start CLI device authorization

> Issues a short-lived device code and a user code for the registered video2ctx CLI client.



## OpenAPI

````yaml /api-reference/openapi.json post /api/auth/device/code
openapi: 3.1.0
info:
  title: video2ctx API
  version: 1.0.0
  license:
    name: Apache License 2.0
    identifier: Apache-2.0
  description: >-
    Consumer-facing contract for the hosted video2ctx API. First-party
    application and operator routes are documented separately at
    https://docs.video2ctx.dev/internals/overview.
servers:
  - url: https://api.video2ctx.dev
    description: Hosted video2ctx API
security: []
tags:
  - name: System
    description: Service status and machine-readable documentation.
  - name: Authentication
    description: Better Auth entry points used by the web application.
  - name: Providers
    description: Supported external video providers and their capabilities.
  - name: Discovery
    description: Search, browse, and trend research.
  - name: Videos
    description: Video metadata and evidence.
  - name: Channels
    description: Channel inspection.
  - name: Playlists
    description: Playlist inspection.
  - name: Projects
    description: Private research projects and saved material.
  - name: Research
    description: Imports, jobs, cited answers, comparisons, and reports.
  - name: Exports
    description: Project export creation and download.
  - name: Monitoring
    description: Monitors, notifications, and digest preferences.
  - name: Billing
    description: Plan, credit, and subscription status.
  - name: Account
    description: Account lifecycle operations.
paths:
  /api/auth/device/code:
    post:
      tags:
        - Authentication
      summary: Start CLI device authorization
      description: >-
        Issues a short-lived device code and a user code for the registered
        video2ctx CLI client.
      operationId: startDeviceAuthorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - client_id
              properties:
                client_id:
                  type: string
                  const: video2ctx-cli
                scope:
                  type: string
                  const: data:read account:access
      responses:
        '200':
          description: Device authorization details.
          content:
            application/json:
              schema:
                type: object
                required:
                  - device_code
                  - user_code
                  - verification_uri
                  - verification_uri_complete
                  - expires_in
                  - interval
                properties:
                  device_code:
                    type: string
                    writeOnly: true
                  user_code:
                    type: string
                  verification_uri:
                    type: string
                    format: uri
                  verification_uri_complete:
                    type: string
                    format: uri
                  expires_in:
                    type: integer
                    minimum: 1
                  interval:
                    type: integer
                    minimum: 1
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/ServerError'
      security: []
components:
  responses:
    BadRequest:
      description: The request is malformed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: An unexpected server error occurred.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: QUERY_REQUIRED
            message:
              type: string
            details: {}
            requestId:
              type: string

````