---
title: "Submit a rerank request"
method: POST
path: "/rerank"
tags: ["Rerank"]
---

# Submit a rerank request

`POST /rerank`

Submits a rerank request to the rerank router

## Request body

- object — Rerank request input
  - `documents` union[], required — The list of documents to rerank. Documents may be plain strings, or structured objects with `text` and/or `image` for multimodal models.
    - union — A document to rerank. Either a plain string, or a structured object with optional `text` and/or `image`.
      - string
      - object — A structured document with optional text and/or image content. At least one of `text` or `image` must be provided.
        - `image` string — An image associated with the document, as a remote URL (http/https) or a base64-encoded data URI (data:image/...).
        - `text` string — The document text
  - `model` string, required — The rerank model to use
  - `provider` object, nullable — Provider routing preferences for the request.
    - `allow_fallbacks` boolean, nullable — Whether to allow backup providers to serve requests - true: (default) when the primary provider (or your custom providers in "order") is unavailable, use the next best provider. - false: use only the primary/custom provider, and return the upstream error if it's unavailable.
    - `data_collection` 'deny' | 'allow' | 'null', nullable — Data collection setting. If no available model provider meets the requirement, your request will return an error. - allow: (default) allow providers which store user data non-transiently and may train on it - deny: use only providers which do not collect user data.
    - `enforce_distillable_text` boolean, nullable — Whether to restrict routing to only models that allow text distillation. When true, only models where the author has allowed distillation will be used.
    - `ignore` union[], nullable — List of provider slugs to ignore. If provided, this list is merged with your account-wide ignored provider settings for this request.
      - union
        - 'AkashML' | 'AI21' | 'AionLabs' | 'Alibaba' | 'Ambient' | 'Baidu' | 'Amazon Bedrock' | 'Amazon Nova' | 'Anthropic' | 'Arcee AI' | 'AtlasCloud' | 'Avian' | 'Azure' | 'BaseTen' | 'BytePlus' | 'Black Forest Labs' | 'Cerebras' | 'Chutes' | 'Cirrascale' | 'Clarifai' | 'Cloudflare' | 'Cohere' | 'Crucible' | 'Crusoe' | 'Darkbloom' | 'Decart' | 'DeepInfra' | 'DeepSeek' | 'DekaLLM' | 'DigitalOcean' | 'Featherless' | 'Fireworks' | 'Friendli' | 'GMICloud' | 'Google' | 'Google AI Studio' | 'Groq' | 'Inception' | 'Inceptron' | 'InferenceNet' | 'Ionstream' | 'Infermatic' | 'Io Net' | 'Inflection' | 'Liquid' | 'Mara' | 'Mancer 2' | 'Minimax' | 'ModelRun' | 'Mistral' | 'Modular' | 'Moonshot AI' | 'Morph' | 'NCompass' | 'Nebius' | 'Nex AGI' | 'NextBit' | 'Novita' | 'Nvidia' | 'OpenAI' | 'OpenInference' | 'Parasail' | 'Poolside' | 'Perceptron' | 'Perplexity' | 'Phala' | 'Recraft' | 'Reka' | 'Relace' | 'SambaNova' | 'Seed' | 'SiliconFlow' | 'Sourceful' | 'StepFun' | 'Stealth' | 'StreamLake' | 'Switchpoint' | 'Together' | 'Upstage' | 'Venice' | 'Wafer' | 'WandB' | 'Xiaomi' | 'xAI' | 'Z.AI' | 'FakeProvider'
        - string
    - `max_price` object — The object specifying the maximum price you want to pay for this request. USD price per million tokens, for prompt and completion.
      - `audio` string — Price per audio unit
      - `completion` string — Price per million completion tokens
      - `image` string — Price per image
      - `prompt` string — Price per million prompt tokens
      - `request` string — Price per request
    - `only` union[], nullable — List of provider slugs to allow. If provided, this list is merged with your account-wide allowed provider settings for this request.
      - union
        - 'AkashML' | 'AI21' | 'AionLabs' | 'Alibaba' | 'Ambient' | 'Baidu' | 'Amazon Bedrock' | 'Amazon Nova' | 'Anthropic' | 'Arcee AI' | 'AtlasCloud' | 'Avian' | 'Azure' | 'BaseTen' | 'BytePlus' | 'Black Forest Labs' | 'Cerebras' | 'Chutes' | 'Cirrascale' | 'Clarifai' | 'Cloudflare' | 'Cohere' | 'Crucible' | 'Crusoe' | 'Darkbloom' | 'Decart' | 'DeepInfra' | 'DeepSeek' | 'DekaLLM' | 'DigitalOcean' | 'Featherless' | 'Fireworks' | 'Friendli' | 'GMICloud' | 'Google' | 'Google AI Studio' | 'Groq' | 'Inception' | 'Inceptron' | 'InferenceNet' | 'Ionstream' | 'Infermatic' | 'Io Net' | 'Inflection' | 'Liquid' | 'Mara' | 'Mancer 2' | 'Minimax' | 'ModelRun' | 'Mistral' | 'Modular' | 'Moonshot AI' | 'Morph' | 'NCompass' | 'Nebius' | 'Nex AGI' | 'NextBit' | 'Novita' | 'Nvidia' | 'OpenAI' | 'OpenInference' | 'Parasail' | 'Poolside' | 'Perceptron' | 'Perplexity' | 'Phala' | 'Recraft' | 'Reka' | 'Relace' | 'SambaNova' | 'Seed' | 'SiliconFlow' | 'Sourceful' | 'StepFun' | 'Stealth' | 'StreamLake' | 'Switchpoint' | 'Together' | 'Upstage' | 'Venice' | 'Wafer' | 'WandB' | 'Xiaomi' | 'xAI' | 'Z.AI' | 'FakeProvider'
        - string
    - `order` union[], nullable — An ordered list of provider slugs. The router will attempt to use the first provider in the subset of this list that supports your requested model, and fall back to the next if it is unavailable. If no providers are available, the request will fail with an error message.
      - union
        - 'AkashML' | 'AI21' | 'AionLabs' | 'Alibaba' | 'Ambient' | 'Baidu' | 'Amazon Bedrock' | 'Amazon Nova' | 'Anthropic' | 'Arcee AI' | 'AtlasCloud' | 'Avian' | 'Azure' | 'BaseTen' | 'BytePlus' | 'Black Forest Labs' | 'Cerebras' | 'Chutes' | 'Cirrascale' | 'Clarifai' | 'Cloudflare' | 'Cohere' | 'Crucible' | 'Crusoe' | 'Darkbloom' | 'Decart' | 'DeepInfra' | 'DeepSeek' | 'DekaLLM' | 'DigitalOcean' | 'Featherless' | 'Fireworks' | 'Friendli' | 'GMICloud' | 'Google' | 'Google AI Studio' | 'Groq' | 'Inception' | 'Inceptron' | 'InferenceNet' | 'Ionstream' | 'Infermatic' | 'Io Net' | 'Inflection' | 'Liquid' | 'Mara' | 'Mancer 2' | 'Minimax' | 'ModelRun' | 'Mistral' | 'Modular' | 'Moonshot AI' | 'Morph' | 'NCompass' | 'Nebius' | 'Nex AGI' | 'NextBit' | 'Novita' | 'Nvidia' | 'OpenAI' | 'OpenInference' | 'Parasail' | 'Poolside' | 'Perceptron' | 'Perplexity' | 'Phala' | 'Recraft' | 'Reka' | 'Relace' | 'SambaNova' | 'Seed' | 'SiliconFlow' | 'Sourceful' | 'StepFun' | 'Stealth' | 'StreamLake' | 'Switchpoint' | 'Together' | 'Upstage' | 'Venice' | 'Wafer' | 'WandB' | 'Xiaomi' | 'xAI' | 'Z.AI' | 'FakeProvider'
        - string
    - `preferred_max_latency` union — Preferred maximum latency (in seconds). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints above the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
      - number, double
      - PercentileLatencyCutoffs — Percentile-based latency cutoffs. All specified cutoffs must be met for an endpoint to be preferred.
        - `p50` number, double, nullable — Maximum p50 latency (seconds)
        - `p75` number, double, nullable — Maximum p75 latency (seconds)
        - `p90` number, double, nullable — Maximum p90 latency (seconds)
        - `p99` number, double, nullable — Maximum p99 latency (seconds)
      - unknown
    - `preferred_min_throughput` union — Preferred minimum throughput (in tokens per second). Can be a number (applies to p50) or an object with percentile-specific cutoffs. Endpoints below the threshold(s) may still be used, but are deprioritized in routing. When using fallback models, this may cause a fallback model to be used instead of the primary model if it meets the threshold.
      - number, double
      - PercentileThroughputCutoffs — Percentile-based throughput cutoffs. All specified cutoffs must be met for an endpoint to be preferred.
        - `p50` number, double, nullable — Minimum p50 throughput (tokens/sec)
        - `p75` number, double, nullable — Minimum p75 throughput (tokens/sec)
        - `p90` number, double, nullable — Minimum p90 throughput (tokens/sec)
        - `p99` number, double, nullable — Minimum p99 throughput (tokens/sec)
      - unknown
    - `quantizations` Quantization[], nullable — A list of quantization levels to filter the provider by.
    - `require_parameters` boolean, nullable — Whether to filter providers to only those that support the parameters you've provided. If this setting is omitted or set to false, then providers will receive only the parameters they support, and ignore the rest.
    - `sort` union — The sorting strategy to use for this request, if "order" is not specified. When set, no load balancing is performed.
      - 'price' | 'throughput' | 'latency' | 'exacto' — The provider sorting strategy (price, throughput, latency)
      - ProviderSortConfig — The provider sorting strategy (price, throughput, latency)
        - `by` 'price' | 'throughput' | 'latency' | 'exacto' | 'null', nullable — The provider sorting strategy (price, throughput, latency)
        - `partition` 'model' | 'none' | 'null', nullable — Partitioning strategy for sorting: "model" (default) groups endpoints by model before sorting (fallback models remain fallbacks), "none" sorts all endpoints together regardless of model.
      - unknown
    - `zdr` boolean, nullable — Whether to restrict routing to only ZDR (Zero Data Retention) endpoints. When true, only endpoints that do not retain prompts will be used.
  - `query` string, required — The search query to rerank documents against
  - `top_n` integer — Number of most relevant documents to return

