Inference APIs
Models/Embedding/BGE-M3
EmbeddingsMultilingual1,024 dimensions8K input
Max input
8K tokens
Dimensions
1,024
Modality
Text → Vector
Price
$0.02 / 1M input tokens
Model ID
BAAI/bge-m3

Quickstart

You need an API key to call this model. Create a free account or log in.

Set INFERENCE_API_KEY to your key from the API Keys page, then run:

curl https://api.inferenceapis.com/v1/embeddings \
  -H "Authorization: Bearer $INFERENCE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "BAAI/bge-m3",
    "input": ["The cat sat on the mat.", "Le chat est sur le tapis."]
  }'
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://api.inferenceapis.com/v1",
    api_key=os.environ["INFERENCE_API_KEY"],
)

resp = client.embeddings.create(
    model="BAAI/bge-m3",
    input=["The cat sat on the mat.", "Le chat est sur le tapis."],
)
vectors = [d.embedding for d in resp.data]
print(len(vectors), len(vectors[0]), resp.usage.total_tokens)
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api.inferenceapis.com/v1",
  apiKey: process.env.INFERENCE_API_KEY,
});

const resp = await client.embeddings.create({
  model: "BAAI/bge-m3",
  input: ["The cat sat on the mat.", "Le chat est sur le tapis."],
});
console.log(resp.data.length, resp.data[0].embedding.length, resp.usage.total_tokens);

When to use it

A good fit when
  • Multilingual search and RAG: one model for more than 100 languages
  • You want an open-weight embedding model, so your vectors never depend on one vendor keeping a model alive
Look elsewhere when
  • You need vectors shorter or longer than 1,024 dimensions

What it costs in practice

WorkloadCost
Index 10,000 documents of 500 tokens$0.10
Index 1 million documents of 500 tokens$10.00
1 million search queries of 20 tokens$0.40

Computed from the live rate below. There is no subscription or minimum; new accounts start with free credit.

Endpoint

POST https://api.inferenceapis.com/v1/embeddings
Headers Authorization: Bearer $INFERENCE_API_KEY
Content-Type: application/json
Compatible OpenAI wire format. /openai/v1/… is accepted too, so Groq-style base URLs work with only the host changed.

Model IDs and aliases

Send any of these as model; they all resolve to this model and bill at its rate.

IDNote
BAAI/bge-m3Canonical
bge-m3Alias

Request body

ParameterTypeDescription
model required string Model ID: BAAI/bge-m3 — also accepted: bge-m3
input required string | array One text or an array of up to 2,048 texts. Each text can be up to 8K tokens.
dimensions integer Not supported by this model; vectors are always 1,024 dimensions.
encoding_format string float (default) or base64.

Response

200 OK · application/json
{
  "object": "list",
  "model": "BAAI/bge-m3",
  "data": [
    { "object": "embedding", "index": 0, "embedding": [0.0123, -0.0456, ...] },
    { "object": "embedding", "index": 1, "embedding": [0.0119, -0.0431, ...] }
  ],
  "usage": { "prompt_tokens": 17, "total_tokens": 17 }
}

Pricing

Price$0.02 / 1M input tokens
BillingPay as you go from prepaid credits. No subscription, no daily request or token cap. See all pricing.

Notes

  • Vectors from different embedding models are not comparable. Switching models means re-embedding your corpus, which is the reason to pick an open-weight model you can always run somewhere.
  • There is no per-minute or per-day cap, so bulk indexing jobs are not throttled by a quota; usage draws on your prepaid balance.

Errors

Errors use the OpenAI envelope: {"error": {"message", "type", "code"}}. 401 missing or invalid key · 402 insufficient_balance · 404 model_not_found · 503 model_unavailable · 502 backend error, safe to retry. Full table with what to retry: API documentation. Errors from other providers: provider error reference.