Back to feed

Seed Audio Prompts API

Key points

# How to Build with the Seed Audio Prompts API: Audio, Image, Video & 3D AI Generation

Key takeaway

A complete developer guide to integrating Seed Audio Prompts into your application. Learn how to generate AI audio, images, videos, and 3D models programmatically — with working code examples in curl and Python.

Why Use the Seed Audio Prompts API?

Seed Audio Prompts is an all-in-one AI generation platform powered by Doubao (ByteDance) models. Instead of juggling five different AI providers, you get a single API that covers:

Media TypeModelWhat It Does
🎵 Audio (TTS)seed-audio-1.0Text-to-speech, voice cloning, image-guided audio
🖼️ Imagedoubao-seedream-4.0Text-to-image, image fusion, editing, variations
🎬 Videodoubao-seedance-2.0Text/image/video-to-video with lip-sync audio
🧊 3Ddoubao-seed3d-2.0Image-to-3D with multiple output formats

Whether you're building a SaaS product, automating content creation, or prototyping an AI-native application, the Seed Audio Prompts API gives you production-ready generation with a unified authentication model, simple JSON request/response format, and built-in credit management.


Step 1: Create an Account & Get Your API Key

Before making any API calls, you need an account and an API key.

1. Register at Seed Audio Prompts

Visit seedaudioprompts.com and sign up with your email, Google, or GitHub account. New users receive 30 free credits to test the API immediately.

2. Navigate to API Keys

Once logged in, go to Settings → API Keys (/settings/apikeys). Click Create API Key, give it a descriptive name (e.g., "production-backend" or "dev-testing"), and copy the generated key.

Your API key will look like this:

sk-a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0

⚠️ Important: Store your API key securely. It's shown only once at creation time. Treat it like a password.


Step 2: Authentication

All API requests authenticate via the Authorization header using the Bearer token scheme:

Authorization: Bearer sk-your-api-key-here

Example headers for every request:

curl -X POST https://seedaudioprompts.com/api/ai/generate \
  -H "Authorization: Bearer sk-your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

In Python with requests:

import requests

HEADERS = {
    "Authorization": "Bearer sk-your-api-key-here",
    "Content-Type": "application/json",
}

Step 3: Understanding Credits

Every API call consumes credits. The pricing model is straightforward:

1 USD = 100 credits

Here's what each generation type costs:

Media TypeCredits per GenerationWhat You Get
🖼️ Image6 credits1 image (up to 4K resolution)
🎵 Audio (TTS)25 credits1 audio clip (any duration)
🎙️ Speech Recognition2–3 credits/minTranscribed text
🧊 3D Model60 credits1 3D model (GLB/OBJ/USD/USDZ)
🎬 Video~851 credits1 video (1080p, 5s default)

Video pricing is dynamic — computed from resolution, frame rate, and duration. Higher resolution or longer videos cost more.

You can check your balance anytime:

curl -X POST https://seedaudioprompts.com/api/user/get-user-credits \
  -H "Authorization: Bearer sk-your-api-key-here"

Response:

{
  "code": 0,
  "message": "ok",
  "data": {
    "remainingCredits": 300
  }
}

If you run low, top up at seedaudioprompts.com/pricing.


Step 4: Generate Audio (Text-to-Speech)

Audio generation is synchronous — you get the result immediately in the response. This is the fastest and cheapest way to add AI voice to your application.

Endpoint

POST /api/ai/generate

Request (curl)

curl -X POST https://seedaudioprompts.com/api/ai/generate \
  -H "Authorization: Bearer sk-your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "doubao",
    "mediaType": "tts",
    "model": "seed-audio-1.0",
    "prompt": "Welcome to Seed Audio Prompts. This is a demonstration of our text-to-speech API with natural voice synthesis.",
    "options": {
      "voice": "Nova",
      "speed": 1.0,
      "volume": 80,
      "pitch": 0,
      "format": "mp3"
    }
  }'

Available voices: Auto, Nova, Sage, Pixel, Sunny, Echo, Bolt Available formats: mp3, wav, ogg, flac Speed range: 0.5 to 2.0 Pitch range: -12 to 12

Request (Python)

import requests

