Video Prompt Generator
Generate polished Sora 2 video prompts through the NanoPhoto.AI Prompt Generator API.
Prerequisites
- 1. Obtain an API key at: https://nanophoto.ai/settings/apikeys
- Configure
NANOPHOTO_API_KEY before using the skill. - Do not paste the API key into chat; store it in the platform's secure env setting for this skill.
Preferred OpenClaw setup:
- - Open the skill settings for this skill
- Add an environment variable named INLINECODE1
- Paste the API key as its value
Equivalent config shape:
CODEBLOCK0
Other valid ways to provide the key:
- - Shell: INLINECODE2
- Tool-specific env config: any runtime that injects INLINECODE3
- OpenClaw config fallback: the bundled script also falls back to
~/.openclaw/openclaw.json at INLINECODE5
Credential declaration summary:
- - Primary credential: INLINECODE6
- Resolution order in the bundled script:
--api-key → NANOPHOTO_API_KEY environment variable → ~/.openclaw/openclaw.json skill env - No unrelated credentials are required
Recommended workflow
- 1. Collect the user's topic or scene idea.
- Decide whether the prompt is for
textToVideo or imageToVideo. - Choose a technique, duration, locale, and optional model override.
- For image-to-video mode, require one to three public image URLs.
- Run the bundled script or call the API directly.
- Return the generated prompt text exactly as produced unless the user asks for adaptation or rewriting.
Parameter guidance
- Required
- Maximum 500 characters
- Keep it specific enough to imply subject, mood, or motion
-
textToVideo: default
-
imageToVideo: requires public
imageUrls
- Default:
montage
- Choose the technique that best matches the intended visual language
-
10
-
15
- Default:
en
- Supported:
en,
zh,
zh-TW,
ja,
ko,
es,
fr,
de,
pt,
ru, INLINECODE34
Preferred command
Use the bundled script for reliable prompt generation:
Text-to-video prompt
CODEBLOCK1
Image-to-video prompt
CODEBLOCK2
The script resolves credentials in this order: --api-key, then NANOPHOTO_API_KEY from the environment, then ~/.openclaw/openclaw.json at skills.entries.video-prompt-generator.env.NANOPHOTO_API_KEY.
Output behavior
- - The API returns streaming text, but the bundled script prints the final assembled prompt text
- Return the prompt directly when the user asked for prompt generation
- If the user wants editing or localization after generation, transform the generated prompt in a second step instead of changing API parameters retroactively
Manual API call
CODEBLOCK3
Error handling
| errorCode | Cause | Action |
|---|
| INLINECODE39 | Invalid or missing API key | Verify key at https://nanophoto.ai/settings/apikeys |
| INLINECODE40 |
Rate limit exceeded | Wait and retry |
|
INSUFFICIENT_CREDITS | Not enough credits | Top up credits |
|
INVALID_INPUT | Missing or invalid topic | Ask for a valid topic under 500 characters |
Bundled files
- -
scripts/video_prompt_generator.py: generate a prompt from a topic using the NanoPhoto Prompt Generator API - INLINECODE44 : condensed API reference, inputs, and error behavior
视频提示词生成器
通过NanoPhoto.AI提示词生成器API生成精美的Sora 2视频提示词。
前提条件
- 1. 在 https://nanophoto.ai/settings/apikeys 获取API密钥
- 使用该技能前配置 NANOPHOTOAPIKEY
- 请勿将API密钥粘贴到聊天中;请将其存储在该技能的平台安全环境设置中
推荐的OpenClaw设置:
- - 打开该技能的技能设置
- 添加名为 NANOPHOTOAPIKEY 的环境变量
- 将API密钥粘贴为其值
等效配置格式:
json
{
skills: {
entries: {
video-prompt-generator: {
enabled: true,
env: {
NANOPHOTOAPIKEY: yourapikey_here
}
}
}
}
}
其他有效的密钥提供方式:
- - Shell:export NANOPHOTOAPIKEY=yourapikeyhere
- 工具特定环境配置:任何注入 NANOPHOTOAPIKEY 的运行时环境
- OpenClaw配置回退:捆绑脚本也会回退到 ~/.openclaw/openclaw.json 中的 skills.entries.video-prompt-generator.env.NANOPHOTOAPI_KEY
凭证声明摘要:
- - 主要凭证:NANOPHOTOAPIKEY
- 捆绑脚本中的解析顺序:--api-key → NANOPHOTOAPIKEY 环境变量 → ~/.openclaw/openclaw.json 技能环境
- 无需其他无关凭证
推荐工作流程
- 1. 收集用户的主题或场景创意
- 确定提示词是用于 textToVideo 还是 imageToVideo
- 选择技术、时长、语言环境和可选的模型覆盖
- 对于图像转视频模式,需要一至三个公开图像URL
- 运行捆绑脚本或直接调用API
- 除非用户要求改编或重写,否则按原样返回生成的提示词文本
参数指南
- 必填
- 最多500个字符
- 保持足够具体以暗示主题、情绪或运动
- textToVideo:默认
- imageToVideo:需要公开的 imageUrls
- 默认:montage
- 选择最匹配预期视觉语言的技术
- 10
- 15
- 默认:en
- 支持:en、zh、zh-TW、ja、ko、es、fr、de、pt、ru、ar
推荐命令
使用捆绑脚本进行可靠的提示词生成:
文本转视频提示词
bash
python3 scripts/videopromptgenerator.py \
--topic 一座宁静的日本花园,樱花飘落进锦鲤池 \
--mode textToVideo \
--technique slow-motion \
--duration 15 \
--locale zh
图像转视频提示词
bash
python3 scripts/videopromptgenerator.py \
--topic 让这个风景动起来,有轻柔的风和飘动的云 \
--mode imageToVideo \
--technique long-take \
--duration 10 \
--locale zh \
--image-url https://example.com/landscape.jpg
脚本按以下顺序解析凭证:--api-key,然后是环境中的 NANOPHOTOAPIKEY,最后是 ~/.openclaw/openclaw.json 中的 skills.entries.video-prompt-generator.env.NANOPHOTOAPIKEY。
输出行为
- - API返回流式文本,但捆绑脚本打印最终组装好的提示词文本
- 当用户要求生成提示词时,直接返回提示词
- 如果用户在生成后想要编辑或本地化,请在第二步中转换生成的提示词,而不是追溯更改API参数
手动API调用
bash
curl -X POST https://nanophoto.ai/api/sora-2/generate-prompt \
-H Content-Type: application/json \
-H Authorization: Bearer $NANOPHOTOAPIKEY \
--data-raw {
topic: 日落时分的未来城市景观,有飞行车辆和霓虹灯,
technique: aerial-view,
duration: 15,
locale: zh
}
错误处理
| errorCode | 原因 | 操作 |
|---|
| LOGINREQUIRED | API密钥无效或缺失 | 在 https://nanophoto.ai/settings/apikeys 验证密钥 |
| APIKEYRATELIMIT_EXCEEDED |
超出速率限制 | 等待后重试 |
| INSUFFICIENT_CREDITS | 积分不足 | 充值积分 |
| INVALID_INPUT | 主题缺失或无效 | 要求提供500字符以内的有效主题 |
捆绑文件
- - scripts/videopromptgenerator.py:使用NanoPhoto提示词生成器API从主题生成提示词
- references/api.md:精简的API参考、输入和错误行为