Analyze videos to extract detailed shot breakdowns and AI-ready prompts via the NanoPhoto.AI API.
Use the bundled script for local file uploads instead of inlining large base64 payloads directly in the shell; it is more reliable for multi-megabyte videos.
NANOPHOTO_API_KEY before using the skill.Preferred OpenClaw setup:
NANOPHOTO_API_KEYEquivalent config shape:
json
{
"skills": {
"entries": {
"video-reverse-prompt": {
"enabled": true,
"env": {
"NANOPHOTO_API_KEY": "your_api_key_here"
}
}
}
}
}
Other valid ways to provide the key:
export NANOPHOTO_API_KEY="your_api_key_here"NANOPHOTO_API_KEYCredential declaration summary:
NANOPHOTO_API_KEYNANOPHOTO_API_KEYIf the env var is not set, ask the user to configure it before proceeding.
videoSource type: youtube, url, or filebash
curl -X POST "https://nanophoto.ai/api/sora-2/reverse-prompt" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $NANOPHOTO_API_KEY" \
--data-raw '{
"videoSource": "youtube",
"locale": "en",
"videoUrl": "https://www.youtube.com/watch?v=XXXXXXXXXXX"
}'
bash
curl -X POST "https://nanophoto.ai/api/sora-2/reverse-prompt" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $NANOPHOTO_API_KEY" \
--data-raw '{
"videoSource": "url",
"locale": "en",
"videoUrl": "https://example.com/video.mp4"
}'
bash
python3 scripts/reverse_prompt_file.py your-video.mp4 --locale en
The script reads NANOPHOTO_API_KEY from the environment, validates the file size/format, base64-encodes the MP4, and prints the streaming text response.
bash
VIDEO_BASE64=$(base64 < your-video.mp4)
curl -X POST "https://nanophoto.ai/api/sora-2/reverse-prompt" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $NANOPHOTO_API_KEY" \
--data-raw "{
\"videoSource\": \"file\",
\"locale\": \"en\",
\"videoFile\": \"$VIDEO_BASE64\",
\"videoFileName\": \"your-video.mp4\"
}"
ParameterTypeRequiredDescriptionvideoSourcestringYesyoutube, url, or file``localestringNoOutput language (default: en). Supported: en, zh, zh-TW, ja, ko, es, fr, de, pt, ru, ar``videoUrlstringConditionalYouTube link or direct .mp4 URLvideoFilestringConditionalBase64-encoded video (when videoSource is file)videoFileNamestringNoOriginal filename for uploaded videos
.mp4 format supportedvideoFile accepts plain base64 or Data URL ( data:video/mp4;base64,...)The API returns a streaming text response ( Content-Type: text/plain; charset=utf-8) containing a Markdown table with:
errorCodeHTTPCauseActionLOGIN_REQUIRED401Invalid or missing API keyVerify key at https://nanophoto.ai/settings/apikeysAPI_KEY_RATE_LIMIT_EXCEEDED429Rate limit exceededWait and retryINSUFFICIENT_CREDITS402Not enough creditsTop up creditsINVALID_INPUT400Missing required parametersCheck videoSource and corresponding fieldsINVALID_YOUTUBE_URL400Invalid YouTube URLAsk user for a valid YouTube linkINVALID_VIDEO_URL400Invalid video URLAsk user for a valid .mp4 URLINVALID_FORMAT400Not MP4 formatOnly .mp4 is supportedFILE_TOO_LARGE400File exceeds 30 MBAsk user for a smaller fileVIDEO_DOWNLOAD_FAILED400Cannot download videoCheck URL accessibilityVIDEO_PROCESSING_FAILED422Processing errorRetry or try a different videoAI_SERVICE_ERROR503AI service unavailableRetry later
scripts/reverse_prompt_file.py: Reliable local-file uploader for .mp4 inputs. Use it when the user provides a local video path.See references/api.md for complete endpoint documentation.