google · Google AI Docs
Gemini API Embeddings
An overview of how to generate vector representations of text using the Gemini API to enable semantic search and similarity tasks.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Gemini API Embeddings
An overview of how to generate vector representations of text using the Gemini API to enable semantic search and similarity tasks.
When To Use
Use when you need to convert text into numerical vectors for semantic search, clustering, or similarity comparisons within an application.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/gemini-api-embeddings-workflow-guide.md | A guide explaining how to generate embeddings for text, images, and video using the Gemini API. | Questions about a guide explaining how to generate embeddings for text, images, and video using the Gemini API. |
examples/gemini-api-embeddings-python-embedcontent.text | A Python code example demonstrating how to use the genai client to generate embeddings for text content using the gemini-embedding-2 model. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the genai client to generate embeddings for text content using the gem... |
examples/gemini-api-embeddings-nodejs-embed.text | A Node.js code example demonstrating how to use the GoogleGenAI SDK to generate content embeddings using the gemini-embedding-2 model. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to use the GoogleGenAI SDK to generate content embeddings using the gemini-e... |
examples/gemini-api-embeddings-golang-embedcontent.text | A Go program demonstrating how to use the genai client to generate content embeddings for a text string. | Exact payloads, commands, or snippets shown in A Go program demonstrating how to use the genai client to generate content embeddings for a text string. |
examples/gemini-api-embeddings-curl-request.text | A curl command demonstrating how to send a POST request to the gemini-embedding-2 model endpoint to generate text embeddings. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to send a POST request to the gemini-embedding-2 model endpoint to generate text emb... |
examples/gemini-api-embeddings-python-query-preparation.text | Python code demonstrating how to format task-specific query strings for generating embeddings. | Exact payloads, commands, or snippets shown in Python code demonstrating how to format task-specific query strings for generating embeddings. |
examples/gemini-api-embeddings-python-query-document-preparation.text | A Python function demonstrating how to format text content with specific task prefixes for embedding generation. | Exact payloads, commands, or snippets shown in A Python function demonstrating how to format text content with specific task prefixes for embedding generation. |
examples/gemini-api-embeddings-python-embedcontent-2.text | A Python code example demonstrating how to use the genai client to generate embeddings for multiple text strings using the embedcontent method. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the genai client to generate embeddings for multiple text strings usin... |
examples/gemini-api-embeddings-nodejs-semantic-similarity.text | A Node.js code example demonstrating how to generate text embeddings using the Gemini API with a semantic similarity task type. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to generate text embeddings using the Gemini API with a semantic similarity... |
examples/gemini-api-embeddings-golang-cosine-similarity.text | A Go implementation demonstrating how to calculate cosine similarity between two embedding vectors. | Exact payloads, commands, or snippets shown in A Go implementation demonstrating how to calculate cosine similarity between two embedding vectors. |
examples/gemini-api-embeddings-curl-embedcontent-request.text | A curl command demonstrating how to call the embedContent endpoint using the gemini-embedding-001 model with a SEMANTIC_SIMILARITY task type. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to call the embedContent endpoint using the gemini-embedding-001 model with a SEMANT... |
examples/gemini-api-embeddings-python-embedcontent-3.text | A Python code example demonstrating how to use the genai client to generate content embeddings with a specified output dimensionality. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the genai client to generate content embeddings with a specified outpu... |
examples/gemini-api-embeddings-nodejs-embed-2.text | A Node.js code example demonstrating how to generate content embeddings using the GoogleGenAI SDK with a specified output dimensionality. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to generate content embeddings using the GoogleGenAI SDK with a specified ou... |
examples/gemini-api-embeddings-golang.text | A Go program demonstrating how to initialize a GenAI client and generate text embeddings using the Gemini API. | Exact payloads, commands, or snippets shown in A Go program demonstrating how to initialize a GenAI client and generate text embeddings using the Gemini API. |
examples/gemini-api-embeddings-curl-request-2.text | A curl command demonstrating how to send a POST request to the gemini-embedding-2 model to generate text embeddings. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to send a POST request to the gemini-embedding-2 model to generate text embeddings. |
examples/gemini-api-embeddings.text | A text representation of a sample embedding response showing the vector length of 768. | Exact payloads, commands, or snippets shown in A text representation of a sample embedding response showing the vector length of 768. |
examples/gemini-api-embeddings-numpy-normalization.text | A Python code snippet demonstrating how to normalize Gemini API embedding vectors using NumPy. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to normalize Gemini API embedding vectors using NumPy. |
examples/gemini-api-embeddings-normed-length.text | A text example demonstrating the normed embedding length and norm values for Gemini API embeddings. | Exact payloads, commands, or snippets shown in A text example demonstrating the normed embedding length and norm values for Gemini API embeddings. |
examples/gemini-api-embeddings-python-multimodal-embedcontent.text | A Python code example demonstrating how to use the Gemini API to generate embeddings for image data using the genai client. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the Gemini API to generate embeddings for image data using the genai c... |
examples/gemini-api-embeddings-nodejs-multimodal-image-embedding.text | A Node.js code example demonstrating how to generate embeddings for an image using the Gemini API. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to generate embeddings for an image using the Gemini API. |
examples/gemini-api-embeddings-multimodal-curl-request.text | A curl command demonstrating how to send a base64 encoded image to the gemini-embedding-2 model for multimodal embedding generation. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to send a base64 encoded image to the gemini-embedding-2 model for multimodal embedd... |
examples/gemini-api-embeddings-python-multimodal-embedcontent-2.text | A Python code example demonstrating how to use the genai client to generate embeddings for both text and image content using the gemini-embedding-2 model. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the genai client to generate embeddings for both text and image conten... |
examples/gemini-api-embeddings-nodejs-multimodal.text | A Node.js code example demonstrating how to generate embeddings for both text and image data using the Gemini API. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to generate embeddings for both text and image data using the Gemini API. |
examples/gemini-api-embeddings-curl-multimodal-request.text | A curl command demonstrating how to send a multimodal request containing both text and base64 encoded image data to the Gemini embedding model. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to send a multimodal request containing both text and base64 encoded image data to t... |
examples/gemini-api-embeddings-python-multimodal-embedcontent-3.text | A Python code example demonstrating how to use the Gemini API to generate embeddings for both text and image content using the genai client. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the Gemini API to generate embeddings for both text and image content... |
examples/gemini-api-embeddings-multimodal-nodejs.text | A Node.js code example demonstrating how to generate embeddings for both text and image data using the Gemini API. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to generate embeddings for both text and image data using the Gemini API. |
examples/gemini-api-embeddings-gemini-api-batch-embed-contents-curl.text | A curl command demonstrating how to send a batch request to the gemini-embedding-2 model using the batchEmbedContents endpoint. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to send a batch request to the gemini-embedding-2 model using the batchEmbedContents... |
examples/gemini-api-embeddings-python-audio-embedcontent.text | A Python code example demonstrating how to use the Gemini API to generate embeddings from an audio file using the embedcontent method. | Exact payloads, commands, or snippets shown in A Python code example demonstrating how to use the Gemini API to generate embeddings from an audio file using the emb... |
examples/gemini-api-embeddings-nodejs-audio-embed.text | A Node.js code example demonstrating how to generate embeddings for audio data using the GoogleGenAI SDK. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to generate embeddings for audio data using the GoogleGenAI SDK. |
examples/gemini-api-embeddings-audio-curl-request.text | A curl command demonstrating how to generate embeddings for audio data using the Gemini API. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to generate embeddings for audio data using the Gemini API. |
examples/gemini-api-embeddings-gemini-api-python-embedcontent-video.text | A Python code snippet demonstrating how to use the Gemini API to generate embeddings from video file bytes using the genai client. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to use the Gemini API to generate embeddings from video file bytes using the... |
examples/gemini-api-embeddings-nodejs-video.text | A Node.js code example demonstrating how to generate embeddings for video content using the GoogleGenAI SDK. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to generate embeddings for video content using the GoogleGenAI SDK. |
examples/gemini-api-embeddings-video-embedcontent-curl.text | A curl command demonstrating how to generate embeddings for a video file using the gemini-embedding-2 model. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to generate embeddings for a video file using the gemini-embedding-2 model. |
examples/gemini-api-embeddings-gemini-api-python-embedcontent-pdf.text | A Python code snippet demonstrating how to use the Gemini API to generate embeddings from a PDF file using the genai client. | Exact payloads, commands, or snippets shown in A Python code snippet demonstrating how to use the Gemini API to generate embeddings from a PDF file using the genai... |
examples/gemini-api-embeddings-nodejs-pdf-embedding.text | A Node.js code example demonstrating how to generate embeddings from a base64 encoded PDF file using the GoogleGenAI SDK. | Exact payloads, commands, or snippets shown in A Node.js code example demonstrating how to generate embeddings from a base64 encoded PDF file using the GoogleGenAI... |
examples/gemini-api-embeddings-pdf-curl-request.text | A curl command demonstrating how to generate embeddings for a PDF file using the Gemini API. | Exact payloads, commands, or snippets shown in A curl command demonstrating how to generate embeddings for a PDF file using the Gemini API. |
What This Skill Covers
- The Gemini API offers embedding models to generate embeddings for text, images, video, and other content. These resulting embeddings can then be used for tas...
- Main sections:
Generating embeddings,Python,JavaScript,Go,REST.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://ai.google.dev/gemini-api/docs/embeddings
