LogoDocs NanoPhoto.AI
LogoDocs NanoPhoto.AI
Page d'accueilDocumentation Homepage

Getting Started

Getting Started

User Guide

User Guide

API

API OverviewSora Watermark Removal APIVideo Reverse Prompt APISora 2 Prompt Generator APISora 2 Video Generation APISora 2 TVC Ad APINano Banana Pro Image Generation APINano Banana 2 Image Generation APIVeo 3.1 Video Generation APISeeDance 1.5 Pro Video Generation API

OpenClaw Skills

OpenClaw SkillsSora 2 GenerateVeo 3.1Nano Banana ProNano Banana 2Video Prompt GeneratorVideo Reverse PromptSora Watermark RemoverComic Drama Generate

Use Cases

Sora 2 TVC Ad Creation

Billing

Billing & Invoice

FAQ

FAQ
X (Twitter)

Video Reverse Prompt API

API for analyzing videos to extract detailed shot breakdowns and prompts.

Try it online: https://nanophoto.ai/video-reverse-prompt

Endpoint

POST /api/sora-2/reverse-prompt

Authentication

Authorization: Bearer YOUR_API_KEY

Credits

1 credit per analysis (API calls only; web interface is free).

Request

Headers

HeaderValue
Content-Typeapplication/json
AuthorizationBearer YOUR_API_KEY

Body Parameters

ParameterTypeRequiredDescription
videoSourcestringYesVideo source type: youtube, url, or file
localestringNoOutput language (default: en). Supported: en, zh, zh-TW, ja, ko, es, fr, de, pt, ru, ar
videoUrlstringConditionalVideo URL. YouTube link (when videoSource is youtube) or direct .mp4 URL (when videoSource is url)
videoFilestringConditionalBase64-encoded video file (required when videoSource is file)
videoFileNamestringNoOriginal filename for uploaded videos

Examples

YouTube Video

curl -X POST "https://nanophoto.ai/api/sora-2/reverse-prompt" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-raw '{
    "videoSource": "youtube",
    "locale": "en",
    "videoUrl": "https://www.youtube.com/watch?v=W-15-UmGP5s"
  }'

Video URL

curl -X POST "https://nanophoto.ai/api/sora-2/reverse-prompt" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-raw '{
    "videoSource": "url",
    "locale": "zh",
    "videoUrl": "https://static.nanophoto.ai/demo/sk2-ad.mp4"
  }'

File Upload (Base64)

Read the video file and encode it to Base64, then pass it in the videoFile field.

app/api/example/route.ts
import { readFile } from "node:fs/promises";

const videoBuffer = await readFile("your-video.mp4");
const videoBase64 = videoBuffer.toString("base64");

const response = await fetch("https://nanophoto.ai/api/sora-2/reverse-prompt", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: "Bearer YOUR_API_KEY",
  },
  body: JSON.stringify({
    videoSource: "file",
    locale: "en",
    videoFile: videoBase64,
    videoFileName: "your-video.mp4",
  }),
});

// Streaming response
const reader = response.body!.getReader();
const decoder = new TextDecoder();

while (true) {
  const { done, value } = await reader.read();
  if (done) break;
  process.stdout.write(decoder.decode(value));
}
  • Only .mp4 format is supported
  • Maximum file size: 30 MB (before Base64 encoding)
  • The videoFile value can be a plain Base64 string or a Data URL (e.g. data:video/mp4;base64,...)

Response

Success - Streaming

The API returns a streaming text response (Content-Type: text/plain; charset=utf-8). The AI analysis is streamed as it's generated, containing a detailed shot breakdown in Markdown table format.

The output includes:

  • Shot number, framing/angle, camera movement
  • Detailed visual description
  • Audio analysis (BGM, sound effects, narration)
  • Duration per shot
  • Overall summary

Error

{
  "success": false,
  "error": "AI service temporarily unavailable. Please try again later.",
  "errorCode": "AI_SERVICE_ERROR"
}

Error Codes

errorCodeHTTP StatusDescription
LOGIN_REQUIRED401Authentication required
API_KEY_RATE_LIMIT_EXCEEDED429Rate limit exceeded
INSUFFICIENT_CREDITS402Not enough credits
INVALID_INPUT400Missing required parameters
INVALID_YOUTUBE_URL400Invalid YouTube URL
INVALID_VIDEO_URL400Invalid video URL
INVALID_FORMAT400Invalid MP4 format
FILE_TOO_LARGE400File exceeds 30MB
VIDEO_DOWNLOAD_FAILED400Video download failed
VIDEO_PROCESSING_FAILED422Video processing failed
AI_SERVICE_ERROR503AI service unavailable
SERVICE_UNAVAILABLE503Service configuration issue
INTERNAL_ERROR500Internal server error

Sora Watermark Removal API

API for removing watermarks from Sora 2 generated videos.

Sora 2 Prompt Generator API

API for generating professional Sora 2 video prompts from topics, with support for multiple video techniques and languages.

Table des matières

Endpoint
Authentication
Credits
Request
Headers
Body Parameters
Examples
YouTube Video
Video URL
File Upload (Base64)
Response
Success - Streaming
Error
Error Codes