Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api.oas3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,9 @@ components:
$ref: "./schemas/serve/transfer.yaml#/Transfer"

# Generation schemas
GenerationAsset:
$ref: "./schemas/generationasset.yaml#/GenerationAsset"

GenerationModel:
$ref: "./schemas/generationmodel.yaml#/GenerationModel"

Expand Down
9 changes: 4 additions & 5 deletions paths/generate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@
schema:
type: string
requestBody:
required: true
description: >-
A prompt-bearing image, video or audio asset to generate.
The asset to generate and, for models that generate to a duration, the length of
the clip it fills.
content:
application/json:
example:
Expand All @@ -103,10 +105,7 @@
type: object
properties:
asset:
oneOf:
- $ref: "../schemas/imageasset.yaml#/ImageAsset"
- $ref: "../schemas/videoasset.yaml#/VideoAsset"
- $ref: "../schemas/audioasset.yaml#/AudioAsset"
$ref: "../schemas/generationasset.yaml#/GenerationAsset"
length:
description: >-
The length, in seconds, of the clip the asset fills. A model that
Expand Down
40 changes: 40 additions & 0 deletions schemas/generationasset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
GenerationAsset:
description: An image, video or audio asset to generate from a text prompt.
type: object
properties:
type:
description: The kind of asset to generate.
type: string
enum: ['image', 'video', 'audio']
example: image
prompt:
description: >-
A description of the asset to generate. For text-to-speech models it is the
text spoken.
type: string
minLength: 1
maxLength: 4000
pattern: '\S'
example: A lighthouse on a rocky coast at sunset, cinematic lighting
model:
description: >-
The generation model. Defaults to `nano-banana-2` for images,
`seedance-2.0-text-to-video` for video and `elevenlabs-multilingual-v2` for
audio. `GET /models` lists the models for each type.
type: string
example: nano-banana-2
options:
description: >-
Settings for the chosen `model`. `GET /models` lists the options each model
accepts; omitted options use the model's defaults and unknown or invalid
options are rejected. A starting image for video goes in `startSrc`
(`inputSrc` on the original image-to-video models) and a speech voice in
`voice`.
type: object
additionalProperties: true
example:
aspectRatio: '16:9'
additionalProperties: false
required:
- type
- prompt
Loading