Sora 2 API integration
Rivya Public API v1 দিয়ে Sora 2 ব্যবহার করুন: model id sora-2, supported inputs, parameters, Files API rules, credits এবং response examples সহ।
sora-2
text, file
reference modes-এর জন্য required
6
ভিডিও
FIXED
10000 characters
Request contract
model id top level-এ পাঠান। Model-specific controls params-এ থাকবে।
| Key | Type | Required | Default | বিবরণ |
|---|---|---|---|---|
| model | string | Yes | sora-2 | sora-2 API model id ব্যবহার করুন। |
| prompt | string | Yes | - | এই model-এর জন্য maximum 10000 characters। |
| params | object | No | - | Model-specific parameter object। allowed keys-এর জন্য নিচের rows ব্যবহার করুন। |
| client_request_id | string | No | - | আপনার system-এ requests trace করার optional client-side id। |
Model parameters
| Key | Type | Required | Default | Range | Options | বিবরণ |
|---|---|---|---|---|---|---|
| n_frames | select | No | 10 | - | 10, 15 | Duration |
| aspect_ratio | select | No | landscape | - | landscape, portrait | Aspect ratio |
| remove_watermark | select | No | false | - | false, true | Remove watermark |
| upload_method | select | No | s3 | - | s3, oss | Upload target |
Upload policy
প্রথমে reference files upload করুন, তারপর returned URL এবং duration token params.referenceMediaItems-এর মধ্যে দিন।
Reference image: Image project-এর জন্য সর্বোচ্চ 1টি image file upload করুন।
1
image
duration verification required হলে video এবং audio references /api/v1/files থেকে durationToken carry করবে।
| kind | Max size | MIME types |
|---|---|---|
| image | 10 MB | image/jpeg, image/png, image/webp |
Minimal request
{
"model": "sora-2",
"prompt": "A cinematic product reveal with smooth camera movement",
"params": {
"n_frames": "10",
"aspect_ratio": "landscape",
"remove_watermark": "false",
"upload_method": "s3"
}
}রেফারেন্স ফাইল রিকোয়েস্ট
{
"model": "sora-2",
"prompt": "A cinematic product reveal with smooth camera movement",
"params": {
"n_frames": "10",
"aspect_ratio": "landscape",
"remove_watermark": "false",
"upload_method": "s3",
"referenceMediaItems": [
{
"url": "https://cdn.example.com/reference-image.png",
"kind": "image",
"name": "reference-image.png",
"mimeType": "image/png"
}
]
}
}Create response
create endpoint public task id return করে। task succeeds বা fails না করা পর্যন্ত status endpoint poll করুন।
{
"id": "task_sora_2_example",
"status": "queued",
"model": "sora-2",
"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
}Common errors
validation_failed, insufficient_credits, idempotency_conflict, rate_limited, not_found
কিছু modes-এর জন্য Files API reference uploads দরকার।