Embeddings

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

Endpoint

Text
POST https://api.qubax.ai/v1/embeddings

All requests require an API key passed as a Bearer token in the Authorization header.

Models

embed-1 — a fast, inexpensive embedding model (3,072 dimensions). Billed per input token.

Parameters

ParameterTypeRequiredDescription
modelstringYesEmbedding model ID — embed-1
inputstring/arrayYesText to embed. Pass an array to embed many inputs in one request.
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"Usage: {response.usage.prompt_tokens} tokens")

cURL

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

Response

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

Ready to build?

400+ models through one OpenAI-compatible API, up to 99% below OpenRouter.

Get your API key →