---
name: Varosity Agent Video SDK
title: Production-Grade Video Generation for Any Agent
description: |
  Universal agent-first skill for generating cinema-quality videos via Varosity.ai.
  Works standalone with ANY agent, any use case. One API key. All platforms.
  No Paperclip, no Postiz, no external dependencies.
trigger: Any agent needs to generate production-grade video content
author: Varosity.ai
version: "3.5"
updated: "2026-11-10"
source_url: https://varosity.ai/api/v1/skills/varosity-agent-video-sdk
local_path: ~/.varosity/skills/varosity-agent-video-sdk.md
tags: [varosity, video, agent-first, production, kling, veo, runway, seedance, elevenlabs, sdk, universal]
kind: reference
---

> **Varosity runtime notes (2026-11-10.2) — these apply to every step below and win over anything older in this playbook.**
>
> - **Auth.** REST steps need a `vsk_` key (`Authorization: Bearer vsk_…`). An app signed in over OAuth (a `vso_` token) can use only the MCP server at `https://varosity.ai/api/mcp`: 29 of the 46 tools and a daily cap that starts at $5, without multi-voice assembly (`/api/v1/audio/assemble`), storyboards, brand agents, transcription, webhook changes or `govern_asset`. Keys made through agent connect have the default scopes (generate:*, projects:*, webhooks:read, credits:read); steps needing any other scope (transcription, storyboards, brands, runs, gates, webhook changes, asset governance) answer 403 until the user adds it on the API keys page. No key yet? A 401 carries `agent_connect` (get a key yourself — POST it, show your user the approval link, poll; the user only approves) and `agent_key` (a one-click key page for your user).
> - **Daily cap.** Every key has a daily spend cap. A run that costs more stops part-way with 429 `daily_cap_exceeded` — estimate first (`GET /api/v1/video/estimate` is free).
> - **Errors.** Not enough Credits (and no own provider key): video, images and music answer 409 `auth_not_configured`; `/api/tts` and storyboards answer 402 `insufficient_credits`; the other voice tools (sound effects, cloning, voice design, voice changer, transcription, dubbing) answer 409 `provider_not_configured`. A finished result the balance can't cover is 402 `insufficient_credits` (from `get_job`: `running` with that code). In every case: top up or connect a key, then retry or poll again — don't resubmit a held result. A finished video whose charge failed on our side is held with `billing_unavailable` instead (`get_job` `running`, REST `/api/v1/jobs` `rendering`): it is never charged twice and the balance is not the problem — keep polling every 30–60 s; don't call `buy_credits` and don't resubmit. A hold can still end `failed`, uncharged (render it again): a billing hold after 72 h, either hold after 1 h on Replicate- or HeyGen-routed models (their outputs expire), or if the output is gone when it would be released. 429 `rate_limited`: wait `Retry-After`, then retry. 429 `daily_cap_exceeded` (with `spent_today_cents`, `daily_cap_cents`): stop and tell the user — it resets at 00:00 UTC; retrying won't help. 400 `reference_image_unreachable`: we couldn't download the reference image and nothing was charged — host it publicly or send a `data:` URI. 400 `invalid_url` (voice tools): a URL you gave isn't public, can't be reached or answered an error, or is too large — fix the URL; retrying won't help. REST errors are `{ ok: false, error, code }`; over MCP a failed tool call says the same — as a result with `isError: true` when your client connects over HTTP and sends `MCP-Protocol-Version`, otherwise (the `@varosity/mcp-server` stdio proxy, plain JSON-RPC callers) as a JSON-RPC error; unknown tools and bad arguments are JSON-RPC `-32602`.
> - **Music.** MCP `generate_music` waits up to 90 s. If `audioUrl` is empty (`sync: false`), call `get_job` with `jobId` = the `trackId` every ~15 s until it succeeds (REST, with a `vsk_` key: `POST /api/music/poll { trackId }`). It is charged once, when ready; a track unfinished after 30 min is reported failed and not charged.
> - **Retries.** An `Idempotency-Key` header blocks a repeat sent while the first is still running on video generation (`/api/v1/video/generate`, `/api/generate`), images (`/api/v1/images` and its aliases), voice (`/api/tts`, `/api/v1/tts`), music (`/api/music`, `/api/v1/music`), `/api/v1/sfx` and `/api/v1/audio/assemble` — that repeat gets 409 `idempotency_in_flight` (retry shortly for the first result); a key reused on a different endpoint gets 409 `idempotency_key_reused`; 409 `idempotency_result_lost` means the first request already ran (and may have been charged) but its response was lost — it is not run or charged again under that key, so do not resend with a new key unless the user wants a second paid generation. Elsewhere, wait for the first call to finish before retrying.
> - **Keep your files.** A video's `outputUrl` is the provider's own link, not Varosity storage: Replicate deletes outputs after about an hour and other providers expire them later — download each clip as soon as its job succeeds, and stitch within the hour if any clip came from a Replicate-routed model (stitching downloads the clips). Images, voice, ElevenLabs Music and stitched project renders are stored by Varosity.
> - **Veo 3.1** (`veo-3.1`, `veo-3.1-quality`, `veo-3.1-lite`) keeps its ids and prices; all three tiers now run on Varosity credits only (no own-key route), always with audio, 1080p only on 8-second clips.
> - **Tell your user** which model made each result and what it cost, from the response: `cost_cents` (REST images), `costCents` (MCP images, music and `generate_voice`, video jobs), `totalCostCents` (assemble). On the user's own provider key there is no Varosity charge — say so.


