Create a job
Starts an image, video or music job and answers at once with the job, which you then read until it succeeds.
Body
modelrequiredA media model ID from the catalog.
promptrequiredUp to 10,000 characters, or the model's max_prompt_chars when it is lower.
nintegerImages to make, up to the model's max_images. Images only, and 1 by default.
duration_secondsintegerThe clip's length, one of the model's durations. Video only, and the first listed by default.
aspect_ratiostringSuch as 16:9, one of the model's aspect_ratios, for images and video.
sizestringSuch as 1536x1024, turned into a ratio when aspect_ratio isn't sent. Images only.
stylestringA style for the song, up to 200 characters. Music only.
instrumentalbooleanA song with no vocals. Music only.
It answers 202 with the job's hold taken. POST /images is the same endpoint limited to image models, and Images, video and music walks through a whole job.
Errors
400invalid_request_errorThe body isn't valid, names a chat model, or asks for a setting the model doesn't take401authentication_errorThe key is missing, revoked or expired402insufficient_creditThe balance or the key's cap can't cover the job's hold403permission_errorThe key may not use this model404not_found_errorThe model isn't in the catalog429rate_limit_errorToo many calls from the key or the account, or to the model, so wait for retry-after when it is sent503overloaded_errorMoth is briefly at capacity, so wait for retry-after529overloaded_errorThe model is paused, or busy or down at its host, so choose another or wait for retry-after when it is sent