POST https://api.qhaigc.net/v1/embeddings
Supported Models
| Model ID | Dimensions | Max Tokens | Languages |
|---|---|---|---|
bge-m3 | 1024 | 8192 | 100+ languages |
text-embedding-3-large | 3072 | 8192 | Multilingual |
Request Parameters
The embedding model to use. Examples:
bge-m3, text-embedding-3-large.The text to embed. Pass a single string, or an array of strings to embed multiple texts in one request. Each string must be within the model’s token limit.
The format of the returned embeddings. Use
"float" (default) for an array of 32-bit floats, or "base64" for a base64-encoded string.Response Fields
Always
"list".Array of embedding objects, one per input string. Results are returned in the same order as the inputs.
The model that produced the embeddings.
Token usage for this request.
Code Examples
Batch embedding multiple texts
Example Response
Common Use Cases
Semantic search
Semantic search
Embed user queries and your document corpus. At query time, find documents whose embedding vectors are closest to the query vector using cosine similarity.
Retrieval-Augmented Generation (RAG)
Retrieval-Augmented Generation (RAG)
Build a RAG pipeline by embedding your knowledge base, storing vectors in a vector database, retrieving the top-k relevant chunks at query time, and passing them as context to a chat model.
Similarity matching and deduplication
Similarity matching and deduplication
Detect near-duplicate content or find semantically similar items in your dataset by comparing embedding vectors.
Classification and clustering
Classification and clustering
Use embeddings as features for downstream classifiers, or group semantically similar texts with k-means or hierarchical clustering.