LogoNanoPhoto.AI文档
LogoNanoPhoto.AI文档
网站首页文档首页

入门指南

入门指南

用户指南

用户指南

API

API 概览Sora 水印去除 API视频反推提示词 APISora 2 提示词生成器 APISora 2 视频生成 APISora 2 TVC 广告 APINano Banana Pro 图片生成 APINano Banana 2 图片生成 APIVeo 3.1 视频生成 API

OpenClaw 技能

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

场景

Sora 2 TVC 广告制作

账单

账单与发票

常见问题

常见问题
X (Twitter)

SeeDance 1.5 Pro Video Generation API

API for generating videos using SeeDance 1.5 Pro with text-to-video and image-to-video modes. Supports multiple resolutions, durations, and audio generation.

Try it online: https://nanophoto.ai/seedance-1-5-pro

Endpoints

MethodPathDescription
POST/api/seedance-1-5-pro/generateGenerate a video
POST/api/seedance-1-5-pro/check-statusCheck task status

Authentication

Authorization: Bearer YOUR_API_KEY

Credits

Web Users

ResolutionDurationWithout AudioWith Audio
480p4s12
480p8s24
480p12s36
720p4s24
720p8s48
720p12s612
1080p4s48
1080p8s816
1080p12s1122

API Users (2x Credits)

ResolutionDurationWithout AudioWith Audio
480p4s24
480p8s48
480p12s612
720p4s48
720p8s816
720p12s1224
1080p4s816
1080p8s1632
1080p12s2244

API calls consume 2x credits compared to web usage. Audio generation doubles the credit cost.

Generate Video

POST /api/seedance-1-5-pro/generate

Headers

HeaderValue
Content-Typeapplication/json
AuthorizationBearer YOUR_API_KEY

Body Parameters

ParameterTypeRequiredDescription
promptstringYesVideo generation prompt (max 1000 characters)
modestringYestextToVideo or imageToVideo
imageUrlsstring[]ConditionalPublic image URLs (required for imageToVideo mode)
aspectRatiostringYesportrait (9:16) or landscape (16:9)
resolutionstringYes480p, 720p, or 1080p
durationstringYes4, 8, or 12 (seconds)
generateAudiobooleanNoGenerate audio for video (default: false)
fixedLensbooleanNoUse fixed lens (default: false)

API calls only accept imageUrls (public URLs). Base64 image upload is not supported via API.

Examples

Text to Video

curl -X POST "https://nanophoto.ai/api/seedance-1-5-pro/generate" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-raw '{
    "prompt": "A golden retriever running on a beach at sunset, cinematic lighting",
    "mode": "textToVideo",
    "aspectRatio": "landscape",
    "resolution": "720p",
    "duration": "8",
    "generateAudio": true,
    "fixedLens": false
  }'

Image to Video

curl -X POST "https://nanophoto.ai/api/seedance-1-5-pro/generate" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-raw '{
    "prompt": "The character comes alive, walking through a magical forest",
    "mode": "imageToVideo",
    "imageUrls": ["https://static.nanophoto.ai/demo/nano-banana-pro.webp"],
    "aspectRatio": "portrait",
    "resolution": "1080p",
    "duration": "12",
    "generateAudio": false,
    "fixedLens": true
  }'

TypeScript

seedance-api-example.ts
async function generateVideo() {
  // Step 1: Submit generation task
  const response = await fetch("https://nanophoto.ai/api/seedance-1-5-pro/generate", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      Authorization: "Bearer YOUR_API_KEY",
    },
    body: JSON.stringify({
      prompt: "A golden retriever running on a beach at sunset",
      mode: "textToVideo",
      aspectRatio: "landscape",
      resolution: "720p",
      duration: "8",
      generateAudio: true,
      fixedLens: false,
    }),
  });

  const data = await response.json();

  if (data.error) {
    console.error("Generation failed:", data.error);
    return;
  }

  const taskId = data.taskId;
  console.log("Task submitted:", taskId);

  // Step 2: Poll for status
  while (true) {
    await new Promise((resolve) => setTimeout(resolve, 5000)); // Wait 5s

    const statusRes = await fetch(
      "https://nanophoto.ai/api/seedance-1-5-pro/check-status",
      {
        method: "POST",
        headers: {
          "Content-Type": "application/json",
          Authorization: "Bearer YOUR_API_KEY",
        },
        body: JSON.stringify({ taskId }),
      }
    );

    const status = await statusRes.json();

    if (status.status === "completed") {
      console.log("Video URL:", status.videoUrl);
      console.log("Generation time:", status.generationTime, "seconds");
      return;
    }

    if (status.status === "failed") {
      console.error("Generation failed:", status.error);
      return;
    }

    console.log("Still processing...");
  }
}

generateVideo();

Response

Processing

{
  "status": "processing",
  "taskId": "task_abc123",
  "creditsUsed": 8
}

When you receive status: "processing", poll the check-status endpoint every 5-10 seconds.

Completed

{
  "status": "completed",
  "taskId": "task_abc123",
  "videoUrl": "https://video.nanophoto.ai/seedance/...",
  "generationTime": 120
}

Error

{
  "error": "Insufficient credits",
  "errorCode": "INSUFFICIENT_CREDITS",
  "requiredCredits": 8
}

Check Task Status

POST /api/seedance-1-5-pro/check-status

Headers

HeaderValue
Content-Typeapplication/json
AuthorizationBearer YOUR_API_KEY

Body Parameters

ParameterTypeRequiredDescription
taskIdstringYesTask ID from generate response

Example

curl -X POST "https://nanophoto.ai/api/seedance-1-5-pro/check-status" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-raw '{
    "taskId": "task_abc123"
  }'

Response

Still Processing

{
  "status": "processing",
  "taskId": "task_abc123"
}

Completed

{
  "status": "completed",
  "taskId": "task_abc123",
  "videoUrl": "https://video.nanophoto.ai/seedance/...",
  "generationTime": 120
}

Failed

{
  "status": "failed",
  "taskId": "task_abc123",
  "error": "Video generation failed"
}

Polling Strategy

  • Poll /api/seedance-1-5-pro/check-status every 5-10 seconds
  • Typical generation time: 1-3 minutes
  • Credits are automatically refunded if generation fails

Error Codes

errorCodeHTTP StatusDescription
LOGIN_REQUIRED401Authentication required
INVALID_API_KEY401Invalid or expired API key
API_KEY_RATE_LIMIT_EXCEEDED429Rate limit exceeded (100 req/hour)
INSUFFICIENT_CREDITS402Not enough credits
PROMPT_REQUIRED400Missing prompt
PROMPT_LENGTH_INVALID400Prompt exceeds 1000 characters
IMAGE_REQUIRED400imageToVideo mode requires images
IMAGE_URLS_REQUIRED400API calls require imageUrls (no base64)
GENERATION_FAILED500Video generation failed
TASK_ID_REQUIRED400Missing task ID
TASK_NOT_FOUND404Task not found or not owned by user
INTERNAL_ERROR500Internal server error

目录

Endpoints
Authentication
Credits
Web Users
API Users (2x Credits)
Generate Video
Headers
Body Parameters
Examples
Text to Video
Image to Video
TypeScript
Response
Processing
Completed
Error
Check Task Status
Headers
Body Parameters
Example
Response
Still Processing
Completed
Failed
Polling Strategy
Error Codes