Gemini Media
v1.1.0Generate images (Nano Banana), video (Veo, Gemini Omni), speech and music (Lyria) with Google models
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
edit_image Edit image
Change an existing image with an instruction (add/remove/replace elements, restyle, relight, change aspect ratio, fix text) while keeping everything else. Accepts extra reference images to insert or match. Say what must stay unchanged. Saves a new file; the original is kept.
| Parameter | Type | Description |
|---|---|---|
image * | string | The image to edit: file path, gemini-media:// URI from an earlier result, or data: URI. |
prompt * | string | The change to make, stated specifically, plus what must stay the same (e.g. 'Replace the sky with a sunset; keep the people, framing and lighting on faces unchanged'). |
approvedCostUsd | number | Only needed above the confirmation threshold: the cost in USD the user approved. |
aspectRatio | string | Change the aspect ratio (outpainting). Omit to keep the source ratio. |
imageSize | string | Output size: 1K, 2K or 4K (512 only on the deprecated gemini-3.1-flash-image). |
model | string | Model ID or alias. Defaults to the model that created the source image, else nb2. |
outputName | string | Optional base file name for the saved file. Defaults to the source name plus -edit. |
referenceImages | null | array | Optional extra images to pull elements or style from (e.g. 'put the logo from image 2 on the mug'). |
edit_video Edit video
Change an existing clip with an instruction (add, remove or replace objects, restyle, relight, change the background) with Gemini Omni Flash, keeping everything else. Pass the jobId of a finished clip (Omni clips are edited in conversation) or a video file of at most 10 s. Asynchronous like generate_video; about $0.10 per second of video at 720p.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | The change, stated simply, ending with 'Keep everything else the same.' (e.g. 'Make the phone invisible. Keep everything else the same.') |
approvedCostUsd | number | Only needed above the confirmation threshold: the cost in USD the user approved. |
jobId | string | A completed video job to edit. Omni clips are edited in conversation (Google keeps the context); other clips are sent as their saved file. Pass jobId or video. |
model | string | Model ID or alias; default omni (the only model that edits videos). |
outputName | string | Optional base file name for the saved video. Defaults to the source name plus -edit. |
referenceImages | null | array | Optional images to bring into the clip; refer to them as <IMAGE_REF_0>, <IMAGE_REF_1>... in the prompt. |
resolution | string | 360p, 720p (default), 1080p or 4k (1080p and 4k are upscaled). |
video | string | Or a video file to edit: file path, gemini-media:// URI or data: URI. At most 10 seconds and 20 MB. |
waitSeconds | integer | Block up to this many seconds for the result (default 0 = return a job handle immediately). Keep under your client's tool timeout. |
estimate_cost Estimate cost
Estimate the cost of an image, video, speech or music request before running it, optionally comparing all models; also reports remaining budget and whether approval is needed.
| Parameter | Type | Description |
|---|---|---|
mediaType * | string | image, video, speech or music |
compare | boolean | Also estimate the same request on every other active model of this media type |
count | integer | Number of images/clips/songs (default 1) |
durationSeconds | integer | Video: clip length (default 8) |
generateAudio | null | boolean | Video on Vertex AI: false for the cheaper silent rate |
imageSize | string | Images: 512, 1K, 2K or 4K |
inputImages | integer | Images: number of reference/source images |
model | string | Model ID or alias (default model when omitted) |
resolution | string | Video: 720p, 1080p or 4k (Omni also 360p) |
text | string | Speech: the text to be spoken (length drives cost) |
extend_video Extend video
Continue a completed clip from its end: omni adds up to 10 s (40 s total, keeping characters and audio coherent); Veo fast/standard add about 7 s (720p, up to 148 s, within 2 days). Asynchronous like generate_video.
| Parameter | Type | Description |
|---|---|---|
jobId * | string | Job handle of a completed generate_video or extend_video call (operation names from older versions also work). |
prompt * | string | What happens next. Veo adds about 7 seconds (720p) from the last second; omni adds up to 10 seconds using the last 10 seconds as context. |
approvedCostUsd | number | Only needed above the confirmation threshold. |
negativePrompt | string | |
outputName | string | |
seed | null | integer | Vertex AI only. |
waitSeconds | integer | Block up to this many seconds for the result (default 0). |
generate_image Generate image
Create images from a text prompt, optionally guided by up to 14 reference images (subjects, products, style). Default model nb2 (Nano Banana 2.1, ~$0.04 per 1K image); pro for the densest scenes and final renders (~$0.15); nb2-lite for bulk drafts. Returns saved files with URIs you can pass to edit_image, generate_video (image) or other tools.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | What to create. Describe subject, setting, composition, lighting and style in full sentences. Put any exact text to render in quotes. |
approvedCostUsd | number | Only needed when a call exceeds the configured confirmation threshold: the cost in USD the user approved. |
aspectRatio | string | e.g. 1:1, 3:2, 2:3, 4:3, 3:4, 4:5, 16:9, 9:16, 21:9 (nb2 also 1:4, 4:1, 1:8, 8:1). Defaults to 1:1 when there are no reference images; with them the model usually follows the first image's ratio. |
count | integer | Number of variations to generate in parallel (1-4, default 1). Each is billed. |
googleSearch | boolean | Ground the image in Google Search results (current events, real places, data for infographics). |
imageSize | string | Output size: 1K (default), 2K or 4K. Larger costs more. 512 only on the deprecated gemini-3.1-flash-image. |
model | string | Model ID or alias. nb2 (default: Nano Banana 2.1, fast and cheap), pro (Nano Banana Pro, highest fidelity for dense scenes), nb2-lite (cheapest inputs). See list_models. |
outputName | string | Optional base file name (without extension) for the saved file(s). |
referenceImages | null | array | Optional images to guide the result (subjects, products, characters, style): file paths, gemini-media:// URIs from earlier results, or data: URIs. Up to 14 for nb2/pro. |
generate_music Generate music
Compose music with Lyria: 30-second clips (clip, $0.04) or full songs of a few minutes with vocals and lyrics (full, $0.08). Control genre, mood, instruments, tempo and structure in the prompt; returns lyrics/structure text when available.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | Describe the music: genre, mood, instruments, tempo, key, production style and song structure. Use [Intro]/[Verse]/[Chorus]/[Bridge]/[Outro] tags or [0:00-0:15] timestamps to control sections. |
approvedCostUsd | number | Only needed above the confirmation threshold. |
bpm | integer | Optional tempo hint in beats per minute. |
durationSeconds | integer | Optional target length hint for full songs (clip is always 30s). |
format | string | mp3 (default) or wav (full model only). |
images | null | array | Optional images (up to 10) whose mood or scene should inspire the music. |
instrumental | boolean | Ask for no vocals. |
lyrics | string | Optional lyrics with section tags; they are sung in the language they are written in. |
model | string | clip (default: 30-second MP3, cheapest) or full (complete song up to about 3 minutes, vocals, WAV option). See list_models. |
outputName | string | Optional base file name. |
generate_speech Generate speech
Turn text into natural speech (WAV) with one voice, or a dialogue between two speakers. Control delivery with style. About $0.01-0.02 per minute of audio. For podcasts, voiceovers, narration and dialogue.
| Parameter | Type | Description |
|---|---|---|
approvedCostUsd | number | Only needed above the confirmation threshold. |
dialogue | null | array | Alternative to text: a conversation between up to 2 named speakers, one entry per line. |
format | string | wav (default) or pcm (raw 16-bit little-endian). |
languageCode | string | Optional BCP-47 code (e.g. en-US, it-IT). Usually auto-detected from the text. |
model | string | Model ID or alias: tts (default, Gemini 3.8 Flash TTS), tts-lite (cheaper). See list_models. |
outputName | string | Optional base file name. |
speakers | null | array | Voice per dialogue speaker; unlisted speakers get distinct defaults. |
style | string | How to deliver the lines, e.g. 'warm and enthusiastic', 'whispered urgently', 'slow, calm narrator'. |
text | string | The exact words to speak (single speaker). Newer models read it verbatim, so put delivery directions in style, not here. Inline tags like <sigh> or <short pause> are allowed. |
voice | string | Voice for single-speaker text, e.g. Kore (firm), Puck (upbeat), Charon (informative), Aoede (breezy, default), Zephyr (bright). list_models shows all 30. |
generate_video Generate video
Start a video clip with native audio from a text prompt, optionally from a first frame, first+last frames, or reference images. Default omni (Gemini Omni Flash: 3-10s, cheap 360p drafts up to 4K, up to 10 references). On Vertex AI the default is Veo lite; fast/standard add Veo 4K and ingredients. Veo is leaving the Gemini API (list_models has the date). estimate_cost prices any option. Asynchronous: returns a jobId; then call get_video.
| Parameter | Type | Description |
|---|---|---|
prompt * | string | What happens in the clip: subject and action, camera movement, setting, lighting, style, and sound (dialogue in quotes, sound effects, ambience, music). |
approvedCostUsd | number | Only needed above the confirmation threshold: the cost in USD the user approved. |
aspectRatio | string | 16:9 (default) or 9:16 |
durationSeconds | integer | Clip length: Veo 4, 6 or 8 seconds; omni 3-10 seconds (default 8). |
generateAudio | null | boolean | Vertex AI only: set false for silent video at a lower price. The Gemini API always generates audio. |
image | string | Optional first frame (image-to-video): file path, gemini-media:// URI or data: URI. |
lastFrame | string | Optional last frame; requires image. Veo interpolates between the two. |
model | string | Model ID or alias: omni (default on the Gemini API: Gemini Omni Flash, best prompt adherence, editable and extendable to 40 s), lite (cheapest Veo; the default on Vertex AI), fast (Veo 4K, ingredients… |
negativePrompt | string | What to avoid, as plain nouns (e.g. 'text overlays, blur'). For omni it is appended to the prompt. |
outputName | string | Optional base file name for the saved video. |
personGeneration | string | allow_all, allow_adult or dont_allow. The Gemini API requires allow_all for text-to-video and allow_adult for image-based modes. |
referenceImages | null | array | Images of characters, objects, products or styles to keep consistent: Veo fast/standard up to 3 (forces 8s, not with image/lastFrame); omni up to 10 including frames (name them <IMAGE_REF_0>... in the… |
resolution | string | 720p (default), 1080p or 4k (not lite); omni also 360p for fast drafts. Veo 1080p and 4k require 8-second clips. |
seed | null | integer | Seed for more repeatable results (Vertex AI only; ignored on the Gemini API). |
waitSeconds | integer | Block up to this many seconds for the result (default 0 = return a job handle immediately). Keep under your client's tool timeout. |
get_config Get configuration
Show the active backend and how it was chosen, output directory, default models, budgets, input-file policy and configuration warnings. Use it to troubleshoot credentials or missing files.
get_usage Get usage and spend
Report estimated spend for this session, today, this month or all time, broken down by model and tool, with budget remaining, recent calls and running video jobs.
| Parameter | Type | Description |
|---|---|---|
period | string | session (since this server started), today (default), month or all |
recent | integer | How many recent entries to include (default 10, max 100) |
get_video Get video job
Check a video job and wait for it (default up to 45s). When the job completes, the video is downloaded and returned; calling again is safe and returns the same files.
| Parameter | Type | Description |
|---|---|---|
jobId * | string | Job handle returned by generate_video, extend_video or edit_video. |
waitSeconds | null | integer | Block up to this many seconds for completion (default 45, 0 = check once). The video is downloaded automatically when ready. |
list_models List models
List current models per media type with aliases, status (GA/preview/deprecated), prices and a short guide to when to use each. detail: true adds supported aspect ratios, sizes, durations and voices; live: true checks what your API key can actually call.
| Parameter | Type | Description |
|---|---|---|
detail | boolean | Include full capabilities (aspect ratios, voices, rules). |
includeInactive | boolean | Also list retired models and their replacements. |
live | boolean | Also query the Gemini API for the models this key can use, flagging unavailable ones and media models missing from the catalog. |
mediaType | string | Filter: image, video, speech or music. |
stitch_tiles Stitch upscaled tiles
Upscale step 3: align each edited tile from tile_image with the image, match its broad color, blend the overlaps and save one large PNG (default 8192 px long edge). Free and local. Reports tiles it rejected (their area keeps the prior pixels) and returns a preview plus 100% crops of the seams to inspect.
| Parameter | Type | Description |
|---|---|---|
job * | string | The job uri returned by tile_image. |
tiles * | null | array | The edited tiles. Tiles left out keep the underlying image. |
colorMatch | null | boolean | Match each tile's broad exposure and color to the image (default true). Fine texture is never transferred. |
details | null | array | Up to 6 points to return as 100% crops for inspection. Default: where grid tiles meet, or each region's center. |
feather | number | Blend width as a fraction of each tile's shorter side (default 0.2, 0.05-0.4). Between neighboring tiles it is capped at half their overlap. |
outputName | string | Optional base name for the stitched PNG. |
tile_image Tile image for upscaling
Upscale step 1: cut an image into crops shaped to the edit model's aspect ratios. longEdge sets the target (1K-16K, default 8K); with grid and imageSize omitted it picks the cheapest plan that covers it (one tile up to about 4K, a 2x2-4x4 grid beyond). regions re-render faces or text in a later pass. Free and local; reports the edit cost. Step 2: edit_image each crop as the result says. Step 3: stitch_tiles. Detail is invented, not recovered.
| Parameter | Type | Description |
|---|---|---|
image * | string | The image to cut: the original photo for the first pass, or the previous stitch_tiles result for a refinement pass. File path, gemini-media:// URI or data: URI. |
grid | integer | Cut a grid x grid layout covering the whole image (1-4). Omit it on a first pass to let tile_image pick the cheapest grid that covers longEdge (explained in planNote); a later full-grid pass defaults… |
imageSize | string | Size the tiles will be edited at (1K, 2K or 4K, as the model supports). Omit it on a first pass to pick it with the grid; otherwise it defaults to the model's largest size. |
longEdge | integer | Long edge in pixels of the image stitch_tiles will produce (default 8192, 1024-16384, at most 70 megapixels). First pass only; later passes keep their input's size. |
model | string | Image model the tiles will be edited with (default: the server's default image model; a refinement pass defaults to the model of the pass before). Sets the supported aspect ratios and the cost estimat… |
original | string | First pass only: the untouched original, sent with every tile as context (as a copy of at most 2048 px). Defaults to image. Refinement passes edit crops alone and keep the first pass's original, so it… |
outputName | string | Optional base name for the crops and the stitched result. Defaults to the original's name. |
padding | number | Context added around each cell or region, as a fraction of its size (default 0.2, 0.05-0.5). Tiles then grow to the nearest aspect ratio the model supports. |
regions | null | array | Refinement pass: up to 12 areas to re-render (faces, hands, text, materials), as fractions of the image. Omit for a full grid. |