# Varosity Agent Video SDK

**Production-grade video generation for any agent.**

Design philosophy: **Agent-first, platform-agnostic, dependency-free.**

Any MCP-compatible agent can use this skill to generate cinema-quality videos — no Paperclip, no Postiz, no external workflow required.

---

## Session Start Protocol

At the beginning of any video generation session, call `list_models` to confirm which models can be called right now and what they cost. The model roster and tool parameters evolve; `list_models` reflects the live registry.

---

## Platform Overview

```
Single Varosity API Key (vsk_...) → All Platforms
├── Video: Veo 3.1 (+ Quality / Lite), Kling 3.0 Pro, Seedance 1.0 Pro, Seedance 2.0,
│          Grok Imagine Video, Runway Gen-4.5 (Replicate), Luma Ray3, Wan 2.6,
│          MiniMax Hailuo 02, Hunyuan Video, LTX Video,
│          HeyGen avatars, D-ID Presenter, WAN Effects, LatentSync,
│          WaveSpeed: Luma Ray 2, Pika 2.2, Hailuo 02, Runway Gen 4,
│          OmniHuman 1.5 (avatar — requires photo + audio clip)
├── Images: FLUX.1 [schnell], FLUX 1.1 Pro, FLUX.2, Flux Dev, Nano Banana,
│           Nano Banana Pro, GPT Image 2, Ideogram V3, Recraft V3,
│           Seedream 4.0, Grok Imagine Image
├── Voice:  ElevenLabs v2, ElevenLabs v3 Alpha, OpenAI TTS-1, OpenAI TTS-1 HD,
│           Deepgram Aura 2, Cartesia Sonic, Fish Audio
├── Music:  Suno v4, ElevenLabs Music, Google Lyria 2
└── Billing: BYOK provider keys (zero markup) or one Varosity Credits pool
```

**Retired / unavailable — do not use:** Sora 2 (OpenAI shut it down
2026-09-24), Imagen 4 / Imagen 4 Fast (shut down 2026-08-17), Wan 2.5 and
Pika 2.2 on Replicate (removed upstream), direct Runway Gen-4.5, direct
Google Veo (`veo-3.1-direct`), direct Luma Ray 3. `list_models` leaves
these out — a request for one is rejected immediately.

---

## Video Model Catalog

Use `list_models kind=video` to get current availability — it is the source of truth. The table below lists the model **ids** to pass as `modelId` (list price per second; Credits charge the same list price).

