cd /news/ai-agents/generating-video-from-claude-and-cur… · home › topics › ai-agents › article
[ARTICLE · art-164489] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Generating video from Claude and Cursor with one API key (MCP + agent skills)

A developer at Revana published a guide and public repo (Aribk7/revana-skills) showing how to give Claude Code, Claude Desktop, Cursor, VS Code and Codex CLI access to paid video-generation models such as Seedance 2.5, Veo 3.1 and Kling through a single API key, via a remote MCP server over streamable HTTP or a shell-based Agent Skill. The design separates a free `get_quote` tool from the paid `generate_video` call, which is capped by `max_cost_usd` and uses idempotency keys so retries return the same job instead of starting a second paid one, while `get_video` long-polls up to 40 seconds to keep agents from filling context with status messages.

by read8 min views2 publishedNov 5, 2026

Disclosure: I work on Revana. The examples use its MCP server and REST API because that's what I know end to end. The patterns (quote first, cap the cost, idempotent retries, wait without polling) apply to any paid generation API you give an agent.

Coding agents are now good at the glue work around media: writing a storyboard, generating a start frame, rendering a clip, trimming it with ffmpeg, and committing the result to a repo. What they lack out of the box is a safe way to spend money on generation. An agent that can call a video model in a retry loop can also burn $50 in a minute.

This post covers two ways to give Claude (Claude Code, Claude Desktop) and Cursor access to video models such as Seedance 2.5, Veo 3.1 and Kling, through a single key:

get_quote and generate_video. curl, following a short set of rules you write once. You can use either or both. MCP is less work. The skill gives you more control and works in any agent that can run a shell.

Everything below is also in a public repo, Aribk7/revana-skills: ready-made Agent Skills for Claude Code, Codex and Cursor, runnable examples, and two n8n workflows.

Revana runs a remote MCP server over streamable HTTP at:

https://revana.si/api/mcp
claude mcp add --transport http revana https://revana.si/api/mcp

Then type /mcp inside Claude Code and choose revana to sign in. The OAuth flow creates a separate API key for this connection. You can revoke it from the dashboard without touching your other keys.

Add it as a custom connector with the same URL, then click Connect and approve it on revana.si.

Add the server to ~/.cursor/mcp.json (global) or .cursor/mcp.json (per project). With OAuth, Cursor asks you to sign in the first time a tool is used:

{
  "mcpServers": {
    "revana": {
      "url": "https://revana.si/api/mcp"
    }
  }
}

If your client doesn't support OAuth, pass an API key from the dashboard as a header. Keep this file out of git: the key spends real credits.

{
  "mcpServers": {
    "revana": {
      "type": "http",
      "url": "https://revana.si/api/mcp",
      "headers": { "Authorization": "Bearer sr_live_YOUR_KEY" }
    }
  }
}

VS Code and Codex CLI one-liners, for completeness:

code --add-mcp '{"name":"revana","type":"http","url":"https://revana.si/api/mcp"}'
codex mcp add revana --url https://revana.si/api/mcp && codex mcp login revana
Tool What it does Costs money
list_models Every video/image model with options and price no
get_quote Exact price for a request, before anything runs no
get_balance What the credits can spend now, what's held by running jobs no
upload_file Turn a local image/clip/sound into an https link for references (14 days) no
generate_video Start the generation, capped by max_cost_usd yes
get_video Wait for a job (long-poll up to 40 s per call) no
get_video_link A download link for the result (valid one hour) no

The design choice that matters is that quoting is a separate, free tool and the server instructions tell the model to quote first and ask before calling generate_video. In practice, this prompt:

Make a 5-second 720p video of a paper boat in the rain with Seedance 2.5. Tell me the price first.

produces a get_quote call, a message like "That's $1.05 (5 s x $0.21/s at 720p, price as of 2026-11-05). Go ahead?", and only after you answer yes, a generate_video call with max_cost_usd: 1.25 and an idempotency key the agent makes up. If the agent retries after a network error, it reuses that key, and the server returns the same job instead of starting a second paid one.

The other detail is get_video with wait_seconds. Without it, agents tend to poll in a tight loop and fill their own context with status messages. A long-poll lets one tool call wait up to 40 seconds.

MCP is convenient, but sometimes you want the agent to drive the HTTP API directly: in CI, in a sandbox without MCP, or when you want the generated files written straight into the repo. In that case, give the agent a short rules file and a key in the environment.

The key goes in the environment, set by you, never pasted into the chat:

export REVANA_API_KEY=sr_live_...   # in your shell profile or a .env the agent can't print

Then add a skill. For Claude Code that's .claude/skills/video/SKILL.md. For Cursor, put the same text in .cursor/rules/video.mdc.

If you'd rather not write it yourself, the revana-skills repo has finished skills for video, images, UGC ads, music and picking the cheapest model. Copy a folder from its skills/ directory into ~/.claude/skills/ (or your agent's skills directory). The minimal version looks like this:

---
name: video
description: Generate a video or image with the Revana API (Seedance 2.5, Veo 3.1, Kling, Wan, Nano Banana Pro). Use when the user asks to make, render or animate a video or image.
---

1. The key is in $REVANA_API_KEY. Never print, echo or write it to a file.
2. Quote first from the live price list (no key needed) and wait for a "yes":
   curl -s https://api.revana.si/v1/models | jq '.data[] | select(.id=="seedance-2.5") | .price'
   Cost = price.usd[resolution] (or "<res>+audio" when present and audio is on) x duration.
3. Always send max_cost_usd equal to the agreed price.
4. Send an Idempotency-Key header. On any retry, send the same key and the same body.
5. Poll GET /v1/generations/{id} every 5 s until status is succeeded or failed.
6. Download with GET /v1/generations/{id}/content into ./media/, then tell the user the path and the final cost_usd.
7. If error.retryable is false, don't retry: change the request or ask the user.

With the skill in place, the agent's generated commands look like this:

GEN=$(curl -s https://api.revana.si/v1/generations \
  -H "Authorization: Bearer $REVANA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: boat-rain-v1" \
  -d '{
    "model": "seedance-2.5",
    "input": {
      "prompt": "a paper boat drifting down a rain-soaked street, low angle, shallow depth of field",
      "resolution": "720p", "duration": 5, "aspect_ratio": "16:9", "audio": true
    },
    "max_cost_usd": 1.05
  }')
ID=$(echo "$GEN" | jq -r .id)

while :; do
  G=$(curl -s https://api.revana.si/v1/generations/$ID -H "Authorization: Bearer $REVANA_API_KEY")
  S=$(echo "$G" | jq -r .status)
  [ "$S" = succeeded ] || [ "$S" = failed ] && break
  sleep 5
done
echo "$G" | jq '{status, cost_usd, error}'

mkdir -p media
curl -sL https://api.revana.si/v1/generations/$ID/content \
  -H "Authorization: Bearer $REVANA_API_KEY" -o media/boat-rain.mp4

Agents often generate a start frame first and then animate it. Reference media must be public https:// URLs, so a local file goes through /v1/uploads first. The upload is free, and the returned link is valid for 14 days:

// upload.mjs: node upload.mjs frame.png  ->  prints a https link to use as image_url
import { readFile } from "node:fs/promises";
import { basename } from "node:path";

const file = process.argv[2];
const bytes = await readFile(file);
const headers = { Authorization: `Bearer ${process.env.REVANA_API_KEY}`, "Content-Type": "application/json" };

const up = await fetch("https://api.revana.si/v1/uploads", {
  method: "POST",
  headers,
  body: JSON.stringify({ content_type: "image/png", bytes: bytes.length, filename: basename(file) }),
}).then((r) => r.json());

// PUT the bytes with exactly the headers the API returned (content type and length are signed)
const put = await fetch(up.upload_url, { method: up.upload_method, headers: up.upload_headers, body: bytes });
if (!put.ok) throw new Error(`upload failed: ${put.status}`);

console.log(up.url); // e.g. https://api.revana.si/v1/uploads/upl_..., good for 14 days

Then the generation takes it as the first frame:

{
  "model": "seedance-2.5",
  "input": { "prompt": "the boat starts to drift, rain intensifies", "image_url": "https://api.revana.si/v1/uploads/upl_...",
             "resolution": "720p", "duration": 5, "aspect_ratio": "16:9", "audio": true },
  "max_cost_usd": 1.25
}

After a few weeks of running this daily, these are the problems I've seen and what fixes each one:

409 idempotency_conflict. The conflict is useful, because it means the agent tried to "retry" with a changed prompt.max_cost_usd on every request. A route above the cap is skipped and the request fails with max_cost_exceeded instead of charging more.error.retryable. content_policy, invalid_input and model_busy, timeout and all_routes_failed are worth retrying later.echo $REVANA_API_KEY while debugging. Fix: say so in the rules, prefer OAuth-scoped MCP keys you can revoke individually, and keep a low balance on agent keys. The official SDKs are open source on GitHub: revana-js (TypeScript/JavaScript) and revana-python. Both wrap the same quote, cap, idempotency key and wait flow described above. Both are published: npm install revana and pip install revana.

The revana-skills repo also has runnable examples (curl, Node, Python, Next.js route handlers, Vercel AI SDK tools, MCP configs) and importable n8n workflows that quote, create, wait and download.

The full API is described in an OpenAPI file at https://revana.si/openapi.json, and GET https://api.revana.si/v1/models lists every model and price without a key. Prices quoted in this post are as of 2026-11-05.

Try it: revana.si has one API key for 200+ video and image models, with live prices on revana.si/pricing.

── more in #ai-agents 4 stories · sorted by recency
── more on @revana 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/generating-video-fro…] indexed:0 read:8min 2026-11-05 · —