response = requests.post(
    "https://seedaudioprompts.com/api/ai/generate",
    headers=HEADERS,
    json={
        "provider": "doubao",
        "mediaType": "tts",
        "model": "seed-audio-1.0",
        "prompt": "Hello world! This is AI-generated speech from Seed Audio Prompts.",
        "options": {
            "voice": "Sage",
            "speed": 1.1,
            "format": "mp3",
        },
    },
)

data = response.json()
print(f"Task ID: {data['data']['taskId']}")
print(f"Credits used: {data['data']['costCredits']}")

Response

{
  "code": 0,
  "message": "ok",
  "data": {
    "taskId": "a1b2c3d4-...",
    "idempotencyKey": "e5f6g7h8-...",
    "status": "success",
    "costCredits": 25
  }
}

The generated audio URL is available immediately — query the task to get it:

curl -X POST https://seedaudioprompts.com/api/ai/query \
  -H "Authorization: Bearer sk-your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{"taskId": "a1b2c3d4-..."}'

The response will include taskInfo.audioUrl — your generated MP3 file.

Advanced: Voice Cloning

You can clone a voice by providing a reference audio URL:

{
  "provider": "doubao",
  "mediaType": "tts",
  "model": "seed-audio-1.0",
  "prompt": "This is my cloned voice speaking.",
  "options": {
    "voice": "Auto",
    "reference_audio_url": "https://example.com/reference-voice.mp3"
  }
}

Advanced: Image-Guided Audio

Generate audio that matches the mood of an image:

{
  "options": {
    "reference_image_url": "https://example.com/mood-image.jpg"
  }
}

Step 5: Generate Images

Image generation is also synchronous — perfect for real-time user experiences. At only 6 credits, it's the most cost-effective way to generate AI visuals.

Endpoint

POST /api/ai/generate

Text-to-Image (curl)

curl -X POST https://seedaudioprompts.com/api/ai/generate \
  -H "Authorization: Bearer sk-your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "doubao",
    "mediaType": "image",
    "model": "doubao-seedream-4-0-250828",
    "prompt": "A serene Japanese garden at golden hour, cherry blossoms falling, koi pond reflecting warm sunlight, photorealistic, 8K",
    "options": {
      "size": "2K",
      "aspect_ratio": "16:9"
    }
  }'

Available sizes: 1K, 2K, 4K Available aspect ratios: 1:1, 3:4, 4:3, 16:9, 9:16, 2:3, 3:2, 21:9, smart

Image-to-Image (Python)

Provide reference images for style transfer, fusion, or editing:

import requests

response = requests.post(
    "https://seedaudioprompts.com/api/ai/generate",
    headers=HEADERS,
    json={
        "provider": "doubao",
        "mediaType": "image",
        "model": "doubao-seedream-4-0-250828",
        "prompt": "Transform this sketch into a photorealistic product photo on a white background",
        "options": {
            "size": "2K",
            "aspect_ratio": "1:1",
            "image_input": [
                "https://example.com/product-sketch.png"
            ],
        },
    },
)

result = response.json()
task_id = result["data"]["taskId"]
print(f"Image task created: {task_id} — cost: {result['data']['costCredits']} credits")

Fetching the Generated Image

Query the task to get the image URL:

import time

def get_image_url(task_id: str, timeout: int = 60) -> str | None:
    """Poll for the generated image URL."""
    start = time.time()
    while time.time() - start < timeout:
        resp = requests.post(
            "https://seedaudioprompts.com/api/ai/query",
            headers=HEADERS,
            json={"taskId": task_id},
        )
        data = resp.json()["data"]
        images = data.get("taskInfo", {}).get("images", [])
        if images and images[0].get("imageUrl"):
            return images[0]["imageUrl"]
        time.sleep(1)
    return None

image_url = get_image_url(task_id)
print(f"Download your image at: {image_url}")

Step 6: Generate Video

Video generation is asynchronous — you submit a task, receive a taskId, then poll for completion. This is because video rendering takes several minutes.

The Async Flow

1. POST /api/ai/generate  →  taskId + status: "queued"
2. Wait (typically 2–8 minutes for 5s video)
3. POST /api/ai/query     →  status: "success" + video URL

Submit a Video Task (curl)

