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

# Video Generation

> Start a video generation job. Supports 6 models. **$5.00/video:** `veo-3.1` (Google best quality). **$3.00/video:** `seedance-2` (default, uncensored, 5–15s), `kling-video` (motion quality, 5–10s), `google-veo-2` (fast cinematic, 5/6/8s), `veo-3.1-fast` (speed-optimized, 4/6/8s), `google-veo-3-fast` (budget Veo, 4/6/8s). Poll the status endpoint with the returned `request_id` to retrieve the result.



## OpenAPI

````yaml /openapi.json post /api/v1/video
openapi: 3.1.0
info:
  title: NinjaChat API
  version: 1.0.0
  description: >-
    Access 40+ AI models through a unified API — chat, image generation, video
    generation, and web search. One API key, one endpoint per type, just change
    the `model` parameter.
servers:
  - url: https://www.ninjachat.ai
security:
  - bearerAuth: []
paths:
  /api/v1/video:
    post:
      tags:
        - Endpoints
      summary: Video Generation
      description: >-
        Start a video generation job. Supports 6 models. **$5.00/video:**
        `veo-3.1` (Google best quality). **$3.00/video:** `seedance-2` (default,
        uncensored, 5–15s), `kling-video` (motion quality, 5–10s),
        `google-veo-2` (fast cinematic, 5/6/8s), `veo-3.1-fast`
        (speed-optimized, 4/6/8s), `google-veo-3-fast` (budget Veo, 4/6/8s).
        Poll the status endpoint with the returned `request_id` to retrieve the
        result.
      operationId: generateVideo
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - prompt
              properties:
                prompt:
                  type: string
                  minLength: 1
                  maxLength: 4000
                  description: >-
                    Text description of the video to generate. Cannot be empty
                    or whitespace-only.
                model:
                  type: string
                  enum:
                    - seedance-2
                    - kling-video
                    - google-veo-2
                    - veo-3.1
                    - veo-3.1-fast
                    - google-veo-3-fast
                  default: seedance-2
                  description: >-
                    Video model to use. **$5.00/video:** `veo-3.1` (Google best
                    quality). **$3.00/video:** `seedance-2` (longest clips,
                    5–15s), `kling-video` (motion quality, 5–10s),
                    `google-veo-2` (fastest, ~40s), `veo-3.1-fast`
                    (speed-optimized, 4/6/8s), `google-veo-3-fast` (budget Veo,
                    4/6/8s).
                duration:
                  type: integer
                  minimum: 4
                  maximum: 15
                  default: 8
                  description: >-
                    Video length in seconds. Seedance 2: 5–15. Kling: 5–10. Veo
                    2: 5–8. Veo 3.1 / Veo 3.1 Fast: 4, 6, or 8.
                aspect_ratio:
                  type: string
                  enum:
                    - '16:9'
                    - '9:16'
                  default: '16:9'
                  description: >-
                    Aspect ratio. `16:9` for landscape, `9:16` for portrait.
                    Supported by Veo and Kling models. Ignored for Seedance 2.
                image_url:
                  type: string
                  format: uri
                  description: >-
                    Public URL of a reference image for image-to-video
                    generation. Must be an HTTP or HTTPS URL. Omit for
                    text-to-video.
            examples:
              seedance:
                summary: Seedance 2 (default)
                value:
                  prompt: A golden retriever running in a sunny park
                  model: seedance-2
                  duration: 10
              kling:
                summary: Kling Video
                value:
                  prompt: >-
                    A samurai draws a katana in a field of golden grass, cherry
                    blossoms swirl in the wind
                  model: kling-video
                  duration: 5
                  aspect_ratio: '16:9'
              veo2:
                summary: Google Veo 2
                value:
                  prompt: >-
                    Underwater camera glides through a bioluminescent coral reef
                    at night
                  model: google-veo-2
                  duration: 5
                  aspect_ratio: '16:9'
              veo31:
                summary: Google Veo 3.1
                value:
                  prompt: >-
                    A drone shot soaring over a misty mountain range at golden
                    hour, cinematic lighting
                  model: veo-3.1
                  duration: 8
                  aspect_ratio: '16:9'
              veo31fast:
                summary: Veo 3.1 Fast
                value:
                  prompt: >-
                    A person walking through a neon-lit Tokyo alley at night,
                    rain reflections
                  model: veo-3.1-fast
                  duration: 6
                  aspect_ratio: '9:16'
              veo-3-fast:
                summary: Google Veo 3 Fast
                value:
                  prompt: >-
                    A cat watching birds from a sunny window ledge, gentle
                    breeze
                  model: google-veo-3-fast
                  duration: 4
                  aspect_ratio: '16:9'
      responses:
        '200':
          description: Video generation job accepted.
          content:
            application/json:
              schema:
                type: object
                properties:
                  request_id:
                    type: string
                    description: >-
                      Unique job identifier. Use this to poll the status
                      endpoint.
                  model:
                    type: string
                    enum:
                      - seedance-2
                      - kling-video
                      - google-veo-2
                      - veo-3.1
                      - veo-3.1-fast
                      - google-veo-3-fast
                    description: The model used for this generation.
                  message:
                    type: string
                    example: >-
                      Poll GET /api/v1/video/status?request_id=... for
                      completion.
                  cost:
                    type: object
                    properties:
                      this_request:
                        type: string
                        example: $3.00
                      per_video:
                        type: string
                        example: $3.00
                  balance:
                    type: string
                    example: $39.00
                    description: Remaining credit balance after this charge.
                  metadata:
                    type: object
                    properties:
                      latency_ms:
                        type: integer
                        description: Request latency in milliseconds.
        '400':
          description: >-
            Validation error (missing/invalid prompt, invalid duration, invalid
            model, or invalid image_url).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: Insufficient credits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '502':
          description: Upstream video generation failed. You were not charged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      type: object
      description: >-
        OpenAI-compatible error. The top-level `message`, `code`, and
        `request_id` mirror fields inside `error` for convenience.
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Human-readable error description.
            type:
              type: string
              description: >-
                Error category: invalid_request_error, authentication_error,
                rate_limit_error, insufficient_quota, or api_error.
            code:
              type: string
              description: Machine-readable error code.
            param:
              type: string
              nullable: true
              description: The request parameter that caused the error, if any.
        message:
          type: string
          description: Same as error.message.
        code:
          type: string
          description: Same as error.code.
        request_id:
          type: string
          description: Unique request ID, useful when contacting support.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key starting with nj_sk_

````