Rank Document Relevance
/v1/rerankOverview
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.
Parameters
Idempotency-Keyheader · stringRequiredRequest Body
providerobjectProvider 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.
modelstringRequiredquerystringRequireddocumentsstring[]RequiredShow nested fields
string
top_nintegerCannot exceed the supplied document count.
Minimum 1 · Maximum 8
Responses
200Sorted relevance scores and complete native token usage.
idstringRequiredmodelstringRequiredresultsobject[]RequiredShow nested fields
indexintegerRequiredMinimum 0
relevance_scorenumberRequiredMinimum 0 · Maximum 1
usageobjectRequiredShow nested fields
input_tokensinteger409Existing 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.
errorobjectRequiredShow nested fields
codestringRequiredmessagestringRequiredparamstring | nullrequest_idstring | nullmetadataobjectTyped 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.