Embeddings & RAG
Gonka Broker serves a text embedding model through the standard OpenAI-compatible POST /v1/embeddings endpoint, with the same base URL and API key you use for chat models.
Embeddings turn text into numeric vectors that capture meaning. Store them in a vector database and you can search documents by semantic similarity: the retrieval step behind RAG (retrieval-augmented generation), semantic search, clustering, and recommendations.
The embeddings model
Section titled “The embeddings model”| Spec | Value |
|---|---|
| Model ID | BAAI/bge-m3 |
| Vector dimensions | 1024 (fixed) |
| Max input | 8,192 tokens per input |
| Languages | 100+, with cross-lingual retrieval |
BGE-M3 is BAAI’s open-source multilingual embedding model. Vectors are normalized, so cosine similarity works out of the box. See Supported Models for pricing.
Generate embeddings
Section titled “Generate embeddings”Replace YOUR_API_KEY with your actual key (starts with gnk-prx-). If you don’t have one yet, see Create an API Key.
curl https://proxy.gonkabroker.com/v1/embeddings \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "BAAI/bge-m3", "input": "Text to embed" }'from openai import OpenAI
client = OpenAI( api_key="YOUR_API_KEY", base_url="https://proxy.gonkabroker.com/v1",)
resp = client.embeddings.create( model="BAAI/bge-m3", input="Text to embed",)
print(resp.data[0].embedding)import OpenAI from "openai";
const client = new OpenAI({ apiKey: "YOUR_API_KEY", baseURL: "https://proxy.gonkabroker.com/v1",});
const resp = await client.embeddings.create({ model: "BAAI/bge-m3", input: "Text to embed",});
console.log(resp.data[0].embedding);The response follows the OpenAI embeddings format: a data array with one embedding vector per input, and a usage object with token counts.
Batch multiple texts
Section titled “Batch multiple texts”Pass an array of strings to embed several texts in one request; one vector comes back per input, in the same order:
{ "model": "BAAI/bge-m3", "input": ["First document chunk", "Second document chunk", "A search query"]}Each input can be up to 8,192 tokens; longer inputs return an error instead of being silently truncated, so chunk your documents before embedding. The request body is limited to 2 MiB.
Parameters and limits
Section titled “Parameters and limits”| Parameter | Supported |
|---|---|
model | Yes; must be an embedding model |
input | Yes; a string or a non-empty array of strings |
encoding_format | Yes; "float" (default) or "base64" |
dimensions | No; vectors are always 1024-dimensional |
See OpenAI API Compatibility for the full endpoint reference.
Billing
Section titled “Billing”Embeddings are billed on input tokens only; there are no output tokens. Usage is reported in the response’s usage.prompt_tokens, and your per-token rate is locked in when you top up, like every model on Gonka Broker. See Billing & Deposits.
Use with RAG frameworks
Section titled “Use with RAG frameworks”Any tool that accepts an OpenAI-compatible embeddings provider works with Gonka Broker: point it at https://proxy.gonkabroker.com/v1, use your API key, and set BAAI/bge-m3 as the embedding model. Connection guides for popular stacks: