EUrouter

Rerank

Rerank documents by their relevance to a query with EU-hosted reranking models through the EUrouter API, for search and RAG pipelines.

OpenAPI JSON

Rerank documents

POST
/api/v1/rerank

Rank a list of documents by relevance to a query. Documents can be plain strings or {"text": "..."} objects and are returned sorted by relevance score, echoing each document with its original input index. Text-only for now; streaming is not supported.

Authorization

bearerAuth
AuthorizationBearer <token>

API key in format: eur_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://api.eurouter.ai/api/v1/rerank" \  -H "Content-Type: application/json" \  -d '{    "model": "string",    "query": "string",    "documents": [      "string"    ],    "property1": null,    "property2": null  }'
{
  "id": "string",
  "model": "string",
  "results": [
    {
      "index": -9007199254740991,
      "relevance_score": 0,
      "document": {
        "text": "string"
      }
    }
  ],
  "usage": {
    "prompt_tokens": -9007199254740991,
    "total_tokens": -9007199254740991,
    "search_units": -9007199254740991,
    "cost": 0,
    "cost_currency": "USD",
    "cost_eur": 0,
    "cost_details": {
      "upstream_inference_cost": 0,
      "upstream_inference_prompt_cost": 0,
      "upstream_inference_completions_cost": 0
    }
  },
  "provider": "string"
}
{
  "error": {
    "code": 403,
    "message": "string",
    "type": "permission_error",
    "param": null,
    "details": {
      "reason": "string",
      "reasons": [
        {
          "code": "string",
          "layer": "org"
        }
      ]
    }
  },
  "requestId": "string"
}

Was this page helpful?

Still stuck? Contact support