curl https://api.portkey.ai/v1/rerank \
-H "x-portkey-api-key: $PORTKEY_API_KEY" \
-H "x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "rerank-v3.5",
"query": "What is the capital of France?",
"documents": [
"Paris is the capital of France.",
"Berlin is the capital of Germany.",
"Madrid is the capital of Spain."
],
"top_n": 2
}'
curl https://api.portkey.ai/v1/rerank \
-H "x-portkey-api-key: $PORTKEY_API_KEY" \
-H "x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "rerank-v3.5",
"query": "What is the capital of France?",
"documents": [
"Paris is the capital of France.",
"Berlin is the capital of Germany.",
"Madrid is the capital of Spain."
],
"top_n": 2
}'
Bedrock: Model ARN (e.g., arn:aws:bedrock:us-west-2::foundation-model/cohere.rerank-v3-5:0)
Azure AI: Cohere rerank deployments on Azure AI Inference; use the model name from your deployment, typically prefixed with cohere. (the gateway strips that prefix for the upstream request)
The list of documents to rerank. Each document can be a string or an object with a text field.
The documents will be scored based on their relevance to the query.
Minimum array length: 1
A document to be reranked. Can be a simple string or an object with a text field and optional metadata.
Example:
"Paris is the capital of France."
Example:
[
"Paris is the capital of France.",
"Berlin is the capital of Germany.",
"Madrid is the capital of Spain."
]
The number of top results to return. If not specified, all documents are returned sorted by relevance.
For Voyage, the gateway maps this field to the provider's top_k parameter.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Portkey (Prisma AIRS AI Gateway) Docs","description":"Comprehensive documentation for AI Gateway, Guardrails, Observability, and Governance features.","colors":{"primary":"#0891B2","light":"#0891B2","dark":"#0891B2"},"logo":{"light":"https://mintcdn.com/portkey-docs/tHk-hgNjLbEj4dhh/images/portkey-PANW-company-logo-positive.png?fit=max\u0026auto=format\u0026n=tHk-hgNjLbEj4dhh\u0026q=85\u0026s=c5fb09014ff79616583b1d3bffe27450","dark":"https://mintcdn.com/portkey-docs/tHk-hgNjLbEj4dhh/images/portkey-PANW-company-logo-negative.png?fit=max\u0026auto=format\u0026n=tHk-hgNjLbEj4dhh\u0026q=85\u0026s=6025ca49ef544522f58ff471b7f75f8f"},"favicon":"https://mintcdn.com/portkey-docs/Hf1XgyjG_b79ym4Q/favicon.png?fit=max\u0026auto=format\u0026n=Hf1XgyjG_b79ym4Q\u0026q=85\u0026s=cbaa1bfc49bb6e3fd6cf499a5da313a3","api":{"openapi":"https://raw.githubusercontent.com/Portkey-AI/openapi/refs/heads/master/openapi.yaml","examples":{"prefill":true},"url":"full"},"navbar":{"links":[{"href":"https://portkey.ai/models","label":"Models"},{"href":"https://support.portkey.ai/forms/customer-portal-ticket-form","label":"Support"},{"href":"https://www.paloaltonetworks.in/ai-security/ai-gateway?utm_source=portkey\u0026utm_medium=referral\u0026utm_campaign=prisma_airs\u0026utm_content=docs_nav#contact","label":"Contact Us"}],"primary":{"type":"button","label":"Sign in","href":"https://stratacloudmanager.paloaltonetworks.com/"}},"footer":{"socials":{"x":"https://twitter.com/PortkeyAI","linkedin":"https://www.linkedin.com/company/portkey-ai","github":"https://git.new/portkey"},"links":[{"header":"For LLMs","items":[{"label":"llms.txt","href":"https://portkey.ai/docs/llms.txt"},{"label":"llms-full.txt","href":"https://portkey.ai/docs/llms-full.txt"}]},{"header":"Products","items":[{"label":"Observability","href":"https://portkey.ai/features/observability"},{"label":"AI Gateway","href":"https://portkey.ai/features/ai-gateway"},{"label":"Guardrails","href":"https://portkey.ai/features/guardrails"},{"label":"Prompt Management","href":"https://portkey.ai/features/prompt-management"},{"label":"Agents","href":"https://portkey.ai/features/agents"},{"label":"MCP Gateway","href":"https://portkey.ai/docs/product/mcp-gateway"},{"label":"Security","href":"https://portkey.ai/features/security-and-compliance"},{"label":"Auto-Instrumentation","href":"https://portkey.ai/features/auto-instrumentation"}]},{"header":"Resources","items":[{"label":"API Status","href":"https://status.portkey.ai/"},{"label":"Helm Charts","href":"https://github.com/portkey-ai/helm"},{"label":"AI Grants Finder","href":"https://grantsfinder.portkey.ai/"},{"label":"Events Calendar","href":"https://lu.ma/portkey"},{"label":"Blog","href":"https://portkey.ai/blog"},{"label":"Error Library","href":"https://portkey.ai/error-library"},{"label":"Models \u0026 Pricing","href":"https://portkey.ai/models"}]},{"header":"Company","items":[{"label":"Pricing","href":"https://portkey.ai/pricing"},{"label":"Compliances","href":"https://trust.portkey.ai/"},{"label":"Privacy Policy","href":"https://portkey.ai/privacy-policy"},{"label":"Terms of Service","href":"https://portkey.ai/terms"},{"label":"DPA","href":"https://portkey.ai/dpa"},{"label":"Cookie Policy","href":"https://portkey.ai/cookie-policy"}]}]},"seo":{"metatags":{"og:type":"website","og:site_name":"Portkey AI Gateway Docs"},"indexing":"navigable"},"styling":{"eyebrows":"breadcrumbs","codeblocks":"system","latex":true},"integrations":{"ga4":{"measurementId":"G-JJMXYE4DRL"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"toc"},"interaction":{"drilldown":true},"metadata":{"timestamp":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"portkey-docs","hasAudioNarration":false,"actualSubdomain":"portkey-docs","customDomains":["docs.portkey.ai","portkey.ai"],"gitSource":{"type":"github","owner":"portkey-ai","repo":"docs-core","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae208355ca9b4a2f463da8b","collectionId":"90268a13-2a6c-48fb-8f39-0cf354671ab3","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae208355ca9b4a2f463da8b"},"feedback":{"thumbs":true,"edits":true,"issues":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae208355ca9b4a2f463da8b","clientVersion":"0.0.4006","searchFilterCounts":[{"language":"default","tag":"Integrations","count":697},{"language":"default","tag":"Product","count":382},{"language":"default","tag":"Docs","count":320},{"language":"default","tag":"LLM Integrations","count":307},{"language":"default","tag":"More","count":176},{"language":"default","tag":"Admin APIs","count":172},{"language":"default","tag":"Guardrails","count":101},{"language":"default","tag":"AI Gateway","count":99},{"language":"default","tag":"Admin API","count":95},{"language":"default","tag":"Documentation","count":91}],"searchSettings":{"isFiltersEnabled":true,"showContentSnippets":true}},"assistantConfig":{"enableAskAiButton":true,"enableStarterQuestions":true,"enableContextualStarterQuestions":true,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"support@portkey.ai","showHelpButton":true}},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"#banner{background:linear-gradient(90deg,#0d1b2e 0,#1a1040 40%,#2d0f22 100%);border-bottom:1px solid rgba(255,255,255,.08)}#banner a{color:#f0f0f0;text-decoration:none;font-weight:600;border-bottom:1px solid rgba(240,240,240,.5);padding-bottom:1px;transition:border-color .2s ease}#banner a:hover{border-bottom-color:#fff}"}],"page":{"pagePath":"api-reference/inference-api/rerank","slug":"/api-reference/inference-api/rerank","pageMetadata":{"title":"Rerank","openapi":"post /rerank","description":"","href":"/api-reference/inference-api/rerank"},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={hr:`hr`,p:`p`,..._provideComponents(),...props.components},{Card}=_components;if(!Card)_missingMdxReference(`Card`,true);return _jsxs(_Fragment,{children:[_jsx(_components.hr,{}),`\n`,_jsx(Card,{title:`Portkey is now PRISMA AIRS AI Gateway. See it in action.`,href:`https://www.paloaltonetworks.in/ai-security/ai-gateway?utm_source=portkey\u0026utm_medium=referral\u0026utm_campaign=prisma_airs\u0026utm_content=docs_nav#contact`,icon:`arrow-up-right-from-square`,children:_jsx(_components.p,{children:`Contact Us`})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"system","config":{},"pageMetadata":{"title":"Rerank","openapi":"post /rerank","description":"","href":"/api-reference/inference-api/rerank"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"operationId":"createRerank","tags":["Rerank"],"summary":"Rerank","description":"Reranks a list of documents based on their relevance to a query. This endpoint provides a unified interface to reranking models from multiple providers including Cohere, Voyage, Jina, Pinecone, Bedrock, and Azure AI.\n\nReranking is useful for improving search results by scoring and sorting documents based on semantic relevance to a query, rather than just keyword matching.\n","parameters":["8c884ce3-071b-4fd7-97b0-f728dadb8cbe","1ab6449d-2cee-4edc-b032-e6bb9f332f1a","ac0a7479-3cbe-4755-962f-f08957ff577d","c3938943-77f2-440a-a427-96b1be321afb","cb9ed1e7-347a-4a85-9bb9-b1e03ea63607"],"requestBody":"52b25923-85cd-482a-b93b-c8dce18fa809","responses":{"200":"9113f3a7-b00d-4bba-84fc-d3b06481d530"},"security":["5eaa45e3-4ec0-498b-9f32-6bf6a15cd504","54a08829-3393-49ff-8ed6-70490ac2085f","64ba3913-342d-4bab-8898-5cfcdc91773d","eabd5d47-b87f-4884-8f7e-affecd6e8597"],"x-code-samples":[{"lang":"curl","label":"Default","source":"curl https://api.portkey.ai/v1/rerank \\\n -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"rerank-v3.5\",\n \"query\": \"What is the capital of France?\",\n \"documents\": [\n \"Paris is the capital of France.\",\n \"Berlin is the capital of Germany.\",\n \"Madrid is the capital of Spain.\"\n ],\n \"top_n\": 2\n }'\n"},{"lang":"python","label":"Default","source":"from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nresponse = client.post(\n \"/rerank\",\n model=\"rerank-v3.5\",\n query=\"What is the capital of France?\",\n documents=[\n \"Paris is the capital of France.\",\n \"Berlin is the capital of Germany.\",\n \"Madrid is the capital of Spain.\",\n ],\n top_n=2,\n)\n\nprint(response)\n"},{"lang":"javascript","label":"Default","source":"import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n const response = await client.post('/rerank', {\n model: 'rerank-v3.5',\n query: 'What is the capital of France?',\n documents: [\n 'Paris is the capital of France.',\n 'Berlin is the capital of Germany.',\n 'Madrid is the capital of Spain.'\n ],\n top_n: 2\n });\n\n console.log(response);\n}\n\nmain();\n"},{"lang":"curl","label":"Self-Hosted","source":"curl -X POST \"SELF_HOSTED_GATEWAY_URL/rerank\" \\\n -H \"Content-Type: application/json\" \\\n -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n -d '{\n \"model\": \"rerank-v3.5\",\n \"query\": \"What is the capital of France?\",\n \"documents\": [\n \"Paris is the capital of France.\",\n \"Berlin is the capital of Germany.\",\n \"Madrid is the capital of Spain.\"\n ],\n \"top_n\": 2\n }'\n"},{"lang":"python","label":"Self-Hosted","source":"from portkey_ai import Portkey\n\nclient = Portkey(\n api_key=\"PORTKEY_API_KEY\",\n virtual_key=\"PROVIDER_VIRTUAL_KEY\",\n base_url=\"SELF_HOSTED_GATEWAY_URL\"\n)\n\nresponse = client.post(\n \"/rerank\",\n model=\"rerank-v3.5\",\n query=\"What is the capital of France?\",\n documents=[\n \"Paris is the capital of France.\",\n \"Berlin is the capital of Germany.\",\n \"Madrid is the capital of Spain.\",\n ],\n top_n=2,\n)\n\nprint(response)\n"},{"lang":"javascript","label":"Self-Hosted","source":"import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n virtualKey: 'PROVIDER_VIRTUAL_KEY',\n baseURL: 'SELF_HOSTED_GATEWAY_URL'\n});\n\nasync function main() {\n const response = await client.post('/rerank', {\n model: 'rerank-v3.5',\n query: 'What is the capital of France?',\n documents: [\n 'Paris is the capital of France.',\n 'Berlin is the capital of Germany.',\n 'Madrid is the capital of Spain.'\n ],\n top_n: 2\n });\n\n console.log(response);\n}\n\nmain();\n"}],"method":"post","type":"path","servers":["d8076808-3868-4b35-b3cb-3222ebe29436","5f33d0c9-90ac-41e5-a6ee-ed8e2a6c8902"],"path":"/rerank","baseUrlOptions":["https://api.portkey.ai/v1","SELF_HOSTED_GATEWAY_URL"],"title":"Rerank","codeSamples":[{"label":"Default","lang":"curl","source":"curl https://api.portkey.ai/v1/rerank \\\n -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"rerank-v3.5\",\n \"query\": \"What is the capital of France?\",\n \"documents\": [\n \"Paris is the capital of France.\",\n \"Berlin is the capital of Germany.\",\n \"Madrid is the capital of Spain.\"\n ],\n \"top_n\": 2\n }'\n"},{"label":"Default","lang":"python","source":"from portkey_ai import Portkey\n\nclient = Portkey(\n api_key = \"PORTKEY_API_KEY\",\n virtual_key = \"PROVIDER_VIRTUAL_KEY\"\n)\n\nresponse = client.post(\n \"/rerank\",\n model=\"rerank-v3.5\",\n query=\"What is the capital of France?\",\n documents=[\n \"Paris is the capital of France.\",\n \"Berlin is the capital of Germany.\",\n \"Madrid is the capital of Spain.\",\n ],\n top_n=2,\n)\n\nprint(response)\n"},{"label":"Default","lang":"javascript","source":"import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n virtualKey: 'PROVIDER_VIRTUAL_KEY'\n});\n\nasync function main() {\n const response = await client.post('/rerank', {\n model: 'rerank-v3.5',\n query: 'What is the capital of France?',\n documents: [\n 'Paris is the capital of France.',\n 'Berlin is the capital of Germany.',\n 'Madrid is the capital of Spain.'\n ],\n top_n: 2\n });\n\n console.log(response);\n}\n\nmain();\n"},{"label":"Self-Hosted","lang":"curl","source":"curl -X POST \"SELF_HOSTED_GATEWAY_URL/rerank\" \\\n -H \"Content-Type: application/json\" \\\n -H \"x-portkey-api-key: $PORTKEY_API_KEY\" \\\n -H \"x-portkey-virtual-key: $PORTKEY_PROVIDER_VIRTUAL_KEY\" \\\n -d '{\n \"model\": \"rerank-v3.5\",\n \"query\": \"What is the capital of France?\",\n \"documents\": [\n \"Paris is the capital of France.\",\n \"Berlin is the capital of Germany.\",\n \"Madrid is the capital of Spain.\"\n ],\n \"top_n\": 2\n }'\n"},{"label":"Self-Hosted","lang":"python","source":"from portkey_ai import Portkey\n\nclient = Portkey(\n api_key=\"PORTKEY_API_KEY\",\n virtual_key=\"PROVIDER_VIRTUAL_KEY\",\n base_url=\"SELF_HOSTED_GATEWAY_URL\"\n)\n\nresponse = client.post(\n \"/rerank\",\n model=\"rerank-v3.5\",\n query=\"What is the capital of France?\",\n documents=[\n \"Paris is the capital of France.\",\n \"Berlin is the capital of Germany.\",\n \"Madrid is the capital of Spain.\",\n ],\n top_n=2,\n)\n\nprint(response)\n"},{"label":"Self-Hosted","lang":"javascript","source":"import Portkey from 'portkey-ai';\n\nconst client = new Portkey({\n apiKey: 'PORTKEY_API_KEY',\n virtualKey: 'PROVIDER_VIRTUAL_KEY',\n baseURL: 'SELF_HOSTED_GATEWAY_URL'\n});\n\nasync function main() {\n const response = await client.post('/rerank', {\n model: 'rerank-v3.5',\n query: 'What is the capital of France?',\n documents: [\n 'Paris is the capital of France.',\n 'Berlin is the capital of Germany.',\n 'Madrid is the capital of Spain.'\n ],\n top_n: 2\n });\n\n console.log(response);\n}\n\nmain();\n"}],"requiredOnlyExamples":false,"requestExampleType":"codeSamples","responseExampleType":"generated","prefillPlaygroundWithExample":true,"prefillPlaygroundExamples":[{"body.model":"rerank-v3.5","body.query":"What is the capital of France?","body.documents.items.0.oneOf.0":"Paris is the capital of France.","body.documents.items.1.oneOf.0":"Berlin is the capital of Germany.","body.documents.items.2.oneOf.0":"Madrid is the capital of Spain.","body.top_n":3,"body.return_documents":false,"body.max_tokens_per_doc":2,"body.priority":123,"body.rank_fields.items.0":"text","body.rank_fields.items.1":"title","body.truncation":true,"body.parameters":{}}],"urlDisplay":"full"},"dependencies":{"parameters":{"8c884ce3-071b-4fd7-97b0-f728dadb8cbe":{"in":"header","name":"x-portkey-trace-id","schema":{"type":"string","isRequired":false,"description":"An ID you can pass to refer to one or more requests later on. If not provided, Portkey generates a trace ID automatically for each request. [Docs](https://portkey.ai/docs/product/observability/traces)","uniqueKey":"","typeLabel":"string"},"description":"An ID you can pass to refer to one or more requests later on. If not provided, Portkey generates a trace ID automatically for each request. [Docs](https://portkey.ai/docs/product/observability/traces)","required":false},"1ab6449d-2cee-4edc-b032-e6bb9f332f1a":{"in":"header","name":"x-portkey-span-id","schema":{"type":"string","isRequired":false,"description":"An ID you can pass to refer to a span under a trace.","uniqueKey":"","typeLabel":"string"},"description":"An ID you can pass to refer to a span under a trace.","required":false},"ac0a7479-3cbe-4755-962f-f08957ff577d":{"in":"header","name":"x-portkey-parent-span-id","schema":{"type":"string","isRequired":false,"description":"Link a child span to a parent span","uniqueKey":"","typeLabel":"string"},"description":"Link a child span to a parent span","required":false},"c3938943-77f2-440a-a427-96b1be321afb":{"in":"header","name":"x-portkey-span-name","schema":{"type":"string","isRequired":false,"description":"Name for the Span ID","uniqueKey":"","typeLabel":"string"},"description":"Name for the Span ID","required":false},"cb9ed1e7-347a-4a85-9bb9-b1e03ea63607":{"in":"header","name":"x-portkey-metadata","schema":{"type":"object","isRequired":false,"description":"Pass any arbitrary metadata along with your request","uniqueKey":"","typeLabel":"object"},"description":"Pass any arbitrary metadata along with your request","required":false}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"Request body for reranking documents. The unified API supports multiple providers including Cohere, Voyage, Jina, Pinecone, Bedrock, and Azure AI.\n","properties":{"model":{"description":"ID of the model to use for reranking. Model availability depends on the provider:\n- **Cohere**: `rerank-v3.5`, `rerank-english-v3.0`, `rerank-multilingual-v3.0`, `rerank-english-v2.0`, `rerank-multilingual-v2.0`\n- **Voyage**: `rerank-2`, `rerank-2-lite`\n- **Jina**: `jina-reranker-v2-base-multilingual`, `jina-reranker-v1-base-en`, `jina-reranker-v1-turbo-en`, `jina-reranker-v1-tiny-en`\n- **Pinecone**: `bge-reranker-v2-m3`, `pinecone-rerank-v0`\n- **Bedrock**: Model ARN (e.g., `arn:aws:bedrock:us-west-2::foundation-model/cohere.rerank-v3-5:0`)\n- **Azure AI**: Cohere rerank deployments on Azure AI Inference; use the model name from your deployment, typically prefixed with `cohere.` (the gateway strips that prefix for the upstream request)\n","type":"string","example":"rerank-v3.5","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"query":{"description":"The search query to compare against the documents.","type":"string","example":"What is the capital of France?","isRequired":true,"uniqueKey":"query","typeLabel":"string"},"documents":{"description":"The list of documents to rerank. Each document can be a string or an object with a `text` field.\nThe documents will be scored based on their relevance to the query.\n","type":"array","items":{"oneOf":[{"type":"string","title":"string","description":"A document to be reranked. Can be a simple string or an object with a text field and optional metadata.\n","example":"Paris is the capital of France.","uniqueKey":"documents.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"object","title":"object","description":"A document to be reranked. Can be a simple string or an object with a text field and optional metadata.\n","required":["text"],"properties":{"text":{"type":"string","description":"The text content of the document.","example":"Paris is the capital of France.","isRequired":true,"uniqueKey":"documents.items.[INDEX].oneOf.1.text","typeLabel":"string"}},"additionalProperties":true,"uniqueKey":"documents.items.[INDEX].oneOf.1","typeLabel":"object · object"}],"uniqueKey":"documents.items.[INDEX]","typeLabel":"string | object · object"},"minItems":1,"example":["Paris is the capital of France.","Berlin is the capital of Germany.","Madrid is the capital of Spain."],"isRequired":true,"uniqueKey":"documents","typeLabel":"(string | object · object)[]"},"top_n":{"description":"The number of top results to return. If not specified, all documents are returned sorted by relevance.\nFor Voyage, the gateway maps this field to the provider's `top_k` parameter.\n","type":"integer","minimum":1,"example":3,"uniqueKey":"top_n","typeLabel":"integer"},"return_documents":{"description":"Whether to return the document text in the response. Supported by Voyage, Jina, and Pinecone.\n","type":"boolean","default":false,"uniqueKey":"return_documents","typeLabel":"boolean"},"max_tokens_per_doc":{"description":"Maximum number of tokens per document. Documents exceeding this limit will be truncated. Cohere-specific parameter.\n","type":"integer","minimum":1,"uniqueKey":"max_tokens_per_doc","typeLabel":"integer"},"priority":{"description":"Request priority hint. Cohere-specific parameter.\n","type":"number","uniqueKey":"priority","typeLabel":"number"},"rank_fields":{"description":"The fields to use for ranking when documents are objects with multiple fields. Pinecone-specific parameter.\n","type":"array","items":{"type":"string","uniqueKey":"rank_fields.items.[INDEX]","typeLabel":"string"},"example":["text","title"],"uniqueKey":"rank_fields","typeLabel":"string[]"},"truncation":{"description":"Whether to truncate documents that exceed the model's maximum context length. Voyage-specific parameter.\n","type":"boolean","uniqueKey":"truncation","typeLabel":"boolean"},"parameters":{"description":"Additional provider-specific parameters. Pinecone-specific parameter.\n","type":"object","additionalProperties":true,"uniqueKey":"parameters","typeLabel":"object"}},"required":["model","query","documents"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"model":"rerank-v3.5","query":"What is the capital of France?","documents":["Paris is the capital of France.","Berlin is the capital of Germany.","Madrid is the capital of Spain."],"top_n":3,"return_documents":false,"max_tokens_per_doc":2,"priority":123,"rank_fields":["text","title"],"truncation":true,"parameters":{}}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"9113f3a7-b00d-4bba-84fc-d3b06481d530":{"description":"OK","content":{"application/json":{"schema":{"type":"object","description":"Response from the rerank endpoint.","properties":{"object":{"type":"string","description":"The object type, which is always \"list\".","enum":["list"],"example":"list","isRequired":true,"uniqueKey":"object","typeLabel":"enum\u003cstring>"},"results":{"type":"array","description":"The reranked results sorted by relevance score in descending order.\n","items":{"type":"object","description":"A single reranked document result.","properties":{"index":{"type":"integer","description":"The index of the document in the original input array.","example":0,"isRequired":true,"uniqueKey":"results.items.[INDEX].index","typeLabel":"integer"},"relevance_score":{"type":"number","format":"float","description":"The relevance score of the document to the query. Higher scores indicate greater relevance.\nScore ranges vary by provider but are typically between 0 and 1.\n","example":0.98,"isRequired":true,"uniqueKey":"results.items.[INDEX].relevance_score","typeLabel":"number\u003cfloat>"},"document":{"type":"object","description":"The original document text. Only present if `return_documents` is true.","properties":{"text":{"type":"string","description":"The text content of the document.","uniqueKey":"results.items.[INDEX].document.text","typeLabel":"string"}},"additionalProperties":true,"uniqueKey":"results.items.[INDEX].document","typeLabel":"object"}},"required":["index","relevance_score"],"uniqueKey":"results.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"results","typeLabel":"object[]"},"model":{"type":"string","description":"The model used for reranking.","example":"rerank-v3.5","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"id":{"type":"string","description":"A unique identifier for the rerank request.","example":"rerank-abc123","uniqueKey":"id","typeLabel":"string"},"usage":{"type":"object","description":"Usage information for the rerank request.","properties":{"search_units":{"type":"integer","description":"The number of search units consumed by the request. Billing varies by provider.\n","uniqueKey":"usage.search_units","typeLabel":"integer"}},"uniqueKey":"usage","typeLabel":"object"},"provider":{"type":"string","description":"The provider that processed the request.","example":"cohere","uniqueKey":"provider","typeLabel":"string"}},"required":["object","results","model"],"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"object":"list","results":[{"index":0,"relevance_score":0.98,"document":{"text":"\u003cstring>"}}],"model":"rerank-v3.5","id":"rerank-abc123","usage":{"search_units":123},"provider":"cohere"}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"5eaa45e3-4ec0-498b-9f32-6bf6a15cd504":{"Portkey-Key":{"type":"apiKey","in":"header","name":"x-portkey-api-key","scopes":[],"schemeName":"Portkey-Key"},"Virtual-Key":{"type":"apiKey","in":"header","name":"x-portkey-virtual-key","scopes":[],"schemeName":"Virtual-Key"}},"54a08829-3393-49ff-8ed6-70490ac2085f":{"Portkey-Key":{"type":"apiKey","in":"header","name":"x-portkey-api-key","scopes":[],"schemeName":"Portkey-Key"},"Provider-Auth":{"type":"http","scheme":"bearer","scopes":[],"schemeName":"Provider-Auth"},"Provider-Name":{"type":"apiKey","in":"header","name":"x-portkey-provider","scopes":[],"schemeName":"Provider-Name"}},"64ba3913-342d-4bab-8898-5cfcdc91773d":{"Portkey-Key":{"type":"apiKey","in":"header","name":"x-portkey-api-key","scopes":[],"schemeName":"Portkey-Key"},"Config":{"type":"apiKey","in":"header","name":"x-portkey-config","scopes":[],"schemeName":"Config"}},"eabd5d47-b87f-4884-8f7e-affecd6e8597":{"Portkey-Key":{"type":"apiKey","in":"header","name":"x-portkey-api-key","scopes":[],"schemeName":"Portkey-Key"},"Provider-Auth":{"type":"http","scheme":"bearer","scopes":[],"schemeName":"Provider-Auth"},"Provider-Name":{"type":"apiKey","in":"header","name":"x-portkey-provider","scopes":[],"schemeName":"Provider-Name"},"Custom-Host":{"type":"apiKey","in":"header","name":"x-portkey-custom-host","scopes":[],"schemeName":"Custom-Host"}}},"servers":{"d8076808-3868-4b35-b3cb-3222ebe29436":{"url":"https://api.portkey.ai/v1","description":"Portkey API Public Endpoint"},"5f33d0c9-90ac-41e5-a6ee-ed8e2a6c8902":{"url":"SELF_HOSTED_GATEWAY_URL","description":"Self-Hosted Gateway URL"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-portkey-api-key","scopes":[],"schemeName":"Portkey-Key"},"schema":{"title":"x-portkey-api-key","type":"string","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"Portkey-Key","name":"x-portkey-api-key"},{"scheme":{"type":"apiKey","in":"header","name":"x-portkey-virtual-key","scopes":[],"schemeName":"Virtual-Key"},"schema":{"title":"x-portkey-virtual-key","type":"string","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"Virtual-Key","name":"x-portkey-virtual-key"}],"title":"Portkey-Key \u0026 Virtual-Key"},{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-portkey-api-key","scopes":[],"schemeName":"Portkey-Key"},"schema":{"title":"x-portkey-api-key","type":"string","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"Portkey-Key","name":"x-portkey-api-key"},{"scheme":{"type":"http","scheme":"bearer","scopes":[],"schemeName":"Provider-Auth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"Provider-Auth","name":"Authorization"},{"scheme":{"type":"apiKey","in":"header","name":"x-portkey-provider","scopes":[],"schemeName":"Provider-Name"},"schema":{"title":"x-portkey-provider","type":"string","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"Provider-Name","name":"x-portkey-provider"}],"title":"Portkey-Key \u0026 Provider-Auth \u0026 Provider-Name"},{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-portkey-api-key","scopes":[],"schemeName":"Portkey-Key"},"schema":{"title":"x-portkey-api-key","type":"string","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"Portkey-Key","name":"x-portkey-api-key"},{"scheme":{"type":"apiKey","in":"header","name":"x-portkey-config","scopes":[],"schemeName":"Config"},"schema":{"title":"x-portkey-config","type":"string","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"Config","name":"x-portkey-config"}],"title":"Portkey-Key \u0026 Config"},{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-portkey-api-key","scopes":[],"schemeName":"Portkey-Key"},"schema":{"title":"x-portkey-api-key","type":"string","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"Portkey-Key","name":"x-portkey-api-key"},{"scheme":{"type":"http","scheme":"bearer","scopes":[],"schemeName":"Provider-Auth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"Provider-Auth","name":"Authorization"},{"scheme":{"type":"apiKey","in":"header","name":"x-portkey-provider","scopes":[],"schemeName":"Provider-Name"},"schema":{"title":"x-portkey-provider","type":"string","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"Provider-Name","name":"x-portkey-provider"},{"scheme":{"type":"apiKey","in":"header","name":"x-portkey-custom-host","scopes":[],"schemeName":"Custom-Host"},"schema":{"title":"x-portkey-custom-host","type":"string","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"Custom-Host","name":"x-portkey-custom-host"}],"title":"Portkey-Key \u0026 Provider-Auth \u0026 Provider-Name \u0026 Custom-Host"}]},"originalFileLocation":"https://raw.githubusercontent.com/Portkey-AI/openapi/refs/heads/master/openapi.yaml"},"subdomain":"portkey-docs","siteName":"Portkey (Prisma AIRS AI Gateway) Docs","title":"Rerank - Portkey (Prisma AIRS AI Gateway) Docs","relatedPagesConfig":{"enabled":true,"limit":5,"mode":"automatic"},"contextualStarterQuestions":[{"_id":"6aa971b90031bd0287c9663a","deploymentId":"67086365a151447bf2fa5021","questionText":"What is reranking?","status":"active","generatedBy":"contextual","path":"api-reference/inference-api/rerank","createdAt":"2026-09-15T16:26:33.725Z","updatedAt":"2026-09-15T16:26:33.725Z","__v":0},{"_id":"6aa971b90031bd0287c9663b","deploymentId":"67086365a151447bf2fa5021","questionText":"How do I use the rerank API?","status":"active","generatedBy":"contextual","path":"api-reference/inference-api/rerank","createdAt":"2026-09-15T16:26:33.725Z","updatedAt":"2026-09-15T16:26:33.725Z","__v":0},{"_id":"6aa971b90031bd0287c9663c","deploymentId":"67086365a151447bf2fa5021","questionText":"What rerank models are available?","status":"active","generatedBy":"contextual","path":"api-reference/inference-api/rerank","createdAt":"2026-09-15T16:26:33.725Z","updatedAt":"2026-09-15T16:26:33.725Z","__v":0}],"navMaps":{"firstHrefInVersion":{"Latest":{"href":"/api-reference/inference-api/rerank","matchLevel":0},"Prisma AIRS":{"href":"/aigw/introduction/welcome","matchLevel":4},"Virtual Keys (Deprecated)":{"href":"/api-reference/inference-api/rerank","matchLevel":0}},"firstHrefInLanguage":{}},"lastModified":"2026-09-15T13:55:28.650Z","gitLastModified":"2026-08-06T05:55:04.000Z","originalFileLocation":"api-reference/inference-api/rerank.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"application-name\" content=\"Portkey (Prisma AIRS AI Gateway) Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Rerank - Portkey (Prisma AIRS AI Gateway) Docs\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Portkey AI Gateway Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.portkey.ai/docs/api-reference/inference-api/rerank\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://portkey-docs.mintlify.app/_mintlify/api/og/v2?division=Rerank\u0026amp;title=Rerank\u0026amp;theme=262137c9f2583e48984715e7\u0026amp;signature=fd138815ab5b0c4aaedf17e2942151104068bea79349142c293a7bd263d4ada9\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Rerank - Portkey (Prisma AIRS AI Gateway) Docs\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://portkey-docs.mintlify.app/_mintlify/api/og/v2?division=Rerank\u0026amp;title=Rerank\u0026amp;theme=262137c9f2583e48984715e7\u0026amp;signature=fd138815ab5b0c4aaedf17e2942151104068bea79349142c293a7bd263d4ada9\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/portkey-docs/9Whrk-8bCE6hyGSn/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Portkey (Prisma AIRS AI Gateway) Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0891B2\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.portkey.ai/docs/api-reference/inference-api/rerank\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/api-reference/inference-api/rerank.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.portkey.ai/#organization\",\"name\":\"Portkey (Prisma AIRS AI Gateway) Docs\",\"url\":\"https://docs.portkey.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/portkey-docs/tHk-hgNjLbEj4dhh/images/portkey-PANW-company-logo-positive.png?fit=max\u0026auto=format\u0026n=tHk-hgNjLbEj4dhh\u0026q=85\u0026s=c5fb09014ff79616583b1d3bffe27450\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.portkey.ai/docs#website\",\"name\":\"Portkey (Prisma AIRS AI Gateway) Docs\",\"url\":\"https://docs.portkey.ai/docs\",\"publisher\":{\"@id\":\"https://docs.portkey.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.portkey.ai/docs/api-reference/inference-api/rerank#webpage\",\"url\":\"https://docs.portkey.ai/docs/api-reference/inference-api/rerank\",\"name\":\"Rerank\",\"dateModified\":\"2026-08-06T05:55:04.000Z\",\"isPartOf\":{\"@id\":\"https://docs.portkey.ai/docs#website\"},\"breadcrumb\":{\"@id\":\"https://docs.portkey.ai/docs/api-reference/inference-api/rerank#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.portkey.ai/docs/api-reference/inference-api/rerank#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portkey (Prisma AIRS AI Gateway) Docs\",\"item\":\"https://docs.portkey.ai/docs\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Rerank\",\"item\":\"https://docs.portkey.ai/docs/api-reference/inference-api/rerank\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.portkey.ai/docs/api-reference/inference-api/rerank#apireference\",\"headline\":\"Rerank\",\"name\":\"Rerank\",\"url\":\"https://docs.portkey.ai/docs/api-reference/inference-api/rerank\",\"mainEntityOfPage\":{\"@id\":\"https://docs.portkey.ai/docs/api-reference/inference-api/rerank#webpage\"},\"dateModified\":\"2026-08-06T05:55:04.000Z\",\"publisher\":{\"@id\":\"https://docs.portkey.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.portkey.ai/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Portkey (Prisma AIRS AI Gateway) Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Portkey (Prisma AIRS AI Gateway) Docs","nav":{"global":null,"versions":[{"version":"Latest","tabs":[{"tab":"Docs","pages":[{"title":"Docs","href":"/introduction/what-is-portkey"}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integrations/ecosystem"}]},{"tab":"Gateway APIs","groups":[{"group":"API Reference","pages":[{"title":"Introduction","href":"/api-reference/inference-api/introduction"},{"title":"Agentic Usage","href":"/api-reference/inference-api/agentic-usage"},{"title":"Supported Providers","href":"/api-reference/inference-api/supported-providers"},{"title":"Authentication","href":"/api-reference/inference-api/authentication"},{"title":"Headers","href":"/api-reference/inference-api/headers"},{"title":"Errors","href":"/api-reference/inference-api/error-codes"},{"title":"Response Schema","href":"/api-reference/inference-api/response-schema"},{"group":"More","pages":[{"title":"Gateway Config Object","href":"/api-reference/inference-api/config-object"},{"title":"OpenAPI Specification","url":"https://github.com/Portkey-AI/openapi","href":"/api-reference/inference-api/open-api-specification"}]}]},{"group":"SDK","pages":[{"title":"Supported SDKs","href":"/api-reference/sdk/list"},{"title":"Python","href":"/api-reference/sdk/python"},{"title":"Node.js","href":"/api-reference/sdk/node"},{"title":"C# (.NET)","href":"/api-reference/sdk/c-sharp"}]},{"group":"Chat Completions","pages":[{"title":"Chat","openapi":"post /chat/completions","href":"/api-reference/inference-api/chat"}]},{"group":"Responses","pages":[{"title":"Create a Response","openapi":"post /responses","href":"/api-reference/inference-api/responses/responses"},{"title":"Get a Response","openapi":"get /responses/{response_id}","href":"/api-reference/inference-api/responses/retrieve-response"},{"title":"Delete a Response","openapi":"delete /responses/{response_id}","href":"/api-reference/inference-api/responses/delete-response"},{"title":"List Input Items","openapi":"get /responses/{response_id}/input_items","href":"/api-reference/inference-api/responses/retrieve-inputs"}]},{"group":"Portkey Endpoints","pages":[{"title":"Prompt Completions","openapi":"post /prompts/{promptId}/completions","href":"/api-reference/inference-api/prompts/prompt-completion"},{"title":"Prompt Render","openapi":"post /prompts/{promptId}/render","href":"/api-reference/inference-api/prompts/render"},{"title":"Insert a Log","openapi":"post /logs","href":"/api-reference/admin-api/data-plane/logs/insert-a-log"},{"title":"Create Feedback","openapi":"post /feedback","href":"/api-reference/admin-api/data-plane/feedback/create-feedback"},{"title":"Update Feedback","openapi":"put /feedback/{id}","href":"/api-reference/admin-api/data-plane/feedback/update-feedback"},{"group":"Log Exports","pages":[{"title":"Retrieve a Log Export","openapi":"get /logs/exports/{exportId}","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/retrieve-a-log-export"},{"title":"Update a Log Export","openapi":"put /logs/exports/{exportId}","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/update-a-log-export"},{"title":"List a Log Export","openapi":"get /logs/exports","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/list-log-exports"},{"title":"Create a Log Export","openapi":"post /logs/exports","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/create-a-log-export"},{"title":"Start a Log Export","openapi":"post /logs/exports/{exportId}/start","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/start-a-log-export"},{"title":"Cancel a Log Export","openapi":"post /logs/exports/{exportId}/cancel","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/cancel-a-log-export"},{"title":"Delete a Log Export","openapi":"delete /logs/exports/{exportId}","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/delete-a-log-export"},{"title":"Download a Log Export","openapi":"get /logs/exports/{exportId}/download","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/download-a-log-export"}]}]},{"group":"Embeddings","pages":[{"title":"Embeddings","openapi":"post /embeddings","description":"","href":"/api-reference/inference-api/embeddings"}]},{"group":"Rerank","pages":[{"title":"Rerank","openapi":"post /rerank","href":"/api-reference/inference-api/rerank"}]},{"group":"Decisions","pages":[{"title":"Decisions","openapi":"post /decisions","description":"","href":"/api-reference/inference-api/decisions"}]},{"group":"OCR","pages":[{"title":"OCR","openapi":"post /ocr","href":"/api-reference/inference-api/ocr"}]},{"group":"Images","pages":[{"title":"Create Image","openapi":"post /images/generations","href":"/api-reference/inference-api/images/create-image"},{"title":"Create Image Edit","openapi":"post /images/edits","href":"/api-reference/inference-api/images/create-image-edit"},{"title":"Create Image Variation","openapi":"post /images/variations","href":"/api-reference/inference-api/images/create-image-variation"}]},{"group":"Models","pages":[{"title":"Models","openapi":"get /models","href":"/api-reference/inference-api/models/models"}]},{"group":"Audio","pages":[{"title":"Create Speech","openapi":"post /audio/speech","href":"/api-reference/inference-api/audio/create-speech"},{"title":"Create Transcription","openapi":"post /audio/transcriptions","href":"/api-reference/inference-api/audio/create-transcription"},{"title":"Create Translation","openapi":"post /audio/translations","href":"/api-reference/inference-api/audio/create-translation"}]},{"group":"Other APIs","pages":[{"title":"Gateway to Other APIs","icon":"chart-network","href":"/api-reference/inference-api/gateway-for-other-apis"}]},{"group":"Completions","pages":[{"title":"Completions","openapi":"post /completions","href":"/api-reference/inference-api/completions"}]},{"group":"Moderations","pages":[{"title":"Moderations","openapi":"post /moderations","href":"/api-reference/inference-api/moderations"}]},{"group":"Fine-tuning","pages":[{"title":"Create Fine-tuning Job","openapi":"post /fine_tuning/jobs","href":"/api-reference/inference-api/fine-tuning/create-fine-tuning-job"},{"title":"List Fine-tuning Jobs","openapi":"get /fine_tuning/jobs","href":"/api-reference/inference-api/fine-tuning/list-fine-tuning-jobs"},{"title":"Retrieve Fine-tuning Job","openapi":"get /fine_tuning/jobs/{fine_tuning_job_id}","href":"/api-reference/inference-api/fine-tuning/retrieve-fine-tuning-job"},{"title":"List Fine-tuning Events","openapi":"get /fine_tuning/jobs/{fine_tuning_job_id}/events","href":"/api-reference/inference-api/fine-tuning/list-fine-tuning-events"},{"title":"List Fine-tuning Checkpoints","openapi":"get /fine_tuning/jobs/{fine_tuning_job_id}/checkpoints","href":"/api-reference/inference-api/fine-tuning/list-fine-tuning-checkpoints"},{"title":"Cancel Fine-tuning","openapi":"post /fine_tuning/jobs/{fine_tuning_job_id}/cancel","href":"/api-reference/inference-api/fine-tuning/cancel-fine-tuning"}]},{"group":"Batch","pages":[{"title":"Create Batch","openapi":"post /batches","href":"/api-reference/inference-api/batch/create-batch"},{"title":"List Batch","openapi":"get /batches","href":"/api-reference/inference-api/batch/list-batch"},{"title":"Retrieve Batch","openapi":"get /batches/{batch_id}","href":"/api-reference/inference-api/batch/retrieve-batch"},{"title":"Cancel Batch","openapi":"post /batches/{batch_id}/cancel","href":"/api-reference/inference-api/batch/cancel-batch"}]},{"group":"Files","pages":[{"title":"Upload File","openapi":"post /files","href":"/api-reference/inference-api/files/upload-file"},{"title":"List Files","openapi":"get /files","href":"/api-reference/inference-api/files/list-files"},{"title":"Retrieve File","openapi":"get /files/{file_id}","href":"/api-reference/inference-api/files/retrieve-file"},{"title":"Retrieve File Content","openapi":"get /files/{file_id}/content","href":"/api-reference/inference-api/files/retrieve-file-content"},{"title":"Delete File","openapi":"delete /files/{file_id}","href":"/api-reference/inference-api/files/delete-file"}]},{"group":"Assistants","pages":[{"group":"Assistants","pages":[{"title":"Create Assistant","openapi":"post /assistants","href":"/api-reference/inference-api/assistants-api/assistants/create-assistant"},{"title":"List Assistant","openapi":"get /assistants","href":"/api-reference/inference-api/assistants-api/assistants/list-assistants"},{"title":"Retrieve Assistant","openapi":"get /assistants/{assistant_id}","href":"/api-reference/inference-api/assistants-api/assistants/retrieve-assistant"},{"title":"Modify Assistant","openapi":"post /assistants/{assistant_id}","href":"/api-reference/inference-api/assistants-api/assistants/modify-assistant"},{"title":"Delete Assistant","openapi":"delete /assistants/{assistant_id}","href":"/api-reference/inference-api/assistants-api/assistants/delete-assistant"}]},{"group":"Threads","pages":[{"title":"Create Thread","openapi":"post /threads","href":"/api-reference/inference-api/assistants-api/threads/create-thread"},{"title":"Retrieve Thread","openapi":"get /threads/{thread_id}","href":"/api-reference/inference-api/assistants-api/threads/retrieve-thread"},{"title":"Modify Thread","openapi":"post /threads/{thread_id}","href":"/api-reference/inference-api/assistants-api/threads/modify-thread"},{"title":"Delete Thread","openapi":"delete /threads/{thread_id}","href":"/api-reference/inference-api/assistants-api/threads/delete-thread"}]},{"group":"Messages","pages":[{"title":"Create Message","openapi":"post /threads/{thread_id}/messages","href":"/api-reference/inference-api/assistants-api/messages/create-message"},{"title":"List Message","openapi":"get /threads/{thread_id}/messages","href":"/api-reference/inference-api/assistants-api/messages/list-messages"},{"title":"Retrieve Message","openapi":"get /threads/{thread_id}/messages/{message_id}","href":"/api-reference/inference-api/assistants-api/messages/retrieve-message"},{"title":"Modify Message","openapi":"post /threads/{thread_id}/messages/{message_id}","href":"/api-reference/inference-api/assistants-api/messages/modify-message"},{"title":"Delete Message","openapi":"delete /threads/{thread_id}/messages/{message_id}","href":"/api-reference/inference-api/assistants-api/messages/delete-message"}]},{"group":"Runs","pages":[{"title":"Create Run","openapi":"post /threads/{thread_id}/runs","href":"/api-reference/inference-api/assistants-api/runs/create-run"},{"title":"Create thread and Run","openapi":"post /threads/runs","href":"/api-reference/inference-api/assistants-api/runs/create-thread-and-run"},{"title":"list Run","openapi":"get /threads/{thread_id}/runs","href":"/api-reference/inference-api/assistants-api/runs/list-runs"},{"title":"Retrieve Run","openapi":"get /threads/{thread_id}/runs/{run_id}","href":"/api-reference/inference-api/assistants-api/runs/retrieve-run"},{"title":"Modify Run","openapi":"post /threads/{thread_id}/runs/{run_id}","href":"/api-reference/inference-api/assistants-api/runs/modify-run"},{"title":"Submit Tool Outputs to Run","openapi":"post /threads/{thread_id}/runs/{run_id}/submit_tool_outputs","href":"/api-reference/inference-api/assistants-api/runs/submit-tool-outputs-to-run"},{"title":"Cancel Run","openapi":"post /threads/{thread_id}/runs/{run_id}/cancel","href":"/api-reference/inference-api/assistants-api/runs/cancel-run"}]},{"group":"Run Steps","pages":[{"title":"List Run Steps","openapi":"get /threads/{thread_id}/runs/{run_id}/steps","href":"/api-reference/inference-api/assistants-api/run-steps/list-run-steps"},{"title":"Retrieve Run Steps","openapi":"get /threads/{thread_id}/runs/{run_id}/steps/{step_id}","href":"/api-reference/inference-api/assistants-api/run-steps/retrieve-run-steps"}]}]}]},{"tab":"Admin APIs","pages":[{"title":"Admin APIs","href":"/api-reference/admin-api/introduction"}]},{"tab":"Cookbooks","pages":[{"title":"Cookbooks","href":"/guides/use-cases/run-batch-evals"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/2026/september"}]},{"tab":"Help Center","pages":[{"title":"Help Center","href":"/help-center/you-do-not-have-enough-permissions"}]}]},{"version":"Prisma AIRS","pages":[{"title":"Prisma AIRS","href":"/aigw/introduction/welcome"}]},{"version":"Virtual Keys (Deprecated)","tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/virtual_key_old/introduction/what-is-portkey"}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/virtual_key_old/integrations/ecosystem"}]},{"tab":"Inference API","groups":[{"group":"API Reference","pages":[{"title":"Introduction","href":"/api-reference/inference-api/introduction"},{"title":"Agentic Usage","href":"/api-reference/inference-api/agentic-usage"},{"title":"Supported Providers","href":"/api-reference/inference-api/supported-providers"},{"title":"Authentication","href":"/api-reference/inference-api/authentication"},{"title":"Headers","href":"/api-reference/inference-api/headers"},{"title":"Errors","href":"/api-reference/inference-api/error-codes"},{"title":"Response Schema","href":"/api-reference/inference-api/response-schema"},{"group":"More","pages":[{"title":"Gateway Config Object","href":"/api-reference/inference-api/config-object"},{"title":"OpenAPI Specification","url":"https://github.com/Portkey-AI/openapi","href":"/api-reference/inference-api/open-api-specification"}]}]},{"group":"SDK","pages":[{"title":"Supported SDKs","href":"/api-reference/sdk/list"},{"title":"Python","href":"/api-reference/sdk/python"},{"title":"Node.js","href":"/api-reference/sdk/node"},{"title":"C# (.NET)","href":"/api-reference/sdk/c-sharp"}]},{"group":"Chat Completions","pages":[{"title":"Chat","openapi":"post /chat/completions","href":"/api-reference/inference-api/chat"}]},{"group":"Responses","pages":[{"title":"Create a Response","openapi":"post /responses","href":"/api-reference/inference-api/responses/responses"},{"title":"Get a Response","openapi":"get /responses/{response_id}","href":"/api-reference/inference-api/responses/retrieve-response"},{"title":"Delete a Response","openapi":"delete /responses/{response_id}","href":"/api-reference/inference-api/responses/delete-response"},{"title":"List Input Items","openapi":"get /responses/{response_id}/input_items","href":"/api-reference/inference-api/responses/retrieve-inputs"}]},{"group":"Portkey Endpoints","pages":[{"title":"Prompt Completions","openapi":"post /prompts/{promptId}/completions","href":"/api-reference/inference-api/prompts/prompt-completion"},{"title":"Prompt Render","openapi":"post /prompts/{promptId}/render","href":"/api-reference/inference-api/prompts/render"},{"title":"Insert a Log","openapi":"post /logs","href":"/api-reference/admin-api/data-plane/logs/insert-a-log"},{"title":"Create Feedback","openapi":"post /feedback","href":"/api-reference/admin-api/data-plane/feedback/create-feedback"},{"title":"Update Feedback","openapi":"put /feedback/{id}","href":"/api-reference/admin-api/data-plane/feedback/update-feedback"},{"group":"Log Exports","pages":[{"title":"Retrieve a Log Export","openapi":"get /logs/exports/{exportId}","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/retrieve-a-log-export"},{"title":"Update a Log Export","openapi":"put /logs/exports/{exportId}","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/update-a-log-export"},{"title":"List a Log Export","openapi":"get /logs/exports","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/list-log-exports"},{"title":"Create a Log Export","openapi":"post /logs/exports","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/create-a-log-export"},{"title":"Start a Log Export","openapi":"post /logs/exports/{exportId}/start","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/start-a-log-export"},{"title":"Cancel a Log Export","openapi":"post /logs/exports/{exportId}/cancel","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/cancel-a-log-export"},{"title":"Delete a Log Export","openapi":"delete /logs/exports/{exportId}","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/delete-a-log-export"},{"title":"Download a Log Export","openapi":"get /logs/exports/{exportId}/download","href":"/api-reference/admin-api/data-plane/logs/log-exports-beta/download-a-log-export"}]}]},{"group":"Embeddings","pages":[{"title":"Embeddings","openapi":"post /embeddings","description":"","href":"/api-reference/inference-api/embeddings"}]},{"group":"Rerank","pages":[{"title":"Rerank","openapi":"post /rerank","href":"/api-reference/inference-api/rerank"}]},{"group":"Decisions","pages":[{"title":"Decisions","openapi":"post /decisions","description":"","href":"/api-reference/inference-api/decisions"}]},{"group":"OCR","pages":[{"title":"OCR","openapi":"post /ocr","href":"/api-reference/inference-api/ocr"}]},{"group":"Images","pages":[{"title":"Create Image","openapi":"post /images/generations","href":"/api-reference/inference-api/images/create-image"},{"title":"Create Image Edit","openapi":"post /images/edits","href":"/api-reference/inference-api/images/create-image-edit"},{"title":"Create Image Variation","openapi":"post /images/variations","href":"/api-reference/inference-api/images/create-image-variation"}]},{"group":"Audio","pages":[{"title":"Create Speech","openapi":"post /audio/speech","href":"/api-reference/inference-api/audio/create-speech"},{"title":"Create Transcription","openapi":"post /audio/transcriptions","href":"/api-reference/inference-api/audio/create-transcription"},{"title":"Create Translation","openapi":"post /audio/translations","href":"/api-reference/inference-api/audio/create-translation"}]},{"group":"Other APIs","pages":[{"title":"Gateway to Other APIs","icon":"chart-network","href":"/api-reference/inference-api/gateway-for-other-apis"}]},{"group":"Completions","pages":[{"title":"Completions","openapi":"post /completions","href":"/api-reference/inference-api/completions"}]},{"group":"Moderations","pages":[{"title":"Moderations","openapi":"post /moderations","href":"/api-reference/inference-api/moderations"}]},{"group":"Fine-tuning","pages":[{"title":"Create Fine-tuning Job","openapi":"post /fine_tuning/jobs","href":"/api-reference/inference-api/fine-tuning/create-fine-tuning-job"},{"title":"List Fine-tuning Jobs","openapi":"get /fine_tuning/jobs","href":"/api-reference/inference-api/fine-tuning/list-fine-tuning-jobs"},{"title":"Retrieve Fine-tuning Job","openapi":"get /fine_tuning/jobs/{fine_tuning_job_id}","href":"/api-reference/inference-api/fine-tuning/retrieve-fine-tuning-job"},{"title":"List Fine-tuning Events","openapi":"get /fine_tuning/jobs/{fine_tuning_job_id}/events","href":"/api-reference/inference-api/fine-tuning/list-fine-tuning-events"},{"title":"List Fine-tuning Checkpoints","openapi":"get /fine_tuning/jobs/{fine_tuning_job_id}/checkpoints","href":"/api-reference/inference-api/fine-tuning/list-fine-tuning-checkpoints"},{"title":"Cancel Fine-tuning","openapi":"post /fine_tuning/jobs/{fine_tuning_job_id}/cancel","href":"/api-reference/inference-api/fine-tuning/cancel-fine-tuning"}]},{"group":"Batch","pages":[{"title":"Create Batch","openapi":"post /batches","href":"/api-reference/inference-api/batch/create-batch"},{"title":"List Batch","openapi":"get /batches","href":"/api-reference/inference-api/batch/list-batch"},{"title":"Retrieve Batch","openapi":"get /batches/{batch_id}","href":"/api-reference/inference-api/batch/retrieve-batch"},{"title":"Cancel Batch","openapi":"post /batches/{batch_id}/cancel","href":"/api-reference/inference-api/batch/cancel-batch"}]},{"group":"Files","pages":[{"title":"Upload File","openapi":"post /files","href":"/api-reference/inference-api/files/upload-file"},{"title":"List Files","openapi":"get /files","href":"/api-reference/inference-api/files/list-files"},{"title":"Retrieve File","openapi":"get /files/{file_id}","href":"/api-reference/inference-api/files/retrieve-file"},{"title":"Retrieve File Content","openapi":"get /files/{file_id}/content","href":"/api-reference/inference-api/files/retrieve-file-content"},{"title":"Delete File","openapi":"delete /files/{file_id}","href":"/api-reference/inference-api/files/delete-file"}]},{"group":"Assistants","pages":[{"group":"Assistants","pages":[{"title":"Create Assistant","openapi":"post /assistants","href":"/api-reference/inference-api/assistants-api/assistants/create-assistant"},{"title":"List Assistant","openapi":"get /assistants","href":"/api-reference/inference-api/assistants-api/assistants/list-assistants"},{"title":"Retrieve Assistant","openapi":"get /assistants/{assistant_id}","href":"/api-reference/inference-api/assistants-api/assistants/retrieve-assistant"},{"title":"Modify Assistant","openapi":"post /assistants/{assistant_id}","href":"/api-reference/inference-api/assistants-api/assistants/modify-assistant"},{"title":"Delete Assistant","openapi":"delete /assistants/{assistant_id}","href":"/api-reference/inference-api/assistants-api/assistants/delete-assistant"}]},{"group":"Threads","pages":[{"title":"Create Thread","openapi":"post /threads","href":"/api-reference/inference-api/assistants-api/threads/create-thread"},{"title":"Retrieve Thread","openapi":"get /threads/{thread_id}","href":"/api-reference/inference-api/assistants-api/threads/retrieve-thread"},{"title":"Modify Thread","openapi":"post /threads/{thread_id}","href":"/api-reference/inference-api/assistants-api/threads/modify-thread"},{"title":"Delete Thread","openapi":"delete /threads/{thread_id}","href":"/api-reference/inference-api/assistants-api/threads/delete-thread"}]},{"group":"Messages","pages":[{"title":"Create Message","openapi":"post /threads/{thread_id}/messages","href":"/api-reference/inference-api/assistants-api/messages/create-message"},{"title":"List Message","openapi":"get /threads/{thread_id}/messages","href":"/api-reference/inference-api/assistants-api/messages/list-messages"},{"title":"Retrieve Message","openapi":"get /threads/{thread_id}/messages/{message_id}","href":"/api-reference/inference-api/assistants-api/messages/retrieve-message"},{"title":"Modify Message","openapi":"post /threads/{thread_id}/messages/{message_id}","href":"/api-reference/inference-api/assistants-api/messages/modify-message"},{"title":"Delete Message","openapi":"delete /threads/{thread_id}/messages/{message_id}","href":"/api-reference/inference-api/assistants-api/messages/delete-message"}]},{"group":"Runs","pages":[{"title":"Create Run","openapi":"post /threads/{thread_id}/runs","href":"/api-reference/inference-api/assistants-api/runs/create-run"},{"title":"Create thread and Run","openapi":"post /threads/runs","href":"/api-reference/inference-api/assistants-api/runs/create-thread-and-run"},{"title":"list Run","openapi":"get /threads/{thread_id}/runs","href":"/api-reference/inference-api/assistants-api/runs/list-runs"},{"title":"Retrieve Run","openapi":"get /threads/{thread_id}/runs/{run_id}","href":"/api-reference/inference-api/assistants-api/runs/retrieve-run"},{"title":"Modify Run","openapi":"post /threads/{thread_id}/runs/{run_id}","href":"/api-reference/inference-api/assistants-api/runs/modify-run"},{"title":"Submit Tool Outputs to Run","openapi":"post /threads/{thread_id}/runs/{run_id}/submit_tool_outputs","href":"/api-reference/inference-api/assistants-api/runs/submit-tool-outputs-to-run"},{"title":"Cancel Run","openapi":"post /threads/{thread_id}/runs/{run_id}/cancel","href":"/api-reference/inference-api/assistants-api/runs/cancel-run"}]},{"group":"Run Steps","pages":[{"title":"List Run Steps","openapi":"get /threads/{thread_id}/runs/{run_id}/steps","href":"/api-reference/inference-api/assistants-api/run-steps/list-run-steps"},{"title":"Retrieve Run Steps","openapi":"get /threads/{thread_id}/runs/{run_id}/steps/{step_id}","href":"/api-reference/inference-api/assistants-api/run-steps/retrieve-run-steps"}]}]}]},{"tab":"Admin API","pages":[{"title":"Admin API","href":"/api-reference/admin-api/introduction"}]},{"tab":"Cookbooks","pages":[{"title":"Cookbooks","href":"/guides/use-cases/run-batch-evals"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/2025/may"}]},{"tab":"Help articles","pages":[{"title":"Help articles","href":"/help-center/you-do-not-have-enough-permissions"}]}]}]},"title":"Rerank - Portkey (Prisma AIRS AI Gateway) Docs","buildId":"dpl_AUojGTPodKNPTVaxVPcxnNvkSVqo","deploymentId":"dpl_AUojGTPodKNPTVaxVPcxnNvkSVqo","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-D2GYGXhJ.js","utils-BFd71lo2.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-i162M7Za.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-oUw0la6W.js","snippetPresets-DtIWL37f.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-BCMBbEQM.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-DC4RgS91.js","shallow-CgVeLRFv.js","getApiPlaygroundDisplay-D5biMY5x.js","CodeSnippet-BFsbT-Fu.js","CodeSnippets-zLLOIece.js","Page-Ddn8iQDL.js","getPastedJson-BrHW4jRt.js","icon-CkMCp-Tk.js","MethodPill-CCcSM-Ep.js","DuplicateIcon-4tBrFI-V.js","createIcon-YbZxtfvX.js","DynamicMarkdown-BQC1aHST.js","SectionHeading-Dyh8yRs0.js","axios-vUo_bRtp.js","Markdown-DnRxVfNy.js","clsx-BHwt7gjg.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CI1QhstW.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-Ctpizp2W.js"]}