SheetMagicSheetMagic
Function Reference

AI Media Functions

Generate images, audio, and video with AIIMAGE, AISPEECH, AIVIDEO, and GPTV functions

Overview

SheetMagic provides powerful AI media generation functions for creating images, audio, and video content directly in Google Sheets. These functions support multiple AI providers and models.

AIIMAGE

Generate images with AI using text descriptions.

Syntax

=AIIMAGE(prompt, [context])

Parameters

ParameterTypeRequiredDescription
promptstringYesImage description or creative prompt
contextstringNoCell reference or additional context

Returns

A clickable URL link to the generated image.

Examples

Basic image generation:

=AIIMAGE("A professional photo of a modern coffee shop interior")

Product image:

=AIIMAGE("Product photo of " & A1 & " on a white background, studio lighting")

Marketing asset:

=AIIMAGE("Social media banner for " & A1 & ", modern minimalist design, " & B1 & " color scheme")

Supported Models

ProviderModels
OpenAIDALL-E 3, DALL-E 2, GPT Image 1
Google GeminiImagen 4 Ultra, Imagen 4, Imagen 4 Fast, Gemini 2.5 Flash Image
OpenRouterGemini 3 Pro Image, Gemini 2.5 Flash Image, GPT-5 Image
StraicoDALL-E 3, Flux 1.1, Ideogram V3, Recraft V3, and more

Use Cases

  • Product photography
  • Marketing banners
  • Social media graphics
  • Blog post images
  • Concept visualization
  • Logo concepts

GPTV

Analyze any image using AI vision capabilities.

Syntax

=GPTV(imageUrl, [prompt])

Parameters

ParameterTypeRequiredDescription
imageUrlstringYesURL of the image to analyze
promptstringNoQuestion or instruction about what to analyze. Default: "Analyze this image"

Returns

AI's analysis and description of the image.

Examples

Basic image analysis:

=GPTV("https://example.com/product.jpg")

With specific question:

=GPTV(A1, "Describe this product image in detail")

Extract text from image:

=GPTV(A1, "Extract all text visible in this image")

Product cataloging:

=GPTV(A1, "List all products visible in this image with estimated prices")

Quality assessment:

=GPTV(A1, "Rate the quality of this product photo and suggest improvements")

Requirements

GPTV requires OpenAI provider with GPT-4o or GPT-4o-mini model. Vision capabilities are not available with other providers.

Use Cases

  • Image cataloging
  • Product analysis
  • OCR (text extraction)
  • Quality assessment
  • Content moderation
  • Visual search

AISPEECH

Generate speech audio from text using AI.

Syntax

=AISPEECH(text, [voice])

Parameters

ParameterTypeRequiredDescription
textstringYesText to convert to speech
voicestringNoVoice selection (default: "alloy")

Available Voices

VoiceDescription
alloyNeutral, balanced voice (default)
ashWarm, conversational
balladExpressive, dramatic
coralClear, professional
echoSoft, calm
fableStorytelling, animated
onyxDeep, authoritative
novaFriendly, upbeat
sageWise, measured
shimmerLight, energetic
versePoetic, rhythmic

Returns

A URL link to the generated audio file.

Examples

Basic text-to-speech:

=AISPEECH("Welcome to our product demo")

With voice selection:

=AISPEECH(A1, "nova")

Professional narration:

=AISPEECH(A1, "onyx")

Requirements

AISPEECH requires OpenAI provider only. Text-to-speech is not available with other providers.

Use Cases

  • Product demo narration
  • Audio content creation
  • Podcast snippets
  • Voice-over generation
  • Accessibility content

AIVIDEO

Generate videos from text descriptions using AI.

Syntax

=AIVIDEO(prompt, [context])

Parameters

ParameterTypeRequiredDescription
promptstringYesVideo description or creative prompt
contextstringNoCell reference or additional context

Returns

A URL link to the generated video file.

Examples

Basic video generation:

=AIVIDEO("A coffee cup on a table with steam rising, cinematic lighting")

Product showcase:

=AIVIDEO("Product showcase of " & A1 & ", rotating 360 degrees on white background")

Marketing video:

=AIVIDEO("Modern office environment, people collaborating, upbeat mood")

Supported Models

ProviderModels
OpenAISora 2 Pro, Sora 2
Google GeminiVeo 3, Veo 3 Fast
StraicoGoogle Veo 2, Runway Gen 4 Turbo, Kling 2.1

Use Cases

  • Product demos
  • Marketing videos
  • Social media content
  • Concept visualization
  • Animated graphics

Best Practices

Image Generation Tips

  1. Be descriptive: Include details about style, lighting, composition
  2. Specify format: Mention "photo", "illustration", "3D render", etc.
  3. Include context: Background, mood, color scheme
=AIIMAGE("Professional product photo of " & A1 & ", white background, soft studio lighting, high resolution, e-commerce style")

Vision Analysis Tips

  1. Use specific questions: Ask exactly what you want to know
  2. Batch processing: Analyze multiple images by referencing a column
  3. Structured output: Request specific formats like lists or JSON
=GPTV(A1, "Return JSON with: product_name, color, estimated_price, condition")

Audio Generation Tips

  1. Match voice to content: Professional content → onyx/coral, friendly → nova/alloy
  2. Keep text concise: Shorter clips have better quality
  3. Punctuation matters: Use periods and commas for natural pauses

Provider Comparison

FeatureOpenAIGeminiOpenRouterStraico
Image GenerationDALL-E 3, GPT ImageImagen 4MultipleMultiple
Vision AnalysisGPT-4o---
Text-to-Speech11 voices--ElevenLabs
Video GenerationSora 2Veo 3-Multiple

Error Handling

Common errors and solutions:

ErrorCauseSolution
#ERROR!Invalid API keyVerify your API key in settings
#UNSUPPORTED!Feature not availableSwitch to a provider that supports the feature
#LIMIT!Rate limit or quotaWait and retry, or check API usage
#INVALID_URL!Image URL not accessibleEnsure image URL is publicly accessible