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

# Create API key

> Generate a new API key. Requires Supabase JWT authentication (API keys cannot create other keys).



## OpenAPI

````yaml /openapi.json post /api/keys
openapi: 3.0.3
info:
  title: SQR API
  description: >-
    Invisible watermarking, digital twin registration, and NFT minting for
    product authentication.
  version: 1.0.0
  contact:
    name: SQR Support
    url: https://yys-sqr-render-bsbe.onrender.com
servers:
  - url: https://yys-sqr-render-bsbe.onrender.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Health
    description: Server status
  - name: Templates
    description: Record templates and field definitions
  - name: Records
    description: Create, read, update, and sync digital twin records
  - name: Watermarking
    description: Embed and scan invisible watermarks
  - name: NFT
    description: Mint and claim ERC-721 tokens for records
  - name: API Keys
    description: Manage API keys (requires Supabase JWT)
paths:
  /api/keys:
    post:
      tags:
        - API Keys
      summary: Create API key
      description: >-
        Generate a new API key. Requires Supabase JWT authentication (API keys
        cannot create other keys).
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  default: default
                  description: Human-readable key name
      responses:
        '201':
          description: API key created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKey'
components:
  schemas:
    ApiKey:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
          example: my-key
        token:
          type: string
          description: Only returned on creation or when key is active.
        active:
          type: boolean
        last_used_at:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Pass a Supabase JWT or a 48-character hex API key as a Bearer token.

````