curl -X POST https://seedaudioprompts.com/api/ai/generate \
  -H "Authorization: Bearer sk-your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "doubao",
    "mediaType": "video",
    "model": "doubao-seedance-2-0-260128",
    "prompt": "A drone shot flying over a misty mountain range at sunrise, golden light breaking through clouds, cinematic, 4K quality",
    "options": {
      "aspect_ratio": "16:9",
      "duration": 5,
      "resolution": "1080p",
      "generate_audio": true
    }
  }'

Available aspect ratios: 21:9, 16:9, 4:3, 1:1, 3:4, 9:16 Available durations: 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 (seconds) Available resolutions: 480p, 720p, 1080p, 4K

Complete Video Generation (Python)

import requests
import time
import json

HEADERS = {
    "Authorization": "Bearer sk-your-api-key-here",
    "Content-Type": "application/json",
}

def generate_video(prompt: str, **options) -> dict:
    """Submit a video generation task."""
    resp = requests.post(
        "https://seedaudioprompts.com/api/ai/generate",
        headers=HEADERS,
        json={
            "provider": "doubao",
            "mediaType": "video",
            "model": "doubao-seedance-2-0-260128",
            "prompt": prompt,
            "options": options,
        },
    )
    return resp.json()["data"]

def poll_task(task_id: str, timeout: int = 600) -> dict | None:
    """Poll an async task until completion or timeout."""
    start = time.time()
    while time.time() - start < timeout:
        resp = requests.post(
            "https://seedaudioprompts.com/api/ai/query",
            headers=HEADERS,
            json={"taskId": task_id},
        )
        data = resp.json()["data"]
        status = data.get("status", data.get("taskStatus"))
        print(f"  Status: {status} ({time.time() - start:.0f}s elapsed)")
        
        if status == "success":
            return data
        elif status == "failed":
            raise RuntimeError(f"Video generation failed: {data.get('lastError', 'unknown error')}")
        
        time.sleep(10)  # Poll every 10 seconds
    raise TimeoutError(f"Video generation timed out after {timeout}s")

# Usage
task = generate_video(
    prompt="A cinematic product reveal: luxury watch emerging from darkness, spotlight reveals details, slow camera orbit",
    aspect_ratio="16:9",
    duration=5,
    resolution="1080p",
)
print(f"Task submitted: {task['taskId']} (estimated cost: {task['costCredits']} credits)")

result = poll_task(task["taskId"])
video_info = result.get("taskInfo", {})
videos = video_info.get("videos", [])
if videos:
    print(f"✅ Video ready: {videos[0].get('videoUrl')}")

Video Tips

  • Start short: Test with 4–5 second videos first to save credits
  • Be descriptive: Include camera angles, lighting, and mood in your prompt
  • Use reference images: Pass an image_input URL to guide the style
  • Audio sync: Set generate_audio: true to get a video with AI-generated soundtrack
  • Chain with TTS: Generate audio first, then pass it via audio_input for lip-synced video

Step 7: Generate 3D Models

3D generation converts a single image into a textured 3D model. It's asynchronous and takes 2–5 minutes typically.

Important: 3D generation uses mediaType: "image" (not "3d") — the model name doubao-seed3d-2-0-260328 tells the system this is a 3D task. An input image is required.

Submit a 3D Task (curl)

curl -X POST https://seedaudioprompts.com/api/ai/generate \
  -H "Authorization: Bearer sk-your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "provider": "doubao",
    "mediaType": "image",
    "model": "doubao-seed3d-2-0-260328",
    "prompt": "Generate a 3D model from the provided image",
    "options": {
      "image_input": ["https://example.com/product-front-view.jpg"],
      "subdivision": "high",
      "fileformat": "GLB"
    }
  }'

Subdivision levels: low (fast, low poly), medium (balanced), high (detailed, slower) Output formats: GLB, OBJ, USD, USDZ

Python Workflow

def generate_3d(image_url: str, subdivision: str = "high", fileformat: str = "GLB") -> str:
    """Submit a 3D generation task from an image. Returns taskId."""
    resp = requests.post(
        "https://seedaudioprompts.com/api/ai/generate",
        headers=HEADERS,
        json={
            "provider": "doubao",
            "mediaType": "image",
            "model": "doubao-seed3d-2-0-260328",
            "prompt": "Generate a 3D model from the provided image",
            "options": {
                "image_input": [image_url],
                "subdivision": subdivision,
                "fileformat": fileformat,
            },
        },
    )
    return resp.json()["data"]["taskId"]

