# Gemini Embedding 2 - Core.Today AI API > Google's second-generation Gemini embedding model and the successor to gemini-embedding-001. Generates vector representations for semantic search, clustering, classification, and RAG at $0.20 per million text input tokens. - **Provider**: Google - **Model ID**: gemini-embedding-2 - **Category**: LLM - **Credits**: 0.4 per 1K tokens - **Speed**: Fast - **Quality**: High ## Model Specifications - **Context Window**: 8K tokens - **Max Output**: 0K tokens - **Training Cutoff**: 2025 - **Supported Formats**: text - **Compatible SDK**: OpenAI, Google AI ### Token Pricing (per 1M tokens) - **Input Tokens**: 371.6 credits ($0.25) - **Output Tokens**: 0 credits ($0.00) ## Features - Successor to gemini-embedding-001 (retiring 2028-05-14) - Matryoshka Representation Learning (MRL) for flexible dimensionality - Optimized for semantic search, clustering, classification, and RAG - Text input billed at $0.20 per 1M tokens; no output-token charge ## Use Cases - Semantic search - Document clustering - Similarity matching - Recommendation systems - RAG (Retrieval-Augmented Generation) ## API Endpoint Base URL: https://api.core.today Endpoint: POST /llm/gemini/v1beta/openai/embeddings ## Authentication Header: Authorization: Bearer YOUR_API_KEY Note: LLM endpoints use OpenAI-compatible format with Authorization Bearer token. ## Input Parameters ### Required - **input**: string | array - Text or array of texts to embed. - **model**: string (default: gemini-embedding-2) - Model identifier. ### Optional - **dimensions**: integer (default: 3072) - Output embedding dimensionality (MRL). Smaller values reduce storage and search cost; L2-normalize truncated vectors before cosine similarity. ## Examples ### Text Embedding Generate embeddings for semantic search ```json { "model": "gemini-embedding-2", "input": "What is the meaning of life?" } ``` ## Response Format ```json { "id": "chatcmpl-abc123", "object": "chat.completion", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Response text here" }, "finish_reason": "stop" } ], "usage": { "prompt_tokens": 100, "completion_tokens": 50, "total_tokens": 150 } } ``` ## Tips - Text input is billed at $0.20 per 1M tokens (371.6 credits/M); audio input is billed at $6.50 per 1M tokens. The OpenAI-compatible embeddings endpoint takes text input - Vectors are not compatible with gemini-embedding-001 - re-embed your whole corpus when you switch - Use a smaller `dimensions` value to cut vector storage and search cost - Batch multiple texts in a single request for efficiency ## Documentation https://ai.google.dev/gemini-api/docs/embeddings