generate_content
Generate content from text, files, or web search using Gemini. Supports code execution and multiple file types for versatile AI-powered tasks.
Instructions
Generate content using Gemini with optional file inputs, code execution, and Google search. Supports multiple files: images (JPG, PNG, GIF, WebP, SVG, BMP, TIFF), video (MP4, AVI, MOV, WebM, FLV, MPG, WMV), audio (MP3, WAV, AIFF, AAC, OGG, FLAC), documents (PDF), and text files (TXT, MD, JSON, XML, CSV, HTML). MIME type is auto-detected from file extension.
Example usage:
{
"user_prompt": "Analyze this video",
"files": [{"path": "/path/to/video.mp4"}]
}PDF to Markdown conversion:
{
"user_prompt": "Convert this PDF to well-formatted Markdown",
"files": [{"path": "/document.pdf"}]
}With Google Search:
{
"user_prompt": "What are the latest AI breakthroughs in 2024?",
"enable_google_search": true
}With Code Execution:
{
"user_prompt": "Write and run a Python script to calculate prime numbers",
"enable_code_execution": true
}Media Resolution Optimization (save tokens):
{
"user_prompt": "Describe this image",
"files": [{"path": "/image.jpg"}],
"media_resolution": "LOW"
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | No | Array of files to include in generation (optional) | |
| model | No | Gemini model to use. Choose from these Gemini 3.x models ONLY: - "gemini-3.5-flash" DEFAULT — best price/perf, fast. Pick this 99% of the time (including video, audio, image, PDF). - "gemini-3.1-pro-preview-thinking" Slow + expensive. ONLY use when you need deep reasoning / a non-trivial `thinking_budget`. - "gemini-3-flash-preview" Cheapest + dumbest. ONLY for high-volume simple classification / extraction. NEVER pass legacy Gemini 2.x ids (gemini-2.5-pro, gemini-2.5-flash, gemini-pro, gemini-flash). They are DEPRECATED for this server. If omitted, the server falls back to the env-configured default (typically "gemini-3.5-flash"). | gemini-3.5-flash |
| temperature | No | Temperature (0-2) | |
| user_prompt | Yes | User prompt for generation | |
| system_prompt | No | System prompt to guide the AI behavior (optional) | |
| thinking_budget | No | Thinking budget for supported models (-1 for unlimited) | |
| media_resolution | No | Media resolution: LOW (saves tokens), MEDIUM, HIGH | MEDIUM |
| enable_google_search | No | Enable Google search capability | |
| enable_code_execution | No | Enable code execution capability |