| modelId | Model | Price | Best For |
|---------|-------|-------|----------|
| `veo-3.1` | Veo 3.1 Fast | $0.15/s | Lip sync, synced audio, photoreal close-ups |
| `veo-3.1-lite` | Veo 3.1 Lite | $0.05/s | Cheap Veo drafts |
| `kling-3.0` | Kling 3.0 Pro | $0.168/s | Cinematic, action, motion (5s or 10s clips, native audio included) |
| `kling-3.0-replicate` | Kling 3.0 Pro (Replicate) | $0.336/s | Same model via Replicate at about twice the price — fallback route only; prefer `kling-3.0` |
| `seedance-1.0-pro` | Seedance 1.0 Pro | $0.1215/s | Multi-shot from one prompt, 1080p, silent |
| `runway-gen-4.5-replicate` | Runway Gen-4.5 (Replicate) | $0.12/s | Camera control, scene consistency (5s or 10s clips) |
| `luma-ray-3-fal` | Luma Ray 3.2 | $0.10/s | Fluid camera movement, B-roll |
| `wan-2.6` | Wan 2.6 | $0.10/s | Strong motion (open-weight); 5, 10 or 15s clips |
| `hunyuan-video` | Hunyuan Video | $0.09/s | High-fidelity motion; fixed ~5s clips, slow |
| `ltx-video` | LTX Video | $0.04/s | Budget-friendly, fast |
| `d-id-talks` | D-ID AI Presenter | $0.05/s | Talking-head presenter from photo |
| `muapi-wan-effects` | WAN Video Effects | $0.06/s | Video effects, Credits-based |
| `muapi-latentsync` | LatentSync Lip-Sync | $0.05/s | Lip-sync to audio, Credits-based |
| `ws-luma-ray-2` | Luma Ray 2 (WaveSpeed) | $0.08/s | Credits-based Luma |
| `ws-pika-2.2` | Pika 2.2 (WaveSpeed) | $0.04/s | Credits-based, cheapest Pika |
| `ws-hailuo-02` | Hailuo 02 (WaveSpeed) | $0.0833/s | Credits-based Hailuo; physics realism; fixed 6s clip (≈ $0.50 per clip); 16:9 or 9:16 |
| `ws-runway-gen4` | Runway Gen 4 (WaveSpeed) | $0.056/s | Credits-based, image-to-video only; 5s or 10s clips |
| `omnihuman` | OmniHuman 1.5 | $0.16/s | Avatar (photo + audio); billed on the rendered clip length, which follows the audio |

**OmniHuman 1.5 note:** This is an avatar model. It requires a reference photo (`reference_image_url`) and an audio clip (`audio_url`). Use it only when the user explicitly wants a talking-head avatar video.

**Cost guidance:** Use `ws-pika-2.2` ($0.04/s) or `veo-3.1-lite` ($0.05/s) for iteration. Use Veo 3.1 Fast (`veo-3.1`, $0.15/s) for hero shots and final delivery. You are charged for the seconds the model produces, not the seconds requested.

---

## Image Model Catalog

Use `list_models kind=image` to get current availability.

| modelId | Model | Notes |
|---------|-------|-------|
| `flux-1-schnell` | FLUX.1 [schnell] | Fast, cheapest |
| `flux-1.1-pro` | FLUX 1.1 Pro | Higher quality photoreal |
| `muapi-flux-dev` | Flux Dev | Uses Varosity Credits — no BYOK key needed |
| `nano-banana` | Nano Banana | Very fast, good identity preservation and image editing (beta) |
| `gemini-3-pro-image` | Nano Banana Pro | Best legible text (no reference edits — use `nano-banana`) |
| `gpt-image-2` | GPT Image 2 | Strong text-in-image, creative compositions |
| `ideogram-v3` | Ideogram V3 | Typography, posters |
| `recraft-v3` | Recraft V3 | Brand-consistent, vector-style, long detailed prompts |

---

## Voice Model Catalog

Use `list_models kind=voice` to get current availability, and `list_voices` for valid voice ids per model.

