Convert text into vector embeddings for semantic search, clustering, and classification. Compatible with the OpenAI Embeddings API.
POST /v1/embeddings| Parameter | Type | Required | Description |
|---|---|---|---|
| model | string | Yes | Embedding model ID (e.g. embed-1) |
| input | string/array | Yes | Text to embed |
| encoding_format | string | No | float or base64 (default float) |
from openai import OpenAI
client = OpenAI(
base_url="https://api.qubax.ai/v1",
api_key="qbx_live_..."
)
response = client.embeddings.create(
model="embed-1",
input="The quick brown fox jumps over the lazy dog"
)
vector = response.data[0].embedding
print(f"Dimensions: {len(vector)}")
print(f"First 5: {vector[:5]}")
curl https://api.qubax.ai/v1/embeddings \
-H "Authorization: Bearer *** \
-H "Content-Type: application/json" \
-d '{
"model": "embed-1",
"input": "The quick brown fox"
}'{
"data": [
{
"embedding": [0.0023, -0.0091, 0.0152, "..."],
"index": 0,
"object": "embedding"
}
],
"model": "embed-1",
"usage": {
"prompt_tokens": 8,
"total_tokens": 8
}
}