media

generate images and videos with ai, browse the workspace media library, and attach media to posts. visual platforms like instagram, tiktok, and pinterest require at least one media file.

generate_image

generate an image with ai (gemini) and automatically save it to the workspace media library. do not call upload_media after this — the returned url is already stored. use attach_media with the returned url to add the image to a post. supports iteration via reference_image_url.

> create a hero image for my product launch
  using antwork.generate_image

  [done] image generated
  [info] saved to media library · url: https://...
parameters
promptstringrequired
detailed description of the image to generate
workspace_idstringoptional
workspace id or name. optional if user has only one workspace
reference_image_urlstringoptional
url of an existing image to use as a reference for iteration
aspect_ratiostringoptional
desired aspect ratio (e.g. "1:1", "16:9", "9:16", "4:5"). default: "1:1"
stylestringoptional
visual style hint (e.g. "photorealistic", "flat design", "watercolor")

generate_video

generate a short video with veo 3.1 lite and automatically save it to the workspace media library. supports 4–8 second clips at 16:9 (landscape) or 9:16 (portrait). generation takes ~30–120 seconds — the call blocks until the video is ready and uploaded.

> create a 6-second portrait video for my reels announcement
  using antwork.generate_video

  [done] video generated
  [info] saved to media library · model: veo-3.1-lite
parameters
promptstringrequired
detailed description of the video (camera, motion, subject, scene, mood). veo rewards specific prompts.
workspace_idstringoptional
workspace id or name. optional if user has only one workspace
aspect_ratiostringoptional
"16:9" (landscape, default) or "9:16" (portrait — reels/shorts/tiktok)
duration_secondsnumberoptional
clip duration in seconds (4–8). defaults to model default.
resolutionstringoptional
"720p" (default) or "1080p"
generate_audiobooleanoptional
whether to generate an audio track. defaults to true.
negative_promptstringoptional
things to avoid (e.g. "blurry, low quality, watermarks")

list_media

list media files in the workspace media library. returns uploaded images and videos with urls that can be attached to posts.

> show me my uploaded images
  using antwork.list_media

  [done] 8 media files found
  [info] 6 images, 2 videos
parameters
workspace_idstringoptional
workspace id or name. optional if user has only one workspace
media_typestringoptional
filter by type: "image", "video", "pdf", or null for all
limitnumberoptional
max items to return (default: 30, max: 50)

get_media

get a single media item by id. returns the media url, name, type, size, and upload date.

> show me details for that image
  using antwork.get_media

  [done] media found
  [info] type: image, size: 2.4 MB
parameters
media_idstringrequired
the media item id

attach_media

attach media (images or videos) to an existing post. replaces any existing media on the post. required for visual platforms like instagram, tiktok, and pinterest.

> attach our latest product image to that post
  using antwork.attach_media

  [done] media attached
  [info] 1 image added to post
parameters
post_idstringrequired
the post id to attach media to
media_urlsstring[]required
list of media urls (from list_media or firebase storage)

upload_media

upload an image to the workspace media library from a url or base64 data. the image is stored in firebase storage and added to the media library.

> upload this product screenshot to my media library
  using antwork.upload_media

  [done] image uploaded
  [info] url: https://storage.googleapis.com/...
parameters
image_urlstringoptional
public url of the image to upload. antwork will download and store it
image_base64stringoptional
base64-encoded image data (alternative to image_url)
mime_typestringoptional
mime type for base64 uploads (default: "image/png")

delete_media

delete a media item from the workspace media library. removes the firestore record.

> delete that old banner image
  using antwork.delete_media

  [done] media deleted
  [info] id: abc123
parameters
media_idstringrequired
the media item id to delete