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

# Create API Key

> Create a new API key for the organization

Create a new API key for your organization. The API key will be created with the specified name and monthly limit.

<Warning>
  The API key string is only returned once upon creation. Make sure to save it securely as it cannot be retrieved later.
</Warning>


## OpenAPI

````yaml POST /v1/manage/apikey
openapi: 3.0.3
info:
  title: Requesty API
  description: Requesty API for AI model routing and key management
  version: 1.0.0
servers:
  - url: https://api-v2.requesty.ai
    description: Management API endpoint
  - url: https://router.requesty.ai
    description: Inference router endpoint
security:
  - BearerAuth: []
paths:
  /v1/manage/apikey:
    servers:
      - url: https://api-v2.requesty.ai
        description: Management API endpoint
    post:
      summary: Create new API key
      description: Create a new API key for the organization
      operationId: createApiKey
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateApiKeyRequest'
      responses:
        '200':
          description: API key created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateApiKeyResponse'
        '400':
          description: Bad request - malformed payload or invalid parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - missing or empty Authorization header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Payment required - organization balance exhausted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden - invalid token or model not in access list.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found - provider/model not supported.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded. Retry after the Retry-After header value.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: Bad gateway - upstream provider returned an invalid response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CreateApiKeyRequest:
      type: object
      properties:
        name:
          type: string
        monthly_limit:
          type: number
          format: decimal
        permissions:
          $ref: '#/components/schemas/GetApiKeyPermissions'
      required:
        - name
    CreateApiKeyResponse:
      type: object
      properties:
        api_key_id:
          type: string
          format: uuid
        api_key:
          type: string
      required:
        - api_key_id
        - api_key
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - origin
            - message
          properties:
            origin:
              type: string
              enum:
                - router
                - provider
              description: >-
                Whether the error originated from Requesty's router or an
                upstream provider.
            message:
              type: string
              description: Human-readable error description.
    GetApiKeyPermissions:
      type: object
      properties:
        manage:
          $ref: '#/components/schemas/ApiKeyPermissions'
        completions:
          $ref: '#/components/schemas/ApiKeyPermissions'
      required:
        - manage
        - completions
    ApiKeyPermissions:
      type: string
      enum:
        - none
        - read
        - write
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key for authentication

````