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

# Obtenir un JWT depuis une clé d'API

> Échange une clé d'API valide contre un token d'accès JWT de courte durée. Fournissez éventuellement 'external_user_id' pour limiter le jeton à un utilisateur final spécifique.



## OpenAPI

````yaml /api-reference/openapi.fr.json post /auth/token
openapi: 3.1.0
info:
  title: UBIK Public API
  description: Publicly accessible API endpoints for UBIK.
  version: '1.0'
servers:
  - url: https://app.ubik-agent.com/api/v1
    description: Production Server
security: []
paths:
  /auth/token:
    post:
      tags:
        - Public API
        - Public API - Authentication
      summary: Obtenir un JWT depuis une clé d'API
      description: >-
        Échange une clé d'API valide contre un token d'accès JWT de courte
        durée. Fournissez éventuellement 'external_user_id' pour limiter le
        jeton à un utilisateur final spécifique.
      operationId: create_token_from_api_key_auth_token_post
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/PublicScopedTokenRequest'
                - type: 'null'
              title: Token Request
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Token'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    PublicScopedTokenRequest:
      properties:
        external_user_id:
          type: string
          title: External User Id
          description: The unique identifier of the end-user to scope this token to.
          example: user_123
        expires_in_minutes:
          type: integer
          maximum: 1440
          minimum: 5
          title: Expires In Minutes
          description: Token expiration time in minutes.
          default: 60
      type: object
      required:
        - external_user_id
      title: PublicScopedTokenRequest
    Token:
      properties:
        access_token:
          type: string
          title: Access Token
        token_type:
          type: string
          title: Token Type
      type: object
      required:
        - access_token
        - token_type
      title: Token
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-KEY

````