POST /v1/rerank
Rerank candidate documents against a query using an installed local runtime that serves the rerank modality. Pass a `model` id from `GET /v1/models`.

Authentication

Bearer Token (b3iq_local) API Key (header: X-B3IQ-API-Key) Bearer Token API Key (header: X-B3IQ-Router-Signature)

Request Body required

application/json
model string REQUIRED
query string REQUIRED
documents string[] REQUIRED
Array of: string
top_n integer
runtime_id string

Responses

200 Ranked documents.
application/json
results object[]
Array of:
index integer
relevance_score number
default B3IQ-native problem response.
curl -X POST 'http://127.0.0.1:8831/v1/rerank' \  -H 'Authorization: Bearer YOUR_API_TOKEN' \  -H 'Content-Type: application/json' \  -d '{  "model": "string",  "query": "string",  "documents": [    "string"  ],  "top_n": 0,  "runtime_id": "string"}'
const response = await fetch('http://127.0.0.1:8831/v1/rerank', {  method: 'POST',  headers: {      "Authorization": "Bearer YOUR_API_TOKEN",      "Content-Type": "application/json"  },  body: JSON.stringify({    "model": "string",    "query": "string",    "documents": [      "string"    ],    "top_n": 0,    "runtime_id": "string"  })});const data = await response.json();console.log(data);
import requestsheaders = {    'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.post('http://127.0.0.1:8831/v1/rerank', headers=headers, json={  "model": "string",  "query": "string",  "documents": [    "string"  ],  "top_n": 0,  "runtime_id": "string"})print(response.json())
200 Response
{  "results": [    {      "index": 123,      "relevance_score": 123    }  ]}
Ask a question... ⌘I