Skip to main content
Call client.rerank.create() to order candidate documents by relevance to a query with POST /v1/rerank. The method has the same name in TypeScript and Python; Rust posts the same JSON with client.post().
Python: client.rerank.create() posts the dict you pass as the JSON body and returns the JSON response; there’s no typed generate_rerank helper. On AsyncPhaseo, await it. The Go, C#, PHP, Ruby and Java SDKs have no rerank method. Send POST /v1/rerank with your HTTP client, as in the Rerank API reference. Confirm the model ID with GET /v1/models before using it in production.

Parameters

Field names are the JSON body fields in every SDK.

Response

RerankResponse has results, each with the document’s index in your list, its relevance_score, and the document when return_documents is set, plus usage.
Last modified on November 5, 2026