# AI Script Generation Source: https://docs.jogg.ai/api-reference/v2/API Documentation/AIScripts Automatically generate engaging video scripts with AI ## Introduction Generate professional marketing scripts automatically using JoggAI's AI. Provide product information or a topic, and get multiple script variations optimized for your video length and language. Perfect for scaling video content production across multiple products, languages, and platforms. ### Key Features Create scripts from product info or descriptions Get 3-5 script variations in different styles Scripts timed for 15/30/60 second videos Generate scripts in any supported language ### Workflow Overview AI script generation is a **2-step asynchronous process**: Send product info and requirements to AI Get generated scripts and choose your favorite ```mermaid theme={null} sequenceDiagram participant Client participant API participant AI Note over Client,AI: Step 1: Submit Request Client->>API: POST /v2/ai_scripts {product_info, language, video_length_seconds, script_style} API->>AI: Generate scripts API-->>Client: 200 OK {task_id} Note over AI: Processing (10-30s) AI->>AI: Generate multiple
script variations Note over Client,AI: Step 2: Retrieve Results Client->>API: GET /v2/ai_scripts/results/{task_id} API-->>Client: 200 OK {scripts[]} ``` AI script generation typically completes in **10-30 seconds**. You can start polling after 15 seconds. *** ## Quick Start ### Related API Endpoints | Endpoint | Purpose | Documentation | | -------------------------------------- | -------------------------------- | ---------------------------------------------------------- | | `POST /v2/ai_scripts` | Submit script generation request | [API Reference](/api-reference/v2/Asset/CreateAIScript) | | `GET /v2/ai_scripts/results/{task_id}` | Get generated scripts | [API Reference](/api-reference/v2/Asset/GetAIScriptResult) | | `POST /v2/product` | Create product entry | [API Reference](/api-reference/v2/Product/CreateProduct) | ### Key Parameters | Parameter | Type | Required | Description | | -------------------------- | ------ | -------- | ------------------------------------------------------------------------------------------ | | `language` | string | ✅ | Script language (e.g., "english", "spanish") | | `video_length_seconds` | string | ✅ | Video length: "15", "30", or "60" | | `script_style` | string | ✅ | Style: "Don't Worry", "Storytime", "Discovery", "Data", "Top 3 reasons", "Light marketing" | | `product_info` | object | ✅ | Product information object | | `product_info.source_type` | string | ✅ | "id" (use product ID) or "details" (provide details) | | `product_info.data` | object | ✅ | Product data (varies by source\_type) | | `target_audience` | string | ❌ | Target audience description (optional) | **Product Info Required:** Either provide a `product_info.data.id` (for existing products) or `product_info.data.name` and `product_info.data.description` (for new products). *** ## Code Examples ### Scenario 1: Generate Scripts from Product ID Use an existing product to generate scripts: #### Step 1: Submit Script Generation Request ```bash theme={null} curl --request POST \ --url 'https://api.jogg.ai/v2/ai_scripts' \ --header 'x-api-key: YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "language": "english", "video_length_seconds": "30", "script_style": "Storytime", "product_info": { "source_type": "id", "data": { "id": "NTQ0MTkzNjg" } } }' ``` **Response:** ```json theme={null} { "code": 0, "msg": "Success", "data": { "task_id": "task_123456789" } } ``` Save the `task_id` - you'll need it to retrieve your scripts! *** #### Step 2: Retrieve Generated Scripts Wait 15-30 seconds, then retrieve your scripts: ```bash theme={null} curl --request GET \ --url 'https://api.jogg.ai/v2/ai_scripts/results/task_123456789' \ --header 'x-api-key: YOUR_API_KEY' ``` **Response (Completed):** ```json theme={null} { "code": 0, "msg": "Success", "data": { "task_id": "task_123456789", "status": "completed", "data": { "generated_scripts": [ { "script_style": "Storytime", "script_paragraphs": [ "Ever tried drinking water while running?", "The Owala FreeSip bottle changes everything.", "Its unique spout lets you sip or swig - no spills, no fuss.", "Plus, it keeps drinks cold for 24 hours.", "Perfect for gym, work, or adventures!" ] }, { "script_style": "Discovery", "script_paragraphs": [ "Discover the Owala FreeSip - the water bottle that adapts to you.", "Sip through the straw or tilt to swig from the spout.", "Double-wall insulation keeps drinks ice-cold all day.", "Available in vibrant colors that match your style!" ] }, { "script_style": "Top 3 reasons", "script_paragraphs": [ "Three reasons to love the Owala FreeSip:", "One, the patented FreeSip spout for sipping or swigging.", "Two, 24-hour cold insulation.", "Three, leak-proof design for your bag.", "Upgrade your hydration game today!" ] } ] } } } ``` The AI generates multiple script variations automatically. Choose the style that best fits your brand and audience! *** ### Scenario 2: Generate Scripts with Product Details Provide product details directly without creating a product entry: #### Step 1: Submit Request with Product Details ```bash theme={null} curl --request POST \ --url 'https://api.jogg.ai/v2/ai_scripts' \ --header 'x-api-key: YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "language": "english", "video_length_seconds": "30", "script_style": "Discovery", "product_info": { "source_type": "details", "data": { "name": "Premium Yoga Mat", "description": "Eco-friendly yoga mat with superior grip and cushioning. Made from natural rubber with moisture-wicking surface. 6mm thickness provides excellent support." } }, "target_audience": "Yoga enthusiasts and fitness lovers" }' ``` **Response:** ```json theme={null} { "code": 0, "msg": "Success", "data": { "task_id": "task_987654321" } } ``` *** #### Step 2: Retrieve Generated Scripts ```bash theme={null} curl --request GET \ --url 'https://api.jogg.ai/v2/ai_scripts/results/task_987654321' \ --header 'x-api-key: YOUR_API_KEY' ``` *** ### Scenario 3: Check Generation Status Poll to check if scripts are ready: ```bash theme={null} curl --request GET \ --url 'https://api.jogg.ai/v2/ai_scripts/results/task_123456789' \ --header 'x-api-key: YOUR_API_KEY' ``` **Response (Still Processing):** ```json theme={null} { "code": 0, "msg": "Success", "data": { "task_id": "task_123456789", "status": "processing" } } ``` **Response (Completed):** ```json theme={null} { "code": 0, "msg": "Success", "data": { "task_id": "task_123456789", "status": "completed", "data": { "generated_scripts": [...] } } } ``` **Response (Failed):** ```json theme={null} { "code": 0, "msg": "Success", "data": { "task_id": "task_123456789", "status": "failed", "err_msg": "Failed to generate script" } } ``` *** ## Advanced Examples ### Short 15-Second Scripts Generate punchy scripts for quick social media videos: ```bash theme={null} curl --request POST \ --url 'https://api.jogg.ai/v2/ai_scripts' \ --header 'x-api-key: YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "language": "english", "video_length_seconds": "15", "script_style": "Light marketing", "product_info": { "source_type": "id", "data": { "id": "NTQ0MTkzNjg" } } }' ``` **Sample Response:** ```json theme={null} { "code": 0, "msg": "Success", "data": { "task_id": "task_123456789", "status": "completed", "data": { "generated_scripts": [ { "script_style": "Light marketing", "script_paragraphs": [ "Meet the Owala FreeSip - your new hydration hero!", "Sip or swig with one spout.", "Stays cold for 24 hours.", "Get yours today!" ] } ] } } } ``` *** ### Multi-Language Scripts Generate scripts in different languages: ```bash theme={null} curl --request POST \ --url 'https://api.jogg.ai/v2/ai_scripts' \ --header 'x-api-key: YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "language": "spanish", "video_length_seconds": "30", "script_style": "Storytime", "product_info": { "source_type": "id", "data": { "id": "NTQ0MTkzNjg" } } }' ``` **Spanish Script Example:** ```json theme={null} { "code": 0, "msg": "Success", "data": { "task_id": "task_123456789", "status": "completed", "data": { "generated_scripts": [ { "script_style": "Storytime", "script_paragraphs": [ "¿Alguna vez intentaste beber agua mientras corres?", "La botella Owala FreeSip lo cambia todo.", "Su boquilla única te permite sorber o tragar - sin derrames, sin problemas.", "Además, mantiene las bebidas frías durante 24 horas.", "¡Perfecto para el gimnasio, trabajo o aventuras!" ] } ] } } } ``` Supported languages include: English, Spanish, French, German, Japanese, Korean, Chinese, Portuguese, and 30+ more. See full list in the [API Reference](/api-reference/v2/Asset/CreateAIScript). *** ## Script Style Guide Understanding different script styles: | Style | Characteristics | Best For | | ------------------- | ----------------------------------- | ----------------------------------------- | | **Storytime** | Narrative, engaging, conversational | Products with a journey or transformation | | **Discovery** | Exciting, exploratory, unveiling | New or innovative products | | **Don't Worry** | Reassuring, problem-solving | Products that solve pain points | | **Data** | Factual, statistics-driven | Tech products, B2B | | **Top 3 Reasons** | Clear, structured, benefit-focused | Feature-rich products | | **Light Marketing** | Friendly, promotional, upbeat | General products, e-commerce | The AI automatically generates scripts in multiple styles so you can choose the best fit for your brand and audience. *** ## Use Case Examples Convert product pages into video scripts: * Use existing product IDs * Generate in multiple languages for global markets * Create variations for A/B testing * Batch process entire catalog Create engaging scripts for social platforms: * Use 15-second scripts for TikTok/Reels * Try "Storytime" or "Discovery" styles * Generate in target market languages * Produce multiple versions weekly Generate ad scripts quickly: * Test different messaging angles * Create urgency with "Don't Worry" style * Use "Top 3 Reasons" for clarity * Localize for different regions Scale video content production: * Generate scripts for product series * Create educational content * Produce weekly tips and tricks * Maintain consistent messaging *** ## Tips for Best Results **Script Selection:** * Match your brand voice by selecting style that aligns with brand personality * Know your audience: "Data" style for B2B, "Storytime" for consumers * Consider platform: Shorter, punchier scripts for social media * Test different styles: A/B test to find what resonates **Optimization Tips:** * **Be specific** with product descriptions for better results * **Include key features** you want highlighted * **Specify target audience** for appropriate tone * **Generate multiple times** if not satisfied with first result * **Provide detailed descriptions** when using `source_type: "details"` **Best Practices:** * Wait 15-30 seconds before checking results * Use product IDs when possible for better consistency * Generate multiple script variations and compare * Test different styles for the same product * Use appropriate video length for your platform *** ## Troubleshooting **Issue:** Generated scripts lack specificity **Solutions:** * Provide more detailed product descriptions * Include specific features and benefits * Specify target audience clearly * Add unique selling points * Use `target_audience` parameter **Issue:** Scripts don't match expected language or style **Solutions:** * Verify `language` parameter is correct * Try different `script_style` options * Provide `target_audience` description * Add context about brand personality in product description * Check language spelling (e.g., "english" not "English") **Issue:** Script generation takes longer than expected **Solutions:** * Wait up to 60 seconds before retry * Check `task_id` is correct * Verify API key permissions * Check product ID exists (if using `source_type: "id"`) * Contact support if persists > 2 minutes **Issue:** Response shows completed but no scripts **Solutions:** * Check `data.generated_scripts` array in response * Verify product information is valid * Ensure product description is detailed enough * Try with different `script_style` * Retry with simpler product description *** ## Related Documentation Create product entries first Use scripts in avatar videos Generate videos with AI scripts Automate script generation # Avatar Videos with Transparent Background Source: https://docs.jogg.ai/api-reference/v2/API Documentation/AvatarVideosTransparentBackground Generate avatars with transparent backgrounds for easy compositing ## Introduction Create avatar videos with transparent backgrounds (alpha channel) for easy compositing over other content. Perfect for presentations, video editing, or web applications. ### Key Features Chroma key background for video editing True transparency with WebM format Overlay on any background Works with all major video editors **Best for:** Overlaying avatars on presentations, adding to existing videos, website backgrounds, video editing projects, green screen replacements, and AR/VR applications. *** ## Quick Start ### Related API Endpoints | Endpoint | Purpose | Documentation | | -------------------------------- | ---------------------------------------- | -------------------------------------------------------------- | | `POST /create_video_from_avatar` | Create video with transparent background | [API Reference](/api-reference/v2/Video/CreateVideoFromAvatar) | | `GET /avatar_video/{id}` | Check video status | [API Reference](/api-reference/v2/Video/AvatarVideoGet) | ### Key Parameters | Parameter | Type | Required | Description | | -------------------- | ------- | -------- | ---------------------------------------------------------------------------- | | `screen_style` | integer | ✅ | **2** = Split screen (green screen), **3** = Picture in picture (WebM alpha) | | `avatar.avatar_id` | integer | ✅ | Choose full-body avatar for best results | | `avatar.avatar_type` | integer | ✅ | 0=Public, 1=Custom | | `voice.type` | string | ✅ | "script" for text-to-speech | | `voice.voice_id` | string | ✅ | Voice ID for text-to-speech | | `voice.script` | string | ✅ | Text for avatar to speak | | `aspect_ratio` | string | ✅ | portrait/landscape/square | **Output Formats:** * **Split Screen (screen\_style: 2)**: MP4 with green background - use chroma key in video editor * **Picture in Picture (screen\_style: 3)**: WebM with alpha channel - true transparency, no keying needed *** ## Code Examples ### Scenario 1: Green Screen (Split Screen) Create video with green screen for video editing: ```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 '{ "avatar": { "avatar_id": 81, "avatar_type": 0 }, "voice": { "type": "script", "voice_id": "en-US-ChristopherNeural", "script": "Welcome! This avatar has a transparent background." }, "aspect_ratio": "portrait", "screen_style": 2, "caption": false }' ``` **Response:** ```json theme={null} { "code": 0, "msg": "Success", "data": { "video_id": "video_123456" } } ``` **Use for:** * Video editing software (Premiere, Final Cut, DaVinci) * Broadcast applications * Maximum compatibility **How to use:** 1. Import video to editor 2. Apply chroma key effect 3. Remove green color 4. Composite over background *** ### Scenario 2: WebM with Alpha Channel Create video with true transparency: ```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 '{ "avatar": { "avatar_id": 81, "avatar_type": 0 }, "voice": { "type": "script", "voice_id": "en-US-ChristopherNeural", "script": "Your script here" }, "aspect_ratio": "portrait", "screen_style": 3 }' ``` **Response:** ```json theme={null} { "code": 0, "msg": "Success", "data": { "video_id": "video_123456" } } ``` **Use for:** * Web applications * HTML5 video players * Direct compositing without keying **How to use:** ```html theme={null} ``` Set `screen_style: 2` for green screen (video editing) or `screen_style: 3` for WebM with alpha channel (web applications). *** ## Use Case Examples Composite avatars into existing videos: * Use green screen format (screen\_style: 2) * Import to Premiere, Final Cut, or DaVinci * Apply chroma key effect * Overlay on any background Add avatars to websites: * Use WebM with alpha (screen\_style: 3) * Embed in HTML5 video player * Overlay on dynamic backgrounds * No keying required Add avatars to slides: * Create transparent avatar videos * Overlay on presentation slides * Professional appearance * Easy to update Use avatars in immersive experiences: * WebM with alpha channel * True transparency * Composite in 3D environments * Realistic integration *** ## Tips for Best Results **Quality Tips:** * Use full-body avatars for best results * Test composite in target environment * For web, use WebM with alpha (screen\_style: 3) * For video editing, use green screen (screen\_style: 2) * Avoid captions if compositing over text-heavy backgrounds * Green screen works best with even lighting * WebM alpha has cleaner edges *** ## Related Documentation Main avatar video guide Check video generation status Complete API documentation Browse available avatars # Avatar Videos with Custom Audio Source: https://docs.jogg.ai/api-reference/v2/API Documentation/AvatarVideosWithAudioSource Use your own audio file instead of text-to-speech ## Introduction Use your own audio recordings instead of text-to-speech for complete control over voice, timing, and delivery. Perfect for professional voice-overs, branded audio, or languages not supported by TTS. ### Key Features Use professional voice talent recordings Control timing, tone, and delivery Maintain consistent brand audio identity Use audio in any language or dialect **When to Use:** Best for professional voice-overs, branded audio, dialects not supported by TTS, or when you need precise control over delivery. *** ## Quick Start ### Related API Endpoints | Endpoint | Purpose | Documentation | | -------------------------------- | ----------------------- | -------------------------------------------------------------- | | `POST /upload/asset` | Upload audio file | [API Reference](/api-reference/v2/Asset/UploadAsset) | | `POST /create_video_from_avatar` | Create video with audio | [API Reference](/api-reference/v2/Video/CreateVideoFromAvatar) | | `GET /avatar_video/{id}` | Check video status | [API Reference](/api-reference/v2/Video/AvatarVideoGet) | ### Key Parameters | Parameter | Type | Required | Description | | -------------------- | ------- | -------- | --------------------------------------------------- | | `voice.type` | string | ✅ | **Must be "audio"** when using audio\_url | | `voice.audio_url` | string | ✅ | URL of uploaded audio file | | `voice.voice_id` | string | ✅ | Voice ID (still required) | | `avatar.avatar_id` | integer | ✅ | Avatar ID | | `avatar.avatar_type` | integer | ✅ | 0=Public, 1=Custom | | `aspect_ratio` | string | ✅ | portrait/landscape/square | | `screen_style` | integer | ✅ | 1=Full screen, 2=Split screen, 3=Picture in picture | **Important:** When using `voice.audio_url`, set `voice.type` to "audio" and do NOT include `voice.script`. The `voice.voice_id` is still required. ## Audio Requirements **Supported Formats:** * MP3 (recommended) * WAV * M4A **Specifications:** * Max size: 20MB * Max duration: 10 minutes * Recommended bitrate: 192 kbps for music, 128 kbps for voice * Sample rate: 44.1 kHz **Quality Tips:** ```bash theme={null} # Optimize audio with FFmpeg ffmpeg -i input.wav -codec:a libmp3lame -b:a 192k output.mp3 # Normalize audio levels ffmpeg -i input.mp3 -filter:a loudnorm output.mp3 ``` *** ## Code Examples ### Step 1: Get signed URL for upload ```bash theme={null} curl --request POST \ --url 'https://api.jogg.ai/v2/upload/asset' \ --header 'x-api-key: YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data '{ "filename": "audio.mp3", "content_type": "audio/mpeg" }' ``` **Response:** ```json theme={null} { "code": 0, "msg": "Success", "data": { "sign_url": "https://storage.jogg.ai/upload/signed-url-here", "asset_url": "https://res.jogg.ai/assets/aud_abc123.mp3" } } ``` ### Step 2: Upload your file using PUT ```bash theme={null} curl --request PUT \ --url 'https://storage.jogg.ai/upload/signed-url-here' \ --header 'Content-Type: audio/mpeg' \ --data-binary '@/path/to/audio.mp3' ``` ### Step 3: Create video with the audio ```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 '{ "avatar": { "avatar_id": 81, "avatar_type": 0 }, "voice": { "type": "audio", "voice_id": "en-US-ChristopherNeural", "audio_url": "https://res.jogg.ai/assets/aud_abc123.mp3" }, "aspect_ratio": "portrait", "screen_style": 1, "caption": false }' ``` **Response:** ```json theme={null} { "code": 0, "msg": "Success", "data": { "video_id": "video_123456" } } ``` Save the `asset_url` from upload response to use as `voice.audio_url`. Video length will automatically match audio duration. ### Step 4: Check Video Status Poll to check if video is ready: ```bash theme={null} curl --request GET \ --url 'https://api.jogg.ai/v2/avatar_video/video_123456' \ --header 'x-api-key: YOUR_API_KEY' ``` **Response (Processing):** ```json theme={null} { "code": 0, "msg": "Success", "data": { "video_id": "video_123456", "status": "processing", "created_at": 1732806631 } } ``` **Response (Completed):** ```json theme={null} { "code": 0, "msg": "Success", "data": { "video_id": "video_123456", "status": "completed", "video_url": "https://res.jogg.ai/videos/video_123456.mp4", "cover_url": "https://res.jogg.ai/covers/cover_123456.jpg", "created_at": 1732806631 } } ``` Instead of polling, use \[Webhooks]\(/api-reference/v2/API Documentation/WebhookIntegration) to get notified instantly when videos are ready! *** ## Use Case Examples Use recordings from professional voice talent: * Record in professional studio * Upload final edited audio * Create videos with consistent voice * Maintain professional quality Maintain branded audio across videos: * Use company spokesperson voice * Record once, use in multiple videos * Consistent brand audio identity * Scale branded content easily Use best take from multiple recordings: * Record several versions * Upload the best performance * Edit audio before uploading * Perfect timing and delivery Use audio in languages not supported by TTS: * Record in any language or dialect * Upload custom audio * Create videos with native speakers * Reach diverse audiences *** ## Tips for Best Results **Audio Quality:** * Use clear speech audio (not music) for best lip sync * Ensure audio quality is good (44.1 kHz, 128-192 kbps) * Trim silence at start/end * Normalize audio levels * Check audio language matches avatar capabilities *** ## Related Documentation Main avatar video guide Upload audio files guide Complete upload API documentation Check video status # Avatar Videos with Photo Avatars Source: https://docs.jogg.ai/api-reference/v2/API Documentation/AvatarVideosWithPhotoAvatar Use custom photo avatars created from your own photos ## Introduction Create personalized avatar videos using custom photo avatars generated from your own portrait photos. Perfect for branded content, personal messaging, or using specific talent. ### Key Features Use your own photo to create custom avatars Maintain consistent personal or brand presence Same face across 40+ languages High-quality avatar generation from photos **Prerequisites:** You must first create a photo avatar before using it in videos. See \[Create Photo Avatar]\(/api-reference/v2/API Documentation/CreatePhotoAvatar) guide. *** ## Quick Start ### Related API Endpoints | Endpoint | Purpose | Documentation | | -------------------------------- | ------------------------------ | -------------------------------------------------------------- | | `GET /avatars/photo_avatars` | Get your photo avatars | [API Reference](/api-reference/v2/Avatar/PhotoAvatarsGet) | | `POST /create_video_from_avatar` | Create video with photo avatar | [API Reference](/api-reference/v2/Video/CreateVideoFromAvatar) | | `GET /avatar_video/{id}` | Check video status | [API Reference](/api-reference/v2/Video/AvatarVideoGet) | ### Key Parameters | Parameter | Type | Required | Description | | -------------------- | ------- | -------- | --------------------------------------------------- | | `avatar.avatar_id` | integer | ✅ | Your photo avatar ID | | `avatar.avatar_type` | integer | ✅ | **Must be `1`** for photo avatars | | `voice.type` | string | ✅ | "script" for text-to-speech | | `voice.voice_id` | string | ✅ | Voice ID for text-to-speech | | `voice.script` | string | ✅ | Text for avatar to speak | | `aspect_ratio` | string | ✅ | portrait/landscape/square | | `screen_style` | integer | ✅ | 1=Full screen, 2=Split screen, 3=Picture in picture | **Important:** Set `avatar.avatar_type: 1` to use photo avatars. Using `0` will use public avatars instead. *** ## Code Examples ### Step 1: Create Video with Photo Avatar Get your photo avatar ID first: ```bash theme={null} curl --request GET \ --url 'https://api.jogg.ai/v2/avatars/photo_avatars' \ --header 'x-api-key: YOUR_API_KEY' ``` **Response:** ```json theme={null} { "code": 0, "msg": "Success", "data": { "avatars": [ { "id": 123, "name": "My Custom Avatar", "status": 1, "cover_url": "https://res.jogg.ai/avatars/cover_123.jpg" } ] } } ``` Then create video with the photo avatar: ```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 '{ "avatar": { "avatar_id": 123, "avatar_type": 1 }, "voice": { "type": "script", "voice_id": "en-US-ChristopherNeural", "script": "Hello! This is my custom photo avatar speaking." }, "aspect_ratio": "portrait", "screen_style": 1, "caption": true }' ``` **Response:** ```json theme={null} { "code": 0, "msg": "Success", "data": { "video_id": "video_123456" } } ``` Ensure photo avatar `status` is `1` (completed) before creating videos. Status `0` means still processing. ### Step 2: Check Video Status Poll to check if video is ready: ```bash theme={null} curl --request GET \ --url 'https://api.jogg.ai/v2/avatar_video/video_123456' \ --header 'x-api-key: YOUR_API_KEY' ``` **Response (Processing):** ```json theme={null} { "code": 0, "msg": "Success", "data": { "video_id": "video_123456", "status": "processing", "created_at": 1732806631 } } ``` **Response (Completed):** ```json theme={null} { "code": 0, "msg": "Success", "data": { "video_id": "video_123456", "status": "completed", "video_url": "https://res.jogg.ai/videos/video_123456.mp4", "cover_url": "https://res.jogg.ai/covers/cover_123456.jpg", "created_at": 1732806631 } } ``` Instead of polling, use \[Webhooks]\(/api-reference/v2/API Documentation/WebhookIntegration) to get notified instantly when videos are ready! *** ## Use Case Examples Use your own face in videos: * Create photo avatar from your photo * Generate branded video content * Consistent personal presence across platforms * Scale your personal brand without being on camera Feature company executives or talent: * Create avatar from CEO or spokesperson photo * Generate company announcements and updates * Consistent company voice and appearance * Reduce production time and costs Speak in languages you don't know: * Create avatar from your photo once * Generate videos in 40+ languages * Maintain your face across all languages * Reach global audiences authentically Scale your content creation: * Use your photo avatar for multiple videos * Create content in different languages * Maintain your personal brand * Save time on video production *** ## Tips for Best Results **Photo Avatar Quality:** * Use high-quality source photos (1920x1080 or higher) * Ensure good lighting in source photo * Face should be clearly visible * Check avatar status is `1` (completed) before use * Test with short script first **Script Recommendations:** * Keep scripts natural and conversational * Avoid very long scripts (\< 2 minutes) * Test pronunciation of special terms * Use appropriate voice for avatar personality ## Related Documentation Generate photo avatars from your photos List your photo avatars Check video generation status Browse available voices # Create Talking Avatar Videos Source: https://docs.jogg.ai/api-reference/v2/API Documentation/CreateAvatarVideos Generate professional videos with realistic AI avatars speaking your script ## Introduction Create engaging talking avatar videos with the JoggAI API. Select from 300+ realistic avatars, provide your script or audio, and generate professional videos in minutes. ### Key Features Professional avatars across all demographics Natural text-to-speech in multiple languages Videos ready in 2-5 minutes Control background, aspect ratio, and captions ### Workflow Overview Avatar video creation is an **asynchronous 4-step process**: Retrieve available avatars and voices from the API Call create endpoint with avatar, voice, and script/audio Video renders automatically (2-5 minutes) Get video URL via webhook or polling ```mermaid theme={null} sequenceDiagram participant Client participant API participant Queue Note over Client: 1. Get Resources Client->>API: GET /avatars/public API-->>Client: Avatar list Client->>API: GET /voices API-->>Client: Voice list Note over Client,Queue: 2. Submit Request Client->>API: POST /create_video_from_avatar API->>Queue: Queue rendering task API-->>Client: 200 OK {video_id} Note over Queue: 3. Processing (2-5 min) Queue->>Queue: Generate video Note over Client,Queue: 4. Get Result alt Webhook (推荐) Queue->>Client: POST /webhook {video_url} else Polling Client->>API: GET /avatar_video/{id} API-->>Client: {video_url, status} end ``` This is an asynchronous process. Don't wait for the response - use webhooks or polling to get results. *** ## Quick Start ### Related API Endpoints | Endpoint | Purpose | Documentation | | -------------------------------- | ---------------------- | -------------------------------------------------------------- | | `GET /avatars/public` | Get public avatar list | [API Reference](/api-reference/v2/Avatar/PublicAvatarsGet) | | `GET /voices` | Get voice list | [API Reference](/api-reference/v2/Voice/GetVoices) | | `POST /create_video_from_avatar` | Create avatar video | [API Reference](/api-reference/v2/Video/CreateVideoFromAvatar) | | `GET /avatar_video/{id}` | Check video status | [API Reference](/api-reference/v2/Video/AvatarVideoGet) | ### Key Parameters | Parameter | Type | Required | Description | | -------------------- | ------- | -------- | --------------------------------------------------- | | `avatar` | object | ✅ | Avatar configuration | | `avatar.avatar_id` | integer | ✅ | Avatar ID from avatar list | | `avatar.avatar_type` | integer | ✅ | 0=Public, 1=Custom avatar | | `voice` | object | ✅ | Voice configuration | | `voice.type` | string | ✅ | "script" or "audio" | | `voice.voice_id` | string | ✅ | Voice ID for text-to-speech | | `voice.script` | string | \* | Text to speak (required when type is "script") | | `voice.audio_url` | string | \* | Audio file URL (required when type is "audio") | | `aspect_ratio` | string | ✅ | portrait/landscape/square | | `screen_style` | integer | ✅ | 1=Full screen, 2=Split screen, 3=Picture in picture | | `caption` | boolean | ❌ | Enable subtitles (default: false) | You must provide either `voice.script` (for text-to-speech) OR `voice.audio_url` (for custom audio), but not both. Set `voice.type` to "script" or "audio" accordingly. *** ## Code Examples ### Step 1: Basic Avatar Video with Script Create a simple video with text-to-speech: ```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 '{ "avatar": { "avatar_id": 81, "avatar_type": 0 }, "voice": { "type": "script", "voice_id": "en-US-ChristopherNeural", "script": "Welcome to JoggAI! Create amazing videos with AI avatars in minutes." }, "aspect_ratio": "portrait", "screen_style": 1, "caption": true }' ``` **Response:** ```json theme={null} { "code": 0, "msg": "Success", "data": { "video_id": "video_123456" } } ``` Save the `video_id` to check status later! ### Step 2: Check Video Status Poll to check if video is ready: ```bash theme={null} curl --request GET \ --url 'https://api.jogg.ai/v2/avatar_video/video_123456' \ --header 'x-api-key: YOUR_API_KEY' ``` **Response (Processing):** ```json theme={null} { "code": 0, "msg": "Success", "data": { "video_id": "video_123456", "status": "processing", "created_at": 1732806631 } } ``` **Response (Completed):** ```json theme={null} { "code": 0, "msg": "Success", "data": { "video_id": "video_123456", "status": "completed", "video_url": "https://res.jogg.ai/videos/video_123456.mp4", "cover_url": "https://res.jogg.ai/covers/cover_123456.jpg", "created_at": 1732806631 } } ``` Instead of polling, use \[Webhooks]\(/api-reference/v2/API Documentation/WebhookIntegration) to get notified instantly when videos are ready! *** ## Use Case Examples Create engaging marketing videos for social platforms: * Use `aspect_ratio: "portrait"` for Instagram Stories/TikTok * Use `aspect_ratio: "landscape"` for YouTube * Enable `caption: true` for silent autoplay Generate educational content with AI presenters: * Choose professional avatars for credibility * Use clear, structured scripts * Add captions for accessibility Showcase products with avatar presenters: * Use custom audio for brand voice * Combine with product visuals * Generate videos in multiple languages Create FAQ and tutorial videos: * Batch generate common questions * Update easily by regenerating * Personalize with voice selection *** ## Related Documentation Browse available avatars Explore voice options Upload custom audio files Get instant notifications # Create Photo Avatar Source: https://docs.jogg.ai/api-reference/v2/API Documentation/CreatePhotoAvatar Generate custom AI avatars from portrait photos ## Introduction Transform portrait photos into talking AI avatars that can speak any script in 40+ languages. Create personalized avatars for branding, marketing, or custom content production. Photo avatars allow you to use your own face or team members' faces in videos, maintaining brand consistency across all content.