OhMyGPT
Videos

Create video

POST
/v1/videos

Start a video generation job and return it right away; poll GET /v1/videos/{id} until status is completed, then download it from GET /v1/videos/{id}/content. The price is fixed when the job is created, from seconds and size. Cancelled and failed jobs are not charged, except a job a provider's content policy blocks where that provider charges for it. seconds takes the values in the model's limits.video.seconds; size takes the sizes its pricing lists. A repeated Idempotency-Key returns the job it first created.

授权

ApiKeyAuth
headerAuthorization<token>

标头参数

Idempotency-Key*string

Any unique string per job, such as a UUID. Retrying with the same key returns the same job instead of starting a second one.

长度length <= 255

请求主体

application/json
  1. body

Other top-level fields go to the model unchanged; they cannot set the duration, size or media, which have the fields below.

media?array<>

Frames and references for image-to-video and reference-to-video models.

model*string

A video model ID from GET /v1/models

prompt*string
seconds?integer

The video length; one of the model's limits.video.seconds, the first of them by default.

size?string

Width by height, such as 848x480; one of the sizes in the model's pricing.

默认"1280x720"
[key: string]?any

响应主体

The created job, or the job this Idempotency-Key created before

application/json
  1. response
created_at*string
格式date-time
error?

Why the job failed

finished_at?string
格式date-time
id*string
model*string
object*"video"
值于"video"
progress*integer

Percent done, as far as the provider reports it

范围0 <= value <= 100
result_available*boolean

Whether GET /v1/videos/{id}/content can download the video now

result_url_expires_at?string

When the download stops being available

格式date-time
seconds*integer
size*string
status*string

creating until the provider accepts the job; completed, failed and cancelled are final.

值于"creating""queued""in_progress""completed""failed""cancelled"
updated_at*string
格式date-time
示例请求
curl -X POST 'https://api.ohmygpt.com/v1/videos' \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "model": "string",  "prompt": "string"}'
示例响应
{  "created_at": "2019-08-24T14:15:22Z",  "error": {    "code": "string",    "message": "string"  },  "finished_at": "2019-08-24T14:15:22Z",  "id": "string",  "model": "string",  "object": "video",  "progress": 0,  "result_available": true,  "result_url_expires_at": "2019-08-24T14:15:22Z",  "seconds": 0,  "size": "string",  "status": "creating",  "updated_at": "2019-08-24T14:15:22Z"}