use-runway-api
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUse Runway API
使用Runway API
Call the Runway public API directly from the agent to manage resources, trigger generations, and inspect account state.
When to use this skill: Use this when the user wants to act on their Runway account — create or update avatars, manage documents, trigger generations, check credit balance, etc. For writing integration code into a project, use theskills instead.+integrate-*
When the user asks to generate media in the context of Runway, prefer the Runway API path from this skill over any generic built-in image or media generation tool.
Skill selection: Pair this skill withwhen you need the canonical API contract. Do not use+api-reference,+integrate-image,+integrate-video,+integrate-audio, or+integrate-charactersunless the task is to write or modify application code.+integrate-documents
通过Agent直接调用Runway公开API来管理资源、触发生成任务并查看账户状态。
何时使用此技能: 当用户需要对其Runway账户执行操作时使用——创建或更新虚拟形象、管理文档、触发生成任务、查看信用余额等。如果是要在项目中编写集成代码,请使用类技能。+integrate-*
当用户在Runway相关场景下要求生成媒体时,优先使用本技能中的Runway API路径,而非任何通用内置的图像或媒体生成工具。
技能选择: 当你需要标准API契约时,请将此技能与搭配使用。除非任务是编写或修改应用代码,否则不要使用+api-reference、+integrate-image、+integrate-video、+integrate-audio或+integrate-characters。+integrate-documents
Runtime Location
运行时位置
The runtime script ships inside this skill at (co-located with this ). It has zero dependencies — Node.js 20+ is required.
scripts/runway-api.mjsSKILL.mdResolving the absolute path. Every shell command below uses the placeholder . Replace it with the absolute directory of the you are currently reading — you already have this path from the tool that loaded this file. Do not guess the path, run from , or search the whole filesystem.
<skill-dir>SKILL.mdfind$HOMEIf is not known from context, check these locations in order with before giving up:
<skill-dir>ls- (if the env var is set)
$RUNWAY_SKILLS_DIR/skills/use-runway-api/scripts/runway-api.mjs - (Claude Code plugin install)
~/.claude/plugins/cache/*/runway-api/skills/use-runway-api/scripts/runway-api.mjs - (Cursor plugin install)
~/.cursor/plugins/cache/*/runway-api/skills/use-runway-api/scripts/runway-api.mjs - (
~/.claude/skills/use-runway-api/scripts/runway-api.mjsinstall)npx skills add - (generic agent install)
~/.agents/skills/use-runway-api/scripts/runway-api.mjs - (source checkout)
~/Documents/github/runway/skills/skills/use-runway-api/scripts/runway-api.mjs
Pick the first match and use it as for the rest of the session. Do not re-resolve between commands.
<skill-dir>/scripts/runway-api.mjs运行时脚本随本技能一起发布,位于(与本同目录)。它没有任何依赖项——需要Node.js 20+版本。
scripts/runway-api.mjsSKILL.md解析绝对路径:以下所有shell命令都使用占位符。请将其替换为你当前阅读的所在的绝对目录——加载此文件的工具应该已经提供了该路径。请勿猜测路径,不要从执行命令,也不要搜索整个文件系统。
<skill-dir>SKILL.md$HOMEfind如果上下文未提供,请按以下顺序使用命令检查位置,若全部失败再放弃:
<skill-dir>ls- (如果已设置环境变量)
$RUNWAY_SKILLS_DIR/skills/use-runway-api/scripts/runway-api.mjs - (Claude Code插件安装路径)
~/.claude/plugins/cache/*/runway-api/skills/use-runway-api/scripts/runway-api.mjs - (Cursor插件安装路径)
~/.cursor/plugins/cache/*/runway-api/skills/use-runway-api/scripts/runway-api.mjs - (
~/.claude/skills/use-runway-api/scripts/runway-api.mjs安装路径)npx skills add - (通用Agent安装路径)
~/.agents/skills/use-runway-api/scripts/runway-api.mjs - (源码检出路径)
~/Documents/github/runway/skills/skills/use-runway-api/scripts/runway-api.mjs
选择第一个匹配的路径,并在本次会话的剩余部分将其用作。请勿在命令之间重新解析路径。
<skill-dir>/scripts/runway-api.mjsBefore Your First Call
首次调用前的准备
Set a session ID so all requests in this chat can be correlated, then verify credentials:
bash
export RUNWAY_SKILLS_CLIENT_ID=$(node -e "console.log(crypto.randomUUID())")
node <skill-dir>/scripts/runway-api.mjs auth status- If is
authenticated→ proceed to the API call. Do not re-check.true - If is
authenticated→ tell the user to setfalse(seeRUNWAY_SKILLS_API_SECRETfor details), then stop and wait for the user to confirm. Do not retry or re-check in a loop.AUTH.md
Staging caveat:hitsauth statuswhich may 500 on stage even when data endpoints work fine. If stage/v1/organizationfails but you haveauth statusset, try a data endpoint likeRUNWAY_SKILLS_API_SECRET_STAGEto confirm the key works before giving up.avatars list --stage
设置会话ID,以便关联本次聊天中的所有请求,然后验证凭据:
bash
export RUNWAY_SKILLS_CLIENT_ID=$(node -e "console.log(crypto.randomUUID())")
node <skill-dir>/scripts/runway-api.mjs auth status- 如果为
authenticated→ 继续执行API调用。无需重新检查。true - 如果为
authenticated→ 告知用户设置false(详情见RUNWAY_SKILLS_API_SECRET),然后停止并等待用户确认。请勿循环重试或重新检查。AUTH.md
预发布环境注意事项:会调用auth status接口,该接口在预发布环境中可能返回500错误,但数据接口仍能正常工作。如果预发布环境的/v1/organization失败,但已设置auth status,请尝试调用数据接口(如RUNWAY_SKILLS_API_SECRET_STAGE)来确认密钥可用,再决定是否放弃。avatars list --stage
Fast Paths
快速路径
For plain list requests, use the compact list commands first instead of the generic command:
request- list avatars →
node <skill-dir>/scripts/runway-api.mjs avatars list - list voices →
node <skill-dir>/scripts/runway-api.mjs voices list - list documents →
node <skill-dir>/scripts/runway-api.mjs documents list [--avatar-id <id>]
These commands return smaller, list-friendly JSON on purpose. After a successful list command, answer once. Do not re-run the command, do not read back the same output, and do not render the same table twice.
对于简单的列表请求,请优先使用简洁的列表命令,而非通用的命令:
request- 列出虚拟形象 →
node <skill-dir>/scripts/runway-api.mjs avatars list - 列出语音 →
node <skill-dir>/scripts/runway-api.mjs voices list - 列出文档 →
node <skill-dir>/scripts/runway-api.mjs documents list [--avatar-id <id>]
这些命令特意返回更简洁、适合列表展示的JSON。成功执行列表命令后,只需回复一次。请勿重新运行命令,不要重复读取相同输出,也不要重复渲染同一表格。
Output Format
输出格式
When the API returns a regular list of records, prefer a compact markdown table over a bare bullet list.
Good defaults:
- avatars: ,
Name,Status,Voice,DocsCreated - documents: ,
Name,AvatarCreated - voices: ,
Name,ProviderPreview
After the table, add one short summary line only if something notable stands out. Do not repeat the table in a second block.
当API返回常规记录列表时,优先使用简洁的Markdown表格,而非纯项目符号列表。
默认推荐列:
- 虚拟形象:、
名称、状态、语音、文档数创建时间 - 文档:、
名称、所属虚拟形象创建时间 - 语音:、
名称、提供商预览
表格后,仅当有值得注意的内容时才添加一行简短总结。请勿在第二个区块中重复表格内容。
Generic Request
通用请求
Call any public API endpoint:
bash
node <skill-dir>/scripts/runway-api.mjs request <METHOD> <path> [--body '<json>'] [--stdin] [--dry-run]All output is JSON. Errors go to stderr with a non-zero exit code and include an field with a correctable invocation.
exampleFlags:
- — inline JSON request body
--body <json> - — read JSON body from stdin (useful for large or multi-line payloads)
--stdin - — print the full request (method, URL, headers, body) without executing it
--dry-run - — show usage and examples for any command
--help
Use as the canonical source for:
+api-reference- model choices
- endpoint details
- exact POST/PATCH body shapes
- required and optional fields
Do not duplicate or invent request schemas in this skill. For simple GET/DELETE calls and the list fast paths above, you do not need to load .
+api-reference调用任意公开API端点:
bash
node <skill-dir>/scripts/runway-api.mjs request <METHOD> <path> [--body '<json>'] [--stdin] [--dry-run]所有输出均为JSON格式。错误信息会输出到stderr,返回非零退出码,并包含一个字段,提供可修正的调用示例。
example标志:
- — 内联JSON请求体
--body <json> - — 从标准输入读取JSON请求体(适用于大型或多行负载)
--stdin - — 打印完整请求(方法、URL、请求头、请求体)但不执行
--dry-run - — 显示任意命令的用法和示例
--help
请将作为以下内容的标准来源:
+api-reference- 模型选择
- 端点详情
- 准确的POST/PATCH请求体结构
- 必填和可选字段
请勿在本技能中重复或自创请求模式。对于简单的GET/DELETE调用以及上述列表快速路径,无需加载。
+api-referenceExamples
示例
Get organization info:
bash
node <skill-dir>/scripts/runway-api.mjs request GET /v1/organizationList avatars:
bash
node <skill-dir>/scripts/runway-api.mjs avatars listGet a specific avatar:
bash
node <skill-dir>/scripts/runway-api.mjs request GET /v1/avatars/<id>Update an avatar:
bash
node <skill-dir>/scripts/runway-api.mjs request PATCH /v1/avatars/<id> --body '{
"personality": "Updated personality text"
}'Delete an avatar (preview first):
bash
node <skill-dir>/scripts/runway-api.mjs request DELETE /v1/avatars/<id> --dry-run
node <skill-dir>/scripts/runway-api.mjs request DELETE /v1/avatars/<id>List knowledge documents for an avatar:
bash
node <skill-dir>/scripts/runway-api.mjs documents list --avatar-id <avatar-id>Create a knowledge document:
bash
node <skill-dir>/scripts/runway-api.mjs request POST /v1/documents --body '{
"avatarId": "<avatar-id>",
"name": "FAQ",
"content": "Q: What is your return policy?\nA: 30 days, no questions asked."
}'List voices:
bash
node <skill-dir>/scripts/runway-api.mjs voices list获取组织信息:
bash
node <skill-dir>/scripts/runway-api.mjs request GET /v1/organization列出虚拟形象:
bash
node <skill-dir>/scripts/runway-api.mjs avatars list获取特定虚拟形象:
bash
node <skill-dir>/scripts/runway-api.mjs request GET /v1/avatars/<id>更新虚拟形象:
bash
node <skill-dir>/scripts/runway-api.mjs request PATCH /v1/avatars/<id> --body '{
"personality": "Updated personality text"
}'删除虚拟形象(先预览):
bash
node <skill-dir>/scripts/runway-api.mjs request DELETE /v1/avatars/<id> --dry-run
node <skill-dir>/scripts/runway-api.mjs request DELETE /v1/avatars/<id>列出虚拟形象的知识库文档:
bash
node <skill-dir>/scripts/runway-api.mjs documents list --avatar-id <avatar-id>创建知识库文档:
bash
node <skill-dir>/scripts/runway-api.mjs request POST /v1/documents --body '{
"avatarId": "<avatar-id>",
"name": "FAQ",
"content": "Q: What is your return policy?\nA: 30 days, no questions asked."
}'列出语音:
bash
node <skill-dir>/scripts/runway-api.mjs voices listWaiting for Tasks
等待任务完成
Generation endpoints return a task ID. Always run immediately after a generation call — do not ask the user whether to wait.
waitbash
node <skill-dir>/scripts/runway-api.mjs wait <task-id>生成类端点会返回任务ID。触发生成调用后,请立即运行命令——无需询问用户是否等待。
waitbash
node <skill-dir>/scripts/runway-api.mjs wait <task-id>Generation Requests
生成请求
When the user asks to generate an image, video, or audio:
- Read once before the first generation POST. It is the canonical source for model options, request body shapes, and valid field values.
+api-reference - Choose the model from and tell the user which one you picked, briefly.
+api-reference - Build the request body from . Do not guess field names.
+api-reference - Call the generation endpoint once with that body.
- Run automatically.
wait - Present the result following the rules in Presenting Generation Output below.
For generation requests, never skip the read. For simple list/get/delete requests, do not load it unless needed.
+api-referenceIf the user says only "generate an image" but the surrounding context is clearly about Runway account actions or this skill, still use the Runway API rather than a generic built-in image tool.
当用户要求生成图像、视频或音频时:
- 在首次发送生成POST请求前,先读取。它是模型选项、请求体结构和有效字段值的标准来源。
+api-reference - 从中选择模型,并简要告知用户你选择的模型。
+api-reference - 根据构建请求体。请勿猜测字段名称。
+api-reference - 使用该请求体调用生成端点一次。
- 自动运行命令。
wait - 按照下方展示生成结果的规则呈现结果。
对于生成请求,切勿跳过读取的步骤。对于简单的列表/获取/删除请求,除非需要,否则无需加载它。
+api-reference如果用户仅说“生成一张图片”,但上下文明显涉及Runway账户操作或本技能,仍应使用Runway API而非通用内置图像工具。
Presenting Generation Output
展示生成结果
The command returns a task with an array of signed URLs. These URLs expire in 24–48 hours and are long signed JWT blobs that are awkward to read inline.
waitoutputAfter a successful generation, do all of the following:
- Lead with what was generated — one short line stating the model and cost, e.g.
Generated with gen4_image (1080p, 8 credits). - Embed images inline as Markdown so the user can see them without clicking:
For videos, link them as plain Markdown links (markdown
) since inline video does not render in most chat UIs.[fox.mp4](...) - Offer to save a local copy in the same message, proactively. Suggest a predictable path (or
./generated/) and infer a filename from the prompt when possible. Example:./runway-outputs/Want me to save it to? The signed URL expires in ~24–48h../generated/fox.png - Do not paste the full signed URL as raw text unless the user asks for it. The Markdown image/link already contains it.
If the user confirms a download, fetch with (quote the URL — it contains ).
curl -L -o <path> '<url>'&waitoutput成功生成后,请完成以下所有步骤:
- 先说明生成内容——用一行简短文字说明使用的模型和成本,例如:
使用gen4_image生成(1080p,消耗8个信用点)。 - 将图像以内联Markdown形式嵌入,让用户无需点击即可查看:
对于视频,请以普通Markdown链接形式展示(markdown
),因为大多数聊天界面不支持内联视频渲染。[fox.mp4](...) - 主动提出保存本地副本,在同一条消息中建议一个可预测的路径(如或
./generated/),并尽可能根据提示推断文件名。示例:./runway-outputs/需要我将它保存到吗?签名URL将在约24-48小时后过期。./generated/fox.png - 除非用户要求,否则不要粘贴完整的签名URL原文。Markdown图像/链接中已包含该URL。
如果用户确认下载,请使用命令获取(请给URL加引号——因为它包含符号)。
curl -L -o <path> '<url>'&API Reference
API参考
Use for the canonical API contract. Use only when you specifically need the latest docs content from .
+api-reference+fetch-api-referencedocs.dev.runwayml.com请将作为标准API契约的来源。仅当你特别需要从获取最新文档内容时,才使用。
+api-referencedocs.dev.runwayml.com+fetch-api-referenceStaging (--stage)
预发布环境(--stage)
Add to any command to target the staging API:
--stagebash
node <skill-dir>/scripts/runway-api.mjs --stage avatars list
node <skill-dir>/scripts/runway-api.mjs --stage request GET /v1/avatarsWith , the CLI checks first, then falls back to . The base URL defaults to .
--stageRUNWAY_SKILLS_API_SECRET_STAGERUNWAY_SKILLS_API_SECREThttps://api.dev-stage.runwayml.com在任意命令后添加即可指向预发布API:
--stagebash
node <skill-dir>/scripts/runway-api.mjs --stage avatars list
node <skill-dir>/scripts/runway-api.mjs --stage request GET /v1/avatars使用时,CLI会优先检查,然后回退到。基础URL默认是。
--stageRUNWAY_SKILLS_API_SECRET_STAGERUNWAY_SKILLS_API_SECREThttps://api.dev-stage.runwayml.comLarge Payloads (--stdin)
大型负载(--stdin)
When creating resources with data URIs (e.g. base64-encoded images for avatar ), the body can exceed shell argument limits. Use to pipe the body:
referenceImage--stdinbash
python3 -c "
import json, base64
with open('image.png', 'rb') as f:
b64 = base64.b64encode(f.read()).decode()
body = json.dumps({'name': 'My Avatar', 'referenceImage': f'data:image/png;base64,{b64}', ...})
with open('/tmp/body.json', 'w') as f:
f.write(body)
" && cat /tmp/body.json | node <skill-dir>/scripts/runway-api.mjs request POST /v1/avatars --stdinAlternatively, write the JSON to a file and use directly. The flag is fine for small JSON payloads but will hit for data URIs of images over ~200KB.
curl -d @file--bodyargument list too long当创建包含数据URI的资源时(例如虚拟形象的base64编码图像),请求体可能会超出shell参数限制。请使用来传递请求体:
referenceImage--stdinbash
python3 -c "
import json, base64
with open('image.png', 'rb') as f:
b64 = base64.b64encode(f.read()).decode()
body = json.dumps({'name': 'My Avatar', 'referenceImage': f'data:image/png;base64,{b64}', ...})
with open('/tmp/body.json', 'w') as f:
f.write(body)
" && cat /tmp/body.json | node <skill-dir>/scripts/runway-api.mjs request POST /v1/avatars --stdin或者,将JSON写入文件并直接使用。对于小型JSON负载,标志足够,但对于超过约200KB的图像数据URI,会触发错误。
curl -d @file--bodyargument list too longEnvironment Variables
环境变量
The runtime reads credentials from the process environment:
| Variable | Description |
|---|---|
| Production API key |
| Stage API key (used with |
| Override the base URL for any environment |
| Optional. Absolute path to the source checkout of this skills repo — used by the agent as a fallback when resolving |
If the agent cannot see , the editor likely needs to be restarted after the variable is set.
RUNWAY_SKILLS_API_SECRET运行时会从进程环境中读取凭据:
| 变量 | 描述 |
|---|---|
| 生产环境API密钥 |
| 预发布环境API密钥(与 |
| 覆盖任意环境的基础URL |
| 可选。本技能仓库源码检出的绝对路径——当解析 |
如果Agent无法读取,可能需要在设置变量后重启编辑器。
RUNWAY_SKILLS_API_SECRETRelated Files
相关文件
- — auth setup and troubleshooting for this skill
AUTH.md
- — 本技能的身份验证设置和故障排除指南
AUTH.md
Related Skills
相关技能
| Skill | When to use |
|---|---|
| Full API reference — models, endpoints, costs, rate limits |
| Fetch latest docs from docs.dev.runwayml.com |
| Write video generation code into a project |
| Write image generation code into a project |
| Write audio generation code into a project |
| Write avatar session code into a project |
| Write knowledge document code into a project |
| 技能 | 使用场景 |
|---|---|
| 完整API参考——模型、端点、成本、速率限制 |
| 从docs.dev.runwayml.com获取最新文档 |
| 在项目中编写视频生成代码 |
| 在项目中编写图像生成代码 |
| 在项目中编写音频生成代码 |
| 在项目中编写虚拟形象会话代码 |
| 在项目中编写知识库文档代码 |