# Usage
task_id = generate_3d(
    image_url="https://example.com/toy-dragon-front.jpg",
    subdivision="high",
    fileformat="GLB",
)
print(f"3D task submitted: {task_id}")

# Poll for result
result = poll_task(task_id, timeout=300)
model_info = result.get("taskInfo", {})
model_url = model_info.get("modelUrl") or model_info.get("glbUrl")
print(f"✅ 3D model ready: {model_url}")

Use Cases

  • E-commerce: Generate 3D product previews from a single photo
  • Gaming: Create assets from concept art
  • AR/VR: Export to USDZ for Apple AR Quick Look
  • Manufacturing: OBJ format for CAD/CAM pipelines

Step 8: Check Task Status

For async media types (video, 3D, speech), use the query endpoint to track progress.

Endpoint

POST /api/ai/query

Request / Response

curl -X POST https://seedaudioprompts.com/api/ai/query \
  -H "Authorization: Bearer sk-your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{"taskId": "your-task-id-here"}'
{
  "code": 0,
  "data": {
    "id": "db-task-uuid",
    "taskId": "provider-task-id",
    "status": "success",
    "mediaType": "video",
    "costCredits": 851,
    "taskInfo": {
      "videos": [
        {
          "videoUrl": "https://storage.seedaudioprompts.com/output/video-xxx.mp4"
        }
      ]
    }
  }
}

Status values:

StatusMeaning
queuedWaiting in queue
processingAI is generating
pendingAwaiting provider callback
successDone — check taskInfo for URLs
failedCheck lastError for details

Webhook (Recommended for Production)

For production applications, set up a webhook endpoint and pass it as the callbackUrl. The system will POST task results to your URL when generation completes, eliminating the need for polling.

{
  "options": {
    "webhook_url": "https://your-app.com/api/seed-webhook"
  }
}

Step 9: Error Handling & Best Practices

Common Error Codes

Error CodeHTTP StatusMeaningWhat to Do
INSUFFICIENT_CREDITS200Not enough creditsRedirect user to /pricing
CONTENT_MODERATION_BLOCKED200Prompt violates AUPAsk user to revise prompt
no auth200Missing/invalid API keyCheck Authorization header
invalid params200Missing required fieldsCheck provider, mediaType, model
invalid mediaType200Unsupported typeUse tts, image, video

Idempotency Keys

Every generation request includes an idempotencyKey in the response. If you need to retry a request (network timeout, etc.), pass the same key to avoid duplicate charges.

Credit Monitoring

Implement a credit check before submitting generation tasks:

def check_balance(min_required: int) -> bool:
    resp = requests.post(
        "https://seedaudioprompts.com/api/user/get-user-credits",
        headers=HEADERS,
    )
    remaining = resp.json()["data"]["remainingCredits"]
    return remaining >= min_required

if not check_balance(25):
    print("⚠️ Insufficient credits for TTS generation")

Rate Limits

Be respectful with polling frequency:

  • Image/TTS: No polling needed (synchronous)
  • Video: Poll every 10–15 seconds
  • 3D: Poll every 10–15 seconds
  • Speech: Poll every 5 seconds

File Uploads

Some endpoints accept external file URLs. To upload your own files, use the storage endpoint:

curl -X POST https://seedaudioprompts.com/api/storage/upload-image \
  -H "Authorization: Bearer sk-your-api-key-here" \
  -F "[email protected]"

Quick Reference: All Supported Options

TTS (mediaType: "tts", model: seed-audio-1.0)

OptionTypeDefaultDescription
voicestring"Nova"Voice preset name
speedfloat1.0Speaking speed (0.5–2.0)
volumeint50Volume percentage (0–100)
pitchint0Pitch shift (-12 to 12)
formatstring"mp3"Output: mp3, wav, ogg, flac
reference_audio_urlstringURL for voice cloning
reference_image_urlstringURL for image-guided audio

Image (mediaType: "image", model: doubao-seedream-4-0-250828)

OptionTypeDefaultDescription
sizestring"2K"Output resolution
aspect_ratiostring"1:1"Image proportions
image_inputstring[]Reference image URLs
watermarkboolfalseAdd watermark

Video (mediaType: "video", model: doubao-seedance-2-0-260128)

OptionTypeDefaultDescription
aspect_ratiostring"16:9"Video proportions
durationint5Seconds (4–15)
resolutionstring"1080p"480p, 720p, 1080p, 4K
generate_audiobooltrueInclude AI soundtrack
image_inputstring[]Reference image URLs
video_inputstring[]Reference video URLs
audio_inputstring[]Audio for lip-sync

3D (mediaType: "image", model: doubao-seed3d-2-0-260328)

OptionTypeDefaultDescription
image_inputstring[]requiredSource image URL
subdivisionstring"medium"low, medium, high
fileformatstring"GLB"GLB, OBJ, USD, USDZ

Putting It All Together: A Complete Pipeline Example

Here's a Python script that demonstrates the full multi-media pipeline — generate an image, turn it into audio, then animate it as video:

import requests
import time

API_BASE = "https://seedaudioprompts.com/api"
HEADERS = {
    "Authorization": "Bearer sk-your-api-key-here",
    "Content-Type": "application/json",
}

def api_post(endpoint: str, body: dict) -> dict:
    resp = requests.post(f"{API_BASE}{endpoint}", headers=HEADERS, json=body)
    data = resp.json()
    if data.get("code") != 0:
        raise RuntimeError(f"API error: {data.get('message')}")
    return data["data"]

def poll_until_done(task_id: str, timeout: int = 600) -> dict:
    start = time.time()
    while time.time() - start < timeout:
        result = api_post("/ai/query", {"taskId": task_id})
        status = result.get("status", result.get("taskStatus"))
        if status == "success":
            return result
        elif status == "failed":
            raise RuntimeError(f"Task failed: {result.get('lastError')}")
        time.sleep(10)
    raise TimeoutError("Task timed out")

# 1. Generate a mood image (6 credits)
print("🖼️  Generating mood image...")
img = api_post("/ai/generate", {
    "provider": "doubao",
    "mediaType": "image",
    "model": "doubao-seedream-4-0-250828",
    "prompt": "A misty forest at dawn, soft golden light filtering through ancient trees, photorealistic",
    "options": {"size": "2K", "aspect_ratio": "16:9"},
})
img_result = poll_until_done(img["taskId"])
cover_image = img_result["taskInfo"]["images"][0]["imageUrl"]
print(f"  ✅ Image: {cover_image}")

# 2. Generate narration audio (25 credits)
print("🎵  Generating narration...")
audio = api_post("/ai/generate", {
    "provider": "doubao",
    "mediaType": "tts",
    "model": "seed-audio-1.0",
    "prompt": "Deep within the ancient forest, a story unfolds. Every tree holds a memory, every shadow whispers a secret.",
    "options": {"voice": "Sage", "speed": 0.9},
})
audio_result = poll_until_done(audio["taskId"])
narration = audio_result["taskInfo"]["audioUrl"]
print(f"  ✅ Audio: {narration}")

# 3. Animate with video (dynamic credits)
print("🎬  Generating video with audio sync...")
video = api_post("/ai/generate", {
    "provider": "doubao",
    "mediaType": "video",
    "model": "doubao-seedance-2-0-260128",
    "prompt": "Slow cinematic push into misty forest, camera gently moving forward, leaves rustling",
    "options": {
        "aspect_ratio": "16:9",
        "duration": 5,
        "resolution": "1080p",
        "image_input": [cover_image],
        "audio_input": [narration],
    },
})
video_result = poll_until_done(video["taskId"], timeout=600)
final_video = video_result["taskInfo"]["videos"][0]["videoUrl"]

total_credits = img["costCredits"] + audio["costCredits"] + video["costCredits"]
print(f"\n✨ Complete pipeline finished!")
print(f"   Final video: {final_video}")
print(f"   Total credits used: {total_credits}")

Conclusion

The Seed Audio Prompts API gives you a single, unified interface to state-of-the-art AI generation across audio, image, video, and 3D — all powered by Doubao models. With simple Bearer token authentication, clear credit pricing, and both synchronous and asynchronous endpoints, it's built for real-world applications.

Next Steps

Happy building! 🚀

Frequently Asked Questions

Q...

...

Audio synthesized by Entity-Echo AI Agent

No AI audio for this article yet. Stay tuned.