{"slug": "generating-video-from-claude-and-cursor-with-one-api-key-mcp-agent-skills", "title": "Generating video from Claude and Cursor with one API key (MCP + agent skills)", "summary": "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.", "body_md": "Disclosure: I work on [Revana](https://revana.si/?utm_source=devto&utm_medium=article&utm_campaign=crosspost-2). 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.\n\nCoding 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.\n\nThis 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:\n\n`get_quote` and `generate_video`.` curl`, following a short set of rules you write once.\nYou 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.\n\nEverything below is also in a public repo, [Aribk7/revana-skills](https://github.com/Aribk7/revana-skills): ready-made Agent Skills for Claude Code, Codex and Cursor, runnable examples, and two n8n workflows.\n\nRevana runs a remote MCP server over streamable HTTP at:\n\n```\nhttps://revana.si/api/mcp\nclaude mcp add --transport http revana https://revana.si/api/mcp\n```\n\nThen 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.\n\nAdd it as a custom connector with the same URL, then click **Connect** and approve it on revana.si.\n\nAdd 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:\n\n```\n{\n  \"mcpServers\": {\n    \"revana\": {\n      \"url\": \"https://revana.si/api/mcp\"\n    }\n  }\n}\n```\n\nIf 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.\n\n```\n{\n  \"mcpServers\": {\n    \"revana\": {\n      \"type\": \"http\",\n      \"url\": \"https://revana.si/api/mcp\",\n      \"headers\": { \"Authorization\": \"Bearer sr_live_YOUR_KEY\" }\n    }\n  }\n}\n```\n\nVS Code and Codex CLI one-liners, for completeness:\n\n```\ncode --add-mcp '{\"name\":\"revana\",\"type\":\"http\",\"url\":\"https://revana.si/api/mcp\"}'\ncodex mcp add revana --url https://revana.si/api/mcp && codex mcp login revana\n```\n\n| Tool | What it does | Costs money | \n|---|---|---|\n| `list_models` | Every video/image model with options and price | no | \n| `get_quote` | Exact price for a request, before anything runs | no | \n| `get_balance` | What the credits can spend now, what's held by running jobs | no | \n| `upload_file` | Turn a local image/clip/sound into an https link for references (14 days) | no | \n| `generate_video` | Start the generation, capped by `max_cost_usd` | **yes** | \n| `get_video` | Wait for a job (long-poll up to 40 s per call) | no | \n| `get_video_link` | A download link for the result (valid one hour) | no | \n\nThe 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:\n\nMake a 5-second 720p video of a paper boat in the rain with Seedance 2.5. Tell me the price first.\n\nproduces 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.\n\nThe 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.\n\nMCP 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.\n\nThe key goes in the environment, set by you, never pasted into the chat:\n\n```\nexport REVANA_API_KEY=sr_live_...   # in your shell profile or a .env the agent can't print\n```\n\nThen add a skill. For Claude Code that's `.claude/skills/video/SKILL.md`. For Cursor, put the same text in `.cursor/rules/video.mdc`.\n\nIf you'd rather not write it yourself, the [revana-skills](https://github.com/Aribk7/revana-skills) repo has finished skills for video, images, UGC ads, music and picking the cheapest model. Copy a folder from its [`skills/`](https://github.com/Aribk7/revana-skills/tree/main/skills) directory into `~/.claude/skills/` (or your agent's skills directory). The minimal version looks like this:\n\n```\n---\nname: video\ndescription: 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.\n---\n\n# Rules\n1. The key is in $REVANA_API_KEY. Never print, echo or write it to a file.\n2. Quote first from the live price list (no key needed) and wait for a \"yes\":\n   curl -s https://api.revana.si/v1/models | jq '.data[] | select(.id==\"seedance-2.5\") | .price'\n   Cost = price.usd[resolution] (or \"<res>+audio\" when present and audio is on) x duration.\n3. Always send max_cost_usd equal to the agreed price.\n4. Send an Idempotency-Key header. On any retry, send the same key and the same body.\n5. Poll GET /v1/generations/{id} every 5 s until status is succeeded or failed.\n6. Download with GET /v1/generations/{id}/content into ./media/, then tell the user the path and the final cost_usd.\n7. If error.retryable is false, don't retry: change the request or ask the user.\n```\n\nWith the skill in place, the agent's generated commands look like this:\n\n```\n# 1. submit (202 Accepted; a replay of the same key returns 200 with the same job)\nGEN=$(curl -s https://api.revana.si/v1/generations \\\n  -H \"Authorization: Bearer $REVANA_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Idempotency-Key: boat-rain-v1\" \\\n  -d '{\n    \"model\": \"seedance-2.5\",\n    \"input\": {\n      \"prompt\": \"a paper boat drifting down a rain-soaked street, low angle, shallow depth of field\",\n      \"resolution\": \"720p\", \"duration\": 5, \"aspect_ratio\": \"16:9\", \"audio\": true\n    },\n    \"max_cost_usd\": 1.05\n  }')\nID=$(echo \"$GEN\" | jq -r .id)\n\n# 2. poll\nwhile :; do\n  G=$(curl -s https://api.revana.si/v1/generations/$ID -H \"Authorization: Bearer $REVANA_API_KEY\")\n  S=$(echo \"$G\" | jq -r .status)\n  [ \"$S\" = succeeded ] || [ \"$S\" = failed ] && break\n  sleep 5\ndone\necho \"$G\" | jq '{status, cost_usd, error}'\n\n# 3. download (the endpoint redirects to a short-lived file URL, hence -L)\nmkdir -p media\ncurl -sL https://api.revana.si/v1/generations/$ID/content \\\n  -H \"Authorization: Bearer $REVANA_API_KEY\" -o media/boat-rain.mp4\n```\n\nAgents 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:\n\n``` php\n// upload.mjs: node upload.mjs frame.png  ->  prints a https link to use as image_url\nimport { readFile } from \"node:fs/promises\";\nimport { basename } from \"node:path\";\n\nconst file = process.argv[2];\nconst bytes = await readFile(file);\nconst headers = { Authorization: `Bearer ${process.env.REVANA_API_KEY}`, \"Content-Type\": \"application/json\" };\n\nconst up = await fetch(\"https://api.revana.si/v1/uploads\", {\n  method: \"POST\",\n  headers,\n  body: JSON.stringify({ content_type: \"image/png\", bytes: bytes.length, filename: basename(file) }),\n}).then((r) => r.json());\n\n// PUT the bytes with exactly the headers the API returned (content type and length are signed)\nconst put = await fetch(up.upload_url, { method: up.upload_method, headers: up.upload_headers, body: bytes });\nif (!put.ok) throw new Error(`upload failed: ${put.status}`);\n\nconsole.log(up.url); // e.g. https://api.revana.si/v1/uploads/upl_..., good for 14 days\n```\n\nThen the generation takes it as the first frame:\n\n```\n{\n  \"model\": \"seedance-2.5\",\n  \"input\": { \"prompt\": \"the boat starts to drift, rain intensifies\", \"image_url\": \"https://api.revana.si/v1/uploads/upl_...\",\n             \"resolution\": \"720p\", \"duration\": 5, \"aspect_ratio\": \"16:9\", \"audio\": true },\n  \"max_cost_usd\": 1.25\n}\n```\n\nAfter a few weeks of running this daily, these are the problems I've seen and what fixes each one:\n\n`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.\nThe official SDKs are open source on GitHub: [revana-js](https://github.com/Aribk7/revana-js) (TypeScript/JavaScript) and [revana-python](https://github.com/Aribk7/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`.\n\nThe [revana-skills](https://github.com/Aribk7/revana-skills) repo also has [runnable examples](https://github.com/Aribk7/revana-skills/tree/main/examples) (curl, Node, Python, Next.js route handlers, Vercel AI SDK tools, MCP configs) and [importable n8n workflows](https://github.com/Aribk7/revana-skills/tree/main/n8n) that quote, create, wait and download.\n\nThe full API is described in an OpenAPI file at [https://revana.si/openapi.json](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.\n\n*Try it: [revana.si](https://revana.si/?utm_source=devto&utm_medium=article&utm_campaign=crosspost-2) has one API key for 200+ video and image models, with live prices on [revana.si/pricing](https://revana.si/pricing?utm_source=devto&utm_medium=article&utm_campaign=crosspost-2).*", "url": "https://wpnews.pro/news/generating-video-from-claude-and-cursor-with-one-api-key-mcp-agent-skills", "canonical_source": "https://dev.to/arib_khan_ba8305927b74917/generating-video-from-claude-and-cursor-with-one-api-key-mcp-agent-skills-4koj", "published_at": "2026-11-05 11:10:27+00:00", "updated_at": "2026-11-05 11:19:29.998244+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-tools", "developer-tools", "generative-ai"], "entities": ["Revana", "Claude Code", "Claude Desktop", "Cursor", "Codex CLI", "Seedance 2.5", "Veo 3.1", "Kling"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/generating-video-from-claude-and-cursor-with-one-api-key-mcp-agent-skills", "markdown": "https://wpnews.pro/news/generating-video-from-claude-and-cursor-with-one-api-key-mcp-agent-skills.md", "text": "https://wpnews.pro/news/generating-video-from-claude-and-cursor-with-one-api-key-mcp-agent-skills.txt", "jsonld": "https://wpnews.pro/news/generating-video-from-claude-and-cursor-with-one-api-key-mcp-agent-skills.jsonld"}}