Seedream 4.0 API इंटीग्रेशन
Rivya Public API v1 के जरिए मॉडल id seedream-4-0, समर्थित इनपुट, पैरामीटर, Files API नियम, क्रेडिट और रिस्पॉन्स उदाहरणों के साथ Seedream 4.0 का उपयोग करें।
seedream-4-0
text, file
संदर्भ mode के लिए जरूरी
6
इमेज
FIXED
5000 अक्षर
रिक्वेस्ट अनुबंध
मॉडल id को शीर्ष स्तर पर भेजें। मॉडल के लिए खास कंट्रोल params में रखें।
| Key | प्रकार | जरूरी | डिफॉल्ट | विवरण |
|---|---|---|---|---|
| model | string | हां | seedream-4-0 | seedream-4-0 API मॉडल id का उपयोग करें। |
| prompt | string | हां | - | इस मॉडल के लिए अधिकतम 5000 अक्षर। |
| params | object | नहीं | - | मॉडल के लिए खास पैरामीटर ऑब्जेक्ट। अनुमत keys के लिए नीचे दी गई पंक्तियां देखें। |
| client_request_id | string | नहीं | - | अपने सिस्टम में रिक्वेस्ट ट्रेस करने के लिए वैकल्पिक client-side id। |
मॉडल पैरामीटर
| Key | प्रकार | जरूरी | डिफॉल्ट | सीमा | विकल्प | विवरण |
|---|---|---|---|---|---|---|
| image_size | select | नहीं | square_hd | - | square, square_hd, portrait_4_3, portrait_3_2, portrait_16_9, landscape_4_3, landscape_3_2, landscape_16_9, landscape_21_9 | Framing ratio को control करता है। Output resolution के साथ मिलकर final pixel dimensions तय करता है। |
| image_resolution | select | नहीं | 1K | - | 1K, 2K, 4K | मौजूदा tiers `1K`, `2K` और `4K` हैं। Higher resolution का मतलब आम तौर पर larger files और longer waits होता है। |
| max_images | number | नहीं | 1 | min 1 / max 6 / step 1 | - | Valid values 1 से 6 तक हैं। यह control करता है कि एक task कितनी images return कर सकता है, इसलिए prompt को उस count के साथ aligned रखना बेहतर है। |
| seed | number | नहीं | - | min 0 / max 2147483647 / step 1 | - | हर बार नया यादृच्छिक नतीजा पाने के लिए इसे खाली छोड़ें। वही पूर्णांक दोबारा इस्तेमाल करने से पिछले नतीजे को दोहराना या बारीक समायोजित करना आसान होता है। नतीजा तभी ज्यादा करीब रहता है जब प्रॉम्प्ट और बाकी मुख्य सेटिंग भी मिलती-जुलती रहें; फिर भी यह 1:1 मिलान की गारंटी नहीं है। |
| nsfw_checker | select | नहीं | false | - | false, true | Content filter को control करता है। इसे off करने से आप raw output के करीब जाते हैं, लेकिन इसका मतलब weaker safety layer स्वीकार करना भी है। |
अपलोड नीति
पहले संदर्भ फाइल अपलोड करें, फिर लौटे हुए URL और duration token को params.referenceMediaItems में रखें।
Reference images जोड़ें: Seedream 4.0 edit path के लिए 10 तक images upload करें।
10
image
अवधि सत्यापन जरूरी होने पर वीडियो और ऑडियो संदर्भों में /api/v1/files से मिला durationToken होना चाहिए।
| kind | अधिकतम आकार | MIME प्रकार |
|---|---|---|
| image | 10 MB | image/jpeg, image/png, image/webp |
न्यूनतम रिक्वेस्ट
{
"model": "seedream-4-0",
"prompt": "A clean editorial product image on a soft studio background",
"params": {
"image_size": "square_hd",
"image_resolution": "1K",
"max_images": 1,
"seed": 0,
"nsfw_checker": "false"
}
}संदर्भ फाइल रिक्वेस्ट
{
"model": "seedream-4-0",
"prompt": "A clean editorial product image on a soft studio background",
"params": {
"image_size": "square_hd",
"image_resolution": "1K",
"max_images": 1,
"seed": 0,
"nsfw_checker": "false",
"referenceMediaItems": [
{
"url": "https://cdn.example.com/reference-image.png",
"kind": "image",
"name": "reference-image.png",
"mimeType": "image/png"
}
]
}
}रिस्पॉन्स बनाएं
Create एंडपॉइंट सार्वजनिक टास्क id लौटाता है। टास्क सफल या विफल होने तक स्टेटस एंडपॉइंट पोल करें।
{
"id": "task_seedream_4_0_example",
"status": "queued",
"model": "seedream-4-0",
"reserved_credits": 6,
"final_credits": 0,
"created_at": "2026-05-11T00:00:00.000Z",
"updated_at": "2026-05-11T00:00:00.000Z",
"result": null,
"error": null
}सामान्य त्रुटियां
validation_failed, insufficient_credits, idempotency_conflict, rate_limited, not_found
कुछ mode में Files API संदर्भ अपलोड जरूरी हैं।