| modelId | Model | Price | Notes |
|---------|-------|-------|-------|
| `elevenlabs-tts` | ElevenLabs Multilingual v2 | $0.0012/s ($0.08/1K chars; Flash/Turbo half) | Stable production voice, cloning |
| `elevenlabs-tts-v3` | ElevenLabs v3 Alpha | $0.0012/s | Newer, most expressive; still in alpha |
| `openai-tts-1` | OpenAI TTS-1 | $0.000225/s | Fast, built-in voices, low latency |
| `openai-tts-1-hd` | OpenAI TTS-1 HD | $0.00045/s | Highest OpenAI voice quality |
| `deepgram-aura-2` | Deepgram Aura 2 | $0.00045/s | Ultra-low latency |
| `cartesia-sonic-3.6` | Cartesia Sonic 3.6 | $0.000975/s | Cartesia's latest — ultra-low latency, 42 languages, large voice library (`cartesia-sonic-3` also listed) |
| `fish-audio-tts` | Fish Audio | $0.000225/s (UTF-8 bytes) | Multilingual |
| `heygen-voice` | HeyGen Voice | $0.00045/s | 24 preset voices; WAV |
| `heygen-voice-turbo` | HeyGen Voice Turbo | $0.00006/s | Same voices, cheapest; WAV |

---

## Music Model Catalog

Use `list_models kind=music` to get current availability.

| modelId | Model | Price | Notes |
|---------|-------|-------|-------|
| `elevenlabs-music` | ElevenLabs Music | $0.0025/s | Commercially licensed training data; up to 300s |
| `lyria-2` | Google Lyria 2 | $0.10 per request | Instrumental, one 30 s clip (max 30 s) |
| `suno-v4` | Suno V6 (id suno-v4, via muapi) | $0.10 per song | Best vocal generation, genre + mood tags; review licensing before commercial use (beta) |

MiniMax Music is **not offered** — it is a continuation model (needs a reference song), not text-to-music.

---

## MCP Tool List (40+ tools — `tools/list` is authoritative)

### Discovery & Setup
| # | Tool | Description |
|---|------|-------------|
| 1 | `list_models` | Filter model registry by kind: video / image / voice / music |
| 2 | `list_voices` | View saved voice library |
| 3 | `list_projects` | Browse recent projects |
| 4 | `suggest_model` | Smart model routing — ranked model recommendations for a shot description |
| 5 | `suggest_storyboard_mode` | Recommend grid vs. keyframes for a given brief |
| 6 | `refresh_skills` | Read-only. With `slug` (e.g. `varosity-agent-video-sdk`) returns that skill's latest text; without, lists the core skills' versions |

### Project Management
| # | Tool | Description |
|---|------|-------------|
| 7 | `create_project` | Create a new empty project — call ONCE per user request |
| 8 | `get_project` | Fetch a single project and its shots |
| 9 | `delete_project` | Remove a project |
| 10 | `list_templates` | List available project templates |
| 11 | `create_project_from_template` | Create a project pre-populated from a template |
| 12 | `list_webhooks` | List registered webhooks for job completion notifications |
| 13 | `create_webhook` | Register a webhook endpoint |
| 14 | `test_webhook` | Send a test payload to a registered webhook |
| 15 | `delete_webhook` | Remove a registered webhook |

### Generation
| # | Tool | Description |
|---|------|-------------|
| 16 | `pick_reference_images` | Generate 3 candidate reference images for user selection — recommended before `generate_video` when the look matters, once per project |
| 17 | `generate_video` | Submit a video render job; params: modelId, prompt, durationSec, aspectRatio, project_id, shot_index (1-based), imagePromptHint, reference_image_url, audio_url, providerOptions. Returns `{ jobId, projectId }` |
| 18 | `generate_image` | Synchronous image generation |
| 19 | `generate_voice` | Speech synthesis (ElevenLabs, OpenAI, Deepgram, Cartesia, Fish Audio) |
| 20 | `generate_music` | Generate a music track |
| 21 | `generate_creative_bible` | Generate a visual bible with reference images |
| 22 | `generate_end_card` | Generate a branded end card |
| 23 | `generate_storyboard_audio` | Generate narration/audio for a storyboard |

### Job & Shot Management
| # | Tool | Description |
|---|------|-------------|
| 24 | `get_job` | Poll job status and retrieve output URL |
| 25 | `render_project` | Stitch all shots into a final MP4 — returns final MP4 URL |
| 26 | `render_shot` | Render a single shot in isolation |

