Rerank
curl --request POST \
--url https://api.gravitex.ai/v1/rerank \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"query": "<string>",
"documents": [
{}
],
"top_n": 123,
"return_documents": true
}
'Completions & Embeddings
Rerank
Rerank documents by relevance to a query
POST
/
v1
/
rerank
Rerank
curl --request POST \
--url https://api.gravitex.ai/v1/rerank \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"query": "<string>",
"documents": [
{}
],
"top_n": 123,
"return_documents": true
}
'Documentation Index
Fetch the complete documentation index at: https://docs.gravitex.ai/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
Rerank a list of candidate documents by relevance to a query. Commonly used in RAG and knowledge-base search.Authentication
Bearer Token, e.g.
Bearer sk-xxxxxxxxxxRequest parameters
Rerank model, e.g.
rerank-english-v2.0Query text
Documents to rerank (strings or objects)
Return top N results
Include document text in results
Request example
curl -X POST "https://api.gravitex.ai/v1/rerank" \
-H "Authorization: Bearer sk-xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "rerank-english-v2.0",
"query": "What is a vector database?",
"documents": [
"Vector databases store and search embeddings",
"Today is sunny",
"RAG pipelines often use reranking"
],
"top_n": 2,
"return_documents": true
}'
Common parameters
- query: User question or search query
- documents: Candidate passages
- top_n: Limit to top N hits
- return_documents: Include source text when
true
results array contains index and relevance_score, sorted by score.âI