Hanzo
OpenapiAi

Implements POST /v1/rerank (Cohere/Jina-compatible).

Implements POST /v1/rerank (Cohere/Jina-compatible).

POST /v1/rerank

Addresshttps://api.hanzo.ai/v1/rerank
MethodPOST
Operationpost_rerank
AuthAuthorization: Bearer $HANZO_API_KEY

Implements POST /v1/rerank (Cohere/Jina-compatible).

Body: {"model": "...", "query": "...", "documents": ["...", ...]|[{"text":"..."}],

"top_n"?: int, "return_documents"?: bool}

Response: {"object":"list","model":...,"results":[{"index","relevance_score","document"?}],"usage":{...}}

Backend selection is provider-driven (one endpoint, one contract):

  • If the model routes to a native rerank provider (Jina/Cohere/Voyage) the request is proxied to that provider's /rerank endpoint.
  • Otherwise scores are computed as a real bi-encoder ranking: embed the query and documents through the resolved embedding model and rank by cosine similarity. No rerank-specific key required.

Request

The document declares no body for POST /v1/rerank. The handler is typed in cloud but its shape is not yet emitted, so the fields are not listed here — ask the MCP door's describe for post_rerank, which answers from the running route.

Response

The document declares no response body for this operation. It answers 200 on success and the platform error shape on failure — see Errors.

Examples

hanzo rerank create

AI API · All Hanzo APIs · Interactive reference

How is this guide?

On this page