Rerank documents
post/v1/rerank
Rerank a list of documents by relevance to a query.
Authentication
Send your OLETOKEN API key as a Bearer token. Keys are created on the API Keys page of the console.
Authorization: Bearer $OLETOKEN_API_KEYRequest body
Content-Type:application/json
| Field | Type | Required | Description |
|---|---|---|---|
| model | string | — | |
| query | string | The query text | |
| documents | string | object[] | The documents to rerank | |
| top_n | integer | — | Return the top N results |
| return_documents | booleandefault: false | — | — |
Responses
200Documents reranked
| Field | Type | Required | Description |
|---|---|---|---|
| id | string | — | — |
| results | object[] | — | — |
| index | integer | — | — |
| relevance_score | number | — | — |
| document | object | — | — |
| meta | object | — | — |
Example request
curl -X POST 'https://api.oletoken.ai/v1/rerank' \
-H "Authorization: Bearer $OLETOKEN_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "rerank-english-v2.0",
"query": "string",
"documents": []
}'
