# Rerank 4 Pro (`cohere/rerank-4-pro`): API > cohere/rerank-4-pro is a reranking model from Cohere you can call on the OceanToken API. Endpoint: `POST https://api.oceantoken.ai/v1/rerank`. Auth: `Authorization: Bearer $OCEANTOKEN_API_KEY`. OpenAI-compatible; the OpenAI SDKs work with base URL https://api.oceantoken.ai/v1. ## Request parameters - `model` (string; required): This model's ID. - `query` (string; required): What to rank against. - `documents` (array; required): The texts to rank. - `top_n` (integer; 1 or more): Return only the best N. ## Example: Basic ```bash curl https://api.oceantoken.ai/v1/rerank \ -H "Authorization: Bearer $OCEANTOKEN_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "cohere/rerank-4-pro", "query": "capital of France", "documents": [ "Berlin is in Germany.", "Paris is the capital of France." ] }' ``` ```python import os import requests result = requests.post( "https://api.oceantoken.ai/v1/rerank", headers={"Authorization": f"Bearer {os.environ['OCEANTOKEN_API_KEY']}"}, json={ "model": "cohere/rerank-4-pro", "query": "capital of France", "documents": ["Berlin is in Germany.", "Paris is the capital of France."], }, ).json() print(result["results"]) ``` ## Response - `results[].index` (integer): Position in `documents`. - `results[].relevance_score` (number): Higher is more relevant. ```json { "results": [ { "index": 1, "relevance_score": 0.92 }, { "index": 0, "relevance_score": 0.11 } ] } ``` ## More - Model page: https://docs.oceantoken.ai/models/cohere/rerank-4-pro - This spec as JSON (with a JSON Schema of the request): https://docs.oceantoken.ai/models/cohere/rerank-4-pro/spec.json - Guide: https://docs.oceantoken.ai/guides/embeddings-rerank - All models: https://docs.oceantoken.ai/llms.txt