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

# Create API Key

> Creates a new API Key for the specified Project. The API Key is used to authenticate requests to the Peaka API on behalf of the Project.

The full key value is only returned once at creation time. Store it securely, as it cannot be retrieved later.


<span style={{display: "flex", gap: "10px", flexDirection: "row", alignItems: "center"}}>
  <img src="https://cdn.peaka.com/badges/partner-api-key-badge.png" />
</span>


## OpenAPI

````yaml post /projects/{projectId}/apiKeys
openapi: 3.0.1
info:
  title: Peaka Gateway API
  description: Peaka Gateway API Documentation
  version: '1.0'
servers:
  - url: https://partner.peaka.studio/api/v1
    description: Default Server URL (US Zone)
  - url: https://partner.eu.peaka.studio/api/v1
    description: EU Zone
security:
  - bearerAuth: []
paths:
  /projects/{projectId}/apiKeys:
    post:
      tags:
        - Projects -- Api Key
      summary: Create API Key
      description: >
        Creates a new API Key for the specified Project. The API Key is used to
        authenticate requests to the Peaka API on behalf of the Project.


        The full key value is only returned once at creation time. Store it
        securely, as it cannot be retrieved later.
      operationId: createApiKey
      parameters:
        - name: projectId
          in: path
          description: Project ID
          required: true
          schema:
            type: string
          example: mtKDhe1U
      requestBody:
        description: API Key request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiKeyRequest'
            examples:
              API Key Request with Expiration:
                description: API Key Request with Expiration
                value:
                  name: test
                  expiresAt: '2027-09-10T10:11:00Z'
              API Key Request With No Expiration:
                description: API Key Request With No Expiration
                value:
                  name: test
        required: true
      responses:
        '200':
          description: API Key created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKey'
              examples:
                API Key:
                  description: API Key
                  value:
                    name: test
                    apiKey: TtgGcQFq.s3fzROFoop8uHG4pS2LYhoqn1rLb6oW6
                    apiKeyId: 21fd1a8d-88d5-4295-b792-5b2113138057
components:
  schemas:
    ApiKeyRequest:
      type: object
      properties:
        name:
          type: string
          description: Name of the API key
        expiresAt:
          type: string
          description: >-
            The expiration date and time of the API key in ISO-8601 format
            (e.g., "2025-12-31T23:59:59Z").
             If not provided, the API key will not have an expiration date.
             The time should be in the ISO-8601 standard.
          format: date-time
    ApiKey:
      type: object
      properties:
        name:
          type: string
          description: Name of the API key
        apiKey:
          type: string
          description: >-
            API key. It is a secret and should not be shared. Please store it
            securely. You will not be able to see it again.
        apiKeyId:
          type: string
          description: ID of the API key
          format: uuid
        expiresAt:
          type: string
          description: |-
            Expiration date of the API key. If null, the API key never expires.
             The time is in the ISO-8601 standard.
          format: date-time
      description: Represents an API key.
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        Use the Authorization header with the value 'Bearer <apiKey>' to
        authenticate. Partner API Keys have full access; Project API Keys are
        limited to their project scope. Learn more:
        https://docs.peaka.com/api-reference/authentication
      scheme: bearer
      bearerFormat: Api Key

````