Mosaic API Skill
With Mosaic you are an AI video editor. You create and run video editing workflows ("Agents"), upload media, connect social accounts, and publish edited videos automatically.
API key setup
Before any API call, you need a Mosaic API key (prefixed mk_).
- 1. Check the environment first. If
MOSAIC_API_KEY is already set (e.g. via the one-click setup at edit.mosaic.so), use it directly. - If the key is not in the environment, ask the user for it. Direct them to edit.mosaic.so/automations?tab=api to generate one using the one-click setup for OpenClaw or Claude Code.
- Store the key as
MOSAIC_API_KEY in your environment for future sessions. - Validate with
GET https://api.mosaic.so/whoami using header Authorization: Bearer $MOSAIC_API_KEY.
HTTP conventions
- - Base URL: INLINECODE5
- Auth: INLINECODE6
- Content: INLINECODE7
Workflows
Each workflow has its own guide. Read the relevant file for the task at hand.
workflows/running-agents.md |
| Upload video/audio/image assets |
workflows/uploading-assets.md |
| Publish to social platforms |
workflows/social-publishing.md |
| Credits, billing, and auto top-ups |
workflows/credits-and-billing.md |
Nodes (tiles)
Agents are graphs of nodes (also called "tiles"). Each node performs one editing action. To discover available nodes and their parameters, call:
CODEBLOCK0
Per-node reference files with IDs and docs links are in the nodes/ directory. Read the relevant node file when you need parameter details for update_params.
Editing best practices
- - For tighter edits, place Rough Cut or Clips before style nodes.
- Place Reframe before layout-sensitive nodes (Captions, Cinematic Captions, Motion Graphics, Watermark).
- Chain edits by passing prior
node_render_ids to subsequent runs.
Guardrails
- -
update_params keys must match agent_node_id values from GET /agent/{agent_id}. - Invalid overrides return
400. - For captions,
caption_font_weight must be string-typed (e.g. "700"). - For Motion Graphics, use
style_video_url and only_generate_full_screen_graphics. - If a run is credit-blocked (
needs_credits: true or needsCredits: true), follow the required plan-check and upgrade flow in workflows/credits-and-billing.md before attempting resume. - Do not use
GET /credits/settings for reads; use GET /credits to inspect current auto-topup configuration. - For free/no paid plan users, list options from
GET /plan/list, prompt for plan_id, then run POST /plan/upgrade. - After successful upgrade, always ask whether to enable auto top-ups; if yes, configure via
POST /credits/settings with user-provided thresholds.
Endpoint map
Full endpoint reference: references/docs-endpoints.md
Mosaic API 技能
借助 Mosaic,您将成为一名 AI 视频编辑师。您可以创建并运行视频编辑工作流(智能体)、上传媒体文件、关联社交媒体账号,并自动发布编辑完成的视频。
API 密钥设置
在进行任何 API 调用之前,您需要一个 Mosaic API 密钥(前缀为 mk_)。
- 1. 首先检查环境变量。 如果 MOSAICAPIKEY 已设置(例如通过 edit.mosaic.so 的一键设置),请直接使用。
- 如果环境中没有该密钥,请向用户索取。引导用户前往 edit.mosaic.so/automations?tab=api,使用 OpenClaw 或 Claude Code 的一键设置生成密钥。
- 将密钥以 MOSAICAPIKEY 的形式存储在您的环境中,以便后续会话使用。
- 使用 GET https://api.mosaic.so/whoami 进行验证,请求头为 Authorization: Bearer $MOSAICAPIKEY。
HTTP 约定
- - 基础 URL: https://api.mosaic.so
- 认证: Authorization: Bearer $MOSAICAPIKEY
- 内容类型: Content-Type: application/json
工作流
每个工作流都有其对应的指南。请根据当前任务阅读相关文件。
workflows/running-agents.md |
| 上传视频/音频/图片素材 |
workflows/uploading-assets.md |
| 发布到社交平台 |
workflows/social-publishing.md |
| 积分、计费和自动充值 |
workflows/credits-and-billing.md |
节点(图块)
智能体由节点(也称为图块)组成的图构成。每个节点执行一个编辑操作。要查看可用的节点及其参数,请调用:
GET /node_types — 列出所有节点类型
GET /nodetype/{nodetype_id} — 获取特定节点的详细信息
包含 ID 和文档链接的每个节点的参考文件位于 nodes/ 目录中。当您需要 updateparams 的参数详情时,请阅读相应的节点文件。
编辑最佳实践
- - 对于更紧凑的剪辑,请在样式节点之前放置粗剪或片段。
- 在布局敏感节点(字幕、电影级字幕、动态图形、水印)之前放置重新构图。
- 通过将之前的 noderenderids 传递给后续运行来串联编辑。
防护措施
- - updateparams 的键必须与 GET /agent/{agentid} 返回的 agentnodeid 值匹配。
- 无效的覆盖参数将返回 400 错误。
- 对于字幕,captionfontweight 必须为字符串类型(例如 700)。
- 对于动态图形,请使用 stylevideourl 和 onlygeneratefullscreengraphics。
- 如果运行因积分不足被阻止(needscredits: true 或 needsCredits: true),请在尝试恢复之前,按照 workflows/credits-and-billing.md 中要求的计划检查和升级流程进行操作。
- 不要使用 GET /credits/settings 进行读取;请使用 GET /credits 检查当前的自动充值配置。
- 对于免费/无付费计划的用户,从 GET /plan/list 列出选项,提示输入 plan_id,然后运行 POST /plan/upgrade。
- 升级成功后,始终询问是否启用自动充值;如果启用,请使用用户提供的阈值通过 POST /credits/settings 进行配置。
端点映射
完整端点参考:references/docs-endpoints.md