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

# Generate an AI Story

> Async. Generates a 5 or 9 scene story with dialogue from a single reference image. Flat 50 credits for `short`, 80 for `medium`. Poll the returned job.



## OpenAPI

````yaml /openapi.json post /api/v1/ai-story
openapi: 3.1.0
info:
  title: VidGuy API
  version: 1.0.0
  description: >-
    Make videos, snacks, carousels, images and audio with VidGuy, and post them
    to your connected accounts. Authenticate with a `vf_live_` key as a Bearer
    token.
servers:
  - url: https://www.vidguy.ai
security:
  - ApiKeyAuth: []
tags:
  - name: Jobs
  - name: Credits
  - name: Brands
  - name: Snacks and memes
  - name: Videos
  - name: Carousels and slides
  - name: Images and video models
  - name: Characters
  - name: Editing
  - name: Assets
  - name: Audio
  - name: Social posting
paths:
  /api/v1/ai-story:
    post:
      tags:
        - Videos
      summary: Generate an AI Story
      description: >-
        Async. Generates a 5 or 9 scene story with dialogue from a single
        reference image. Flat 50 credits for `short`, 80 for `medium`. Poll the
        returned job.
      operationId: createAiStory
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAiStoryRequest'
      responses:
        '201':
          description: AI Story job accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateAiStoryResponse'
        '400':
          description: Invalid request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Insufficient credits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Quota or rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: Failed to dispatch the worker.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: AI Story pipeline unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreateAiStoryRequest:
      type: object
      properties:
        directorInput:
          $ref: '#/components/schemas/DirectorInput'
        prompt:
          type: string
          minLength: 10
          maxLength: 5000
        referenceImageUrl:
          type: string
          format: uri
        styleTemplateId:
          type: string
          enum:
            - fruit-drama
            - toy-soap
            - claymotion
            - anime-romance
            - educational-explainer
            - custom
        styleReferenceImageUrl:
          type: string
          format: uri
        duration:
          type: string
          enum:
            - short
            - medium
        engine:
          type: string
          enum:
            - grok
        platform:
          type: string
          enum:
            - tiktok
            - reels
            - shorts
            - youtube
            - linkedin
        topic:
          type: string
          minLength: 3
          maxLength: 5000
        name:
          type: string
          minLength: 1
          maxLength: 200
      required:
        - prompt
        - referenceImageUrl
    CreateAiStoryResponse:
      type: object
      properties:
        jobId:
          type: string
        offeringId:
          type: string
          enum:
            - ai_story_generation
        projectId:
          type: string
        status:
          $ref: '#/components/schemas/ApiJobStatus'
        pollUrl:
          type: string
        instanceId:
          type:
            - string
            - 'null'
        creditsReserved:
          type: integer
        duration:
          type: string
          enum:
            - short
            - medium
        sceneCount:
          type: integer
      required:
        - jobId
        - offeringId
        - projectId
        - status
        - pollUrl
        - creditsReserved
        - duration
        - sceneCount
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          example: Invalid request
        message:
          type: string
        details:
          type: object
          additionalProperties: {}
      required:
        - error
    DirectorInput:
      type: object
      properties:
        version:
          type: number
          enum:
            - 1
        mode:
          type: string
          enum:
            - guide
            - locked
        creativeIntent:
          type: string
          minLength: 1
          maxLength: 2000
        visualDirection:
          type: string
          minLength: 1
          maxLength: 2000
        continuity:
          type: string
          minLength: 1
          maxLength: 2000
        avoid:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 500
          minItems: 1
          maxItems: 20
        scenes:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                minLength: 1
                maxLength: 80
                pattern: ^[a-zA-Z0-9_-]+$
              durationMs:
                type: integer
                exclusiveMinimum: 0
                maximum: 120000
              narration:
                type: string
                minLength: 1
                maxLength: 5000
              dialogue:
                type: array
                items:
                  type: object
                  properties:
                    speaker:
                      type: string
                      minLength: 1
                      maxLength: 80
                    line:
                      type: string
                      minLength: 1
                      maxLength: 1500
                  required:
                    - speaker
                    - line
                  additionalProperties: false
                minItems: 1
                maxItems: 10
              visualPrompt:
                type: string
                minLength: 1
                maxLength: 5000
              motionPrompt:
                type: string
                minLength: 1
                maxLength: 2000
              referenceAssetIds:
                type: array
                items:
                  type: string
                  format: uuid
                maxItems: 5
            required:
              - id
              - visualPrompt
            additionalProperties: false
          minItems: 1
          maxItems: 20
      required:
        - version
        - mode
      additionalProperties: false
      description: >-
        Optional, versioned creative/scene direction. Feature-gated;
        job-specific capabilities determine which fields and control modes can
        execute. Omit to retain existing generation behavior. Locked mode
        requires scenes with unique IDs; maximum 80,000 serialized characters.
    ApiJobStatus:
      type: string
      enum:
        - queued
        - processing
        - awaiting_selection
        - completed
        - failed
        - cancelled
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: 'Send your API key in the Authorization header: `Bearer vf_live_...`'

````

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