Skip to content

File.generate

POST /{namespace}/files/generate

Generate makes an image, video, speech or music File from a prompt and reference Files, and records how it was made.

Noun
File
Mode
do
Event
File.generated

Inputs

InputTypeRequiredDescription
kindstringrequiredWhat to make.
prompttextrequiredWhat to make, or for speech the text to speak.
referenceslist of FileFiles the output follows, such as a product photo or a first frame.
voiceVoiceThe Voice that speaks, for speech.
formatjsonAspect ratio, resolution, duration and file type.

Outputs

OutputTypeRequiredDescription
fileFilerequiredThe generated File, its bytes in Storage and its provenance recorded.

Effects

  • Emits File.generated.
  • Performed by the Content Lead.
  • Two-way: it runs at once, in the try, send and do modes.
  • Runs as a background Action that waits with reason running until the upstream finishes.
  • Copies the result bytes into Storage before the Action is done; an upstream link is never the record.
  • Posts no Cost when generation fails and ends refused when the upstream declines the prompt.
  • Canceling the Action cancels the upstream task.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.File.generate

When it waits

GateDefault
Decision classLow: two-way, nothing at stake
Delay windowNone: it runs once review passes.
LimitThe call Limit of the Permission it runs under.
Over the LimitIt waits pending for an Approval from the Founder. Approved, it runs; refused, it ends refused with limit-exceeded; unanswered by its deadline, it ends canceled.