deCloud
MA CHAIN · 20260131
← All models

Cohere: Rerank 4 Pro

Origin
cohere/rerank-4-pro

Cohere's AI search foundation model for enhancing the relevance of information surfaced within search and RAG systems. Features a 32K context window, multilingual support across 100+ languages, no data pre-processing...

Pricing
Billed at actual usage

Billing follows the provider's own reported cost. The unit prices here are for reference; a model marked "billed at actual usage" has no reliable pre-call price, so your usage page is the record of what you paid.

Call it

Rerank models are served on POST /v1/rerank. Send a query and a list of documents and get them back ranked by relevance; top_n limits how many come back. Billing follows the provider's reported cost.

curl https://macdecloud.com/v1/rerank \
  -H "Authorization: Bearer dcld-sk-..." \
  -H "Content-Type: application/json" \
  -d '{"model":"cohere/rerank-4-pro","query":"What is the capital of France?","documents":["Paris is the capital of France.","Berlin is the capital of Germany."],"top_n":1}'

Python

The OpenAI SDK has no rerank method; POST with httpx, which the SDK already depends on.

import httpx

resp = httpx.post(
    "https://macdecloud.com/v1/rerank",
    headers={"Authorization": "Bearer dcld-sk-..."},
    json={
        "model": "cohere/rerank-4-pro",
        "query": "What is the capital of France?",
        "documents": ["Paris is the capital of France.", "Berlin is the capital of Germany."],
        "top_n": 1,
    },
)
for r in resp.json()["results"]:
    print(r["index"], r["relevance_score"])
Cohere: Rerank 4 Pro (ORIGIN) · deCloud