Docs · guides

Media Generation Tool

Generate images, videos, and music with the MediaGeneration MCP tool through Gemini, FAL, xAI, Alibaba Cloud, and ByteDance ModelArk.

The MediaGeneration tool lets your agents generate images, videos, and music directly in conversations. It's available as a built-in MCP tool at mcp__teamday-media__MediaGeneration.

Provider credentials, plan policy, quota, and estimated cost are checked before generation. Successful usage is attributed automatically to Teamday credits or your organization's own provider key.


Actions

ActionPurpose
generateImageText-to-image generation
imageToVideoAnimate a static image into a video clip
textToVideoGenerate a video from a text prompt
generateMusicGenerate music with Gemini Lyria
checkBalanceCheck which media providers are configured

Image Generation

Basic Usage

Generate a blog cover image of a futuristic AI office with soft neon lighting.

The agent calls:

{
  "action": "generateImage",
  "prompt": "Futuristic AI office with soft neon lighting, clean modern design",
  "outputPath": "images/ai-office.png"
}

outputPath is relative to the chat's or mission's working directory — the folder chosen when it was created. Use an absolute organization path such as /marketing/images/cover.png to save somewhere else.

Parameters

ParameterTypeDefaultDescription
promptstringrequiredText description of the image to generate
providerstringautoProvider override: modelark, alibaba, fal, xai, or gemini
modelstringprovider defaultExact model ID or supported alias (see Models below)
aspectRatioenum16:91:1, 16:9, 9:16, or the equivalent named alias
outputPathstringgenerated-image.pngFile path, relative to the working directory or an absolute organization path

Aspect Ratios

ValueUse Case
16:9 or landscape_16_9Blog covers, headers
1:1 or squareSocial media, thumbnails
9:16 or portrait_9_16Mobile, stories

Image Models

ModelProviderCostBest For
gemini-3.1-flash-imageGoogle Gemini~7cFast 1K text-to-image generation
fal-ai/flux-2-flex or flux-2-flexFAL.AI4cGeneral purpose, prompt expansion
grok-imagine-imagexAI2cFast, affordable creative images
grok-imagine-image-qualityxAI5cHigher quality 1K output
qwen-image-2.0Alibaba Cloud3.5cVersatile image generation via DashScope
qwen-image-2.0-proAlibaba Cloud7.5cHigher quality Qwen images
wan2.7-image-proAlibaba Cloud7.5cWan 2.7 pro-quality images
seedream-5-0-260128ByteDance ModelArk5cDefault when provider and model are omitted

Video Generation

Image-to-Video

Animate a static image into a short video clip. Requires either imagePath (a file in your organization's folders) or imageUrl (public URL).

{
  "action": "imageToVideo",
  "imagePath": "images/product-shot.png",
  "prompt": "Subtle zoom in with gentle particle effects",
  "provider": "fal",
  "model": "fal-ai/kling-video/v3/pro/image-to-video",
  "duration": 5,
  "outputPath": "videos/product-animation.mp4"
}

Parameters

ParameterTypeDefaultDescription
imagePathstring---Path to the source image, relative to the working directory or an absolute organization path
imageUrlstring---Public URL of source image (alternative to imagePath)
promptstring""Motion/style description
providerstringautoProvider override: modelark, alibaba, fal, or xai
modelstringprovider defaultExact model ID or supported alias
durationnumberprovider defaultRequested seconds; Kling 3 accepts 3–15 and xAI accepts up to 15
generateAudiobooleanfalseEnable Kling 3 native audio; changes FAL pricing
outputPathstringgenerated-video.mp4Output file path

Video Models

ModelProviderCostNotes
fal-ai/kling-video/v3/pro/image-to-videoFAL.AI11.2c/s without audio; 16.8c/s with audioCurrent FAL image-to-video default
fal-ai/kling-video/v3/pro/text-to-videoFAL.AI11.2c/s without audio; 16.8c/s with audioCurrent FAL text-to-video default
fal-ai/wan/v2.6/text-to-video or wanFAL.AIroute estimateText-to-video compatibility route
grok-imagine-video-1.5xAI1c image input + 14c/s at 720pImage-to-video only
grok-imagine-videoxAI7c/s at 720pText-to-video and compatibility image-to-video
wan2.7-i2vAlibaba Cloud~10c/sWan 2.7 image-to-video
happyhorse-1.0-i2vAlibaba Cloud~11.2c/sHappyHorse image-to-video
dreamina-seedance-2-0-260128ByteDance ModelArkroute estimateSeedance text-to-video or image-to-video

Note: Alibaba Cloud models (wan2.7-i2v, happyhorse-1.0-i2v) and ByteDance ModelArk models (seedance) require the corresponding provider credentials configured for your organization. Ask an organization owner to enable these providers under Settings → AI providers.


Checking Provider Availability

Check whether the required provider credential is available before generation:

{
  "action": "checkBalance"
}

Returns:

{
  "ok": true,
  "balance": {
    "configured": {
      "modelark": true,
      "fal": true,
      "xai": false,
      "gemini": true
    },
    "dry_run": false
  }
}

How It Works

  1. Agent calls the tool --- the MCP server runs inside the computer service
  2. Policy pre-check --- verifies credentials, plan policy, quota, and estimated cost
  3. API call --- sends the request to Google Gemini, FAL.AI, xAI, Alibaba Cloud, or ByteDance ModelArk depending on the model
  4. File saved --- downloads the result and saves it at outputPath
  5. Usage recorded --- estimated and provider-reported actual cost are attributed to platform or BYOK billing

Generated files land in the folder you choose: relative to the run's working directory by default, or at any absolute organization path you give in outputPath. The agent can then reference them in responses, embed them in documents, or use them as inputs for further processing.


Tips for Agents

  • Always specify outputPath with a meaningful filename
  • Use checkBalance to confirm provider availability before expensive generation
  • For blog images, use 16:9; for profile images, use 1:1
  • Use grok-imagine-video-1.5 only with imagePath or imageUrl
  • Set generateAudio: true only when you need Kling 3 native audio; it raises the provider cost

Pricing Summary

All costs are per generation in USD cents.

Images:

ModelProviderCost per Image
grok-imagine-imagexAI2c
qwen-image-2.0Alibaba Cloud3.5c
flux-2-flexFAL.AI4c
grok-imagine-image-qualityxAI5c
gemini-3.1-flash-imageGoogle Gemini~7c
qwen-image-2.0-proAlibaba Cloud7.5c
wan2.7-image-proAlibaba Cloud7.5c
seedream-5-0-260128ByteDance ModelArk5c

Videos:

Model + DurationProviderCost
seedance 5sByteDance ModelArk10c
seedance 10sByteDance ModelArk20c
Kling 3 Pro, audio offFAL.AI11.2c/s
Kling 3 Pro, audio onFAL.AI16.8c/s
grok-imagine-video 5s at 720pxAI35c
grok-imagine-video-1.5 5s at 720pxAI71c including image input
wan2.7-i2v per secAlibaba Cloud~10c/s
happyhorse-1.0-i2v per secAlibaba Cloud~11.2c/s