[ ABORT TO HUD ]
SEQ. 1
SEQ. 2

The Embeddings API

🧲 Embeddings & Vector Search 12 min 200 BASE XP

Turning Text into Numbers

Embeddings are dense vector representations of text that capture semantic meaning. Two texts about the same topic will have similar embeddings, even if they use completely different words.

Available Models (2026)

ModelDimensionsMax TokensBest For
text-embedding-3-small1,5368,191Cost-effective, high-volume search
text-embedding-3-large3,0728,191Maximum accuracy, complex similarity
const embedding = await openai.embeddings.create({
  model: "text-embedding-3-small",
  input: "How do I reset my password?",
  dimensions: 1024  // Optional: reduce dimensions for efficiency
});
// Returns: { embedding: [0.0023, -0.0091, 0.0154, ...] }

Dimension Reduction

Both models support native dimension reduction. You can request fewer dimensions (e.g., 256, 512, 1024) to save storage and improve search speed with minimal accuracy loss.

Use Cases

  • Semantic Search: Find documents by meaning, not keywords
  • RAG: Retrieve relevant context for LLM prompts
  • Clustering: Group similar content automatically
  • Anomaly Detection: Find outliers in text datasets
  • Recommendations: "Users who liked X also liked Y"
💡 Pro Tip: Use text-embedding-3-small with 1,024 dimensions for 90% of use cases. Only upgrade to large when you need maximum precision for nuanced similarity tasks.
SYNAPSE VERIFICATION
QUERY 1 // 3
What is a text embedding?
A compressed version of text
A dense vector representation that captures semantic meaning
An encrypted string
A database index
Watch: 139x Rust Speedup
The Embeddings API | Embeddings & Vector Search — OpenAI Academy