Built by Metorial, the integration platform for agentic AI.
Update the TTL or expiration time of existing cached content. Use this to extend or shorten the lifetime of a cache entry.
Create cached content to save and reuse precomputed input tokens. Caching is useful when repeatedly prompting with the same large context (e.g., a long document or system instructions). Cached content can be referenced in subsequent generation requests for cost and latency savings.
Get metadata for a file previously uploaded to the Gemini File API. Returns file details including processing state, size, MIME type, and expiration time.
Generate text using Gemini models with multimodal input support. Supports single-turn and multi-turn conversations with text, images, audio, video, and document inputs. Configure generation parameters, safety settings, system instructions, JSON output mode, and function calling.
Delete a file previously uploaded to the Gemini File API. The file will no longer be available for use in generation requests.
Get metadata for a specific Gemini model, including supported generation methods, token limits, version, and generation defaults. Use this before invoking a model-specific capability such as text generation, embeddings, or token counting.
Generate or edit images using Gemini's native image generation capabilities or Imagen models. Supports text-to-image generation and image editing with text prompts. Returns generated images as base64-encoded data.
Delete a cached content entry. The cached content will no longer be available for use in generation requests.
List available Gemini models and their capabilities. Returns model names, supported generation methods, token limits, and other metadata. Use this to discover which models are available and their specifications.
List all cached content entries. Returns cached content metadata including model association, creation time, and expiration.
Upload a text, image, audio, video, or document file to the Gemini File API for reuse in generation requests. Returns the file URI needed for fileData parts in Generate Text and cached content workflows.
Generate vector embeddings for text content using Gemini embedding models. Supports single and batch embedding generation with configurable task type and dimensionality. Useful for semantic search, classification, and clustering.
List files previously uploaded to the Gemini File API. Files are stored for 48 hours and can be referenced in generation requests by their URI.
Get metadata for a cached content entry. The API returns cache metadata such as model, display name, token usage, and expiration, but not the original cached content body.
Count the number of tokens in text content for a specific Gemini model. Useful for estimating costs and ensuring prompts fit within model token limits before sending generation requests.