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
| Action | Purpose |
|---|---|
generateImage | Text-to-image generation |
imageToVideo | Animate a static image into a video clip |
textToVideo | Generate a video from a text prompt |
generateMusic | Generate music with Gemini Lyria |
checkBalance | Check 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
| Parameter | Type | Default | Description |
|---|---|---|---|
prompt | string | required | Text description of the image to generate |
provider | string | auto | Provider override: modelark, alibaba, fal, xai, or gemini |
model | string | provider default | Exact model ID or supported alias (see Models below) |
aspectRatio | enum | 16:9 | 1:1, 16:9, 9:16, or the equivalent named alias |
outputPath | string | generated-image.png | File path, relative to the working directory or an absolute organization path |
Aspect Ratios
| Value | Use Case |
|---|---|
16:9 or landscape_16_9 | Blog covers, headers |
1:1 or square | Social media, thumbnails |
9:16 or portrait_9_16 | Mobile, stories |
Image Models
| Model | Provider | Cost | Best For |
|---|---|---|---|
gemini-3.1-flash-image | Google Gemini | ~7c | Fast 1K text-to-image generation |
fal-ai/flux-2-flex or flux-2-flex | FAL.AI | 4c | General purpose, prompt expansion |
grok-imagine-image | xAI | 2c | Fast, affordable creative images |
grok-imagine-image-quality | xAI | 5c | Higher quality 1K output |
qwen-image-2.0 | Alibaba Cloud | 3.5c | Versatile image generation via DashScope |
qwen-image-2.0-pro | Alibaba Cloud | 7.5c | Higher quality Qwen images |
wan2.7-image-pro | Alibaba Cloud | 7.5c | Wan 2.7 pro-quality images |
seedream-5-0-260128 | ByteDance ModelArk | 5c | Default 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
| Parameter | Type | Default | Description |
|---|---|---|---|
imagePath | string | --- | Path to the source image, relative to the working directory or an absolute organization path |
imageUrl | string | --- | Public URL of source image (alternative to imagePath) |
prompt | string | "" | Motion/style description |
provider | string | auto | Provider override: modelark, alibaba, fal, or xai |
model | string | provider default | Exact model ID or supported alias |
duration | number | provider default | Requested seconds; Kling 3 accepts 3–15 and xAI accepts up to 15 |
generateAudio | boolean | false | Enable Kling 3 native audio; changes FAL pricing |
outputPath | string | generated-video.mp4 | Output file path |
Video Models
| Model | Provider | Cost | Notes |
|---|---|---|---|
fal-ai/kling-video/v3/pro/image-to-video | FAL.AI | 11.2c/s without audio; 16.8c/s with audio | Current FAL image-to-video default |
fal-ai/kling-video/v3/pro/text-to-video | FAL.AI | 11.2c/s without audio; 16.8c/s with audio | Current FAL text-to-video default |
fal-ai/wan/v2.6/text-to-video or wan | FAL.AI | route estimate | Text-to-video compatibility route |
grok-imagine-video-1.5 | xAI | 1c image input + 14c/s at 720p | Image-to-video only |
grok-imagine-video | xAI | 7c/s at 720p | Text-to-video and compatibility image-to-video |
wan2.7-i2v | Alibaba Cloud | ~10c/s | Wan 2.7 image-to-video |
happyhorse-1.0-i2v | Alibaba Cloud | ~11.2c/s | HappyHorse image-to-video |
dreamina-seedance-2-0-260128 | ByteDance ModelArk | route estimate | Seedance 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
- Agent calls the tool --- the MCP server runs inside the computer service
- Policy pre-check --- verifies credentials, plan policy, quota, and estimated cost
- API call --- sends the request to Google Gemini, FAL.AI, xAI, Alibaba Cloud, or ByteDance ModelArk depending on the model
- File saved --- downloads the result and saves it at
outputPath - 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
outputPathwith a meaningful filename - Use
checkBalanceto confirm provider availability before expensive generation - For blog images, use
16:9; for profile images, use1:1 - Use
grok-imagine-video-1.5only withimagePathorimageUrl - Set
generateAudio: trueonly when you need Kling 3 native audio; it raises the provider cost
Pricing Summary
All costs are per generation in USD cents.
Images:
| Model | Provider | Cost per Image |
|---|---|---|
grok-imagine-image | xAI | 2c |
qwen-image-2.0 | Alibaba Cloud | 3.5c |
flux-2-flex | FAL.AI | 4c |
grok-imagine-image-quality | xAI | 5c |
gemini-3.1-flash-image | Google Gemini | ~7c |
qwen-image-2.0-pro | Alibaba Cloud | 7.5c |
wan2.7-image-pro | Alibaba Cloud | 7.5c |
seedream-5-0-260128 | ByteDance ModelArk | 5c |
Videos:
| Model + Duration | Provider | Cost |
|---|---|---|
seedance 5s | ByteDance ModelArk | 10c |
seedance 10s | ByteDance ModelArk | 20c |
| Kling 3 Pro, audio off | FAL.AI | 11.2c/s |
| Kling 3 Pro, audio on | FAL.AI | 16.8c/s |
grok-imagine-video 5s at 720p | xAI | 35c |
grok-imagine-video-1.5 5s at 720p | xAI | 71c including image input |
wan2.7-i2v per sec | Alibaba Cloud | ~10c/s |
happyhorse-1.0-i2v per sec | Alibaba Cloud | ~11.2c/s |