-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathopenapi.yaml
More file actions
541 lines (520 loc) · 19.7 KB
/
openapi.yaml
File metadata and controls
541 lines (520 loc) · 19.7 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
openapi: 3.1.0
info:
title: Dream Machine API
summary: A RESTful API for interacting with the Dream Machine
description: Generate videos using Dream Machine.
termsOfService: https://lumalabs.ai/legal/tos
contact:
name: Luma AI, Inc.
email: support@lumalabs.ai
url: https://lumalabs.ai
license:
name: Proprietary
url: https://lumalabs.ai/legal/tos
version: 1.1.0
servers:
- url: https://api.lumalabs.ai/dream-machine/v1
security:
- BearerAuth: []
components:
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
schemas:
Error:
type: object
description: The error object
properties:
detail:
type: string
description: The error message
example:
detail: 'Invalid API key is provided'
State:
type: string
description: The state of the generation
enum:
- queued
- dreaming
- completed
- failed
example: completed
ListGenerationResponse:
type: object
description: The generations response object
properties:
has_more:
type: boolean
description: Whether there are more generations
count:
type: integer
description: The number of generations returned
limit:
type: integer
description: The limit of the generations requested
offset:
type: integer
description: The offset of the generations requested
generations:
type: array
items:
$ref: '#/components/schemas/Generation'
description: The generations requested
required:
- generations
example:
has_more: false
count: 1
limit: 100
offset: 0
generations:
- id: '123e4567-e89b-12d3-a456-426614174000'
state: 'completed'
failure_reason: null
created_at: '2023-06-01T12:00:00Z'
assets:
video: 'https://example.com/video.mp4'
version: 'v1.6'
request:
prompt: 'A serene lake surrounded by mountains at sunset'
aspect_ratio: '16:9'
loop: true
keyframes:
frame0:
type: image
url: 'https://example.com/image.jpg'
frame1:
type: generation
id: '123e4567-e89b-12d3-a456-426614174000'
GenerationReference:
type: object
description: The generation reference object
properties:
type:
type: string
enum:
- generation
default: generation
id:
type: string
format: uuid
description: The ID of the generation
required:
- type
- id
example:
type: generation
id: '123e4567-e89b-12d3-a456-426614174000'
ImageReference:
type: object
description: The image object
properties:
type:
type: string
enum:
- image
default: image
url:
type: string
format: uri
description: The URL of the image
required:
- type
- url
example:
type: image
url: 'https://example.com/image.jpg'
Assets:
type: object
description: The assets of the generation
properties:
video:
type: string
format: uri
description: The URL of the video
example:
video: 'https://example.com/video.mp4'
AspectRatio:
type: string
enum:
- '1:1'
- '16:9'
- '9:16'
- '4:3'
- '3:4'
- '21:9'
- '9:21'
description: The aspect ratio of the generation
example: '16:9'
default: '16:9'
GenerationRequest:
type: object
description: The generation request object
properties:
prompt:
type: string
description: The prompt of the generation
aspect_ratio:
$ref: '#/components/schemas/AspectRatio'
description: The aspect ratio of the generation
loop:
type: boolean
description: Whether to loop the video
keyframes:
$ref: '#/components/schemas/Keyframes'
description: The keyframes of the generation
callback_url:
type: string
format: uri
description: The callback URL of the generation, a POST request with Generation object will be sent to the callback URL when the generation is dreaming, completed, or failed
examples:
- summary: Text to video
value:
prompt: 'A serene lake surrounded by mountains at sunset'
aspect_ratio: '16:9'
loop: true
- summary: Image to video
value:
prompt: 'A serene lake surrounded by mountains at sunset'
aspect_ratio: '16:9'
loop: false
keyframes:
frame0:
type: image
url: 'https://example.com/image.jpg'
- summary: Image to video end frame
value:
prompt: 'A serene lake surrounded by mountains at sunset'
aspect_ratio: '16:9'
loop: false
keyframes:
frame1:
type: image
url: 'https://example.com/image.jpg'
- summary: Image to video keyframes
value:
prompt: 'A serene lake surrounded by mountains at sunset'
aspect_ratio: '16:9'
keyframes:
frame0:
type: image
url: 'https://example.com/image.jpg'
frame1:
type: image
url: 'https://example.com/image.jpg'
- summary: Extend video
value:
prompt: 'A serene lake surrounded by mountains at sunset'
aspect_ratio: '16:9'
loop: true
keyframes:
frame0:
type: generation
id: '123e4567-e89b-12d3-a456-426614174000'
- summary: Extend video reverse
value:
prompt: 'A serene lake surrounded by mountains at sunset'
aspect_ratio: '16:9'
keyframes:
frame1:
type: generation
id: '123e4567-e89b-12d3-a456-426614174000'
- summary: Interpolate image to video
value:
prompt: 'A serene lake surrounded by mountains at sunset'
aspect_ratio: '16:9'
keyframes:
frame0:
type: image
url: 'https://example.com/image.jpg'
frame1:
type: generation
id: '123e4567-e89b-12d3-a456-426614174000'
- summary: Interpolate video to image
value:
prompt: 'A serene lake surrounded by mountains at sunset'
aspect_ratio: '16:9'
keyframes:
frame0:
type: generation
id: '123e4567-e89b-12d3-a456-426614174000'
frame1:
type: image
url: 'https://example.com/video.mp4'
Generation:
type: object
description: The generation response object
properties:
id:
type: string
format: uuid
description: The ID of the generation
state:
$ref: '#/components/schemas/State'
description: The state of the generation
failure_reason:
type: string
description: The reason for the state of the generation
created_at:
type: string
format: date-time
description: The date and time when the generation was created
assets:
$ref: '#/components/schemas/Assets'
description: The assets of the generation
version:
type: string
description: The model version used for the generation eg. v1.6
request:
$ref: '#/components/schemas/GenerationRequest'
example:
id: '123e4567-e89b-12d3-a456-426614174000'
state: 'completed'
failure_reason: null
created_at: '2023-06-01T12:00:00Z'
assets:
video: 'https://example.com/video.mp4'
version: 'v1.6'
request:
prompt: 'A serene lake surrounded by mountains at sunset'
aspect_ratio: '16:9'
loop: true
keyframes:
frame0:
type: image
url: 'https://example.com/image.jpg'
frame1:
type: generation
id: '123e4567-e89b-12d3-a456-426614174000'
Keyframe:
oneOf:
- $ref: '#/components/schemas/GenerationReference'
- $ref: '#/components/schemas/ImageReference'
discriminator:
propertyName: type
mapping:
generation: '#/components/schemas/GenerationReference'
image: '#/components/schemas/ImageReference'
description: A keyframe can be either a Generation reference, an Image, or a Video
examples:
- summary: Generation reference
value:
type: generation
id: '123e4567-e89b-12d3-a456-426614174000'
- summary: Image reference
value:
type: image
url: 'https://example.com/image.jpg'
Keyframes:
type: object
description: The keyframes of the generation
properties:
frame0:
$ref: '#/components/schemas/Keyframe'
description: The frame 0 of the generation
frame1:
$ref: '#/components/schemas/Keyframe'
description: The frame 1 of the generation
example:
frame0:
type: image
url: 'https://example.com/image.jpg'
frame1:
type: generation
id: '123e4567-e89b-12d3-a456-426614174000'
Credits:
type: object
description: The credits object
properties:
credit_balance:
type: number
format: float
description: Available credits balance in USD cents
required:
- credit_balance
paths:
/ping:
get:
summary: Ping
description: Check if the API is running
operationId: ping
tags:
- Ping
responses:
'200':
description: API is running
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: The message
example:
message: 'pong'
/generations:
post:
summary: Create a generation
description: Initiate a new generation with the provided prompt
operationId: createGeneration
tags:
- Generations
requestBody:
required: true
description: The generation request object
content:
application/json:
schema:
$ref: '#/components/schemas/GenerationRequest'
examples:
default:
value:
prompt: 'A serene lake surrounded by mountains at sunset'
aspect_ratio: '16:9'
loop: true
keyframes:
frame0:
type: image
url: 'https://example.com/image.jpg'
frame1:
type: generation
id: '123e4567-e89b-12d3-a456-426614174000'
responses:
'201':
description: Generation created
content:
application/json:
schema:
$ref: '#/components/schemas/Generation'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
get:
summary: List generations
description: Retrieve a list of generations with optional filtering and sorting
operationId: listGenerations
tags:
- Generations
parameters:
- name: limit
in: query
required: false
schema:
type: integer
default: 100
- name: offset
in: query
required: false
schema:
type: integer
default: 0
responses:
'200':
description: Generations found
content:
application/json:
schema:
$ref: '#/components/schemas/ListGenerationResponse'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/generations/{id}:
get:
summary: Get a generation
description: Retrieve details of a specific generation by its ID
operationId: getGeneration
tags:
- Generations
parameters:
- name: id
in: path
required: true
schema:
type: string
description: The ID of the generation
responses:
'200':
description: Generation found
content:
application/json:
schema:
$ref: '#/components/schemas/Generation'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
delete:
summary: Delete a generation
description: Remove a specific generation by its ID
operationId: deleteGeneration
tags:
- Generations
parameters:
- name: id
in: path
required: true
schema:
type: string
description: The ID of the generation
responses:
'204':
description: Generation deleted
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/generations/camera_motion/list:
get:
summary: Get camera motions
description: Get all possible camera motions
operationId: getCameraMotion
tags:
- Generations
responses:
'200':
description: Camera motion found
content:
application/json:
schema:
type: array
items:
type: string
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/credits:
get:
summary: Get credits
description: Get the credits information for the api user
operationId: getCredits
tags:
- Credits
responses:
'200':
description: Credits found
content:
application/json:
schema:
$ref: '#/components/schemas/Credits'
default:
description: Error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'