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

# Create an API key

> Create a new gf_live_* API key (plaintext returned once; OAuth JWT required).



## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/account/api-keys
openapi: 3.1.0
info:
  title: Gainflow API
  version: 1.1.0
  description: >
    Hard-to-get web data delivered to builders and AI agents. All public REST
    endpoints use snake_case JSON, RFC 9457 application/problem+json errors,
    opaque cursor pagination, and IETF RateLimit headers. Remote MCP server
    endpoint: https://mcp.gainflow.ai/mcp (OAuth 2.1 via WorkOS AuthKit or
    Bearer gf_live_*).
servers:
  - url: https://api.gainflow.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Scraping
    description: Fetch pages and PDFs, and discover URLs on a site.
  - name: Monitors
    description: Scheduled website change monitoring and diff history.
  - name: Webhooks
    description: Signed HMAC-SHA256 outbound webhook endpoints and delivery logs.
  - name: Batches
    description: Asynchronous bulk URL scraping jobs.
  - name: Crawls
    description: Asynchronous multi-page website crawls.
  - name: Account
    description: Credit balance, plan and the credit ledger.
  - name: API keys
    description: Create, list and revoke gf_live_* keys. Needs a signed-in OAuth session.
  - name: Billing
    description: Stripe Checkout and Customer Portal. Needs a signed-in OAuth session.
paths:
  /v1/account/api-keys:
    post:
      tags:
        - API keys
      summary: Create an API key
      description: >-
        Create a new gf_live_* API key (plaintext returned once; OAuth JWT
        required).
      operationId: createApiKey
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateApiKeyRequest'
      responses:
        '201':
          description: Created API key with one-time plaintext value
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreatedApiKey'
        '400':
          $ref: '#/components/responses/ProblemResponse'
        '401':
          $ref: '#/components/responses/ProblemResponse'
components:
  schemas:
    CreateApiKeyRequest:
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 80
        scopes:
          type: array
          maxItems: 20
          items:
            type: string
          default: []
    CreatedApiKey:
      allOf:
        - $ref: '#/components/schemas/ApiKeySummary'
        - type: object
          required:
            - key
          properties:
            key:
              type: string
              description: Full gf_live_* secret key returned once upon creation.
    ApiKeySummary:
      type: object
      required:
        - id
        - name
        - key_prefix
        - scopes
        - revoked_at
        - last_used_at
        - created_at
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        key_prefix:
          type: string
        scopes:
          type: array
          items:
            type: string
        revoked_at:
          type:
            - string
            - 'null'
          format: date-time
        last_used_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
    ProblemDetails:
      type: object
      required:
        - type
        - title
        - status
        - code
        - request_id
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        code:
          type: string
          enum:
            - UNAUTHORIZED
            - FORBIDDEN
            - INSUFFICIENT_CREDITS
            - RATE_LIMITED
            - VALIDATION_ERROR
            - NOT_FOUND
            - CONFLICT
            - UPSTREAM_FAILED
            - INTERNAL_ERROR
        request_id:
          type: string
  responses:
    ProblemResponse:
      description: RFC 9457 Problem Details error
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ProblemDetails'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Either a Gainflow API key (gf_live_*) or a WorkOS AuthKit OAuth 2.1 JWT.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.