veo-3.1
veo-3.1
VideoGoogleVeo 3.1veo-3.1
Veo 3.1 是一种用于生成 8 秒视频(720p、1080p 或 4k)的模型,可原生生成音频。
Autentikasi
- Base URL
https://api.dreamtoai.com- Authorization
Authorization: Bearer YOUR_API_KEY- Content-Type
application/json- Nama model (model)
veo-3.1
Protokol integrasi
Mengapa memilih protokol ini
适合需要提交任务并轮询状态的图像、视频、音频生成工作流。
URL endpoint
POST/v1/jobs
Authorization: Bearer YOUR_API_KEYContent-Type: application/jsonJSON permintaan dan respons
Permintaan
{
"model": "veo-3.1",
"input": {
"prompt": "一段自然纪录片风格的雪山航拍镜头",
"image": "https://example.com/image.png",
"lastframe": [
"https://example.com/ref.png"
],
"referenceImages": [
"https://example.com/ref.png"
],
"video": [
"https://example.com/ref.mp4"
],
"aspectratio": "16:9,9:16",
"resolution": "720p,1080p,4k",
"generate_audio": false,
"negative_prompt": "低清晰度、闪烁、变形",
"durationseconds": "4,6,8"
}
}Respons
{
"id": "job_example",
"object": "job",
"status": "processing",
"model": "veo-3.1",
"created": 1710000000,
"request_id": "req_example"
}Field permintaan dan respons
Field permintaan
| Field | Tipe | Wajib |
|---|---|---|
| prompt | string | Y |
| image | image | N |
| lastframe | string | N |
| referenceImages | string | N |
| video | video | N |
| aspectratio | string | N |
| resolution | string | N |
| generate_audio | boolean | N |
| negative_prompt | string | N |
| durationseconds | string | N |
Field respons
| Field | Tipe | Wajib |
|---|---|---|
| task_id | string | N |
| status | enum | N |
Contoh kode
cURLrequest.sh
curl -X POST "https://api.dreamtoai.com/v1/jobs" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "veo-3.1",
"input": {
"prompt": "一段自然纪录片风格的雪山航拍镜头",
"image": "https://example.com/image.png",
"lastframe": [
"https://example.com/ref.png"
],
"referenceImages": [
"https://example.com/ref.png"
],
"video": [
"https://example.com/ref.mp4"
],
"aspectratio": "16:9,9:16",
"resolution": "720p,1080p,4k",
"generate_audio": false,
"negative_prompt": "低清晰度、闪烁、变形",
"durationseconds": "4,6,8"
}
}'
# cURL untuk memeriksa status
# Ganti job_example dengan task_id yang dikembalikan respons submit.
curl -X GET "https://api.dreamtoai.com/v1/jobs/job_example" \
-H "Authorization: Bearer YOUR_API_KEY"