Reranking
POST https://gateway.primexos.com/v1/rerank
Rank documents by relevance to a query. Each document may be a string or an
object with a text field. top_n is optional and defaults to all results.
POST /v1/rerank · Primex-native
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Offering ID to route to (discover IDs via GET /v1/models for this service_type). |
query | string | Yes | The search query to rank the documents against. |
documents | (string | object)[] | Yes | Documents to rank (1–1000). Each item is a string or an object with a text field. |
top_n | integer | No | Return only the top N ranked documents. Omit to return all. |
Billed per query.
curl https://gateway.primexos.com/v1/rerank \
-H "Authorization: Bearer prx-YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "YOUR_LIVE_RERANK_MODEL",
"query": "How does Primex protect funds?",
"documents": [
"Failed requests aren't billed.",
"VM credentials arrive after provisioning."
],
"top_n": 1
}'
The response returns document indexes and relevance scores plus
usage.searches. One request is one billable search unit, independent of the
number of returned results. Get the current model name and rate from the
live catalogue.