Logo
Back to all models

Text Embedding 004 - In-Depth Overview

Google · Gemini

Current
Latest in family

Get all the details on Text Embedding 004, an AI model from Google. This page covers its token limits, pricing structure, key capabilities such as embedding, available API code samples, and performance strengths.

Key Metrics

Input Limit

3.1K tokens

Output Limit

No data tokens

Input Cost

N/A/1M

Output Cost

N/A/1M

Sample API Code

import google.generativeai as genai

genai.configure(api_key='YOUR_API_KEY')

def embed_text(text):
  model = genai.GenerativeModel('text-embedding-004')
  embedding = model.embed_content(text=text)
  return embedding

text_to_embed = "Hello, world!"
embedding_vector = embed_text(text_to_embed)
print(embedding_vector)

Required Libraries

google-generative-ai
@google/generative-ai

Notes

State-of-the-art text embedding model.

Capabilities

embedding

Supported Data Types

Input Types

text

Output Types

embedding

Strengths & Weaknesses

Good at

semantic similarity
text representation

Additional Information

Latest Update

May 13, 2025

Knowledge Cutoff

No data