Embeddings
Generate vector representations of text for search, retrieval, recommendation, clustering, and other tasks.
Request
POST /embeddings
Request Body
{
"model": "text-embedding-3-small",
"input": ["Hello", "Welcome to Qiyiguo AI, a unified API for multiple model providers."]
}
Response
Response Example
{
"data": [
{ "index": 0, "embedding": [0.06, 0.03, 0.08] },
{ "index": 1, "embedding": [0.09, 0.10, 0.20] }
],
"model": "text-embedding-3-small",
"usage": {
"prompt_tokens": 6,
"total_tokens": 6
}
}
Best Practices
- Use consistent tokenization and text normalization strategies
- Choose a vector store that supports cosine or dot-product similarity
- Manage embedding versions and dimensions to avoid mixing them in production