## Response `200`

Rerank response

- object — Rerank response containing ranked results
  - `id` string — Unique identifier for the rerank response (ORID format)
  - `model` string, required — The model used for reranking
  - `provider` string — The provider that served the rerank request
  - `results` object[], required — List of rerank results sorted by relevance
    - `document` object, required — The document object echoing the original input (text and/or image)
      - `image` string — The image (URL or data URI) from the original document
      - `text` string — The document text
    - `index` integer, required — Index of the document in the original input list
    - `relevance_score` number, double, required — Relevance score of the document to the query
  - `usage` object — Usage statistics
    - `cost` number, double — Cost of the request in credits
    - `search_units` integer — Number of search units consumed (Cohere billing)
    - `total_tokens` integer — Total number of tokens used

## Other responses

- `400` — Bad Request - Invalid request parameters or malformed input
- `401` — Unauthorized - Authentication required or invalid credentials
- `402` — Payment Required - Insufficient credits or quota to complete request
- `404` — Not Found - Resource does not exist
- `429` — Too Many Requests - Rate limit exceeded
- `500` — Internal Server Error - Unexpected server error
- `502` — Bad Gateway - Provider/upstream API failure
- `503` — Service Unavailable - Service temporarily unavailable
- `524` — Infrastructure Timeout - Provider request timed out at edge network
- `529` — Provider Overloaded - Provider is temporarily overloaded

---

[API](https://skmtc.dev/openrouterteam/apis/openrouter-api.md) · [All operations](https://skmtc.dev/openrouterteam/apis/openrouter-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/openrouterteam/openrouter-api/revisions/619a2678ecee/schema)
