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

  • 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

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
  • Compatibility Priority: Use text-embedding-ada-002, fully compatible with older versions

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).