### Planning & Storyboard
| # | Tool | Description |
|---|------|-------------|
| 27 | `plan_brand_run` | Claude-powered brand planning |
| 28 | `plan_storyboard` | Director-mode storyboard planning |
| 29 | `generate_storyboard_grid` | Mode A: produce a single storyboard grid sheet image |
| 30 | `generate_storyboard_keyframes` | Mode B: produce parallel keyframe stills |
| 31 | `regenerate_keyframe` | Re-roll a single keyframe |
| 32 | `render_storyboard` | Render the full storyboard sequence |

### Brand Agent Tools
| # | Tool | Description |
|---|------|-------------|
| 33 | `list_brand_agents` | List available brand agent configurations |
| 34 | `run_brand_agent` | Execute a brand agent pipeline (multi-shot, automated) |
| 35 | `gate_decide` | Approve / revise / reject a pending brand-run gate |

### Voice, Audio & Provenance
| # | Tool | Description |
|---|------|-------------|
| 36 | `clone_voice` | Clone a voice from public audio sample URLs → `voiceId` |
| 37 | `design_voice` | Design a new voice from a text description |
| 38 | `sound_effect` | Generate a sound effect from a text description |
| 39 | `voice_changer` | Speech-to-speech: re-voice an audio clip |
| 40 | `transcribe_audio` | Speech-to-text |
| 41 | `clip_audio` | Trim a clip out of a longer audio file |
| 42 | `verify_asset` | Check an asset's provenance record |
| 43 | `govern_asset` | Sign / watermark / label an external asset |

---

## Optional Step: Reference Image Workflow

A text prompt alone is enough for a first clip. When the look matters — a product, a character or a brand that must look the same in every shot — run `pick_reference_images` once per project (never per shot) and reuse the chosen image for every shot.

**Why:** Reference images lock the visual aesthetic — lighting, color palette, subject style — so all shots feel like they belong to the same production.

**Cost:** about 6¢ for 3 images on the default `muapi-flux-dev` (2¢ each on Credits); more on pricier image models.

**Workflow:**

```
Step 1: pick_reference_images
        └── Args: { prompt, count?, aspectRatio?, modelId? }
        └── Returns 3 candidate images as [{ index, imageUrl }]
        └── Present to user → user selects one

Step 2: generate_video (for each shot)
        └── Pass selected image URL as reference_image_url
        └── Pass imagePromptHint describing the aesthetic
```

**When to skip:** Skip `pick_reference_images` if:
- This is a first clip or a one-off shot where a text prompt is enough.
- The user provides their own reference image URL.
- The user says they don't want a reference image.

---

## Standard Video Generation Workflow

```
Session start
├── list_models kind=video                  ← confirm roster
│
Per user request
├── suggest_model (if unsure which model)   ← smart routing
├── create_project                          ← ONCE per request
│   └── save project_id
├── pick_reference_images                   ← optional, once per project, when the look matters
│   └── present 3 options to user
│   └── user selects one
│
Per shot
├── generate_video                          ← submit job
│   └── params: project_id, modelId, prompt, durationSec,
│             aspectRatio, reference_image_url, imagePromptHint
├── get_job (poll until succeeded)          ← retrieve output URL
│   ├── code "insufficient_credits"         ← held render: buy_credits, then poll once more
│   └── code "billing_unavailable"          ← charge failed on our side: keep polling, no buy_credits
│
After all shots
├── render_project                          ← stitch all shots into final MP4
│   └── delivers final MP4 URL
│
Optional
├── generate_voice                          ← narration
├── generate_music                          ← backing track
└── generate_end_card                       ← branded end card
```

---

## Key Rules

