API reference
Embeddings
POST /v1/embeddings — vector embeddings for search and RAG.
POST https://api.qubittron.ai/v1/embeddingsGenerate dense vector embeddings, OpenAI-compatible.
Authentication
Authorization: Bearer qbt_<key>
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
model | string | yes | Embedding model id |
input | string | string[] | yes | Single string or array (batch) |
encoding_format, dimensions, user | various | no | Passthrough |
Supported models
| Model | Dim | Context | Notes |
|---|---|---|---|
Qwen3-Embedding-8B | varies | 32K | High quality, larger |
bge-m3 | 1024 | 8K | Multilingual, strong default |
bge-multilingual-gemma2 | varies | 8K | Multilingual, Gemma2 base |
Examples
curl https://api.qubittron.ai/v1/embeddings \
-H "Authorization: Bearer $QUBITTRON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "bge-m3",
"input": "hello world"
}'import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.qubittron.ai/v1",
apiKey: process.env.QUBITTRON_API_KEY,
});
// Single
const single = await client.embeddings.create({
model: "bge-m3",
input: "hello world",
});
// Batch
const batch = await client.embeddings.create({
model: "bge-m3",
input: ["one", "two", "three"],
});
console.log(batch.data.map((d) => d.embedding.length));const res = await fetch("https://api.qubittron.ai/v1/embeddings", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.QUBITTRON_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ model: "bge-m3", input: "hello world" }),
});
const json = (await res.json()) as {
data: { object: "embedding"; embedding: number[]; index: number }[];
model: string;
usage: { prompt_tokens: number; total_tokens: number };
};
console.log(json.data[0].embedding.slice(0, 4));Response
{
"object": "list",
"data": [
{
"object": "embedding",
"embedding": [0.0123, -0.0456, ...],
"index": 0
}
],
"model": "bge-m3",
"usage": {
"prompt_tokens": 2,
"total_tokens": 2
}
}Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | Body failed validation |
| 400 | model_not_found | Model unknown or doesn't support embeddings |
| 401 | invalid_api_key | Missing/invalid Bearer token |
| 402 | insufficient_funds | Account credit exhausted |
| 429 | rate_limit_exceeded | Rate limit hit |
| 502 | upstream_error | Upstream model unreachable or 5xx |
Pricing
Metered per input token. Embedding endpoints have no output token cost.