Embeddings
Convert text into vector representations for semantic search, clustering, classification, and other use cases.
Endpoint
POST https://api.ofox.ai/v1/embeddingsRequest Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | ✅ | Embedding model, e.g. openai/text-embedding-3-small |
input | string | string[] | ✅ | Text to embed (single or batch) |
encoding_format | string | — | Output format: float (default) or base64 |
dimensions | number | — | Output vector dimensions (supported by some models) |
Request Examples
cURL
Terminal
curl https://api.ofox.ai/v1/embeddings \
-H "Authorization: Bearer $OFOX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/text-embedding-3-small",
"input": "OfoxAI is an LLM Gateway"
}'Response Format
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [0.0023, -0.0091, 0.0156, ...]
}
],
"model": "openai/text-embedding-3-small",
"usage": {
"prompt_tokens": 8,
"total_tokens": 8
}
}Available Models
| Model | Dimensions | Description |
|---|---|---|
openai/text-embedding-3-small | 1536 | Cost-effective |
openai/text-embedding-3-large | 3072 | Highest accuracy |
bailian/text-embedding-v4 | 1024 | Optimized for Chinese, Qwen embedding model |
Last updated on