-
Notifications
You must be signed in to change notification settings - Fork 5
/
openapi.yaml
401 lines (382 loc) · 12.3 KB
/
openapi.yaml
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
openapi: 3.0.3
info:
title: Tavus Developer API Collection
description: >-
We're an AI video research company making personalized video possible at
scale. Generate videos of yourself, and never record again! Available via
web app & developer APIs.
version: 1.0.0
contact: {}
servers:
- url: https://tavusapi.com
tags:
- name: Replicas
- name: Videos
paths:
/v2/replicas:
post:
tags:
- Replicas
summary: Create Replica
operationId: Replicas_createNewReplica
description: >
This endpoint creates a new Replica that can be used to generate
personalized videos.
The only required body parameter is `train_video_url`. This url must be
a download link such as a presigned S3 url. Please ensure you pass in a
video that meets the
[requirements](https://docs.tavusapi.com/api-reference) for training.
Replica training will fail without the following consent statement being
present at the beginning of the video:
> I, [FULL NAME], am currently speaking and consent Tavus to create an
AI clone of me by using the audio and video samples I provide. I
understand that this AI clone can be used to create videos that look and
sound like me.
Learn more about the consent statement
[here](https://docs.tavusapi.com/api-reference).
Learn more about training a personal Replica
[here](https://docs.tavusapi.com/api-reference).
requestBody:
content:
application/json:
examples:
Create Replica:
value:
callback_url: ''
replica_name: ''
train_video_url: ''
schema:
$ref: '#/components/schemas/ReplicasCreateNewReplicaRequest'
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ReplicasCreateNewReplicaResponse'
get:
tags:
- Replicas
summary: List Replicas
operationId: Replicas_list
description: >
This endpoint returns a list of all replicas that have been created by
the API Key in use. In the response, a root level `data` key will
contain the list of Replicas.
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ReplicasListResponse'
/v2/replicas/{replica_id}:
parameters:
- in: path
name: replica_id
required: true
schema:
type: string
get:
tags:
- Replicas
summary: Get Replica
operationId: Replicas_getReplicaById
description: >
This endpoint returns a single Replica by its unique identifier.
Included in the response body is a `training_progress` string that
represents the progress of the Replica training. If there are any errors
during training, the `status` will be `error` and the `error_message`
will be populated.
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/ReplicasGetReplicaByIdResponse'
delete:
tags:
- Replicas
summary: Delete Replica
operationId: Replicas_deleteByReplicaId
description: >
This endpoint deletes a single Replica by its unique identifier. Once
deleted, this Replica can not be used to generate videos.
responses:
'200': {}
/v2/replicas/{replica_id}/name:
parameters:
- in: path
name: replica_id
required: true
schema:
type: string
patch:
tags:
- Replicas
summary: Rename Replica
operationId: Replicas_renameReplicaById
description: |
This endpoint renames a single Replica by its unique identifier.
requestBody:
content:
application/json:
examples:
Rename Replica:
value:
replica_name: ''
schema:
$ref: '#/components/schemas/ReplicasRenameReplicaByIdRequest'
responses:
'200': {}
/v2/videos:
post:
tags:
- Videos
summary: Generate Video
operationId: Videos_createVideoFromReplicaAndScript
description: >
This endpoint generates a new video using a Replica and a script.
The only required body parameters are `replica_id` and `script`. The
`replica_id` is a unique identifier for the Replica that will be used to
generate the video. The `script` is the text that will be spoken by the
Replica in the video.
If a `background_url` is provided, Tavus will record a video of the
website and use it as the background for the video. If a
`background_source_url` is provided, where the URL points to a download
link such as a presigned S3 URL, Tavus will use the video as the
background for the video. If neither are provided, the video will
consist of a full screen Replica.
To learn more about generating videos with Replicas, see
[here](https://docs.tavusapi.com/api-reference).
To learn more about writing an effective script for your video, see
[Scripting prompting](https://docs.tavusapi.com/api-reference).
requestBody:
content:
application/json:
examples:
Generate Video:
value:
background_url: ''
replica_id: ''
script: ''
video_name: ''
schema:
$ref: >-
#/components/schemas/VideosCreateVideoFromReplicaAndScriptRequest
responses:
'200':
content:
application/json:
schema:
$ref: >-
#/components/schemas/VideosCreateVideoFromReplicaAndScriptResponse
/v2/videos/{video_id}:
parameters:
- in: path
name: video_id
required: true
schema:
type: string
delete:
tags:
- Videos
summary: Delete Video
operationId: Videos_deleteByVideoId
description: |
This endpoint deletes a single video by its unique identifier.
responses:
'200': {}
/v2/videos/{video_id}/name:
parameters:
- in: path
name: video_id
required: true
schema:
type: string
patch:
tags:
- Videos
summary: Rename Video
operationId: Videos_updateName
description: |
This endpoint renames a single video by its unique identifier.
requestBody:
content:
application/json:
examples:
Rename Video:
value:
video_name: ''
schema:
$ref: '#/components/schemas/VideosUpdateNameRequest'
responses:
'200': {}
components:
securitySchemes:
apiKey:
in: header
name: x-api-key
type: apiKey
schemas:
ReplicasCreateNewReplicaRequest:
properties:
callback_url:
description: >-
A url that will receive a callback on completion of replica training
or on error.
type: string
replica_name:
description: A name for the replica.
type: string
train_video_url:
description: >-
A direct link to a publicly accessible storage location such as an
S3 bucket. This video will be used for replica training.
type: string
required:
- train_video_url
type: object
ReplicasRenameReplicaByIdRequest:
properties:
replica_name:
type: string
required:
- replica_name
type: object
VideosCreateVideoFromReplicaAndScriptRequest:
properties:
background_source_url:
description: >-
A direct link to a video that is publicly accessible via a storage
location such as an S3 bucket. This will be used as the background
for the video. The video must be publicly accessible.
type: string
background_url:
description: >-
A link to a website. This will be used as the background for the
video. The website must be publicly accessible and properly formed.
type: string
replica_id:
description: >-
A unique identifier for the replica that will be used to generate
the video.
example: r783537ef5
type: string
script:
description: A script to be used for the video.
example: Hello from Tavus! Enjoy your new replica
type: string
video_name:
description: A name for the video.
example: My First Video
type: string
required:
- replica_id
- script
type: object
VideosUpdateNameRequest:
properties:
video_name:
type: string
required:
- video_name
type: object
ReplicasListResponse:
properties:
data:
items:
properties:
created_at:
type: string
replica_id:
description: A unique identifier for the replica.
example: r783537ef5
type: string
replica_name:
description: The name of the replica.
example: My Replica
type: string
status:
description: The status of the replica.
example: completed
type: string
thumbnail_video_url:
description: >-
A direct link to the video that will be used as the thumbnail
for the replica.
type: string
training_progress:
description: The progress of the replica training.
example: 100/100
type: string
type: object
type: array
type: object
ReplicasCreateNewReplicaResponse:
properties:
replica_id:
description: A unique identifier for the replica.
example: r783537ef5
type: string
status:
description: The status of the replica.
example: training
type: string
type: object
ReplicasGetReplicaByIdResponse:
properties:
created_at:
description: The date and time the replica was created.
example: '2024-01-24T07:14:03.327Z'
type: string
error_message:
description: If the replica has an error, this will contain the error message.
nullable: true
type: string
replica_id:
description: A unique identifier for the replica.
example: r783537ef5
type: string
replica_name:
description: The name of the replica.
example: My Replica
type: string
status:
description: The status of the replica.
example: completed
type: string
thumbnail_video_url:
description: >-
A direct link to the video that will be used as the thumbnail for
the replica.
type: string
training_progress:
description: The progress of the replica training.
example: 100/100
type: string
updated_at:
description: The date and time of when the replica was last updated.
example: '2024-01-24T07:14:03.327Z'
type: string
type: object
VideosCreateVideoFromReplicaAndScriptResponse:
properties:
created_at:
description: The date and time the video was created.
type: string
hosted_url:
description: >-
A direct link to view your video once generation has completed,
hosted by Tavus.
type: string
status:
description: The status of the video.
type: string
video_id:
description: A unique identifier for the video.
type: string
video_name:
description: The name of the video.
type: string
type: object
security:
- apiKey: []