# AIVidLab API — Complete Reference for AI Agents # Last updated: 2026-07-03 # Base URL: https://api.aividlab.shop # Authentication: Bearer token in Authorization header # Get API key: /apikey command in @AIVidLab_bot on Telegram # Dashboard: https://api.aividlab.shop/dashboard # Token rate: 1 token = RM0.10 (Malaysian Ringgit) ## AUTHENTICATION All requests require: ``` Authorization: Bearer YOUR_KEY ``` Get your key: 1. Open @AIVidLab_bot on Telegram 2. Send /apikey 3. Copy the key ## PRICING 1 token = RM0.10 Topup packs: RM5 (50 tok), RM10 (100 tok), RM30 (300 tok), RM50 (500 tok +5% bonus), RM100 (1000 tok +5% bonus) --- ## VIDEO MODELS ### Grok Video - Model ID: `grok-video` - Modes: text-to-video, image-to-video - Resolutions: 720p - Aspect Ratios: 16:9, 9:16 - Pricing: - 10s = 7 tokens (RM0.70) - 20s = 12 tokens (RM1.20) - 30s = 17 tokens (RM1.70) ```bash # Text-to-video curl -s -X POST https://api.aividlab.shop/v1/video/generate \ -H "Authorization: Bearer YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "grok-video", "prompt": "A cat playing piano in a jazz bar", "duration": 10, "aspect_ratio": "16:9" }' # Image-to-video (pass image_url for i2v) curl -s -X POST https://api.aividlab.shop/v1/video/generate \ -H "Authorization: Bearer YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "grok-video", "prompt": "The subject walks forward confidently", "image_url": "https://example.com/photo.jpg", "duration": 10, "aspect_ratio": "9:16" }' ``` --- ### Omni Flash - Model ID: `omni-flash` - Modes: text-to-video, image-to-video - Resolutions: 720p, 1080p, 4k - Durations: 6s, 8s, 10s - Aspect Ratios: 16:9, 9:16, 1:1 - Pricing: 16 tokens per generation (RM1.60) — flat rate regardless of duration/resolution ```bash # Text-to-video curl -s -X POST https://api.aividlab.shop/v1/video/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "omni-flash", "prompt": "Cinematic shot of a sunset over mountains", "duration": 10, "resolution": "720p", "aspect_ratio": "16:9" }' # Image-to-video curl -s -X POST https://api.aividlab.shop/v1/video/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "omni-flash", "prompt": "The subject walks forward confidently", "image_url": "https://example.com/photo.jpg", "duration": 10, "resolution": "720p", "aspect_ratio": "16:9" }' ``` --- ### Seedance 2.0 Fast - Model ID: `seedance-2-fast` - Modes: text-to-video, image-to-video, multimodal - Resolutions: 480p, 720p, 1080p, 2k, 4k - Durations: 5s, 10s, 15s - Aspect Ratios: 16:9, 9:16, 1:1 - Audio: included automatically - Pricing (tokens): | Resolution | 5s | 10s | 15s | |---|---|---|---| | 480p | 23 (RM2.30) | 40 (RM4.00) | 56 (RM5.60) | | 720p | 40 (RM4.00) | 73 (RM7.30) | 110 (RM11.00) | | 1080p | 48 (RM4.80) | 92 (RM9.20) | 137 (RM13.70) | | 2k | 52 (RM5.20) | 101 (RM10.10) | 151 (RM15.10) | | 4k | 58 (RM5.80) | 114 (RM11.40) | 172 (RM17.20) | ```bash curl -s -X POST https://api.aividlab.shop/v1/video/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "seedance-2-fast", "prompt": "A dancer performing contemporary dance in a studio", "duration": 5, "resolution": "720p", "aspect_ratio": "16:9" }' ``` --- ### Seedance 2.0 Standard - Model ID: `seedance-2-standard` - Modes: text-to-video, image-to-video, multimodal - Resolutions: 480p, 720p, 1080p, native1080p, native4k - Durations: 5s, 10s, 15s - Aspect Ratios: 16:9, 9:16, 1:1 - Audio: included automatically - Note: native1080p and native4k are TRUE native rendering (not upscaled) - Pricing (tokens): | Resolution | 5s | 10s | 15s | |---|---|---|---| | 480p | 27 (RM2.70) | 48 (RM4.80) | 69 (RM6.90) | | 720p | 48 (RM4.80) | 92 (RM9.20) | 137 (RM13.70) | | 1080p | 56 (RM5.60) | 110 (RM11.00) | 165 (RM16.50) | | native1080p | 137 (RM13.70) | 229 (RM22.90) | 343 (RM34.30) | | native4k | 229 (RM22.90) | 457 (RM45.70) | 685 (RM68.50) | ```bash curl -s -X POST https://api.aividlab.shop/v1/video/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "seedance-2-standard", "prompt": "Aerial drone shot of a tropical island at golden hour", "duration": 10, "resolution": "native1080p", "aspect_ratio": "16:9" }' ``` --- ### Wan 2.7 - Model ID: `wan-2.7` - Modes: t2v, i2v, spicy_i2v, reference_to_video, video_extend, video_edit - Resolutions: 720P, 1080P - Durations: 2–15s (mode-dependent; ref2v/edit max 10s) - Aspect Ratios: 16:9, 9:16, 1:1, 4:3, 3:4 - Pricing (tokens): | Mode | Resolution | 5s | 10s | 15s | |---|---|---|---|---| | t2v / i2v / extend | 720P | 20 (RM1.97) | 37 (RM3.44) | 53 (RM4.91) | | t2v / i2v / extend | 1080P | 30 (RM2.52+fee) | 56 (RM5.54) | 81 (RM8.06) | | spicy_i2v | 720P | 32 (RM3.23) | 60 (RM5.96) | 87 (RM8.69) | | spicy_i2v | 1080P | 46 (RM4.70) | 89 (RM8.90) | 132 (RM13.10) | | ref2v / video_edit | 720P | 20 (RM1.97) 5s out | 27 (RM2.67) 10s out | — | | ref2v / video_edit | 1080P | 30 (RM2.52+fee) 5s out | 43 (RM4.20+fee) 10s out | — | - Additional params: `prompt_extend` (bool), `seed` (0-2147483647), `negative_prompt`, `audio_url` - video_edit requires `input_duration` for billing accuracy - reference_to_video accepts `video_urls` (max 5) + `image_urls` (max 5) ```bash curl -s -X POST https://api.aividlab.shop/v1/video/generate \ -H "Authorization: Bearer ***" \ -H "Content-Type: application/json" \ -d '{ "model": "wan-2.7", "mode": "t2v", "prompt": "Product showcase spinning on a white background", "duration": 5, "resolution": "720P", "aspect_ratio": "16:9" }' ``` --- ### Sora 2 - Model ID: `sora-2` - Modes: text-to-video - Resolutions: 1080p - Durations: 4s, 8s, 12s, 16s, 20s - Aspect Ratios: 16:9, 9:16, 1:1 - Pricing: - 4s = 28 tokens (RM2.80) - 8s = 46 tokens (RM4.60) - 12s = 65 tokens (RM6.50) - 16s = 84 tokens (RM8.40) - 20s = 103 tokens (RM10.30) ```bash curl -s -X POST https://api.aividlab.shop/v1/video/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "sora-2", "prompt": "A cinematic tracking shot through a futuristic city at night", "duration": 8, "aspect_ratio": "16:9" }' ``` --- ### HappyHorse 1.0 - Model ID: `happyhorse-1.0` - Modes: text-to-video (t2v), image-to-video (i2v) - Resolutions: 720p, 1080p - Durations: 3s, 4s, 5s, 6s, 7s, 8s, 9s, 10s, 11s, 12s, 13s, 14s, 15s - Aspect Ratios: 16:9, 9:16, 1:1, 4:3, 3:4 - Pricing (720p): - 3s = 22 tokens (RM2.20) - 5s = 34 tokens (RM3.40) - 10s = 64 tokens (RM6.40) - 15s = 94 tokens (RM9.40) - Pricing (1080p): - 3s = 26 tokens (RM2.60) - 5s = 40 tokens (RM4.00) - 10s = 76 tokens (RM7.60) - 15s = 112 tokens (RM11.20) ```bash curl -s -X POST https://api.aividlab.shop/v1/video/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "happyhorse-1.0", "prompt": "A playful kitten chasing butterflies in a garden", "duration": 5, "resolution": "720p", "aspect_ratio": "16:9" }' ``` --- ### HappyHorse 1.1 - Model ID: `happyhorse-1.1` - Modes: text-to-video (t2v), image-to-video (i2v) - Resolutions: 720p, 1080p - Durations: 3s, 4s, 5s, 6s, 7s, 8s, 9s, 10s, 11s, 12s, 13s, 14s, 15s - Aspect Ratios: 16:9, 9:16, 1:1, 4:3, 3:4 - Pricing: Same as 1.0 — quality upgrade, no price change - Note: HappyHorse 1.1 is a quality improvement over 1.0 at the same price point ```bash curl -s -X POST https://api.aividlab.shop/v1/video/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "happyhorse-1.1", "prompt": "Cinematic slow-motion of a horse galloping through mist at sunrise", "duration": 10, "resolution": "1080p", "aspect_ratio": "16:9" }' ``` --- ### Kling Standard - Model ID: `kling-std` - Modes: text-to-video (t2v), image-to-video (i2v), reference-to-video (ref2v), video-edit, motion-control - Resolutions: 1080p - Durations: 3-15s (any integer) - Aspect Ratios: 16:9, 9:16, 1:1 - Pricing (tokens) — UPDATED 2026-07-05: | Mode | Duration | Tokens | |---|---|---| | t2v | 3s | 11 (RM1.10) | | t2v | 5s | 19 (RM1.90) | | t2v | 10s | 38 (RM3.80) | | t2v | 15s | 52 (RM5.20) | | i2v | 10s | 48 (RM4.80) | | ref2v | 10s | 48 (RM4.80) | | video_edit | flat | 50 (RM5.00) | | motion | flat | 57 (RM5.70) | ```bash # Text-to-video curl -s -X POST https://api.aividlab.shop/v1/video/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "kling-std", "mode": "t2v", "prompt": "A samurai drawing his katana in the rain, cinematic lighting", "duration": 5, "aspect_ratio": "16:9", "sound": true }' ``` --- ### Kling Pro - Model ID: `kling-pro` - Modes: text-to-video (t2v), image-to-video (i2v), reference-to-video (ref2v), video-edit, motion-control - Resolutions: 1080p - Durations: 3-15s (any integer) - Aspect Ratios: 16:9, 9:16, 1:1 - Native sound sync: automatically enabled - Pricing (tokens) — UPDATED 2026-07-05: | Mode | Duration | Tokens | |---|---|---| | t2v | 3s | 14 (RM1.40) | | t2v | 5s | 24 (RM2.40) | | t2v | 10s | 48 (RM4.80) | | t2v | 15s | 66 (RM6.60) | | i2v | 10s | 62 (RM6.20) | | ref2v | 10s | 62 (RM6.20) | | video_edit | flat | 31 (RM3.10) | | motion | flat | 50 (RM5.00) | ```bash # Image-to-video curl -s -X POST https://api.aividlab.shop/v1/video/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "kling-pro", "mode": "i2v", "prompt": "The woman walks forward, hair flowing in wind", "image_url": "https://your-image-url.jpg", "last_image_url": null, "duration": 5, "sound": true }' # Reference-to-video curl -s -X POST https://api.aividlab.shop/v1/video/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "kling-pro", "mode": "ref2v", "prompt": "The character performs a spin move", "image_urls": ["https://ref-image-1.jpg"], "video_url": "https://ref-video.mp4", "duration": 5, "aspect_ratio": "16:9" }' # Video edit curl -s -X POST https://api.aividlab.shop/v1/video/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "kling-std", "mode": "video_edit", "prompt": "Change the time to night, add rain", "video_url": "https://your-video.mp4" }' # Motion control curl -s -X POST https://api.aividlab.shop/v1/video/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "kling-pro", "mode": "motion", "image_url": "https://subject-image.jpg", "video_url": "https://reference-motion.mp4", "orientation": "video" }' ``` Orientation options for motion mode: - `image` — Subject Mode (≤10s): follow subject image orientation - `video` — Video Mode (≤30s): follow reference video motion --- ### Kling 4K Ultra HD - Model ID: `kling-4k` - Modes: text-to-video (t2v), image-to-video (i2v), reference-to-video (ref2v) - Resolutions: 4K - Durations: 3-15s (any integer) - Aspect Ratios: 16:9, 9:16, 1:1 - Pricing (tokens) — UPDATED 2026-07-05: | Mode | Duration | Tokens | |---|---|---| | t2v | 3s | 56 (RM5.60) | | t2v | 5s | 94 (RM9.40) | | t2v | 10s | 188 (RM18.80) | | t2v | 15s | 276 (RM27.60) | | i2v | 10s | 188 (RM18.80) | | ref2v | 10s | 188 (RM18.80) | ```bash curl -s -X POST https://api.aividlab.shop/v1/video/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "kling-4k", "mode": "t2v", "prompt": "Ultra-detailed aerial shot of a luxury resort at sunset", "duration": 10, "aspect_ratio": "16:9" }' ``` --- ### Veo 3.1 Stable - Model ID: `veo-3.1-stable` - Modes: text-to-video, image-to-video - Resolutions: 720p, 1080p - Durations: 4s, 6s, 8s - Aspect Ratios: 16:9, 9:16, 1:1 - Pricing (tokens): | Resolution | 4s | 6s | 8s | |---|---|---|---| | 720p | 12 (RM1.20) | 16 (RM1.60) | 20 (RM2.00) | | 1080p | 17 (RM1.70) | 23 (RM2.30) | 29 (RM2.90) | ```bash curl -s -X POST https://api.aividlab.shop/v1/video/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "veo-3.1-stable", "prompt": "A beautiful sunset over the ocean, cinematic drone shot", "duration": 6, "resolution": "1080p", "aspect_ratio": "16:9" }' ``` --- ### Veo 3.1 Pro - Model ID: `veo-3.1-pro` - Modes: text-to-video, image-to-video - Resolutions: 720p, 1080p, 4K - Duration: auto (not configurable) - Aspect Ratios: 16:9, 9:16, 1:1 - Pricing (per-resolution, flat rate): | Resolution | Cost | |---|---| | 720p | 9 tokens (RM0.90) | | 1080p | 11 tokens (RM1.10) | | 4K | 14 tokens (RM1.40) | ```bash curl -s -X POST https://api.aividlab.shop/v1/video/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "veo-3.1-pro", "prompt": "Cinematic product showcase with dynamic camera movement", "resolution": "1080p", "aspect_ratio": "9:16" }' ``` --- ### Veo 3.1 Fast - Model ID: `veo-3.1-fast` - Modes: text-to-video, image-to-video - Resolutions: 720p, 1080p, 4K (same price) - Duration: auto (not configurable) - Aspect Ratios: 16:9, 9:16, 1:1 - Pricing: 12 tokens flat (RM1.20) — all resolutions same price - Note: Fastest generation time of all Veo models ```bash curl -s -X POST https://api.aividlab.shop/v1/video/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "veo-3.1-fast", "prompt": "Quick product video with zoom effects", "resolution": "4k", "aspect_ratio": "16:9" }' ``` --- ## IMAGE MODELS ### GPT Image 2 - Model ID: `gpt-image-2` - Modes: text-to-image, image-to-image (pass `image_urls` for edit) - Pricing: 4 tokens per image (RM0.40) - Aspect Ratios: 1:1, 16:9, 9:16 ```bash # Text-to-image curl -s -X POST https://api.aividlab.shop/v1/image/generate \ -H "Authorization: Bearer YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-image-2", "prompt": "A modern minimalist logo for a tech startup", "aspect_ratio": "1:1" }' # Image-to-image (edit mode — pass image_urls) curl -s -X POST https://api.aividlab.shop/v1/image/generate \ -H "Authorization: Bearer YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-image-2", "prompt": "Change the background to a tropical beach sunset", "image_urls": ["https://example.com/original.jpg"], "aspect_ratio": "16:9" }' ``` --- ### GPT Image 1.5 - Model ID: `gpt-image-1-5` - Modes: text-to-image, image-to-image (pass `image_urls` for edit) - Pricing: 4 tokens per image (RM0.40) — cheapest, fast, sharp text rendering - Aspect Ratios: 1:1, 16:9, 9:16 ```bash curl -s -X POST https://api.aividlab.shop/v1/image/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-image-1-5", "prompt": "A bold typographic poster that says SALE NOW", "aspect_ratio": "16:9" }' ``` --- ### Nano Banana - Model ID: `nano-banana` - Modes: text-to-image, image-to-image (pass `image_urls` for edit) - Pricing: 2 tokens per image (RM0.20) — cheapest image model - Aspect Ratios: 1:1, 16:9, 9:16 ```bash curl -s -X POST https://api.aividlab.shop/v1/image/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "nano-banana", "prompt": "A cute cartoon cat sitting on a couch", "aspect_ratio": "1:1" }' ``` --- ### Nano Banana 2 - Model ID: `nano-banana-2` - Modes: text-to-image, image-to-image (pass `image_urls` for edit) - Pricing: 4 tokens per image (RM0.40) — improved quality over Nano Banana - Aspect Ratios: 1:1, 16:9, 9:16 ```bash curl -s -X POST https://api.aividlab.shop/v1/image/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "nano-banana-2", "prompt": "Professional headshot of a business woman, studio lighting", "aspect_ratio": "1:1" }' ``` --- ### Nano Banana Pro - Model ID: `nano-banana-pro` - Modes: text-to-image, image-to-image (pass `image_urls` for edit) - Pricing: 6 tokens per image (RM0.60) — best image quality - Aspect Ratios: 1:1, 16:9, 9:16 ```bash curl -s -X POST https://api.aividlab.shop/v1/image/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "nano-banana-pro", "prompt": "Hyperrealistic food photography, gourmet burger with dramatic lighting", "aspect_ratio": "16:9" }' ``` ### Grok - Model ID: `grok` - Pricing: 2 tokens per image (RM0.20) — fast & budget friendly - Aspect Ratios: 1:1, 16:9, 9:16 - Edit mode: pass `image_urls` (max 1 reference image) ```bash curl -s -X POST https://api.aividlab.shop/v1/image/generate \ -H "Authorization: Bearer *** \ -H "Content-Type: application/json" \ -d '{ "model": "grok", "prompt": "A neon-lit cyberpunk street at night, rain reflections", "aspect_ratio": "9:16" }' ``` ### Grok Stable - Model ID: `grok-stable` - Pricing: 2 tokens per image (RM0.20) — official, more stable & consistent - Aspect Ratios: 1:1, 16:9, 9:16 - Edit mode: pass `image_urls` (max 1 reference image) ```bash curl -s -X POST https://api.aividlab.shop/v1/image/generate \ -H "Authorization: Bearer *** \ -H "Content-Type: application/json" \ -d '{ "model": "grok-stable", "prompt": "Professional product shot of a perfume bottle, soft studio light", "aspect_ratio": "1:1" }' ``` ### Grok Quality - Model ID: `grok-quality` - Pricing: 5 tokens per image (RM0.50) — high quality, sharper detail - Aspect Ratios: 1:1, 16:9, 9:16 - Edit mode: pass `image_urls` (max 1 reference image) ```bash curl -s -X POST https://api.aividlab.shop/v1/image/generate \ -H "Authorization: Bearer *** \ -H "Content-Type: application/json" \ -d '{ "model": "grok-quality", "prompt": "Cinematic portrait, dramatic rim lighting, ultra detailed", "aspect_ratio": "16:9" }' ``` ### Seedream 4.5 - Model ID: `seedream-v45` - Pricing: 3 tokens per image (RM0.30) - Aspect Ratios: 1:1, 16:9, 9:16, 4:3, 3:4 - Edit mode: pass `image_urls` (up to 10 reference images) ```bash curl -s -X POST https://api.aividlab.shop/v1/image/generate \ -H "Authorization: Bearer *** \ -H "Content-Type: application/json" \ -d '{ "model": "seedream-v45", "prompt": "Cinematic wuxia movie poster, dramatic night rain, ultra detailed", "aspect_ratio": "9:16" }' ``` ### Seedream 5 Lite - Model ID: `seedream-v5lite` - Pricing: 3 tokens per image (RM0.30) - Aspect Ratios: 1:1, 16:9, 9:16, 4:3, 3:4 - Edit mode: pass `image_urls` (up to 10 reference images) ```bash curl -s -X POST https://api.aividlab.shop/v1/image/generate \ -H "Authorization: Bearer *** \ -H "Content-Type: application/json" \ -d '{ "model": "seedream-v5lite", "prompt": "Modern flat illustration weather forecast chart, clean vector style", "aspect_ratio": "16:9" }' ``` ### Seedream 5 Pro - Model ID: `seedream-v5pro` - Pricing: 5 tokens per image (RM0.50) - Aspect Ratios: 1:1, 16:9, 9:16, 4:3, 3:4 - Edit mode: pass `image_urls` (up to 10 reference images) ```bash curl -s -X POST https://api.aividlab.shop/v1/image/generate \ -H "Authorization: Bearer *** \ -H "Content-Type: application/json" \ -d '{ "model": "seedream-v5pro", "prompt": "High-end skincare e-commerce hero shot, glass serum bottle, soft studio lighting, ultra detailed", "aspect_ratio": "9:16" }' ``` ### Jimeng 4.6 - Model ID: `jimeng46` - Pricing: 3 tokens per image (RM0.30) - Aspect Ratios: 1:1, 16:9, 9:16, 4:3, 3:4 - Edit mode: pass `image_urls` (up to 6 reference images recommended) ```bash curl -s -X POST https://api.aividlab.shop/v1/image/generate \ -H "Authorization: Bearer *** \ -H "Content-Type: application/json" \ -d '{ "model": "jimeng46", "prompt": "Professional Japanese anime illustration, full-body portrait, premium quality", "aspect_ratio": "9:16" }' ``` --- ### Flux Klein - Model ID: `flux-klein` - Pricing: 2 tokens per image (RM0.20) - Aspect Ratios: 1:1, 16:9, 9:16, 4:3, 3:4, 2:3, 3:2 - Edit mode: pass `image_urls` (1 reference image) ```bash curl -s -X POST https://api.aividlab.shop/v1/image/generate \ -H "Authorization: Bearer *** \ -H "Content-Type: application/json" \ -d '{ "model": "flux-klein", "prompt": "Photorealistic product shot, soft studio lighting, crisp text on label", "aspect_ratio": "9:16" }' ``` --- ## MUSIC & AUDIO MODELS ### Suno V5.5 - Model ID: `suno-v5.5` - Category: Song generation - Cost: 9 tokens (RM0.90) - Required params: `title`, `lyrics`, `tags` - Endpoint: POST /v1/music/generate ``` curl -s -X POST https://api.aividlab.shop/v1/music/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "suno-v5.5", "title": "Rindu Di Hati", "lyrics": "[Verse]\nMalam ini aku sendiri\n[Chorus]\nRindu ini membara", "tags": "pop melayu, sedih, slow ballad, female vocal" }' ``` ### Suno V5 - Model ID: `suno-v5` - Cost: 9 tokens (RM0.90) - Same params as suno-v5.5 ### Suno V4.5 - Model ID: `suno-v4.5` - Cost: 9 tokens (RM0.90) - Same params as suno-v5.5 ### Mureka 8 Song - Model ID: `mureka-v8-song` - Cost: 6 tokens (RM0.60) - Required: `lyrics` - Optional: `prompt` (style), `vocal_id`, `reference_id`, `melody_id`, `n` (1-3) ``` curl -s -X POST https://api.aividlab.shop/v1/music/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "mureka-v8-song", "lyrics": "[Verse]\nAku berjalan tanpa arah\n[Chorus]\nHati ini masih rindu", "prompt": "upbeat pop, female vocal, acoustic guitar" }' ``` ### Mureka 7.6 Song - Model ID: `mureka-v7.6-song` - Cost: 5 tokens (RM0.50) - Same params as mureka-v8-song ### Mureka O2 Song - Model ID: `mureka-o2-song` - Cost: 6 tokens (RM0.60) - Same params as mureka-v8-song ### MiniMax Music 2.6 - Model ID: `minimax-music-2.6` - Cost: 9 tokens (RM0.90) - Optional: `prompt` (style), `lyrics`, `is_instrumental` (bool) ``` curl -s -X POST https://api.aividlab.shop/v1/music/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "minimax-music-2.6", "prompt": "cinematic orchestral epic", "is_instrumental": true }' ``` ### Mureka 8 BGM - Model ID: `mureka-v8-bgm` - Category: Instrumental/BGM (no vocals) - Cost: 6 tokens (RM0.60) - Required: `prompt` (style/mood) ``` curl -s -X POST https://api.aividlab.shop/v1/music/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "mureka-v8-bgm", "prompt": "calm lo-fi hip hop, rainy day vibes" }' ``` ### Mureka 7.6 BGM - Model ID: `mureka-v7.6-bgm` - Cost: 5 tokens (RM0.50) - Same params as mureka-v8-bgm ### Suno Lyrics - Model ID: `suno-lyrics` - Category: AI lyrics generation - Cost: 4 tokens (RM0.40) - Required: `prompt` (theme/topic) - Response: `lyrics` text field (NOT audio URL) ``` curl -s -X POST https://api.aividlab.shop/v1/music/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "suno-lyrics", "prompt": "lagu cinta putus asa, gaya pop melayu" }' ``` ### Mureka AI Lyrics - Model ID: `mureka-lyrics` - Cost: 4 tokens (RM0.40) - Same params as suno-lyrics ### Mureka 8 Extend - Model ID: `mureka-v8-extend` - Category: Continue/extend existing song - Cost: 8 tokens (RM0.80) - Required: `file_url` (audio URL), `lyrics` (new section) - Optional: `extend_at` (ms, default 8000), `extend_type` ("tail"/"head") ``` curl -s -X POST https://api.aividlab.shop/v1/music/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "mureka-v8-extend", "file_url": "https://cdn.example.com/song.mp3", "lyrics": "[Bridge]\nDi sini aku menunggu", "extend_type": "tail" }' ``` ### Mureka 7.6 Extend - Model ID: `mureka-v7.6-extend` - Cost: 5 tokens (RM0.50) - Same params (no extend_type) ### MiniMax Cover - Model ID: `minimax-cover` - Category: AI song cover - Cost: 9 tokens (RM0.90) - Required: `file_url` (audio URL) - Optional: `prompt` (style), `lyrics` ``` curl -s -X POST https://api.aividlab.shop/v1/music/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "minimax-cover", "file_url": "https://cdn.example.com/reference.mp3", "prompt": "acoustic jazz version" }' ``` ### MiniMax Cover Preprocess - Model ID: `minimax-cover-pre` - Cost: 9 tokens (RM0.90) - Required: `file_url` - Returns: `coverFeatureId` (valid 24h, use for cover generation) ### Mureka Vocal Clone - Model ID: `mureka-vocal-clone` - Category: Voice cloning - Cost: 206 tokens (RM20.60) - Required: `file_url` (clean vocal, 10s–5min, MP3/WAV) - Returns: `vocalId` — reuse with mureka-v8-song ``` curl -s -X POST https://api.aividlab.shop/v1/music/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "mureka-vocal-clone", "file_url": "https://cdn.example.com/vocal-sample.mp3" }' ``` --- ## TEXT-TO-SPEECH (TTS) Endpoint: POST /v1/tts/generate Poll status: GET /v1/music/{task_id} (same as music) Result: audio MP3 URL (expires 24h) ### Available TTS Models | Model ID | Cost | Features | |----------|------|----------| | speech-2.8-hd | 6 tok (RM0.60) | Latest HD, 40+ languages, emotion, interjections | | speech-2.6-hd | 8 tok (RM0.80) | HD with emotion and pitch control | | speech-2.6-turbo | 6 tok (RM0.60) | Fast, low latency | | speech-02-hd | 6 tok (RM0.60) | High-definition voice | | speech-02-turbo | 5 tok (RM0.50) | Budget, fastest speed | ### TTS Parameters - `model` (required): Model ID from table above - `text` (required): 1–10,000 characters - `voice_id` (optional): Wise_Woman, Gentle_Woman, Warm_Man, Deep_Man, Narrator, Cheerful_Girl, Calm_Boy, Storyteller, Broadcaster, Customer_Service (default: Wise_Woman) - `speed` (optional): 0.5–2.0 (default: 1.0) - `volume` (optional): 0.1–10.0 (default: 1.0) - `pitch` (optional): -12 to +12 semitones (default: 0) - `emotion` (optional): neutral, happy, sad, angry, fearful, disgusted, surprised (default: neutral) ``` curl -s -X POST https://api.aividlab.shop/v1/tts/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "speech-2.8-hd", "text": "Selamat datang ke AIVidLab.", "voice_id": "Warm_Man", "speed": 1.0, "emotion": "happy" }' ``` --- ## ENDPOINTS REFERENCE ### Check Balance ``` GET /v1/balance ``` Response: `{"available": 150, "reserved": 0, "total_topup": 200, "total_spent": 50}` ### List Models ``` GET /v1/models ``` Returns all models with capabilities and pricing. ### Models Status (24H) ``` GET /v1/models/status ``` Returns real-time 24H health stats per model: success_rate, total generations, avg generation time, status (healthy/degraded/down). Response: ```json { "models": [ { "model": "Super Grok", "status": "healthy", "success_rate": 96.7, "avg_generation_time": 95.2, "total_24h": 90 } ] } ``` ### Models Status Timeline (144 segments) ``` GET /v1/models/status/timeline ``` Returns 144 segments per model (10-min buckets over 24 hours). Use this to render uptime-style status bars. Response: ```json { "period_start": 1782952980, "period_end": 1783039380, "bucket_size_seconds": 600, "models": [ { "model": "Super Grok", "segments": ["green", "green", "grey", "red", ...], "success_rate": 96.7, "total": 90 } ] } ``` Segment colors: `green` = all success, `red` = all failed, `yellow` = mixed, `grey` = no data in that 10-min window. ### Generate Video ``` POST /v1/video/generate ``` Body: - `model` (required): Model ID from list above - `prompt` (required): Text description (max 5000 chars) - `duration` (optional): Duration in seconds (default 10, range 3-30 depending on model) - `resolution` (optional): e.g. "720p", "1080p", "4k", "native1080p", "native4k" - `aspect_ratio` (optional): e.g. "16:9", "9:16", "1:1" (default "9:16") - `image_url` (optional): Reference image URL for i2v mode - `video_url` (optional): Reference video URL for multimodal/ref2v/video-edit/motion mode - `mode` (optional): Kling mode — "t2v", "i2v", "ref2v", "video_edit", "motion". Auto-detected if omitted. - `image_urls` (optional): Multiple reference image URLs (max 9, for multimodal/ref2v) - `last_image_url` (optional): End frame image URL (Kling i2v mode) - `orientation` (optional): Motion control orientation — "image" or "video" (Kling motion mode) - `sound` (optional): Enable native sound sync (Kling Pro auto-enables) - `negative_prompt` (optional): Describe what to avoid in the video (Kling) - `cfg_scale` (optional): CFG scale for prompt adherence (Kling) - `element_list` (optional): Kling element IDs for character/object consistency (max 3) Response: `{"task_id": "123", "status": "submitted", "model": "grok-video", "cost_tokens": 7, "message": "Video generation submitted. Poll GET /v1/video/{task_id} for status."}` ### Check Video Status ``` GET /v1/video/{task_id} ``` Response: `{"task_id": "123", "status": "completed", "result_url": "https://...", "progress": 100, "error": null}` Status values: `submitting`, `submitted`, `processing`, `completed`, `failed` ⚠️ IMPORTANT: - Result URLs expire after 24 hours. Download and store on your own CDN immediately. - Tokens are auto-refunded on failure (status becomes `refunded`). - Recommended polling interval: every 5 seconds. - Typical generation times: Veo Fast ~1min, Veo Pro ~2min, Kling ~2min, Seedance ~3min, Omni ~5min, Sora ~5min. - Max polling duration: 10 minutes. If still `processing` after 10min, assume timeout (auto-refunded). ### Generate Image ``` POST /v1/image/generate ``` Body: - `model` (required): Model ID - `prompt` (required): Text description (max 5000 chars) - `aspect_ratio` (optional): e.g. "1:1", "16:9", "9:16" (default "1:1") - `image_urls` (optional): Reference image URLs for image-to-image/edit mode (max 10) Response: `{"task_id": "456", "status": "submitted", "model": "gpt-image-2", "cost_tokens": 4, "message": "Image generation submitted. Poll GET /v1/image/{task_id} for status."}` ### Check Image Status ``` GET /v1/image/{task_id} ``` Response: `{"task_id": "456", "status": "completed", "result_url": "https://...", "error": null}` ### Generate Music/Audio ``` POST /v1/music/generate ``` Body: `{"model": "suno-v5.5", "title": "...", "lyrics": "...", "tags": "..."}` Response: `{"task_id": "789", "status": "submitted", "model": "Suno V5.5", "cost_tokens": 9}` See MUSIC & AUDIO MODELS section above for per-model required/optional params. ### Generate TTS ``` POST /v1/tts/generate ``` Body: `{"model": "speech-2.8-hd", "text": "Hello world", "voice_id": "Warm_Man", "emotion": "happy"}` Response: `{"task_id": "790", "status": "submitted", "model": "Speech-2.8 HD", "cost_tokens": 6}` ### Check Music/TTS Status ``` GET /v1/music/{task_id} ``` Response: `{"task_id": "789", "status": "completed", "result_url": "https://...audio.mp3", "error": null}` ⚠️ Audio result URLs expire after 24 hours. Download immediately on completion. ### Upload File ``` POST /v1/upload ``` Upload an image or video file. Returns a public CDN URL for use as `image_url` or `video_url` in generation requests. ⚠️ Uploaded file URLs expire after 72 hours. Re-upload if needed after expiry. - Content-Type: `multipart/form-data` - Field: `file` (required) - Max size: 10MB (images), 100MB (videos) - Supported images: jpg, png, webp, gif - Supported videos: mp4, webm, mov, avi Response: `{"url": "https://...", "filename": "photo.jpg", "type": "image"}` ```bash curl -s -X POST https://api.aividlab.shop/v1/upload \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "file=@/path/to/photo.jpg" ``` ### Usage History ``` GET /v1/usage?limit=50&offset=0 ``` Optional query params: `from` (YYYY-MM-DD), `to` (YYYY-MM-DD) — dates in MYT (UTC+8). Response: `{"usage": [...], "total": 100, "stats": {"total_jobs": 100, "completed": 90, "failed": 10, "total_tokens_used": 1500}}` ### Generations List ``` GET /v1/generations?limit=20&offset=0&status=completed ``` List user's generation history (video + image combined). Includes prompt details. Optional query params: - `limit` (default 20, max 100) - `offset` (default 0) - `status` (optional filter: submitting, submitted, processing, completed, failed) Response: `{"results": [...], "total": 50}` ### User Info ``` GET /v1/user/info ``` Get user profile info for dashboard display. Response: `{"telegram_id": 123456, "username": "johndoe", "first_name": "John", "available": 150, "reserved": 0, "total_topup": 200, "total_spent": 50}` ### API Keys Management List keys: ``` GET /v1/keys ``` Create key: ``` POST /v1/keys ``` Response: `{"key": "avl_...", "created": true}` Revoke key: ``` DELETE /v1/keys/{key} ``` Response: `{"message": "Key revoked."}` ### Developer Generations (Multi-User Tracking) ``` GET /v1/developer/generations?limit=50&offset=0 ``` List all generations submitted via YOUR API key. Useful for developers tracking their end-users' usage. Requires API key auth (not JWT). Returns only generations where `api_key_id` matches caller's key. Optional query params: - `limit` (default 50, max 100) - `offset` (default 0) Response: `{"generations": [...], "total": 12}` Each generation includes: id, model, mode, prompt, duration, resolution, aspect_ratio, image_urls, video_urls, token_cost, status, result_url, error_message, created_at, completed_at, created_at_fmt, completed_at_fmt Note: Only tracks generations made AFTER api_key_id tracking was enabled (2026-07-03). --- ### Kling Elements Kling Elements are reusable character/object references for consistency across videos. Create element: ``` POST /v1/kling/elements ``` Body: - `name` (required): Element name, max 100 chars - `description` (optional): Description, max 500 chars - `image_url` (required): Reference image URL - `tags` (optional): Tags for organization Cost: 1 token per element. Response: `{"id": 1, "status": "ready", "element_id": "elem_abc123", "name": "Beg Kuning"}` List elements: ``` GET /v1/kling/elements ``` Response: `{"elements": [...]}` Delete element: ``` DELETE /v1/kling/elements/{element_db_id} ``` Response: `{"message": "Element deleted."}` ### Webhooks Register: ``` POST /v1/webhooks Body: {"url": "https://yourapp.com/webhook", "secret": "signing_secret", "events": ["video.completed", "image.completed", "job.failed"]} ``` Events: `video.completed`, `image.completed`, `job.failed`, `all` (receive everything). List: ``` GET /v1/webhooks ``` Delete: ``` DELETE /v1/webhooks/{webhook_id} ``` Webhook payload (video.completed): ```json { "event": "video.completed", "task_id": "123", "model": "Veo 3.1 Fast", "status": "completed", "result_url": "https://...", "error": null, "cost_tokens": 12, "timestamp": "2026-07-03T10:30:00Z" } ``` Webhook payload (job.failed): ```json { "event": "job.failed", "task_id": "124", "model": "Kling V3.0 Pro", "status": "refunded", "result_url": null, "error": "Model timeout", "cost_tokens": 0, "timestamp": "2026-07-03T10:31:00Z" } ``` Signature verification: Header `X-AIVidLab-Signature: sha256=HMAC_SHA256(secret, request_body)` Failed deliveries are retried 3× with exponential backoff (5s, 30s, 5min). Max 5 webhooks per account. --- ## AIVIDLAB OMNI — STORYBOARD + VIDEO PIPELINE Omni is an end-to-end ad creation pipeline: Gemini designs storyboards → GPT Image 2 generates scene sheets → Omni Flash generates videos. ### Omni Styles ``` GET /v1/omni/meta/styles ``` Returns available visual styles. | Key | Name | Mascot | Description | |---|---|---|---| | realistik | Realistik | No | Foto realistik, cinematic | | ugc | UGC | No | Gaya TikTok UGC, handheld | | cinematic | Cinematic | No | Cinematic premium, color graded | | pixar | Pixar 3D | Yes | Gaya Pixar, mascot product | | kartun3d | Kartun 3D | Yes | Kartun 3D, mascot product | | anime | Anime | Yes | Gaya anime Jepun | | claymation | Claymation | Yes | Clay/stop-motion look | ### Create Omni Job ``` POST /v1/omni/create ``` Gemini auto-designs all scenes. Tokens are NOT charged here — only when sheets/videos are generated. Body: - `product_name` (optional): Product name (max 200 chars) - `product_usp` (optional): Unique selling point (max 500 chars) - `product_cta` (optional, default "Tekan Beg Kuning sekarang"): Call to action (max 100 chars) - `talent_persona` (optional): Talent description (max 300 chars) - `mode` (optional, default "product"): "product" or "story" - `style_key` (optional, default "realistik"): See styles list above - `scene_count` (optional, default 1, range 1-4): Number of scenes - `beat_count` (optional, default 3, range 3-4): Beats per scene - `product_image_url` (optional): Product reference image - `talent_image_url` (optional): Talent reference image - `resolution` (optional, default "720p"): "720p" or "1080p" - `aspect_ratio` (optional, default "9:16"): "9:16" or "16:9" Response: `{"job_token": "abc123def456", "scenes": [...]}` ### Generate Storyboard Sheets ``` POST /v1/omni/{job_token}/sheets ``` Generates storyboard sheet images (GPT Image 2) for all draft scenes. Cost: 4 tokens per scene. Response: `{"submitted": 2, "failed": 0, "message": "2 storyboard dihantar"}` ### Get Omni Job Status ``` GET /v1/omni/{job_token} ``` Returns all scenes with sheet + video status. ### List Omni Jobs ``` GET /v1/omni/jobs ``` Returns all Omni jobs for the current user. Response: `{"jobs": [...]}` ### Generate Videos ``` POST /v1/omni/{job_token}/videos ``` Generates Omni Flash videos for all scenes with completed sheets. Cost: 16 tokens per scene. Response: `{"submitted": 2, "failed": 0, "message": "2 video dihantar"}` ### Regenerate Sheet ``` POST /v1/omni/scene/{scene_id}/regenerate-sheet ``` Regenerate a single scene's storyboard sheet. Response: `{"task_id": "...", "status": "submitted"}` ### Retry Video ``` POST /v1/omni/scene/{scene_id}/retry-video ``` Retry video generation for a failed scene. ### Edit Scene ``` PATCH /v1/omni/scene/{scene_id} ``` Edit dialog & text-on-screen for a scene (before sheet generation). Body: - `vo_dialog` (optional): Full dialog text (max 500 chars) - `text_on_screen` (optional): Full text-on-screen (max 300 chars) - `dialog_beats` (optional): Array of per-beat dialog texts (3 or 4 items) - `text_beats` (optional): Array of per-beat text-on-screen (3 or 4 items) Response: `{"id": 123, "vo_dialog": "...", "text_on_screen": "...", "dialog_beats": [...], "text_beats": [...]}` --- ## ERROR CODES | Code | Meaning | Action | |---|---|---| | 401 | Invalid/missing API key | Check Bearer token | | 402 | Insufficient token balance | Top up via /topup | | 400 | Invalid parameters | Check model ID and params | | 403 | Account suspended | Contact support | | 404 | Resource not found | Check task_id or job_token | | 413 | File too large | Check upload size limits | | 429 | Rate limited (30 req/min) | Wait and retry | | 500 | Server error | Retry after 5 seconds | --- ## RATE LIMITS - 30 requests per minute per API key - Max 3 API keys per account - Webhook delivery retries 3× with exponential backoff --- ## WORKFLOW EXAMPLE 1. Submit generation: ```bash RESPONSE=$(curl -s -X POST https://api.aividlab.shop/v1/video/generate \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model": "grok-video", "prompt": "Your prompt", "duration": 10, "aspect_ratio": "16:9"}') TASK_ID=$(echo $RESPONSE | jq -r '.task_id') ``` 2. Poll until complete: ```bash while true; do STATUS=$(curl -s https://api.aividlab.shop/v1/video/$TASK_ID \ -H "Authorization: Bearer YOUR_API_KEY" \ echo $STATUS | jq '.status, .progress' if echo $STATUS | jq -e '.status == "completed"' > /dev/null; then echo "Done! URL:" $(echo $STATUS | jq -r '.result_url') break fi sleep 5 done ``` Or use webhooks to avoid polling entirely. --- ## QUICK REFERENCE — CHEAPEST OPTIONS - Cheapest video: Grok Video 10s = 7 tokens (RM0.70) - Cheapest HD video: Kling Standard 3s = 19 tokens (RM1.90) - Cheapest image: Nano Banana = 2 tokens (RM0.20) - Best value video: Omni Flash 10s = 16 tokens (RM1.60) with image-to-video support - Best quality video: Kling 4K Ultra HD 15s = 241 tokens (RM24.10) - Best quality image: Nano Banana Pro = 6 tokens (RM0.60) - Cheapest music: Mureka 7.6 Song = 5 tokens (RM0.50) - Best music: Suno V5.5 = 9 tokens (RM0.90) - Cheapest lyrics: Suno Lyrics / Mureka Lyrics = 4 tokens (RM0.40) - Cheapest BGM: Mureka 7.6 BGM = 5 tokens (RM0.50) - Cheapest TTS: Speech-02 Turbo = 5 tokens (RM0.50) - Best TTS: Speech-2.8 HD = 6 tokens (RM0.60) --- ## VIDEO GENERATE — FULL PARAMETER REFERENCE | Parameter | Type | Required | Description | |---|---|---|---| | model | string | yes | Model ID (see models list) | | prompt | string | yes | Text description (max 5000) | | duration | int | no | Seconds (default 10, range 3-30) | | resolution | string | no | "480p", "720p", "1080p", "2k", "4k", "native1080p", "native4k" | | aspect_ratio | string | no | "16:9", "9:16", "1:1" (default "9:16") | | image_url | string | no | Reference image URL (i2v mode) | | video_url | string | no | Reference video URL (multimodal/ref2v/video_edit/motion) | | mode | string | no | Kling: "t2v", "i2v", "ref2v", "video_edit", "motion" | | image_urls | array | no | Multiple ref images (max 9, multimodal/ref2v) | | last_image_url | string | no | End frame image (Kling i2v) | | orientation | string | no | Motion: "image" or "video" | | sound | bool | no | Enable sound sync (Kling Pro auto) | | negative_prompt | string | no | What to avoid (Kling, max 5000) | | cfg_scale | float | no | CFG scale (Kling) | | shot_type | string | no | Shot type (Kling, default "customize") | | element_list | array | no | Kling element IDs (max 3) |