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

# Create Api Key

> Mint an API key. The secret is returned HERE AND NOWHERE ELSE.



## OpenAPI

````yaml /openapi.json post /account/keys
openapi: 3.1.0
info:
  title: Corpus API
  description: >-
    Point-in-time financial and governed-document data for the US, India, and
    China.
  version: '2026-07-20'
servers:
  - url: https://corpus-api.onera.app
    description: Production
security: []
paths:
  /account/keys:
    post:
      tags:
        - Account
      summary: Create Api Key
      description: Mint an API key. The secret is returned HERE AND NOWHERE ELSE.
      operationId: create_api_key_account_keys_post
      parameters:
        - name: name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Name
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatedApiKeyResponse'
        '400':
          description: Invalid parameter combination
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Insufficient jurisdiction or scope
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Unknown resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Request schema validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Source content is unavailable or still processing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - X-API-KEY: []
components:
  schemas:
    CreatedApiKeyResponse:
      properties:
        key_id:
          type: string
          title: Key Id
        api_key:
          type: string
          title: Api Key
        key_prefix:
          type: string
          title: Key Prefix
        scopes:
          items:
            type: string
          type: array
          title: Scopes
        message:
          type: string
          title: Message
          default: Store this key now. It cannot be retrieved again.
      type: object
      required:
        - key_id
        - api_key
        - key_prefix
        - scopes
      title: CreatedApiKeyResponse
      description: >-
        The only response that ever contains the secret.


        ``api_key`` is shown once and is unrecoverable afterwards — only its
        SHA-256 digest is

        stored, so a database disclosure cannot be turned back into a working
        credential.
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
        message:
          type: string
          title: Message
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
      type: object
      required:
        - error
        - message
      title: ErrorResponse
  securitySchemes:
    X-API-KEY:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        Provisioned Corpus API key with the required jurisdiction and operation
        scopes.

````