Rerankers
Reranker management.
Methods on this page are called through client.rerankers.
client.rerankers.create
client.rerankers.create(request: RerankersCreateRequest, requestOptions?: ProviderApiKeyOptions): Promise<RerankerResponseShape>Creates a new reranker configuration for ranking search results. Rerankers represent connections to different reranking API services (like TEI, OpenAI, etc.) and include all the necessary configuration to use them for result ranking. DUPLICATE DETECTION: Returns HTTP 409 Conflict (ALREADY_EXISTS) if another reranker exists with identical {ownerId, providerType, endpointUrl, apiPath, modelIdentifier, credentialsFingerprint} after URL canonicalization. Uniqueness is enforced per-owner, allowing different users to have identical configurations. Credentials are hashed (SHA-256) for uniqueness while remaining encrypted. DEFAULTS: apiPath defaults to '/v2/rerank' for Cohere and '/rerank' for other providers if omitted; supportedModalities defaults to [TEXT] if omitted. Requires CREATE_RERANKER_OWN permission (or CREATE_RERANKER_ANY for admin users). This operation is NOT idempotent - each request creates a new reranker record.
HTTP: POST /v1/rerankers
Parameters
| Parameter | Type | Description |
|---|---|---|
request | RerankersCreateRequest | Creation request. Known modelIdentifier values fill provider, endpoint, dimensionality, and modality defaults. |
requestOptions | ProviderApiKeyOptions optional | Provider API key plus per-call signal, timeout, or headers. |
Returns: Promise<RerankerResponseShape>
Example
const reranker = await client.rerankers.create(
{
displayName: "Doc Reranker",
modelIdentifier: "rerank-2",
labels: { env: "docs" },
},
{ apiKey: "voyage-key-..." },
);client.rerankers.delete
client.rerankers.delete(id: string, requestOptions?: RequestOptions): Promise<void>Permanently deletes a reranker configuration. This operation cannot be undone and immediately removes the reranker record from the database. SIDE EFFECTS: Invalidates any cached references to this reranker; does not affect historical usage data or audit logs. Requires DELETE_RERANKER_OWN permission for rerankers you own (or DELETE_RERANKER_ANY for admin users). This operation is safe to retry - may return NOT_FOUND if already deleted.
HTTP: DELETE /v1/rerankers/{id}
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The unique identifier of the reranker to delete |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<void>
Example
await client.rerankers.delete("your-reranker-id");client.rerankers.get
client.rerankers.get(id: string, requestOptions?: RequestOptions): Promise<RerankerResponseShape>Retrieves the details of a specific reranker configuration by its unique identifier. Response payloads include stored credentials, matching gRPC response semantics. Requires READ_RERANKER_OWN permission for rerankers you own (or READ_RERANKER_ANY for admin users). This is a read-only operation with no side effects and is safe to retry.
HTTP: GET /v1/rerankers/{id}
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The unique identifier of the reranker to retrieve |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<RerankerResponseShape>
Example
const fetchedReranker = await client.rerankers.get("your-reranker-id");
console.log(fetchedReranker.displayName);client.rerankers.list
client.rerankers.list(options?: RerankersListOptions, requestOptions?: RequestOptions): Promise<Array<RerankerResponseShape>>Retrieves a list of reranker configurations accessible to the caller, with optional filtering. IMPORTANT: Pagination is NOT supported - all matching results are returned. Results are ordered by created_at descending. Responses include stored credentials, matching gRPC response semantics. LABEL FILTERS: Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production). PERMISSION-BASED FILTERING: With LIST_RERANKER_OWN permission, only your own rerankers are shown. With LIST_RERANKER_ANY permission, you can see all rerankers or filter by any ownerId. Specifying ownerId without LIST_RERANKER_ANY permission returns PERMISSION_DENIED.
HTTP: GET /v1/rerankers
Parameters
| Parameter | Type | Description |
|---|---|---|
options | RerankersListOptions optional | Optional query parameters. |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<Array<RerankerResponseShape>>
Example
for (const item of await client.rerankers.list()) {
console.log(item.rerankerId, item.displayName);
}client.rerankers.update
client.rerankers.update(id: string, request: UpdateRerankerRequest, requestOptions?: RequestOptions): Promise<RerankerResponseShape>Updates an existing reranker configuration including display information, endpoint configuration, model parameters, credentials, and labels. All fields are optional - only specified fields will be updated. IMMUTABLE FIELDS: providerType and ownerId cannot be changed after creation. SUPPORTED_MODALITIES UPDATE: If the array contains >=1 elements, it replaces the stored set; if empty or omitted, no change occurs and it does not count as an update by itself. Returns ALREADY_EXISTS if update would create duplicate with same {ownerId, providerType, endpointUrl, apiPath, modelIdentifier, credentialsFingerprint} after URL canonicalization (HTTP 409 Conflict / ALREADY_EXISTS). Requires UPDATE_RERANKER_OWN permission for rerankers you own (or UPDATE_RERANKER_ANY for admin users). This operation is idempotent.
HTTP: PUT /v1/rerankers/{id}
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | The unique identifier of the reranker to update |
request | UpdateRerankerRequest | Request body. |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<RerankerResponseShape>
Example
const updatedReranker = await client.rerankers.update("your-reranker-id", {
displayName: "Doc Reranker (updated)",
mergeLabels: { version: "2" },
});
console.log(updatedReranker.rerankerId);Data Models
Interfaces
ListRerankersResponse
Response containing a list of rerankers
| Field | Type | Required | Description |
|---|---|---|---|
rerankers | Array<RerankerResponse> | yes | List of reranker configurations |
RerankerCreationRequest
Request body for creating a new Reranker. A Reranker represents a configuration for reranking search results.
| Field | Type | Required | Description |
|---|---|---|---|
displayName | string | yes | User-facing name of the reranker |
description | string | null | no | Description of the reranker |
providerType | ProviderType | yes | Type of reranking provider |
endpointUrl | string | yes | API endpoint URL |
apiPath | string | null | no | API path for reranking request (defaults: Cohere /v2/rerank, Jina /v1/rerank, others /rerank) |
modelIdentifier | string | yes | Model identifier |
supportedModalities | Array<Modality> | null | no | Supported content modalities (defaults to TEXT if not provided) |
credentials | EndpointAuthentication | null | no | Structured credential payload describing how to authenticate with the provider. Required for SaaS providers; optional for local or proxy providers. |
labels | Record<string, string> | null | no | User-defined labels for categorization |
version | string | null | no | Version information |
monitoringEndpoint | string | null | no | Monitoring endpoint URL |
ownerId | string | null | no | Optional owner ID. If not provided, derived from the authentication context. Requires CREATE_RERANKER_ANY permission if specified. |
rerankerId | string | null | no | Optional client-provided UUID for idempotent creation. If not provided, server generates a new UUID. Returns ALREADY_EXISTS if ID is already in use. |
RerankerResponse
Reranker configuration information
| Field | Type | Required | Description |
|---|---|---|---|
rerankerId | string | yes | Unique identifier of the reranker |
displayName | string | yes | User-facing name of the reranker |
description | string | null | no | Description of the reranker |
providerType | ProviderType | yes | Type of reranking provider |
endpointUrl | string | yes | API endpoint URL |
apiPath | string | null | no | API path for reranking request |
modelIdentifier | string | yes | Model identifier |
supportedModalities | Array<Modality> | yes | Supported content modalities |
credentials | EndpointAuthentication | null | no | Structured credential payload used for upstream authentication |
labels | Record<string, string> | yes | User-defined labels for categorization |
version | string | null | no | Version information |
monitoringEndpoint | string | null | no | Monitoring endpoint URL |
ownerId | string | yes | Owner ID of the reranker |
createdAt | number | yes | Creation timestamp (milliseconds since epoch) |
updatedAt | number | yes | Last update timestamp (milliseconds since epoch) |
createdById | string | yes | ID of the user who created the reranker |
updatedById | string | yes | ID of the user who last updated the reranker |
UpdateRerankerRequest
Request body for updating an existing Reranker. Only fields that should be updated need to be included. supportedModalities replaces the stored set only when the array contains at least one value; empty or omitted leaves it unchanged and does not count as an update by itself.
| Field | Type | Required | Description |
|---|---|---|---|
displayName | string | null | no | User-facing name of the reranker |
description | string | null | no | Description of the reranker |
endpointUrl | string | null | no | API endpoint URL |
apiPath | string | null | no | API path for reranking request |
modelIdentifier | string | null | no | Model identifier |
supportedModalities | Array<Modality> | null | no | Update supported modalities (if array contains >=1 elements, replaces stored set; if empty or omitted, no change and does not count as an update by itself) |
credentials | EndpointAuthentication | null | no | Structured credential payload describing how to authenticate with the provider. Omit to keep existing credentials. |
replaceLabels | Record<string, string> | null | no | Replace all existing labels with these (mutually exclusive with mergeLabels) |
mergeLabels | Record<string, string> | null | no | Merge these labels with existing ones (mutually exclusive with replaceLabels) |
version | string | null | no | Version information |
monitoringEndpoint | string | null | no | Monitoring endpoint URL |
Response Shapes
Response shape types model values returned by the SDK after forward-compatible unknown enum strings are coerced to null.
ListRerankersResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
rerankers | Array<RerankerResponseShape> | yes | List of reranker configurations |
RerankerResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
rerankerId | string | yes | Unique identifier of the reranker |
displayName | string | yes | User-facing name of the reranker |
description | string | null | no | Description of the reranker |
providerType | ProviderType | null | yes | Type of reranking provider |
endpointUrl | string | yes | API endpoint URL |
apiPath | string | null | no | API path for reranking request |
modelIdentifier | string | yes | Model identifier |
supportedModalities | Array<Modality | null> | yes | Supported content modalities |
credentials | EndpointAuthenticationResponseShape | null | no | Structured credential payload used for upstream authentication |
labels | Record<string, string> | yes | User-defined labels for categorization |
version | string | null | no | Version information |
monitoringEndpoint | string | null | no | Monitoring endpoint URL |
ownerId | string | yes | Owner ID of the reranker |
createdAt | number | yes | Creation timestamp (milliseconds since epoch) |
updatedAt | number | yes | Last update timestamp (milliseconds since epoch) |
createdById | string | yes | ID of the user who created the reranker |
updatedById | string | yes | ID of the user who last updated the reranker |