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

# Create a new API key



## OpenAPI

````yaml post /api/auth/api-keys
openapi: 3.0.3
info:
  title: Momanic Public API
  version: 0.1.0
  description: |
    Public API for account, infrastructure, and support operations.
    This spec intentionally excludes payment and checkout flows.
servers:
  - url: https://my.momanic.com
    description: Production
security: []
tags:
  - name: Auth
  - name: API Keys
  - name: Products
  - name: Services
  - name: SSH Keys
  - name: Notifications
  - name: Support
paths:
  /api/auth/api-keys:
    post:
      tags:
        - API Keys
      summary: Create a new API key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateApiKeyRequest'
      responses:
        '201':
          description: API key created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateApiKeyResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    CreateApiKeyRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 64
        expiresInDays:
          type: integer
          minimum: 1
          maximum: 3650
      required:
        - name
    CreateApiKeyResponse:
      allOf:
        - $ref: '#/components/schemas/ApiKey'
        - type: object
          properties:
            apiKey:
              type: string
              description: Returned only at creation time.
    ApiKey:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        keyPreview:
          type: string
        createdAt:
          type: string
          format: date-time
          nullable: true
        lastUsedAt:
          type: string
          format: date-time
          nullable: true
        expiresAt:
          type: string
          format: date-time
          nullable: true
        revokedAt:
          type: string
          format: date-time
          nullable: true
        state:
          type: string
          enum:
            - active
            - expired
            - revoked
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Bearer token (access token or API key)

````