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

# Create an API key

> Mints a new key. The `plaintext` field in the response is shown exactly once — store it securely.



## OpenAPI

````yaml openapi.json POST /api/v1/keys
openapi: 3.1.0
info:
  title: Vine API
  version: extraction.v1
  description: >-
    Provider detection and extraction service. URL in → structured business data
    out.
servers:
  - url: https://vine.getcourtyard.ai
security:
  - bearerAuth: []
paths:
  /api/v1/keys:
    post:
      summary: Create an API key
      description: >-
        Mints a new key. The `plaintext` field in the response is shown exactly
        once — store it securely.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateKeyRequest'
      responses:
        '201':
          description: Key created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  key:
                    $ref: '#/components/schemas/KeyCreated'
        '422':
          $ref: '#/components/responses/Error'
      security: []
components:
  schemas:
    CreateKeyRequest:
      type: object
      required:
        - name
      additionalProperties: false
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 100
          description: Human label for the key (e.g. 'hassan-dev').
          example: my-service-key
        env:
          type: string
          enum:
            - live
            - test
          default: test
          description: Key prefix environment. Defaults to 'test'.
        scopes:
          type: array
          items:
            type: string
          description: >-
            Override default scopes. Defaults to ['detect', 'extract',
            'extractions:read'].
    KeyCreated:
      type: object
      description: Includes the one-time plaintext.
      properties:
        id:
          type: string
        name:
          type: string
        keyPrefix:
          type: string
        plaintext:
          type: string
          description: Shown once — never stored.
        scopes:
          type: array
          items:
            type: string
        rateTier:
          type: string
        createdAt:
          type: string
          format: date-time
  responses:
    Error:
      description: Error envelope.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                properties:
                  code:
                    type: string
                  message:
                    type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: vine_live_… / vine_test_… API key

````