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

# Create an API token. The token value is returned only in this response.



## OpenAPI

````yaml /openapi/openapi.yaml post /tokens
openapi: 3.0.3
info:
  title: Albus API
  description: Albus service REST API
  version: 1.0.0
servers:
  - url: https://albus.sh/api
    description: Production server
  - url: http://localhost:8080
    description: Local development server
security:
  - bearerAuth: []
  - apiKeyAuth: []
tags:
  - name: Auth
    description: Identify the authenticated user.
  - name: Health
    description: Check service availability.
  - name: Secrets
    description: Manage secrets available to agent sessions.
  - name: Sessions
    description: Run and inspect agent sessions.
  - name: Tokens
    description: Manage organization API keys.
paths:
  /tokens:
    post:
      tags:
        - Tokens
      summary: Create an API token. The token value is returned only in this response.
      operationId: createToken
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTokenRequest'
      responses:
        '200':
          description: Created — token value is returned only at creation time
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTokenResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrUnauthorized'
      security:
        - bearerAuth: []
components:
  schemas:
    CreateTokenRequest:
      type: object
      required:
        - name
      properties:
        name:
          type: string
    CreateTokenResponse:
      type: object
      required:
        - id
        - name
        - token
        - created_at
      properties:
        id:
          type: string
          description: Globally unique lookup identifier.
        name:
          type: string
          description: Human-readable display name.
        token:
          type: string
          description: |
            The full API token value (format: alb-<id>-<secret>).
            Returned only at creation time — it cannot be retrieved again.
        created_at:
          type: string
          format: date-time
    ErrUnauthorized:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          description: Human-readable error message
          example: Invalid or expired token
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKeyAuth:
      type: http
      scheme: bearer
      description: Org-scoped API key issued via POST /tokens

````