Generations

Keep an output as a file

Turns an image output of a succeeded generation into a file of your workspace, so you can pass its ID to the next run without downloading and uploading it. Calling it again returns the same file. Other outputs answer 400.

Needs an API key with the generations:write scope.

post/v1/generations/{id}/outputs/{index}/file

Request

  • Base URL: https://api.tryleap.ai
  • URL: https://api.tryleap.ai/v1/generations/{id}/outputs/{index}/file
  • Auth: one of:
    • API key in header x-api-key
    • HTTP bearer

Path parameters

idstring required

The generation's ID, gen_....

indexinteger required

The output's position in output, from 0.

Response

The file.

idstring required

The file's ID, file_.... Pass it in a model's input.

object'file' required
content_typestring required

The type, read from the file's bytes, such as image/jpeg or video/mp4.

bytesinteger required

The size in bytes.

widthinteger nullable required

Width in pixels; null for a sound.

heightinteger nullable required

Height in pixels; null for a sound.

durationnumber nullable required

A video's or a sound's length in seconds; null for an image.

filenamestring nullable required

The name you gave, if any.

urlstring uri required

A signed link to the file, valid for 24 hours. Read the file again for a fresh one.

created_atstring date-time required

When it was stored.

Changes

No recorded changes to this operation across all 1 revision of this API.