API reference

API reference · API

Start a render plan

POST/v1/studio/projects/{id}/plansAPI key

The quoted total is held whole in one conditional step, so either the whole batch is held and the plan starts or nothing is held or made (402 plan_unfunded when the balance falls short). Each shot then runs as its own job whose hold moves out of the plan's, a few at a time per account, the rest waiting for a slot; what is left of the plan's hold is released when it closes. A balance only, never the free allowance; a freeze and the monthly cap apply, checked again as each shot starts. A 404 while video and sound jobs are switched off. An API key with the chat scope (a write or a spend). Rate limited per key at the key's own requests a minute, in a window of its own. An agent's key is refused (403 policy_violation). Every /v1/studio door is a 404 while video and sound jobs are switched off.

Parameters

Path and query parameters
FieldTypeWhat it is
id (path)requiredstringThe project's id, stp_ followed by hex.

Request body

application/json, required

Request body fields
FieldTypeWhat it is
shotsrequiredarray of object
shots[].kindrequiredstringA clip, a sound, or a still: a picture for a shot to start from. One of "video", "sound", "still".
shots[].modelrequiredstring
shots[].promptrequiredstring
shots[].secondsnumber
shots[].resolutionstring
shots[].aspect_ratiostring
shots[].audioboolean
shots[].imagestringThe starting picture for a model whose input is image: an https URL, or a data:image/png, jpeg or webp base64 URL of at most 5242880 bytes decoded.
shots[].image_assetstringA picture the account stored (sa_ followed by hex) to start from instead of image; sent to the provider as a data URL, never as a link to the store. For a talking still, a motion control, an upscale of a picture (enlarge) or a fill (inpaint), the still it starts from, which the provider fetches through a signed link on this origin that lapses after 30 minutes; an upscale or a fill is held from the still's own size, read from the file on the server.
shots[].referencesarray of stringReference pictures a model keeps a subject from (a character's), or a still is made from, as many as the model takes (its references in the model list): each an https URL, a data:image URL, or a stored picture (sa_ followed by hex) sent as a data URL.
shots[].end_imagestringThe last frame, for a model whose endFrame is true: a picture as references takes one.
shots[].negative_promptstring
shots[].seedinteger
shots[].lyricsstring
shots[].camerastring or nullA camera move phrased into a video's prompt on the server. One of "push-in", "pull-out", "orbit", "crane-up", "dolly-zoom", "tracking", "handheld", "drone", "whip-pan", "static", null.
shots[].titlestring
picturesarray of stringStarting pictures as data:image URLs, sent once: a shot's image may say picture:<index> to name one.

Example

{
  "shots": [
    {
      "kind": "video",
      "model": "antimatter/auto",
      "prompt": "Say hello in five words."
    }
  ],
  "pictures": [
    "string"
  ]
}

Answer 201

The plan, running.

Fields of the 201 answer
FieldTypeWhat it is
idstring
objectstringOne of "studio.plan".
project_idstring
statusstringOne of "running", "completed", "cancelled".
quote_microsintegerThe total the balance was checked against.
microsintegerSettled shots' charges plus running shots' holds.
countsobject
shotsarray of object
shots[].idstring
shots[].objectstringOne of "studio.shot".
shots[].indexinteger
shots[].titlestring or null
shots[].modelstring
shots[].statusstringOne of "waiting", "starting", "running", "completed", "failed", "cancelled".
shots[].microsintegerThe quote while it waits, the job's hold while it runs, the charge once done.
shots[].job_idstring or null
shots[].jobobject or nullThe shot's job, as /api/studio/jobs answers it.
shots[].errorobject or null
shots[].error.codestring
shots[].error.messagestring
shots[].created_atinteger
shots[].started_atinteger or null
shots[].finished_atinteger or null
created_atinteger
finished_atinteger or null

Errors

  • 400OpenAI shaped error.
  • 401OpenAI shaped error.
  • 402OpenAI shaped error.
  • 403OpenAI shaped error.
  • 404OpenAI shaped error.
  • 429OpenAI shaped error.

Every error answers in one shape, with its type, code and the field it names. The whole list is in the docs' Errors section.

Antimatter