1. **Call `list_models` at session start.** Model IDs and parameters change; use the ids it returns.
2. **Use `pick_reference_images` when the look matters** (a product, character or brand) — once per project, never per shot. A text prompt alone is enough for a first clip.
3. **Call `create_project` exactly once per user request.** Pass the returned `project_id` to every `generate_video` call in that request.
4. **Use `suggest_model`** whenever you are unsure which video model to use. Do not guess.
5. **`render_project` stitches all shots into one MP4.** For single-shot videos, you don't need render_project — use the `outputUrl` from `get_job` directly.
6. **Only use model ids that `list_models` returns** (its default listing contains only callable models). Sora 2, Imagen 4, Wan 2.5, direct Runway Gen-4.5, and `veo-3.1-direct` are retired or unavailable.
7. **Held renders.** A `get_job` result with status `running` (REST: `rendering`) and `code: "insufficient_credits"` is a FINISHED render held for 24 hours (1 hour for providers whose files expire) until it is paid for. Stop polling, call `buy_credits` (or tell the user to add credits), then poll once more to release it. Don't resubmit. With `code: "billing_unavailable"` instead, the render is finished but charging it failed on our side: it is never charged twice and the balance is not the problem — keep polling every 30–60 s, and do NOT call `buy_credits` or resubmit. Either hold can still end `failed`, uncharged (render it again): a billing hold after 72 h, either hold after 1 h on Replicate- or HeyGen-routed models (their outputs expire), or when the output is gone by release time.

---

---

## Model Selection Quick Guide

| Shot type | Recommended modelId |
|-----------|---------------------|
| Photorealistic close-up / dialogue | `veo-3.1` |
| Cinematic action / motion | `kling-3.0` |
| Audio + video together | `seedance-2.0` |
| Camera control | `runway-gen-4.5-replicate` |
| Fluid camera movement / B-roll | `luma-ray-3-fal` |
| Physics realism / long prompts | `ws-hailuo-02` (fixed 6s clip) |
| Product motion on a budget | `wan-2.6` |
| Fast iteration / drafts | `ltx-video` or `ws-pika-2.2` |
| Talking-head avatar | `omnihuman` (photo + audio required) |

If unsure, call `suggest_model` with the shot description. It returns a ranked list with reasoning.

---

## Pricing Table

List price per second, the same on BYOK and on Varosity Credits.

| Model | Price | 10s clip cost |
|-------|-------|--------------|
| Veo 3.1 Fast (`veo-3.1`, max 8s) | $0.15/s | $1.20 for 8s |
| Seedance 1.0 Pro (`seedance-1.0-pro`) | $0.1215/s | $1.40 |
| Kling 3.0 Pro (`kling-3.0`) | $0.168/s | $1.68 |
| Kling 3.0 Pro (`kling-3.0-replicate`) | $0.34/s | $3.36 |
| Wan 2.6 (`wan-2.6`, 5/10/15s) | $0.10/s | $1.00 for 10s |
| Runway Gen-4.5 (`runway-gen-4.5-replicate`) | $0.12/s | $1.20 |

**Cost strategy:** Use `ws-pika-2.2` or `veo-3.1-lite` for drafts. Use Veo 3.1 for hero shots and final delivery.

---

## Example Workflow: 3-Shot Product Reel

```
User: "Make a 15-second product reel for our espresso machine."

Agent:
1. list_models kind=video
2. suggest_model("wide establishing shot, espresso machine, bright cafe")
   → Returns: Kling 3.0 Pro ranked highest for cinematic motion
3. create_project(title="espresso-reel-2026-05-03")
   → projectId: "3f2b8c1e-5a47-4d09-9c1b-7e6a2d4f8b10"
4. pick_reference_images(prompt="espresso machine, bright cafe, warm tones")
   → once for the whole reel (the product must look the same in every shot)
   → Returns 3 candidate images → user selects image #2
5. generate_video(
     project_id="3f2b8c1e-5a47-4d09-9c1b-7e6a2d4f8b10",
     shot_index=1,
     modelId="kling-3.0",
     prompt="Wide establishing shot of espresso machine in bright modern cafe, warm morning light",
     durationSec=5,
     aspectRatio="9:16",
     reference_image_url="<selected image URL>",
     imagePromptHint="warm cafe, golden tones, soft light"
   ) → jobId: <jobId-1>
6. generate_video(
     project_id="3f2b8c1e-5a47-4d09-9c1b-7e6a2d4f8b10",
     shot_index=2,
     modelId="veo-3.1",
     prompt="Extreme close-up of steam rising from espresso portafilter, photorealistic detail",
     durationSec=6,
     aspectRatio="9:16",
     reference_image_url="<same selected image URL>"
   ) → jobId: <jobId-2>
7. generate_video(
     project_id="3f2b8c1e-5a47-4d09-9c1b-7e6a2d4f8b10",
     shot_index=3,
     modelId="seedance-1.0-pro",
     prompt="Hero product shot of espresso machine, studio lighting, 360 rotation",
     durationSec=5,
     aspectRatio="9:16",
     reference_image_url="<same selected image URL>"
   ) → jobId: <jobId-3>
8. get_job(jobId=<jobId-1>) [poll until status == "succeeded"] → outputUrl
   get_job(jobId=<jobId-2>) [poll until status == "succeeded"] → outputUrl
   get_job(jobId=<jobId-3>) [poll until status == "succeeded"] → outputUrl
   (a "running" result with code "insufficient_credits" is held: buy_credits, then poll once more;
    with code "billing_unavailable" charging failed on our side: keep polling, no buy_credits)
9. render_project(projectId="3f2b8c1e-5a47-4d09-9c1b-7e6a2d4f8b10")
   → Returns final MP4 URL (outputUrl)
10. Deliver final video to user.
```

