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

# Create API key



## OpenAPI

````yaml POST /api/keys
openapi: 3.0.3
info:
  title: LiteLLM Agent Platform API
  description: >-
    Unified API for the LiteLLM Agent Platform — gateway, agents, sessions, and
    runtimes.
  version: 0.1.0
servers:
  - url: https://litellm-rust.onrender.com
    description: Production
  - url: http://localhost:4000
    description: Local (Docker Compose)
security:
  - BearerAuth: []
tags:
  - name: System
  - name: Models
  - name: Messages
  - name: API Keys
  - name: Agents
  - name: Sessions
  - name: Runtimes
  - name: MCP
paths:
  /api/keys:
    post:
      tags:
        - API Keys
      summary: Create a gateway API key
      operationId: createGatewayApiKey
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                label:
                  type: string
                  example: alice
      responses:
        '201':
          description: Created. The secret is returned once.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  label:
                    type: string
                  key:
                    type: string
                    description: The secret value — shown once, store it now.
        '401':
          description: Invalid or missing gateway key
      security:
        - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'Your LITELLM_MASTER_KEY. Default for local Docker Compose: `sk-local`'

````