API/interactions
Generate or edit video with Gemini Omni. Send text with optional reference images or videos, and get the result back as base64 in the same response.
https://api.framewharf.com/v1/interactionsAuthorization: Bearer sk-your_api_keySend JSON with your API key in the Authorization header. The request stays open while the video is generated. The cURL example saves the response to interaction.json; the Python example also decodes and saves each video. Install the requests library to run the Python example.
curl "https://api.framewharf.com/v1/interactions" \
-H "Authorization: Bearer sk-your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-omni-1.1-flash",
"input": "Create a three-second video of a blue ceramic cup on a white table, with a gentle camera move.",
"store": false,
"response_format": {
"type": "video",
"resolution": "720p",
"aspect_ratio": "16:9",
"duration": "3s",
"delivery": "inline"
}
}' \
-o interaction.jsonIf you omit response_format, the default is 720p video output delivered inline. Individual models may impose further limits on duration and requested output settings.
To turn an image into a video, build an input array with your prompt and the reference image. Read the image data and base64-encode it:
import base64
from pathlib import Path
reference = base64.b64encode(Path("reference.png").read_bytes()).decode("ascii")
input_blocks = [
{"type": "text", "text": "Animate this scene with a slow camera pan."},
{"type": "image", "mime_type": "image/png", "data": reference},
]Set input to input_blocks in the Python request above. To edit a video, use a video block instead, as in this request body:
{
"model": "gemini-omni-1.1-flash",
"input": [
{
"type": "text",
"text": "Change the lighting to a warm sunset, keeping the setting and camera motion unchanged."
},
{
"type": "video",
"mime_type": "video/mp4",
"data": "<base64-video>"
}
],
"store": false,
"response_format": {
"type": "video",
"resolution": "720p",
"delivery": "inline"
}
}Replace the base64 placeholder with the full file contents. data holds plain base64, without a data: prefix. Use the matching mime_type, such as image/png, image/jpeg or video/mp4. File URLs and the uri field are not accepted.
The trimmed response below shows where the video is returned. Read the model_output steps and decode the data field of each video block:
{
"id": "interaction_example",
"model": "gemini-omni-1.1-flash",
"status": "completed",
"steps": [
{
"type": "model_output",
"content": [
{
"type": "video",
"mime_type": "video/mp4",
"data": "<base64-mp4>"
}
]
}
]
}A completed response may hold only clarifying or refusal text and no video. Read the text blocks and check for a video block before saving a file.
Store the returned data in your application. This endpoint has no GET, DELETE or later download route, and an interaction id cannot be used to fetch or continue an earlier request.
Call GET /v1/models with your API key to find the models you can call. Pick a model whose supported_endpoints includes /v1/interactions.
Usage is priced by input tokens, text output, reasoning and video output. Unit prices are in dong per token; see current prices in the model catalog.
Send the full input with every request. Streaming, background jobs, stored history, previous_interaction_id, agents, tools, system_instruction and generation_config are not supported. Audio input blocks are not accepted.
For models that use asynchronous video jobs, see POST /v1/videos.