Skip to content

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.

SpecValue
Model IDBAAI/bge-m3
Vector dimensions1024 (fixed)
Max input8,192 tokens per input
Languages100+, 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.

Replace YOUR_API_KEY with your actual key (starts with gnk-prx-). If you don’t have one yet, see Create an API Key.

Terminal window
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"
}'

The response follows the OpenAI embeddings format: a data array with one embedding vector per input, and a usage object with token counts.

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.

ParameterSupported
modelYes; must be an embedding model
inputYes; a string or a non-empty array of strings
encoding_formatYes; "float" (default) or "base64"
dimensionsNo; vectors are always 1024-dimensional

See OpenAI API Compatibility for the full endpoint reference.

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.

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: