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

# Create Api Key



## OpenAPI

````yaml https://api.galileo.ai/public/v2/openapi.json post /v2/users/api_keys
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.galileo.ai
    description: Galileo Public APIs - galileo-v2
security: []
paths:
  /v2/users/api_keys:
    post:
      tags:
        - api_keys
      summary: Create Api Key
      operationId: create_api_key_v2_users_api_keys_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateApiKeyRequest'
              examples:
                - description: My cool api_key
                  expires_at: '2025-04-01 09:00:00+00:00'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateApiKeyResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - OAuth2PasswordBearer: []
        - HTTPBasic: []
components:
  schemas:
    CreateApiKeyRequest:
      properties:
        description:
          type: string
          title: Description
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
          description: Expiry date for the API key
        project_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Project Id
        project_role:
          anyOf:
            - $ref: '#/components/schemas/CollaboratorRole'
            - type: 'null'
        api_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Api Key
          description: >-
            Optional pre-generated API key value. If not provided, one will be
            generated automatically. This is used for setups where the same API
            key needs to exist on multiple clusters.
      type: object
      required:
        - description
      title: CreateApiKeyRequest
    CreateApiKeyResponse:
      properties:
        id:
          type: string
          format: uuid4
          title: Id
        description:
          type: string
          title: Description
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        last_used:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Used
        project_id:
          anyOf:
            - type: string
              format: uuid4
            - type: 'null'
          title: Project Id
        project_role:
          anyOf:
            - $ref: '#/components/schemas/CollaboratorRole'
            - type: 'null'
        created_by:
          type: string
          format: uuid4
          title: Created By
        truncated:
          type: string
          title: Truncated
        api_key:
          type: string
          title: Api Key
      type: object
      required:
        - id
        - description
        - created_at
        - updated_at
        - created_by
        - truncated
        - api_key
      title: CreateApiKeyResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CollaboratorRole:
      type: string
      enum:
        - owner
        - editor
        - annotator
        - viewer
      title: CollaboratorRole
    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: Galileo-API-Key
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: https://api.galileo.ai/login
    HTTPBasic:
      type: http
      scheme: basic

````