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

# Create API Key

> Create a new API key for a project. Requires project ownership.

Create a new API key for a specific project. Requires project ownership.

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication
</ParamField>

### Path Parameters

<ParamField path="project_id" type="string" required>
  Unique project identifier
</ParamField>

### Body

<ParamField body="name" type="string">
  API key name/description (optional)
</ParamField>

### Response

<ResponseField name="id" type="string">
  API key unique identifier
</ResponseField>

<ResponseField name="key" type="string">
  The actual API key (only shown once during creation)
</ResponseField>

<ResponseField name="name" type="string">
  API key name
</ResponseField>

<ResponseField name="project_id" type="string">
  Associated project ID
</ResponseField>

<ResponseField name="created_at" type="string">
  API key creation timestamp
</ResponseField>

<Warning>
  The API key is only displayed once during creation. Store it securely as you won't be able to retrieve it again.
</Warning>


## OpenAPI

````yaml POST /api/v1/projects/{project_id}/api-keys
openapi: 3.1.0
info:
  title: Dev Kit for AI API
  description: 'API for Dev Kit for AI: Developer Toolkit for AI-Powered Web Applications'
  version: 1.6.1
servers:
  - url: https://api.devkit4ai.com
    description: Dev Kit for AI Production Server
  - url: https://api.vibecoding.ad
    description: Vibe Coding Production Server
security: []
paths:
  /api/v1/projects/{project_id}/api-keys:
    post:
      tags:
        - Project Management
      summary: Create Api Key
      description: Create a new API key for a project. Requires project ownership.
      operationId: create_api_key_api_v1_projects__project_id__api_keys_post
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Project Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiKeyCreateRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyCreatedResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ApiKeyCreateRequest:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Name
      type: object
      title: ApiKeyCreateRequest
    ApiKeyCreatedResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        key:
          type: string
          title: Key
        key_prefix:
          type: string
          title: Key Prefix
        is_active:
          type: boolean
          title: Is Active
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - name
        - key
        - key_prefix
        - is_active
        - created_at
      title: ApiKeyCreatedResponse
    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:
    HTTPBearer:
      type: http
      scheme: bearer

````