Embeddings
kenari provides an embeddings endpoint compatible with OpenAI Embeddings. This endpoint only serves models marked as embedding models in the catalog. Calling it with an ordinary chat model returns status 400.
Available models
Section titled “Available models”The list of embedding models is dynamic. Do not hardcode an id from this page: call GET /v1/models?modality=embedding (public, no key) to read the ids that are currently active. A bare GET /v1/models lists chat models only, so embedding, rerank, and moderation models do not appear there.
As of 29 July 2026 the public catalog shows bge-m3 and qwen3-embedding-0.6b as active embedding models. The examples below use bge-m3. If that id is no longer sold, swap in one returned by ?modality=embedding.
Endpoint
Section titled “Endpoint”POST /v1/embeddings
Send input and model, and the gateway returns an embedding vector for each input text.
Request parameters
Section titled “Request parameters”| Field | Type | Required | Description |
|---|---|---|---|
model | string | yes | Embedding model id from the catalog. |
input | string or array of strings | yes | A single text, or several texts at once in one array. |
Billing
Section titled “Billing”Billing is calculated per input token, from the total character count across input (roughly four characters per token, rounded up), then deducted from the Rupiah balance. Cost is computed before the request is forwarded to the provider, since some embedding providers do not report the token count they actually used. See Billing for balance and deduction details.
Response shape
Section titled “Response shape”The response follows the OpenAI Embeddings shape: object is "list", model echoes the model id you requested (never the provider’s internal name), and the data array holds one entry per input with index and embedding (an array of numbers).
{ "object": "list", "model": "bge-m3", "data": [ { "object": "embedding", "index": 0, "embedding": [0.0123, -0.0456] } ]}Examples
Section titled “Examples”curl https://kenari.id/v1/embeddings \ -H "Authorization: Bearer kn-..." \ -H "Content-Type: application/json" \ -d '{"model":"bge-m3","input":"a cat sitting on a rug"}'Python (OpenAI SDK)
Section titled “Python (OpenAI SDK)”from openai import OpenAI
client = OpenAI( base_url="https://kenari.id/v1", api_key="kn-...",)
result = client.embeddings.create( model="bge-m3", input="a cat sitting on a rug",)
print(result.data[0].embedding[:5])JavaScript (OpenAI SDK)
Section titled “JavaScript (OpenAI SDK)”import OpenAI from "openai";
const client = new OpenAI({ baseURL: "https://kenari.id/v1", apiKey: "kn-...",});
const result = await client.embeddings.create({ model: "bge-m3", input: "a cat sitting on a rug",});
console.log(result.data[0].embedding.slice(0, 5));