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

# Create an API key

> Generates a new API key for programmatic access. The plain-text key is only returned once.



## OpenAPI

````yaml post /v1/system/api-keys
openapi: 3.0.0
info:
  title: Revstack API
  version: 1.0.0
  description: >-
    Open Source Billing OS for Developers. The scalable, developer-first billing
    engine with subscriptions, invoicing, usage metering, and entitlements.
servers:
  - url: http://localhost:6900
    description: Revstack API (Local Development)
security: []
paths:
  /v1/system/api-keys:
    post:
      tags:
        - API Keys
      summary: Create an API key
      description: >-
        Generates a new API key for programmatic access. The plain-text key is
        only returned once.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                environment_id:
                  type: string
                  minLength: 1
                name:
                  type: string
                  minLength: 1
                type:
                  type: string
                  enum:
                    - public
                    - secret
                scopes:
                  type: array
                  items:
                    type: string
                  default: []
              required:
                - environment_id
                - name
                - type
      responses:
        '201':
          description: API key created
          content:
            application/json:
              schema:
                nullable: true

````