Skip to main content

Embeddings

POST /v1/embeddings

Convert text into high-dimensional vector representations for semantic search, clustering, and classification. The examples use current recommended embedding IDs instead of older single-model defaults.

Endpoint

POST https://deepailab.ai/v1/embeddings

Request Example

curl https://deepailab.ai/v1/embeddings \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer $DEEPAILAB_API_KEY" \
 -d '{
 "model": "text-embedding-3-small",
 "input": [
 "DeepAILab provides a unified model gateway",
 "Vector retrieval is useful for RAG"
 ]
 }'

Request Parameters

ParameterTypeRequiredDescription
modelstring
Required
Embedding model ID
inputstring | array
Required
Text to embed, can be string or array of strings

Response Example

{
 "object": "list",
 "data": [
 {
 "object": "embedding",
 "index": 0,
 "embedding": [
 0.0023064255,
 -0.009327292,
 0.015797347,
 // ... 1536-dimensional vector
 ]
 }
 ],
 "model": "text-embedding-3-small",
 "usage": {
 "prompt_tokens": 12,
 "total_tokens": 12
 }
}

Supported Embedding Models

text-embedding-3-small
OpenAI-compatible
1536 dimensions Recommended default for most workloads
text-embedding-3-large
OpenAI-compatible
3072 dimensions Higher quality for more demanding semantic tasks
text-embedding-ada-002
Legacy compatibility
1536 dimensions Retained for compatibility with older integrations

For the current live model list and capability metadata, query /v1/models/catalog.

Common Use Cases

Semantic Search
Match documents by meaning, not just keywords
RAG Retrieval
Provide relevant context for LLMs
Text Clustering
Automatically group similar texts