---

## Troubleshooting

| Issue | Solution |
|-------|----------|
| `get_job` stays `running` with `code: "insufficient_credits"` | A finished render held 24 hours (1 hour for providers whose files expire) for payment — call `buy_credits` (or ask the user to add credits), then poll once more. Don't resubmit |
| `get_job` stays `running` with `code: "billing_unavailable"` | A finished render whose charge failed on our side; it is never charged twice — keep polling every 30–60 s. Don't call `buy_credits`, don't resubmit |
| Wrong model selected | Use `suggest_model` with the shot description |
| Job stuck in "queued" / "running" | Keep polling `get_job` every 5–8s for up to ~4 min; check your balance at varosity.ai/app/credits and provider keys at varosity.ai/app/keys |
| Video incoherent across shots | Run `pick_reference_images` once for the project and pass the same URL to every shot |
| ffmpeg not installed | `brew install ffmpeg` (macOS) or `apt-get install ffmpeg` (Linux) |
| "Authorization failed" | Verify token starts with `vsk_` and is not expired |
| Skill parameters stale | Fetch the latest version from https://varosity.ai/api/v1/skills/varosity-agent-video-sdk or call `refresh_skills` with `slug: "varosity-agent-video-sdk"` |
| OmniHuman render fails | It is an avatar model — pass a photo (`reference_image_url`) AND an audio clip (`audio_url`) |

---

## No SDK Package Required

Despite the name, there is nothing to install: no `pip install`, no
`varosity_sdk` Python module. This skill is the whole "SDK" — it drives
Varosity through the MCP tools above. For plain REST from Python (submit →
poll → download with `requests`), see
https://varosity.ai/docs/agent-video-sdk.

REST equivalents (host is always `https://varosity.ai`, `Authorization: Bearer vsk_…`):

| Action | REST call |
|--------|-----------|
| Generate video | `POST /api/v1/video/generate` `{ prompt, modelId, aspectRatio, durationSec, referenceImageUrl? }` → `{ ok, jobId, projectId, status: "rendering", outputUrl }` |
| Poll a job | `GET /api/v1/jobs/{jobId}` → `{ ok, status, outputUrl }` (`queued` → `rendering` → `succeeded` / `failed`) |
| Generate image | `POST /api/v1/images` `{ prompt, modelId, aspectRatio }` → `{ ok, imageUrl, model }` |
| Voice | `POST /api/v1/tts` `{ text, voiceId?, voiceModel? }` → `{ ok, audioUrl }` |
| Music | `POST /api/v1/music` `{ modelId, prompt, durationSec }` → `{ ok, trackId, audioUrl }` |

Note the naming difference: REST uses `referenceImageUrl` / `audioUrl`; the MCP `generate_video` tool uses `reference_image_url` / `audio_url` / `project_id`.

---

## Resources

- **Agent Mode Docs:** https://varosity.ai/docs/agent-mode
- **Model Picker Guide:** https://varosity.ai/docs/picking-the-right-model
- **Prompting Cheatsheet:** https://varosity.ai/docs/prompting-cheatsheet
- **API Spec:** https://varosity.ai/api/openapi.json
- **API Keys:** https://varosity.ai/app/keys/api-keys

---

**One API key. All platforms. Pure video production.**
