Embeddings

Convert text into vector embeddings for semantic search, clustering, and classification. Compatible with the OpenAI Embeddings API.

Endpoint

HTTP
POST /v1/embeddings

Parameters

ParameterTypeRequiredDescription
modelstringYesEmbedding model ID (e.g. embed-1)
inputstring/arrayYesText to embed
encoding_formatstringNofloat or base64 (default float)

Python

Python
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

Shell
curl https://api.qubax.ai/v1/embeddings \
  -H "Authorization: Bearer *** \
  -H "Content-Type: application/json" \
  -d '{
    "model": "embed-1",
    "input": "The quick brown fox"
  }'

Response

JSON
{
  "data": [
    {
      "embedding": [0.0023, -0.0091, 0.0152, "..."],
      "index": 0,
      "object": "embedding"
    }
  ],
  "model": "embed-1",
  "usage": {
    "prompt_tokens": 8,
    "total_tokens": 8
  }
}
💡
Embeddings are great for semantic search, RAG (retrieval-augmented generation), and clustering. Compare similarity using cosine distance between vectors.