Skip to main content
APIYI provides industry-leading text embedding capabilities, using OpenAI’s Embedding models to convert text into high-dimensional vector representations. This is the core technology for building intelligent knowledge bases, semantic search, and RAG (Retrieval-Augmented Generation) systems, featuring ultra-high concurrency and extremely low cost.
Text Embedding Core Capabilities Convert text into numerical vectors, capture semantic information, and enable efficient semantic retrieval, similarity calculation, and intelligent recommendations.

Core Features

  • Two Model Families: the OpenAI text-embedding series plus the open-source multilingual bge-m3 (1024 dims, 8192 context, 100+ languages)
  • Ultra-High Concurrency: Supports large-scale concurrent requests, suitable for enterprise applications
  • Extremely Low Cost: Pay-as-you-go, prices as low as $0.01/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

Model Selection Guide:
  • High Precision Needs: Use text-embedding-3-large, suitable for professional knowledge bases, legal documents, etc.
  • General Scenarios: Recommend text-embedding-3-small, best cost-performance, suitable for most applications
  • Chinese-heavy knowledge bases: Recommend bge-m3. Same retrieval tier as text-embedding-3-small at half the unit price, and more than twice as token-efficient on Chinese (about 2.1 chars/token versus 0.9), so the same Chinese corpus costs roughly one fifth as much; 1024 dims also saves 33% storage against 1536
  • Compatibility Priority: Use text-embedding-ada-002, fully compatible with older versions
Score ranges differ sharply between models, so thresholds cannot be carried across models. Measured model comparisons, chunk sizing, threshold calibration, batching and concurrency are covered in Embedding Tuning in Practice.

Quick Start

1. Simplest Example - Using curl Command

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

  1. Choose the Right Model - Use text-embedding-3-small for general scenarios (cheapest)
  2. Batch Processing - Send requests in batches to reduce network overhead
  3. Caching Strategy - Use cache for repeated texts to avoid redundant computation
  4. Text Preprocessing - Remove useless information to reduce token consumption

Important Notes

  1. Text Length: Single text should not exceed model’s token limit (usually 8191 tokens)
  2. Batch Limit: Single request should not exceed 2048 texts
  3. Rate Limiting: Be aware of API rate limits, add delays if necessary
  4. Vector Storage: Choose appropriate vector database (e.g., Pinecone, Milvus, Weaviate)
  5. Similarity Calculation: Recommend using cosine similarity for best results
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).