Create a video job
const url = 'https://api.saygm.com/v1/videos';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"model":"example","prompt":"example","seconds":1,"size":"example","seed":1,"image_reference":[{"image_url":"example","role":"first_frame"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.saygm.com/v1/videos \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "model": "example", "prompt": "example", "seconds": 1, "size": "example", "seed": 1, "image_reference": [ { "image_url": "example", "role": "first_frame" } ] }'Start video generation and receive a job object. Poll GET /v1/videos/{id} for status; the response includes expires_at for the generated content.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Optional printable key of up to 128 characters. Repeating the same key and request returns the existing job; reusing it for a different request returns 409.
Request Bodyrequired
Section titled “Request Bodyrequired”object
A model id that supports video generation.
A non-empty prompt of at most 4,000 UTF-8 bytes.
Requested duration in seconds; supported values depend on the model.
Requested output dimensions; supported values depend on the model.
object
A base64 data URL for a PNG, JPEG, or WebP image of at most 2 MiB.
object
A non-empty prompt of at most 4,000 UTF-8 bytes.
Unsigned 32-bit integer serialized as decimal text.
A JSON array of image_reference entries matching VideoImageReference.
Responses
Section titled “Responses”The created or previously accepted video job.
object
Requested duration in seconds, serialized as a numeric string.
Creation time as Unix seconds.
Completion time as Unix seconds, or null until complete.
Content expiry time as Unix seconds.
Example
{ "object": "video", "status": "queued"}The request is invalid or the model does not support the requested video options.
object
object
Example
{ "billing_status": "settled"}The API key is missing or invalid.
object
object
Example
{ "billing_status": "settled"}The account does not have enough available credit for this video.
object
object
Example
{ "billing_status": "settled"}The request body did not arrive before the upload timeout (upload_timeout).
object
object
Example
{ "billing_status": "settled"}The idempotency key conflicts with a different request.
object
object
Example
{ "billing_status": "settled"}The request body is too large.
object
object
Example
{ "billing_status": "settled"}The account has reached a video job or upload concurrency limit.
object
object
Example
{ "billing_status": "settled"}The upstream video request could not be accepted.
object
object
Example
{ "billing_status": "settled"}The service cannot complete the request right now.
object
object
Example
{ "billing_status": "settled"}