v54

OpenAPI 3.1.0raw.githubusercontent.com2026-08-038690315.6 KB
rerank

Create Rerank

Rerank documents by relevance to a query.

Authentication modes:

  • Master key + user field: Use specified user (must exist)
  • API key + user field: Use specified user (must exist)
  • API key without user field: Use the shared "default" user
post/v1/rerank

Request body

documentsstring[] required

List of document strings to rerank

max_tokens_per_docinteger nullable

Per-document truncation limit

modelstring required

Provider-prefixed model ID, e.g. 'cohere:rerank-v3.5'

querystring required

The search query to rerank documents against

top_ninteger nullable

Maximum number of results to return

userstring nullable

User ID for usage attribution

Response

Successful Response

{"stackTrail":"paths:/v1/rerank:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}