在智能体流程中通过 VAP Media API 生成与编辑图像、视频和音乐。
设计与多媒体
VAP Media API skill for Realistic image video music
通过 VAP Media API,用同一把 Bearer 密钥生成与编辑图像、视频和音乐。
它能做什么
调用 POST /api/v1/generations 生成图像、视频与音乐,再通过 POST /api/v1/operations 执行 inpaint、upscale、背景移除、视频裁剪与合并等编辑。提交前会按风格、光线、构图等维度润色提示词,任务轮询至完成,最终返回媒体链接。鉴权使用仅限 VAP Media API 的 VAP_API_KEY。
什么时候用它
- 生成指定画幅比例的产品图或社交平台素材
- 制作 4–8 秒、720p 或 1080p 的短视频片段
- 按响度预设生成 mp3 或 wav 格式、30–480 秒的背景音乐
- 对已有图片或视频进行放大、局部重绘或抠图处理
技能文档
VAP Media API Skill
Generate images, video, and music through VAP Media API. Edit and enhance media with inpaint, AI edit, upscale, background removal, video trim, and video merge.
This skill is a Media API distribution surface for agent ecosystems such as ClawHub. Keep the agent workflow direct and useful: improve prompts, choose the matching VAP Media API endpoint, poll the task or operation, and return the final media URL.
Product Boundary
Use this skill for VAP Media API work only:
- image generation
- video generation
- music generation
- media editing and enhancement
Do not route coding-model requests through this skill. Coding agents and IDE model workflows use the separate VAP Coding Plan API with model ID vap-code.
Access
Use VAP_API_KEY as a Bearer token. This key is product-scoped to VAP Media API access.
If VAP_API_KEY is not set, ask the user to get a Media API key from Developer Hub:
https://vapagent.com/developer/?key=media#keys
View Room and Media plans: https://vapagent.com/new-dashboard/?billing=monthly#plans
Generation
Use POST /api/v1/generations for image, video, and music generation.
Create Generation
curl -s -X POST https://api.vapagent.com/api/v1/generations \
-H "Authorization: Bearer $VAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"kind":"image","prompt":"PROMPT","params":{"aspect_ratio":"1:1"}}'
Returns a task id:
{"generation_id":"UUID","task_id":"UUID","status":"pending","kind":"image"}
Poll Generation
curl -s https://api.vapagent.com/api/v1/generations/GENERATION_ID \
-H "Authorization: Bearer $VAP_API_KEY"
When complete, return the media URL from result_url, image_url, video_url, audio_url, or the primary URL inside result.
Generation Types And Params
Image
{
"kind": "image",
"prompt": "A clean product photo of a violet-white AI media emblem on a studio desk",
"params": {
"aspect_ratio": "1:1"
}
}
| Param | Type | Default | Description |
|---|---|---|---|
aspect_ratio | enum | 1:1 | 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 21:9, 9:21 |
width | int | optional | Target width when supported |
height | int | optional | Target height when supported |
negative_prompt | string | optional | What to avoid |
output_format | string | optional | Requested output format when supported |
quantity | int | optional | Number of images when supported |
Video
{
"kind": "video",
"prompt": "Drone shot over misty mountains at sunrise",
"params": {
"duration": 8,
"aspect_ratio": "9:16",
"resolution": "1080p"
}
}
| Param | Type | Default | Description |
|---|---|---|---|
duration | int | 8 | 4, 6, or 8 seconds |
aspect_ratio | enum | 16:9 | 16:9 landscape or 9:16 portrait |
generate_audio | bool | true | Include audio track |
resolution | enum | 720p | 720p or 1080p |
negative_prompt | string | optional | What to avoid |
source_image | string | optional | Input image URL for image-to-video when supported |
Music
{
"kind": "music",
"prompt": "Upbeat lo-fi hip hop beat, warm vinyl crackle, chill atmosphere",
"params": {
"duration": 120,
"instrumental": true,
"audio_format": "mp3"
}
}
| Param | Type | Default | Description |
|---|---|---|---|
duration | int | 120 | 30-480 seconds |
instrumental | bool | false | No vocals |
audio_format | enum | mp3 | mp3 or wav |
loudness_preset | enum | streaming | streaming, apple, or broadcast |
style | string | optional | Genre/style |
title | string | optional | Song title |
custom_mode | bool | false | Enable custom lyrics and style mode |
Operations
Use POST /api/v1/operations for edit and enhancement operations.
Create Operation
curl -s -X POST https://api.vapagent.com/api/v1/operations \
-H "Authorization: Bearer $VAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"operation":"background_remove","media_url":"https://example.com/photo.png"}'
Poll Operation
curl -s https://api.vapagent.com/api/v1/operations/OPERATION_ID \
-H "Authorization: Bearer $VAP_API_KEY"
When complete, return the media URL from result_url, image_url, video_url, or the primary URL inside result.
Available Operations
| Operation | Required Params | Description |
|---|---|---|
inpaint | media_url, prompt | AI editing with optional mask_url |
ai_edit | media_url, prompt | AI-powered image editing with optional additional_images |
background_remove | media_url | Remove background |
upscale | media_url | Enhance resolution with options.scale: 2 or 4 |
video_trim | media_url, options.start_time, options.end_time | Trim video |
video_merge | media_urls array, min 2 | Merge video clips |
Agent Instructions
When a user asks to create, generate, or make an image, video, or music:
- Improve the prompt with useful style, lighting, composition, mood, or production details.
- Require
VAP_API_KEY; if it is missing, send the user to Developer Hub for a Media API key. - Submit
POST /api/v1/generationswith top-levelkind, top-levelprompt, and optionalparams. - Set aspect ratio based on the content need:
- portrait/social ->
9:16 - YouTube/web/widescreen ->
16:9 - square feed asset ->
1:1
- portrait/social ->
- Poll
GET /api/v1/generations/{id}until completed or failed. - Return the final media URL to the user with concise status.
When a user asks to edit, enhance, or modify an existing image or video:
- Identify the operation:
inpaint,ai_edit,upscale,background_remove,video_trim, orvideo_merge. - Get the media URL from a previous generation or user-provided URL.
- Submit
POST /api/v1/operations. - Poll
GET /api/v1/operations/{id}until completed or failed. - Return the output URL.
Do not expose internal provider details as the product identity. The visible product is VAP Media API.
Examples
Image
curl -s -X POST https://api.vapagent.com/api/v1/generations \
-H "Authorization: Bearer $VAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"kind":"image","prompt":"A fluffy orange tabby cat on a sunlit windowsill, soft bokeh, golden hour light, photorealistic","params":{"aspect_ratio":"16:9"}}'
curl -s https://api.vapagent.com/api/v1/generations/GENERATION_ID \
-H "Authorization: Bearer $VAP_API_KEY"
Video
curl -s -X POST https://api.vapagent.com/api/v1/generations \
-H "Authorization: Bearer $VAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"kind":"video","prompt":"Drone shot over misty mountains at sunrise","params":{"duration":8,"aspect_ratio":"9:16","resolution":"1080p"}}'
Music
curl -s -X POST https://api.vapagent.com/api/v1/generations \
-H "Authorization: Bearer $VAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"kind":"music","prompt":"Upbeat lo-fi hip hop beat, warm vinyl crackle, chill vibes","params":{"duration":120,"instrumental":true,"audio_format":"wav","loudness_preset":"streaming"}}'
AI Edit
curl -s -X POST https://api.vapagent.com/api/v1/operations \
-H "Authorization: Bearer $VAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"operation":"ai_edit","media_url":"https://example.com/photo.jpg","prompt":"Change the background to a sunset beach"}'
Upscale
curl -s -X POST https://api.vapagent.com/api/v1/operations \
-H "Authorization: Bearer $VAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"operation":"upscale","media_url":"https://example.com/photo.jpg","options":{"scale":4}}'
Background Remove
curl -s -X POST https://api.vapagent.com/api/v1/operations \
-H "Authorization: Bearer $VAP_API_KEY" \
-H "Content-Type: application/json" \
-d '{"operation":"background_remove","media_url":"https://example.com/photo.jpg"}'
Prompt Tips
- Style: "oil painting", "3D render", "watercolor", "photograph", "flat illustration"
- Lighting: "golden hour", "neon lights", "soft diffused light", "dramatic shadows"
- Composition: "close-up", "aerial view", "wide angle", "rule of thirds"
- Mood: "serene", "energetic", "mysterious", "premium", "playful"
- Aspect ratio: mention "widescreen", "portrait", or "16:9" when relevant.
Setup
- Get a Media API key: https://vapagent.com/developer/?key=media#keys
- View Room and Media plans if access is needed: https://vapagent.com/new-dashboard/?billing=monthly#plans
- Set:
export VAP_API_KEY=vap_xxxxxxxxxxxxxxxxxxxx
Links
- Developer Hub: https://vapagent.com/developer/
- Media API key: https://vapagent.com/developer/?key=media#keys
- Room and Media plans: https://vapagent.com/new-dashboard/?billing=monthly#plans
- VAP AI: https://vapagent.com/
- GitHub: https://github.com/vapagentmedia/vap-media-skill
常见问题
- 这个技能会调用哪些接口?
- 图像、视频、音乐生成走 POST /api/v1/generations,编辑增强(如 inpaint、upscale、背景移除)走 POST /api/v1/operations。每个任务都通过对应的 GET 接口轮询,直到完成或失败。
- 需要什么鉴权?
- 需要一个 VAP_API_KEY 作为 Bearer 令牌,作用域仅限 VAP Media API。若未配置,需要去 Developer Hub 申请 Media API 密钥。
- 支持哪些媒体操作?
- Operations 支持 inpaint、ai_edit、background_remove、upscale(2 倍或 4 倍)、video_trim 和 video_merge(至少两个片段)。生成侧覆盖图片、4–8 秒可选带音频的视频,以及 30–480 秒的音乐。
相关技能
通过文本提示和三家语音服务商,生成配音、音乐、音效及克隆语音音频。
通过文本提示生成 5 秒至 10 分钟的原创配乐与人声歌曲,按 CellCog 服务条款免版税,可用于 YouTube、播客、应用、游戏、广告与影视等商业项目。
用自然语言通过 Lovart AI 设计 Agent 生成图片、视频与音频,并附带项目与会话管理能力。
一条提示词生成电影级 AI 视频——剧情短片、品牌片、音乐 MV 都能做。
为 Suno 编写风格提示、结构化歌词与完整生成流程,支持 API、浏览器自动化或手动粘贴。