Skip to content

Rank Document Relevance

POST/v1/rerank

Overview

Rank up to eight short documents with a direct DeepInfra reranker. Requires rerank.write, credits, Idempotency-Key and RERANK_ENABLED. Each query and document is limited to 256 ASCII characters, excluding angle brackets. A full native sequence is funded for each query/document pair. Only the native input-token counter determines the charge. Integration preview until deployed staging acceptance; also accepts /api/v1/rerank.

Authorization

Authorizationstring · headerRequired

AudioLab API key sent as Bearer <token>. Authentication guide

Parameters

Idempotency-Keyheader · stringRequired

Request Body

application/json
providerobject

Provider preferences for a single-endpoint product.

Show nested fields
data_regionstring | string[]

Route only to endpoints documented as processing in this region: us, eu (which includes EU member states), or a country code such as nl, sg, in or cn. A list matches any of its regions. Endpoints whose region is global or unknown never match; global on its own means no requirement. The request's region narrows the workspace's Data Region and a named router's region policy, and never widens them. Fallbacks keep to it. When no endpoint qualifies, the request is refused with 400 data_region_unavailable, param provider.data_region.

Show nested fields
Option 1: string

string

Option 2: string[]

See the OpenAPI schema for this nested object.

modelstringRequired
querystringRequired
documentsstring[]Required
Show nested fields

string

top_ninteger

Cannot exceed the supplied document count.

Minimum 1 · Maximum 8

Responses

200Sorted relevance scores and complete native token usage.
application/json
idstringRequired
modelstringRequired
resultsobject[]Required
Show nested fields
indexintegerRequired

Minimum 0

relevance_scorenumberRequired

Minimum 0 · Maximum 1

usageobjectRequired
Show nested fields
input_tokensinteger
409Existing idempotent request; native inference is not repeated.
422Provider contract unavailable or unsupported request.
503Disabled route or unresolved provider outcome.
defaultThe request could not be completed.
application/json
errorobjectRequired
Show nested fields
codestringRequired
messagestringRequired
paramstring | null
request_idstring | null
metadataobject

Typed detail for some refusals. budget_exceeded (402): limit (key_budget or workspace_budget) and budget with scope, period, limit, usage and resets_at. key_limit_exceeded (402): limit key_spend_limit. access_denied (403): policy (workspace or key), rule (models, providers or products), product, provider and model.