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

# Create auth token

> Verifies an API key and returns a short-lived bearer token.



## OpenAPI

````yaml POST /api/v1/auth/token
openapi: 3.1.0
info:
  title: FamilyCo API
  description: Core and Knowledge endpoints from the FamilyCo Fastify server.
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: http://127.0.0.1:4000
    description: Local development server
security:
  - bearerAuth: []
tags:
  - name: Core
    description: Infrastructure and runtime status endpoints.
  - name: Auth
    description: Token and API key related endpoints.
  - name: Knowledge
    description: Document upload, indexing, and retrieval endpoints.
paths:
  /api/v1/auth/token:
    post:
      tags:
        - Auth
      summary: Create JWT from API key
      description: Verifies an API key and returns a short-lived bearer token.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthTokenRequest'
      responses:
        '200':
          description: Token created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthTokenResponse'
        '401':
          description: Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security: []
components:
  schemas:
    AuthTokenRequest:
      type: object
      required:
        - apiKey
      properties:
        apiKey:
          type: string
          minLength: 1
        agentId:
          type: string
          minLength: 1
    AuthTokenResponse:
      type: object
      required:
        - token
        - tokenType
        - apiKeyId
        - level
      properties:
        token:
          type: string
        tokenType:
          type: string
          enum:
            - Bearer
        apiKeyId:
          type: string
        level:
          type: string
          enum:
            - L0
            - L1
            - L2
    ErrorResponse:
      type: object
      required:
        - statusCode
        - code
        - message
      properties:
        statusCode:
          type: integer
        code:
          type: string
        message:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````