> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neuraltrust.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Rerank

> Call POST /{consumer}/v1/rerank with a Cohere v2 body. TrustGate routes only to registries that can rerank.

Clients send the same JSON they would send to Cohere `/v2/rerank`. Auth and the
consumer slug are the same as [chat](/trustgate/getting-started/quickstart#call-from-your-application).

```bash theme={null}
curl -X POST "https://<gateway-host>/<consumer-slug>/v1/rerank" \
  -H "X-AG-API-Key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "rerank-english-v3.0",
    "query": "What is TrustGate?",
    "documents": ["TrustGate is an LLM gateway", "Unrelated text"]
  }'
```

On a Private data plane, add `X-AG-Gateway-Slug` as in the chat snippets.

The gateway speaks the Cohere v2 rerank shape on this path. It is not an OpenAI Chat
Completions route.

## Providers

| Registry   | Upstream            |
| ---------- | ------------------- |
| **Cohere** | Cohere `/v2/rerank` |

OpenAI, Azure, Anthropic, Gemini / Vertex, Bedrock, Groq, Mistral, OpenRouter, and other
chat-only providers do not expose rerank. They are left out of the candidate pool.

The `model` field is allowlisted as usual and can pin with `@provider/model`.

## Routing

1. The consumer's registries are filtered to those that advertise rerank.
2. [Model resolution](/trustgate/routing/model-resolution) and
   [load balancing](/trustgate/routing/load-balancing) run on that pool.
3. Pinning a registry that cannot rerank is a **400**, not a failover.
4. An empty capable pool is a **503**.

Attach at least one Cohere registry to the consumer. A mixed chat + rerank pool is fine:
chat still uses every chat-capable member; rerank skips the rest.

## Related

* [Registries](/trustgate/concepts/registries)
* [Consumers](/trustgate/concepts/consumers) — Connect tab
* [Embeddings](/trustgate/routing/embeddings)
* [Models](/trustgate/routing/models)
* [Quickstart](/trustgate/getting-started/quickstart)
