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

# Get credit balance



## OpenAPI

````yaml /openapi.json get /api/v1/credits
openapi: 3.1.0
info:
  title: Porn Factory AI API
  version: 1.0.0
  description: >-
    Catalog-backed image and video generation with credit accounting, polling,
    and signed webhooks.
servers:
  - url: https://pornfactoryai.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Catalog
    description: Generator-ready checkpoints and LoRAs
  - name: Credits
    description: Account credit balance
  - name: Generations
    description: Image and video request lifecycle
paths:
  /api/v1/credits:
    get:
      tags:
        - Credits
      summary: Get credit balance
      operationId: getCreditBalance
      responses:
        '200':
          description: Current credit balance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditBalance'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  schemas:
    CreditBalance:
      type: object
      required:
        - object
        - available_credits
        - bonus_credits
        - total_credits
      properties:
        object:
          type: string
          const: credit_balance
        available_credits:
          type: number
        bonus_credits:
          type: number
        total_credits:
          type: number
    Error:
      type: object
      required:
        - error
        - code
      properties:
        error:
          type: string
        code:
          type: string
        available_credits:
          type: number
        required_credits:
          type: number
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Missing scope or suspended account
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Rate limit exceeded
      headers:
        X-RateLimit-Limit:
          schema:
            type: integer
        X-RateLimit-Remaining:
          schema:
            type: integer
        X-RateLimit-Reset:
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServiceUnavailable:
      description: Temporary platform failure
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: pfai_ API key
      description: Create a scoped key at https://pornfactoryai.com/account?tab=developer

````