API reference
🇺🇸 English
  • 🇨🇳 Chinese
  • 🇺🇸 English
  1. Official
API reference
🇺🇸 English
  • 🇨🇳 Chinese
  • 🇺🇸 English
  • Chat Models
    • Chat
      • Create chat completion
      • vision
    • OpenAI-Realtime
    • Completions
      • Instruct
    • Audio
      • Transcriptions
      • Translations
      • Speech
    • Image generation
      • DALL·E 3
    • Embeddings
      • Create
    • Models
      • model list
    • Help
      • 常见问题及解决办法
  • Anthropic
    • Anthropic Claude
      POST
  • Suno
    • Generate music
      POST
    • Generate lyrics
      POST
    • Upload music
      POST
    • Music concat
      POST
    • Fetch task
      GET
    • Fetch batch tasks
      POST
  • Udio
    • Generate music
      POST
    • Fetch task
      GET
  • Midjourney API
    • Quick
    • Task Submit
      • Imagine
      • Action
      • Modal
      • Blend
      • Describe
      • Shorten
      • Upload discord
    • Get Task
      • Fetch task by ids
      • Fetch task by id
      • Get seed
  • Flux
    • Official
      • Generate
      • Finetune
      • Fetch task
    • OpenAI Dalle3
  • Recraft
    • Official
      • Generate Image
      • Vectorize Image
      • Remove Background
      • Clarity Upscale
      • Generative Upscale
      • Create style
    • OpenAI Dalle3
  • Ideogram
    • Generate
    • Remix
    • Edit
    • Upscale
    • Describe
  • Luma
    • Official
      • Generate
        POST
      • Fetch task
        GET
    • Own format
      • Submit
        • Generate
        • Get video of no mark
        • 扩展视频
      • Get task
        • Get task
        • Get batch task
  • Runway
    • Official
      • image to video
      • get task
    • reverse
      • text to video
      • image to video
      • video2video
      • Act-one
      • Get task
  • Kling-API
    • Callback
    • Generate image
    • Text 2 Video
    • Image 2 Video
    • Video extend
    • Get task
    • lip-sync
    • kolors-virtual-try-on
  • Replicate
    • Generate
    • Get
  • MiniMax
    • Generate video
    • Get task
    • Get file
  1. Official

Generate

POST
/dream-machine/v1/generations
Last modified:2025-02-05 11:29:37

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Header Params
Content-Type
string 
optional
Example:
application/json; charset=utf-8
Authorization
string 
optional
Default:
{{YOUR_API_KEY}}
Body Params application/json
prompt
string 
required
提示词
aspect_ratio
string 
optional
长宽比
Default:
16:9
loop
boolean 
optional
是否循环播放视频
keyframes
object 
optional
关键帧
frame0
object 
首帧
optional
frame1
object 
尾帧
optional
callback_url
string 
optional
Example
{
  "prompt": "A tiger walking in snow",
  "keyframes": {
    "frame0": {
      "type": "image",
      "url": "https://storage.cdn-luma.com/dream_machine/7e4fe07f-1dfd-4921-bc97-4bcf5adea39a/video_0_thumb.jpg"
    }
  }
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location -g --request POST '/dream-machine/v1/generations' \
--header 'Authorization: ' \
--header 'Content-Type: application/json; charset=utf-8' \
--data-raw '{
  "prompt": "A tiger walking in snow",
  "keyframes": {
    "frame0": {
      "type": "image",
      "url": "https://storage.cdn-luma.com/dream_machine/7e4fe07f-1dfd-4921-bc97-4bcf5adea39a/video_0_thumb.jpg"
    }
  }
}'

Responses

🟢201成功
application/json
Body
id
string 
required
state
string 
required
failure_reason
null 
required
created_at
string 
required
assets
null 
required
version
null 
required
request
object 
required
prompt
string 
required
aspect_ratio
string 
required
loop
boolean 
required
keyframes
null 
required
callback_url
string 
required
Example
{
  "id": "7ca76429-99d1-46ab-bb2e-84baa4acdb04",
  "state": "queued",
  "failure_reason": null,
  "created_at": "2024-11-27T13:50:56.313494Z",
  "assets": null,
  "version": null,
  "request": {
    "prompt": "A serene lake surrounded by mountains at sunset",
    "aspect_ratio": "16:9",
    "loop": true,
    "keyframes": null,
    "callback_url": "xxx"
  }
}
Previous
Describe
Next
Fetch task
Built with