Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.portkey.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

Portkey exposes Google Vertex AI’s Discovery Engine ranking API through the unified /v1/rerank endpoint.
Enable the Discovery Engine API on the GCP project backing your Vertex AI provider before making rerank requests.

Supported Models

  • semantic-ranker-default@latest (default)
  • semantic-ranker-fast@latest
  • semantic-ranker-512@latest
  • Specific versions: semantic-ranker-default-004, semantic-ranker-fast-004, semantic-ranker-default-003, semantic-ranker-default-002

Rerank documents

curl --location 'https://api.portkey.ai/v1/rerank' \
--header 'x-portkey-api-key: $PORTKEY_API_KEY' \
--header 'x-portkey-provider: @VERTEX_AI_PROVIDER_SLUG' \
--header 'Content-Type: application/json' \
--data '{
    "model": "semantic-ranker-default@latest",
    "query": "What is the capital of the United States?",
    "top_n": 3,
    "documents": [
        "Carson City is the capital city of the American state of Nevada.",
        "The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.",
        "Washington, D.C. is the capital of the United States.",
        "Capitalization is the use of a capital letter at the start of a word."
    ]
}'

Parameters

ParameterTypeRequiredDescription
modelstringYesRanking model to use (see supported models)
querystringYesQuery against which documents are ranked
documentsstring[] | object[]YesDocuments to rank. Accepts strings or { text, title? } objects (max 200)
top_nintegerNoNumber of top results to return. Omit to return all
return_documentsbooleanNoSet to false to receive only IDs and scores (default true)

Google Vertex AI Ranking API

Official documentation for the Vertex AI Discovery Engine ranking API.
Last modified on May 4, 2026