> ## 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 a generation request

> Returns the latest status for a request created by the same API key.



## OpenAPI

````yaml /openapi.json get /api/v1/requests/{requestId}
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/requests/{requestId}:
    get:
      tags:
        - Generations
      summary: Get a generation request
      description: Returns the latest status for a request created by the same API key.
      operationId: getGenerationRequest
      parameters:
        - name: requestId
          in: path
          required: true
          schema:
            type: string
            pattern: ^req_
      responses:
        '200':
          description: Current generation status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Generation'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  schemas:
    Generation:
      type: object
      required:
        - object
        - request_id
        - status
        - poll_url
        - credits
        - created_at
        - updated_at
      properties:
        object:
          type: string
          const: generation
        request_id:
          type: string
          pattern: ^req_
        status:
          type: string
          enum:
            - IN_QUEUE
            - IN_PROGRESS
            - COMPLETED
            - FAILED
        kind:
          type:
            - string
            - 'null'
          enum:
            - image
            - video
            - null
        poll_url:
          type: string
          format: uri
        progress:
          type: number
        credits:
          type: object
          required:
            - charged
          properties:
            charged:
              type: number
        output:
          type: object
          properties:
            media_url:
              type:
                - string
                - 'null'
              format: uri
            preview_url:
              type:
                - string
                - 'null'
              format: uri
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        completed_at:
          type:
            - string
            - 'null'
          format: date-time
    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'
    NotFound:
      description: Scoped request not found
      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

````