Reranking
Rank text documents against a query with a catalogue-listed rerank model.
Choose an available rerank model from the Models pagebefore submitting a request.
Request
curl --fail-with-body https://tokenhub-api.belive.sg/api/v1/rerank \ -H "Authorization: Bearer $TOKENHUB_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"alibaba/qwen3-rerank","query":"Which city is France capital?","documents":["Berlin is in Germany.","Paris is France capital."],"top_n":1,"return_documents":true}'
Inputs and result
Send one non-empty query and 1 to 500 text documents. top_n bounds returned matches; return_documents includes document content. Results identify the original document index and relevance score. This is text ranking, not embedding generation or media understanding. Read the model's input pricing and response usage.
Support and limits
Send a non-empty query and the documents. Input length limits are per model. Reranking returns ranked document indices.
Gateway validation, defaults and response forms are in the operation index and the OpenAPI schemas.
Error codes and recovery are in Errors and recovery. Keep the request or job ID from each response: it identifies the call in Activity and for support.