Text Embedding Core Capabilities
Convert text into numerical vectors, capture semantic information, and enable efficient semantic retrieval, similarity calculation, and intelligent recommendations.
Core Features
- OpenAI Top Models: text-embedding-3-large, text-embedding-3-small, text-embedding-ada-002
- Ultra-High Concurrency: Supports large-scale concurrent requests, suitable for enterprise applications
- Extremely Low Cost: Pay-as-you-go, prices as low as $0.02/million tokens
- Easy to Use: Compatible with OpenAI API format, seamless integration
- High-Quality Vectors: Captures deep semantics with high retrieval accuracy
Supported Embedding Models
Quick Start
1. Simplest Example - Using curl Command
View Response Example
View Response Example
2. Basic Example - Using OpenAI SDK
3. Batch Text Vectorization
4. Using requests Library
Typical Use Cases
1. Semantic Search Engine
2. Building a Vector Database
3. RAG System
Best Practices
1. Text Preprocessing
2. Caching Mechanism
3. Error Handling and Retry
Performance Comparison
Cost Optimization Recommendations
- Choose the Right Model - Use text-embedding-3-small for general scenarios (cheapest)
- Batch Processing - Send requests in batches to reduce network overhead
- Caching Strategy - Use cache for repeated texts to avoid redundant computation
- Text Preprocessing - Remove useless information to reduce token consumption
Important Notes
- Text Length: Single text should not exceed model’s token limit (usually 8191 tokens)
- Batch Limit: Single request should not exceed 2048 texts
- Rate Limiting: Be aware of API rate limits, add delays if necessary
- Vector Storage: Choose appropriate vector database (e.g., Pinecone, Milvus, Weaviate)
- Similarity Calculation: Recommend using cosine similarity for best results
Related Resources
Pro Tip: Embedding is the foundational capability for building intelligent applications. Recommend starting with text-embedding-3-small, which achieves the best balance between performance and cost. For enterprise applications, recommend using it with professional vector databases (e.g., Pinecone, Milvus).