models/BAAI/Bge-Reranker-Base
BAAI

Bge-Reranker-Base

rerank
Compare

Different from embedding model, reranker uses question and document as input and directly output similarity instead of embedding. You can get a relevance score by inputting query and passage to the reranker. And the score can be mapped to a float value in [0,1] by sigmoid function.

MODALITIES
embedding
RELEASED
2025-02-14

Bge-Reranker-Base (baai/bge-reranker-base) is a rerank model from BAAI, released 2025-02-14. Context window: — tokens; max output —. Pricing via AIgateway: $0.0000 per request. Call it via https://api.aigateway.sh/v1/rerank — set model="baai/bge-reranker-base".

model · baai/bge-reranker-basefamily · BGE

Use this model

model: baai/bge-reranker-base
curl https://api.aigateway.sh/v1/rerank \
  -H "Authorization: Bearer $AIGATEWAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"baai/bge-reranker-base","query":"weather","documents":["sun is bright","mars is red"]}'

Capabilities

Strengths

  • High-precision result ordering
  • Cross-encoder quality

Pricing

Per request$0.0000
You pay pass-through pricing.
See API example →CompareAPI referenceSee usage ranking →

Collections

More embedding models →More from BAAI →Frontier models →Free-tier models →
API schema

Call Bge-Reranker-Base from any OpenAI SDK

POST https://api.aigateway.sh/v1/rerank·Content-Type: application/json·Auth: Bearer sk-aig-...

Request body

json
{
  "model": "baai/bge-reranker-base",
  "query": "What is the capital of France?",
  "documents": [
    "Paris is the capital of France.",
    "Berlin is the capital of Germany.",
    "The Eiffel Tower is in Paris."
  ],
  "top_n": 3
}

Response

json
{
  "model": "baai/bge-reranker-base",
  "results": [
    { "index": 0, "document": "Paris is the capital of France.", "score": 0.98 },
    { "index": 2, "document": "The Eiffel Tower is in Paris.", "score": 0.71 },
    { "index": 1, "document": "Berlin is the capital of Germany.", "score": 0.04 }
  ]
}

Quickstart

import os, requests

r = requests.post(
    "https://api.aigateway.sh/v1/rerank",
    headers={"Authorization": f"Bearer {os.environ['AIGATEWAY_API_KEY']}"},
    json={
        "model": "baai/bge-reranker-base",
        "query": "What is the capital of France?",
        "documents": [
            "Paris is the capital of France.",
            "Berlin is the capital of Germany."
        ]
    },
)
print(r.json())

Errors

401authentication_errorInvalid or missing API key
402insufficient_creditsWallet empty (PAYG only)
404not_foundUnknown model or endpoint
429rate_limit_errorOver per-minute limit — see Retry-After header
500server_errorUpstream provider failed (retryable)
503service_unavailableUpstream saturated (retryable)
Full docs →API reference →OpenAPI spec →llms.txt →

Frequently asked questions

What is Bge-Reranker-Base?
Different from embedding model, reranker uses question and document as input and directly output similarity instead of embedding. You can get a relevance score by inputting query and passage to the reranker. And the score can be mapped to a float value in [0,1] by sigmoid function. It is a rerank model from BAAI, accessible via AIgateway's OpenAI-compatible API at slug baai/bge-reranker-base.
How much does Bge-Reranker-Base cost via AIgateway?
Pass-through pricing. See the pricing panel on this page for exact rates.
How do I call Bge-Reranker-Base from my code?
Point the OpenAI SDK at https://api.aigateway.sh/v1 with your AIgateway key and set model to "baai/bge-reranker-base". The request and response shapes match OpenAI exactly.
Does Bge-Reranker-Base support streaming, tool calling, vision, and JSON mode?
Streaming — no. Tool calling — no. Vision — no. JSON mode — no. Prompt caching — no.
What are the best use cases for Bge-Reranker-Base?
Key strengths: High-precision result ordering; Cross-encoder quality.
Can I bring my own BAAI API key (BYOK)?
Yes. Attach a BAAI key in your AIgateway dashboard and this model flips to pass-through — you pay BAAI directly and AIgateway adds no platform fee on those calls.