seed audio prompts api

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

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.

Seed Audio Prompts API - AI Multimedia Generation


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 Type Model What It Does
🎵 Audio (TTS) seed-audio-1.0 Text-to-speech, voice cloning, image-guided audio
🖼️ Image doubao-seedream-4.0 Text-to-image, image fusion, editing, variations
🎬 Video doubao-seedance-2.0 Text/image/video-to-video with lip-sync audio
🧊 3D doubao-seed3d-2.0 Image-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:

1
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:

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

Example headers for every request:

1
2
3
4
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:

1
2
3
4
5
6
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 Type Credits per Generation What You Get
🖼️ Image 6 credits 1 image (up to 4K resolution)
🎵 Audio (TTS) 25 credits 1 audio clip (any duration)
🎙️ Speech Recognition 2–3 credits/min Transcribed text
🧊 3D Model 60 credits 1 3D model (GLB/OBJ/USD/USDZ)
🎬 Video ~851 credits 1 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:

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

Response:

1
2
3
4
5
6
7
{
"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

1
POST /api/ai/generate

Request (curl)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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

1
2
3
4
5
6
7
8
9
10
{
"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:

1
2
3
4
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:

1
2
3
4
5
6
7
8
9
10
{
"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:

1
2
3
4
5
{
"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

1
POST /api/ai/generate

Text-to-Image (curl)

1
2
3
4
5
6
7
8
9
10
11
12
13
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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
2
3
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)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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

1
POST /api/ai/query

Request / Response

1
2
3
4
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"}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"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:

Status Meaning
queued Waiting in queue
processing AI is generating
pending Awaiting provider callback
success Done — check taskInfo for URLs
failed Check lastError for details

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.

1
2
3
4
5
{
"options": {
"webhook_url": "https://your-app.com/api/seed-webhook"
}
}

Step 9: Error Handling & Best Practices

Common Error Codes

Error Code HTTP Status Meaning What to Do
INSUFFICIENT_CREDITS 200 Not enough credits Redirect user to /pricing
CONTENT_MODERATION_BLOCKED 200 Prompt violates AUP Ask user to revise prompt
no auth 200 Missing/invalid API key Check Authorization header
invalid params 200 Missing required fields Check provider, mediaType, model
invalid mediaType 200 Unsupported type Use 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:

1
2
3
4
5
6
7
8
9
10
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:

1
2
3
curl -X POST https://seedaudioprompts.com/api/storage/upload-image \
-H "Authorization: Bearer sk-your-api-key-here" \
-F "file=@reference-image.jpg"

Quick Reference: All Supported Options

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

Option Type Default Description
voice string "Nova" Voice preset name
speed float 1.0 Speaking speed (0.5–2.0)
volume int 50 Volume percentage (0–100)
pitch int 0 Pitch shift (-12 to 12)
format string "mp3" Output: mp3, wav, ogg, flac
reference_audio_url string URL for voice cloning
reference_image_url string URL for image-guided audio

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

Option Type Default Description
size string "2K" Output resolution
aspect_ratio string "1:1" Image proportions
image_input string[] Reference image URLs
watermark bool false Add watermark

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

Option Type Default Description
aspect_ratio string "16:9" Video proportions
duration int 5 Seconds (4–15)
resolution string "1080p" 480p, 720p, 1080p, 4K
generate_audio bool true Include AI soundtrack
image_input string[] Reference image URLs
video_input string[] Reference video URLs
audio_input string[] Audio for lip-sync

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

Option Type Default Description
image_input string[] required Source image URL
subdivision string "medium" low, medium, high
fileformat string "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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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! 🚀