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

# Create Video from Avatar

> Create a video with talking avatar using script or audio input.
Either provide a script for text-to-speech or upload an audio file.


Create a talking avatar video by providing a script, avatar ID, and voice ID. This endpoint generates videos with AI avatars speaking your provided text.

## Example Usage

```bash theme={null}
curl --request POST \
  --url 'https://api.jogg.ai/v2/create_video_from_avatar' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "script": "Welcome to JoggAI! Create amazing avatar videos with our API.",
    "avatar_id": 127,
    "voice_id": "en-US-ChristopherNeural",
    "aspect_ratio": 0,
    "screen_style": 0
  }'
```

## Related Guides

<CardGroup cols={2}>
  <Card title="Create Avatar Videos Guide" href="/api-reference/v2/API Documentation/CreateAvatarVideos">
    Learn how to create avatar videos step-by-step
  </Card>

  <Card title="Get Video Status" href="/api-reference/v2/Video/AvatarVideoGet">
    Check the status of your video generation
  </Card>
</CardGroup>


## OpenAPI

````yaml POST /v2/create_video_from_avatar
openapi: 3.0.1
info:
  title: JoggAI OpenAPI v2
  description: >
    JoggAI OpenAPI v2 provides a comprehensive suite of endpoints for creating
    and managing AI-powered video content.


    ## Authentication

    All API requests require authentication using an API key provided in the
    `x-api-key` header.


    ## Base URL

    Production: https://api.jogg.ai/v2


    ## Rate Limiting

    API calls are subject to rate limiting based on your subscription plan.


    ## Error Handling

    All endpoints return standard HTTP status codes along with detailed error
    messages in the response body.
  version: 2.0.0
  license:
    name: MIT
servers:
  - url: https://api.jogg.ai
    description: Production server
security:
  - apiKeyAuth: []
tags:
  - name: Video
    description: Video creation and management operations
  - name: Avatar
    description: Avatar management and creation operations
  - name: Voice
    description: Voice and timbre management operations
  - name: Asset
    description: Asset management including music, scripts, and uploads
  - name: Template
    description: Template management operations
  - name: Product
    description: Product management operations
  - name: User
    description: User account operations
  - name: Webhook
    description: Webhook endpoint management for event notifications
paths:
  /v2/create_video_from_avatar:
    post:
      tags:
        - Video
      summary: Create talking avatar video
      description: |
        Create a video with talking avatar using script or audio input.
        Either provide a script for text-to-speech or upload an audio file.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - avatar
                - voice
                - aspect_ratio
                - screen_style
              properties:
                avatar:
                  type: object
                  description: Avatar configuration
                  required:
                    - avatar_type
                    - avatar_id
                  properties:
                    avatar_type:
                      type: integer
                      description: |
                        Source type of the avatar:
                        * 0 - Public avatar
                        * 1 - Custom avatar
                      enum:
                        - 0
                        - 1
                      example: 0
                    avatar_id:
                      type: integer
                      description: ID of the avatar to use
                      example: 81
                voice:
                  type: object
                  description: Voice configuration including script or audio input
                  required:
                    - type
                    - voice_id
                  properties:
                    type:
                      type: string
                      description: Voice input type
                      enum:
                        - script
                        - audio
                      example: script
                    script:
                      type: string
                      description: >-
                        Text script for voice synthesis (required when type is
                        "script")
                      example: >-
                        Hi, welcome to JoggAI and create longer videos with
                        Talking Avatars in minutes!
                    audio_url:
                      type: string
                      description: >-
                        Audio file URL for voice input (required when type is
                        "audio")
                      format: uri
                      example: https://res.jogg.ai/audio.mp3
                    voice_id:
                      type: string
                      description: Voice ID for text-to-speech
                      example: en-US-ChristopherNeural
                aspect_ratio:
                  type: string
                  description: Aspect ratio of the output video
                  enum:
                    - portrait
                    - landscape
                    - square
                  example: portrait
                screen_style:
                  type: integer
                  description: |
                    Background style:
                    * 1 - Full screen
                    * 2 - Split screen
                    * 3 - Picture in picture
                  enum:
                    - 1
                    - 2
                    - 3
                  example: 1
                caption:
                  type: boolean
                  description: Enable or disable subtitles
                  example: true
                webhook_url:
                  type: string
                  description: Webhook URL for status notifications
                  format: uri
                  example: https://example.com/webhook
                video_name:
                  type: string
                  description: Custom name for the video
                  example: My Talking Avatar Video
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/BaseResponse'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          video_id:
                            type: string
                            description: Created video ID
                            example: video_123456
components:
  schemas:
    BaseResponse:
      type: object
      required:
        - code
        - msg
      properties:
        code:
          type: integer
          description: |
            Business status code:
            * 0 - Success
            * 10104 - Record not found
            * 10105 - Invalid API key
            * 18020 - Insufficient credit
            * 18025 - No permission to call APIs
            * 40000 - Parameter error
            * 50000 - System error
          example: 0
        msg:
          type: string
          description: Response message
          example: Success
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication. Obtain your key from the JoggAI dashboard.

````