import requests
url = "https://api.naga.ac/v1/rerank"
payload = {
"model": "qwen/qwen3-reranker-8b",
"query": "How do I rotate an API key?",
"documents": ["Create a new key, switch your clients to it, then revoke the old one.", "The balance is shown in US dollars.", "Keys can be limited to a monthly budget."]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'qwen/qwen3-reranker-8b',
query: 'How do I rotate an API key?',
documents: [
'Create a new key, switch your clients to it, then revoke the old one.',
'The balance is shown in US dollars.',
'Keys can be limited to a monthly budget.'
]
})
};
fetch('https://api.naga.ac/v1/rerank', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
curl https://api.naga.ac/v1/rerank \
-H "Authorization: Bearer $NAGA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen/qwen3-reranker-8b",
"query": "How do I rotate an API key?",
"documents": [
"Create a new key, switch your clients to it, then revoke the old one.",
"The balance is shown in US dollars.",
"Keys can be limited to a monthly budget."
],
"top_n": 2
}'
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.naga.ac/v1/rerank"
payload := strings.NewReader("{\n \"model\": \"qwen/qwen3-reranker-8b\",\n \"query\": \"How do I rotate an API key?\",\n \"documents\": [\n \"Create a new key, switch your clients to it, then revoke the old one.\",\n \"The balance is shown in US dollars.\",\n \"Keys can be limited to a monthly budget.\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
{
"id": "rrk-4tKq7Zc1Nb9Wx2Ry8Vd3Ms6Ph0Q",
"model": "qwen/qwen3-reranker-8b",
"results": [
{
"index": 0,
"relevance_score": 0.9812,
"document": {
"text": "Create a new key, switch your clients to it, then revoke the old one."
}
},
{
"index": 2,
"relevance_score": 0.1436,
"document": {
"text": "Keys can be limited to a monthly budget."
}
}
],
"usage": {
"total_tokens": 61
}
}
{
"error": {
"type": "invalid_api_key",
"message": "The provided API key is invalid. Please ensure your API key is correct and active. You can find more information about obtaining a key on our website: https://naga.ac If you just created this key, wait a few minutes and try again."
}
}
{
"error": {
"type": "insufficient_quota",
"message": "More credits required to process this request. Visit https://naga.ac/dashboard/credits to add credits."
}
}
{
"error": {
"type": "rate_limit_exceeded",
"message": "Free model limit reached (100 requests per day and 10 per minute). Try again in 3s, or add credits at https://naga.ac/dashboard/credits to use paid models, which have no request limit."
}
}
Ranks documents by their relevance to a query and charges the account for the tokens the model read. Requires an API key.
POST
https://api.naga.ac
/
v1
/
rerank
Python
import requests
url = "https://api.naga.ac/v1/rerank"
payload = {
"model": "qwen/qwen3-reranker-8b",
"query": "How do I rotate an API key?",
"documents": ["Create a new key, switch your clients to it, then revoke the old one.", "The balance is shown in US dollars.", "Keys can be limited to a monthly budget."]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'qwen/qwen3-reranker-8b',
query: 'How do I rotate an API key?',
documents: [
'Create a new key, switch your clients to it, then revoke the old one.',
'The balance is shown in US dollars.',
'Keys can be limited to a monthly budget.'
]
})
};
fetch('https://api.naga.ac/v1/rerank', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
curl https://api.naga.ac/v1/rerank \
-H "Authorization: Bearer $NAGA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen/qwen3-reranker-8b",
"query": "How do I rotate an API key?",
"documents": [
"Create a new key, switch your clients to it, then revoke the old one.",
"The balance is shown in US dollars.",
"Keys can be limited to a monthly budget."
],
"top_n": 2
}'
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.naga.ac/v1/rerank"
payload := strings.NewReader("{\n \"model\": \"qwen/qwen3-reranker-8b\",\n \"query\": \"How do I rotate an API key?\",\n \"documents\": [\n \"Create a new key, switch your clients to it, then revoke the old one.\",\n \"The balance is shown in US dollars.\",\n \"Keys can be limited to a monthly budget.\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
{
"id": "rrk-4tKq7Zc1Nb9Wx2Ry8Vd3Ms6Ph0Q",
"model": "qwen/qwen3-reranker-8b",
"results": [
{
"index": 0,
"relevance_score": 0.9812,
"document": {
"text": "Create a new key, switch your clients to it, then revoke the old one."
}
},
{
"index": 2,
"relevance_score": 0.1436,
"document": {
"text": "Keys can be limited to a monthly budget."
}
}
],
"usage": {
"total_tokens": 61
}
}
{
"error": {
"type": "invalid_api_key",
"message": "The provided API key is invalid. Please ensure your API key is correct and active. You can find more information about obtaining a key on our website: https://naga.ac If you just created this key, wait a few minutes and try again."
}
}
{
"error": {
"type": "insufficient_quota",
"message": "More credits required to process this request. Visit https://naga.ac/dashboard/credits to add credits."
}
}
{
"error": {
"type": "rate_limit_exceeded",
"message": "Free model limit reached (100 requests per day and 10 per minute). Try again in 3s, or add credits at https://naga.ac/dashboard/credits to use paid models, which have no request limit."
}
}
An account API key. Send it as Authorization: Bearer <key>.
Body
application/json
The request body of POST /v1/rerank.
model
string
required
The rerank model, named by its id or alias.
query
string
required
The search query the documents are ranked against.
documents
(string | Document object · object)[]
required
The documents to rank, from 1 to 1000: strings, or objects with text.
Required array length: 1 - 1000 elements
One document to rank: plain text, or an object carrying it.
models
string[] | null
Fallback models, tried in order when model cannot answer: none of its providers served it. At most 3, and only the model that answered is billed. A NagaAI extension in OpenRouter's shape.
Maximum array length: 3
routing
object | null
How NagaAI picks the providers for this request: max_price removes the ones above it and can fail the request. A NagaAI extension.
Hide child attributes
routing.max_price
object | null
The most this request may pay per unit, keyed by a meter of the model's pricing in GET /v1/models: {"output_image_token": "0.00003"} caps image output at 30 credits per million tokens, {"output_video_second": "0.1"} caps a video at 0.1 credits per second. NagaAI then sends the request only to providers whose price for each named meter is at or below the cap, and a model whose price is above it is not tried. A meter the model does not price is ignored. An unknown meter or a negative value draws a 400.
Hide child attributes
routing.max_price.{key}
stringnumber<double>
A price cap: credits per unit, as a decimal string or a JSON number.
top_n
integer<int64> | null
How many of the most relevant documents to return. All of them when absent.
Required range: x >= 1
return_documents
boolean
default:true
Whether each result carries its document's text. true when absent.
Response
The ranking. results carries the documents most relevant first, each with its index in the request and its score; usage carries the token count behind the charge.
The body of a successful POST /v1/rerank.
id
string
required
The identifier of this rerank, minted by the gateway.
model
string
required
The model that ranked, as the catalog id the request resolved to.
results
object[]
required
The documents, most relevant first, cut to top_n.
Hide child attributes
results.index
integer<int64>
required
The position of the document in the request's documents, from 0.
results.relevance_score
number<double>
required
How relevant the document is to the query; higher is more relevant. The scale is the model's own, so compare scores within one model only.
results.document
object | null
The document itself, unless the request set return_documents to false.
Hide child attributes
results.document.text
string
required
The document text, as the request sent it.
usage
object
required
What the request was billed on.
Hide child attributes
usage.total_tokens
integer<int64>
required
The tokens the model read: the query once beside each document, plus the documents.
usage.search_units
integer<int64> | null
The search units the request was billed, for a model sold per search: one query over up to 100 documents, a document past 500 tokens with the query counting once per 500-token chunk.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"NagaAI Documentation","colors":{"primary":"#5a5ae5","light":"#8893fa","dark":"#5351da"},"logo":{"light":"https://mintcdn.com/nagaai-60f8697b/3Tc2Ajidq18FPFoC/static/img/logo-light.svg?fit=max\u0026auto=format\u0026n=3Tc2Ajidq18FPFoC\u0026q=85\u0026s=18d579338bd90baa596e41e2e2322393","dark":"https://mintcdn.com/nagaai-60f8697b/3Tc2Ajidq18FPFoC/static/img/logo-dark.svg?fit=max\u0026auto=format\u0026n=3Tc2Ajidq18FPFoC\u0026q=85\u0026s=f4927df5611f5a22c6984a3e7b91b6a0"},"favicon":"https://mintcdn.com/nagaai-60f8697b/nbl1KDrtw3_cqedh/static/img/favicon.ico?fit=max\u0026auto=format\u0026n=nbl1KDrtw3_cqedh\u0026q=85\u0026s=a8361945277b5cce4de483745aa5c21c","api":{"params":{"expanded":"all"},"playground":{"display":"interactive"},"examples":{"defaults":"required","languages":["python","javascript","curl","go"],"prefill":true},"url":"full"},"appearance":{"default":"system"},"background":{"color":{"light":"#ffffff","dark":"#09090b"}},"navbar":{"links":[{"href":"https://naga.ac/models","label":"Models"},{"href":"https://naga.ac/pricing","label":"Pricing"},{"href":"https://naga.ac/playground","label":"Playground"}],"primary":{"type":"button","label":"Dashboard","href":"https://naga.ac/dashboard"}},"footer":{"socials":{"discord":"https://discord.naga.ac","github":"https://github.com/naga-ai-hub","x":"https://x.com/NagaAIProject","reddit":"https://www.reddit.com/r/NagaAI"},"links":[{"header":"Community","items":[{"label":"Status","href":"https://status.naga.ac"},{"label":"Announcements","href":"https://naga.ac/announcements"},{"label":"Support","href":"https://discord.naga.ac"}]},{"header":"Resources","items":[{"label":"Models","href":"https://naga.ac/models"},{"label":"Playground","href":"https://naga.ac/playground"},{"label":"Chat","href":"https://chat.naga.ac"}]},{"header":"Legal","items":[{"label":"Privacy","href":"https://naga.ac/legal/privacy"},{"label":"Terms","href":"https://naga.ac/legal/terms"}]}]},"fonts":{"family":"Geist"},"styling":{"codeblocks":{"theme":{"light":"github-light-default","dark":"github-dark-dimmed"}},"latex":true},"contextual":{"options":["copy","view","download-spec","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"nagaai-60f8697b","hasAudioNarration":false,"actualSubdomain":"nagaai-60f8697b","customDomains":["docs.naga.ac"],"gitSource":{"type":"github","owner":"naga-ai-hub","repo":"naga-ai","deployBranch":"master","contentDirectory":"docs-site","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6af8ff874f86660c4a26100c","clientVersion":"0.0.4143","searchFilterCounts":[{"language":"default","tag":"Docs","count":34},{"language":"default","tag":"API Reference","count":25},{"language":"default","tag":"Endpoints","count":24},{"language":"default","tag":"Guides","count":16},{"language":"default","tag":"Integrations","count":13},{"language":"default","tag":"Account","count":11},{"language":"default","tag":"Coding agents","count":8},{"language":"default","tag":"How NagaAI works","count":5},{"language":"default","tag":"API Keys","count":5},{"language":"default","tag":"Get started","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","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":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","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":"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":"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":"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":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","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":"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":"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":"turbopuffer-dual-write","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},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","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}],"googleFontsInlined":true},"customCss":[],"page":{"pagePath":"api-reference/rerank/rerank-documents","slug":"/api-reference/rerank/rerank-documents","pageMetadata":{"title":"Rerank documents","description":"Ranks documents by their relevance to a query and charges the account for the tokens the model read. Requires an API key.","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/rerank","href":"/api-reference/rerank/rerank-documents","autogeneratedByOpenApi":true},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Ranks documents by their relevance to a query and charges the account for the tokens the model read. Requires an API key.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"codeStyling":{"theme":{"light":"github-light-default","dark":"github-dark-dimmed"}},"config":{},"pageMetadata":{"title":"Rerank documents","description":"Ranks documents by their relevance to a query and charges the account for the tokens the model read. Requires an API key.","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/rerank","href":"/api-reference/rerank/rerank-documents","autogeneratedByOpenApi":true}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Rerank"],"summary":"Rerank documents","description":"Ranks documents by their relevance to a query and charges the account for the tokens the model read. Requires an API key.","operationId":"create_rerank","requestBody":"89ecb765-44b1-429f-ad3a-9acc251a6a39","responses":{"200":"6657d9f2-93ac-4c60-b247-73fc36c94fa6","400":"72ff2c87-c7e4-4bae-b8f7-dc5c2d2806fb","401":"9ad37232-919e-4665-8295-73df32df4ee6","402":"d8d1a217-acff-49cb-955c-e7148bc57c1b","403":"e21eac26-a6ec-4994-b528-bb3df5443417","408":"e591284a-f748-43ac-884f-fe7b5422fe4e","410":"dcfceaf9-b144-4da0-8eb7-6e475844bdeb","413":"01f7206b-c1fa-4e88-8f59-b36915f37772","422":"a4653372-f79d-46f2-aa50-a49f07d15cdc","429":"cef72b2e-e89c-4387-b55f-162e1f10440c","500":"2529944b-b95b-48a4-9104-bf4b940cce8f","503":"2ed6109d-4d7e-458a-bb98-8d3b9d7fc315"},"security":["1a52ac18-71ef-4dce-877d-876c7a3b516a","c2b95515-87a4-4acc-b552-17d77207bef5"],"x-codeSamples":[{"lang":"bash","label":"curl","source":"curl https://api.naga.ac/v1/rerank \\\n -H \"Authorization: Bearer $NAGA_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"qwen/qwen3-reranker-8b\",\n \"query\": \"How do I rotate an API key?\",\n \"documents\": [\n \"Create a new key, switch your clients to it, then revoke the old one.\",\n \"The balance is shown in US dollars.\",\n \"Keys can be limited to a monthly budget.\"\n ],\n \"top_n\": 2\n}'"}],"x-mcp":{"name":"naga_create_rerank","annotations":{"readOnlyHint":false,"destructiveHint":false,"idempotentHint":false,"openWorldHint":true}},"method":"post","type":"path","servers":["1f832259-cf6b-4a42-bbfa-27ea13bc5009"],"path":"/v1/rerank","baseUrlOptions":["https://api.naga.ac"],"title":"Rerank documents","codeSamples":[{"label":"curl","lang":"bash","source":"curl https://api.naga.ac/v1/rerank \\\n -H \"Authorization: Bearer $NAGA_API_KEY\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"model\": \"qwen/qwen3-reranker-8b\",\n \"query\": \"How do I rotate an API key?\",\n \"documents\": [\n \"Create a new key, switch your clients to it, then revoke the old one.\",\n \"The balance is shown in US dollars.\",\n \"Keys can be limited to a monthly budget.\"\n ],\n \"top_n\": 2\n}'"}],"requestExampleLanguages":["python","javascript","bash","go"],"requiredOnlyExamples":true,"requestExampleType":"codeSamples","responseExampleType":"generated","prefillPlaygroundWithExample":true,"prefillPlaygroundExamples":[{"body.model":"qwen/qwen3-reranker-8b","body.query":"How do I rotate an API key?","body.documents.items.0.oneOf.0":"Create a new key, switch your clients to it, then revoke the old one.","body.documents.items.1.oneOf.0":"The balance is shown in US dollars.","body.documents.items.2.oneOf.0":"Keys can be limited to a monthly budget.","body.top_n.oneOf.0":2}],"urlDisplay":"full"},"dependencies":{"parameters":{},"requestBody":{"content":{"application/json":{"schema":{"type":"object","description":"The request body of `POST /v1/rerank`.","required":["model","query","documents"],"properties":{"model":{"type":"string","description":"The rerank model, named by its id or alias.","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"query":{"type":"string","description":"The search query the documents are ranked against.","isRequired":true,"uniqueKey":"query","typeLabel":"string"},"documents":{"type":"array","items":{"oneOf":[{"type":"string","title":"Plain text","description":"One document to rank: plain text, or an object carrying it.","uniqueKey":"documents.items.[INDEX].oneOf.0","typeLabel":"string"},{"type":"object","title":"Document object","description":"One document to rank: plain text, or an object carrying it.","required":["text"],"properties":{"text":{"type":"string","description":"The document text.","isRequired":true,"uniqueKey":"documents.items.[INDEX].oneOf.1.text","typeLabel":"string"}},"additionalProperties":false,"uniqueKey":"documents.items.[INDEX].oneOf.1","typeLabel":"Document object · object"}],"uniqueKey":"documents.items.[INDEX]","typeLabel":"string | Document object · object"},"description":"The documents to rank, from 1 to 1000: strings, or objects with `text`.","maxItems":1000,"minItems":1,"isRequired":true,"uniqueKey":"documents","typeLabel":"(string | Document object · object)[]"},"models":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"models.oneOf.0.items.[INDEX]","typeLabel":"string"},"description":"Fallback models, tried in order when `model` cannot answer: none of its providers served it. At most 3, and only the model that answered is billed. A NagaAI extension in OpenRouter's shape.","maxItems":3,"uniqueKey":"models.oneOf.0","typeLabel":"string[]"},{"type":"null","items":{"type":"string"},"description":"Fallback models, tried in order when `model` cannot answer: none of its providers served it. At most 3, and only the model that answered is billed. A NagaAI extension in OpenRouter's shape.","maxItems":3,"uniqueKey":"models.oneOf.1","typeLabel":"null"}],"uniqueKey":"models","typeLabel":"string[] | null"},"routing":{"oneOf":[{"type":"object","description":"How NagaAI picks the providers for this request: `max_price` removes the ones above it and can fail the request. A NagaAI extension.","properties":{"max_price":{"oneOf":[{"type":"object","description":"The most this request may pay per unit, keyed by a `meter` of the model's `pricing` in `GET /v1/models`: `{\"output_image_token\": \"0.00003\"}` caps image output at 30 credits per million tokens, `{\"output_video_second\": \"0.1\"}` caps a video at 0.1 credits per second. NagaAI then sends the request only to providers whose price for each named meter is at or below the cap, and a model whose price is above it is not tried. A meter the model does not price is ignored. An unknown meter or a negative value draws a 400.","additionalProperties":{"oneOf":[{"type":"string","description":"A price cap: credits per unit, as a decimal string or a JSON number.","uniqueKey":"routing.oneOf.0.max_price.oneOf.0.additionalProperties.oneOf.0","typeLabel":"string"},{"type":"number","description":"A price cap: credits per unit, as a decimal string or a JSON number.","format":"double","uniqueKey":"routing.oneOf.0.max_price.oneOf.0.additionalProperties.oneOf.1","typeLabel":"number\u003cdouble>"}],"uniqueKey":"routing.oneOf.0.max_price.oneOf.0.additionalProperties","typeLabel":"string | number\u003cdouble>"},"propertyNames":{"type":"string"},"uniqueKey":"routing.oneOf.0.max_price.oneOf.0","typeLabel":"object"},{"type":"null","description":"The most this request may pay per unit, keyed by a `meter` of the model's `pricing` in `GET /v1/models`: `{\"output_image_token\": \"0.00003\"}` caps image output at 30 credits per million tokens, `{\"output_video_second\": \"0.1\"}` caps a video at 0.1 credits per second. NagaAI then sends the request only to providers whose price for each named meter is at or below the cap, and a model whose price is above it is not tried. A meter the model does not price is ignored. An unknown meter or a negative value draws a 400.","additionalProperties":{"oneOf":[{"type":"string","description":"A price cap: credits per unit, as a decimal string or a JSON number.","uniqueKey":"routing.oneOf.0.max_price.oneOf.1.additionalProperties.oneOf.0","typeLabel":"string"},{"type":"number","description":"A price cap: credits per unit, as a decimal string or a JSON number.","format":"double","uniqueKey":"routing.oneOf.0.max_price.oneOf.1.additionalProperties.oneOf.1","typeLabel":"number\u003cdouble>"}],"uniqueKey":"routing.oneOf.0.max_price.oneOf.1.additionalProperties","typeLabel":"string | number\u003cdouble>"},"propertyNames":{"type":"string"},"uniqueKey":"routing.oneOf.0.max_price.oneOf.1","typeLabel":"null"}],"uniqueKey":"routing.oneOf.0.max_price","typeLabel":"object | null"}},"additionalProperties":false,"uniqueKey":"routing.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"routing.oneOf.1","typeLabel":"null"}],"uniqueKey":"routing","typeLabel":"object | null"},"top_n":{"oneOf":[{"type":"integer","format":"int64","description":"How many of the most relevant documents to return. All of them when absent.","minimum":1,"uniqueKey":"top_n.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"How many of the most relevant documents to return. All of them when absent.","minimum":1,"uniqueKey":"top_n.oneOf.1","typeLabel":"null"}],"uniqueKey":"top_n","typeLabel":"integer\u003cint64> | null"},"return_documents":{"type":"boolean","description":"Whether each result carries its document's text. `true` when absent.","default":true,"uniqueKey":"return_documents","typeLabel":"boolean"}},"uniqueKey":"","typeLabel":"object"},"examples":{"basic":{"title":"basic","summary":"Rank three documents, keep the best two","value":{"model":"qwen/qwen3-reranker-8b","query":"How do I rotate an API key?","documents":["Create a new key, switch your clients to it, then revoke the old one.","The balance is shown in US dollars.","Keys can be limited to a monthly budget."],"top_n":2}}},"exampleType":"examples"}},"required":true,"exampleType":"examples"},"responses":{"6657d9f2-93ac-4c60-b247-73fc36c94fa6":{"description":"The ranking. `results` carries the documents most relevant first, each with its index in the request and its score; `usage` carries the token count behind the charge.","content":{"application/json":{"schema":{"type":"object","description":"The body of a successful `POST /v1/rerank`.","required":["id","model","results","usage"],"properties":{"id":{"type":"string","description":"The identifier of this rerank, minted by the gateway.","isRequired":true,"uniqueKey":"id","typeLabel":"string"},"model":{"type":"string","description":"The model that ranked, as the catalog id the request resolved to.","isRequired":true,"uniqueKey":"model","typeLabel":"string"},"results":{"type":"array","items":{"type":"object","description":"One ranked document.","required":["index","relevance_score"],"properties":{"index":{"type":"integer","format":"int64","description":"The position of the document in the request's `documents`, from 0.","isRequired":true,"uniqueKey":"results.items.[INDEX].index","typeLabel":"integer\u003cint64>"},"relevance_score":{"type":"number","format":"double","description":"How relevant the document is to the query; higher is more relevant. The scale is the model's own, so compare scores within one model only.","isRequired":true,"uniqueKey":"results.items.[INDEX].relevance_score","typeLabel":"number\u003cdouble>"},"document":{"oneOf":[{"type":"object","description":"The document itself, unless the request set `return_documents` to `false`.","required":["text"],"properties":{"text":{"type":"string","description":"The document text, as the request sent it.","isRequired":true,"uniqueKey":"results.items.[INDEX].document.oneOf.0.text","typeLabel":"string"}},"uniqueKey":"results.items.[INDEX].document.oneOf.0","typeLabel":"object"},{"type":"null","uniqueKey":"results.items.[INDEX].document.oneOf.1","typeLabel":"null"}],"uniqueKey":"results.items.[INDEX].document","typeLabel":"object | null"}},"uniqueKey":"results.items.[INDEX]","typeLabel":"object"},"description":"The documents, most relevant first, cut to `top_n`.","isRequired":true,"uniqueKey":"results","typeLabel":"object[]"},"usage":{"type":"object","description":"What the request was billed on.","required":["total_tokens"],"properties":{"total_tokens":{"type":"integer","format":"int64","description":"The tokens the model read: the query once beside each document, plus the documents.","isRequired":true,"uniqueKey":"usage.total_tokens","typeLabel":"integer\u003cint64>"},"search_units":{"oneOf":[{"type":"integer","format":"int64","description":"The search units the request was billed, for a model sold per search: one query over up to 100 documents, a document past 500 tokens with the query counting once per 500-token chunk.","uniqueKey":"usage.search_units.oneOf.0","typeLabel":"integer\u003cint64>"},{"type":"null","format":"int64","description":"The search units the request was billed, for a model sold per search: one query over up to 100 documents, a document past 500 tokens with the query counting once per 500-token chunk.","uniqueKey":"usage.search_units.oneOf.1","typeLabel":"null"}],"uniqueKey":"usage.search_units","typeLabel":"integer\u003cint64> | null"}},"isRequired":true,"uniqueKey":"usage","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"basic":{"title":"basic","summary":"Two results, best first","value":{"id":"rrk-4tKq7Zc1Nb9Wx2Ry8Vd3Ms6Ph0Q","model":"qwen/qwen3-reranker-8b","results":[{"index":0,"relevance_score":0.9812,"document":{"text":"Create a new key, switch your clients to it, then revoke the old one."}},{"index":2,"relevance_score":0.1436,"document":{"text":"Keys can be limited to a monthly budget."}}],"usage":{"total_tokens":61}}}},"exampleType":"examples"}},"x-retry-safe":false,"exampleType":"examples"},"72ff2c87-c7e4-4bae-b8f7-dc5c2d2806fb":{"description":"The request is malformed: a field failed its constraint, the body is not valid JSON, or the model name is unknown.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"generated"},"9ad37232-919e-4665-8295-73df32df4ee6":{"description":"The API key is missing, malformed, disabled, or does not belong to an account that may call this route.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"invalid-api-key":{"title":"invalid-api-key","summary":"401 — the key is not one this gateway serves","value":{"error":{"type":"invalid_api_key","message":"The provided API key is invalid. Please ensure your API key is correct and active. You can find more information about obtaining a key on our website: https://naga.ac If you just created this key, wait a few minutes and try again."}}}},"exampleType":"examples"}},"x-retry-safe":false,"exampleType":"examples"},"d8d1a217-acff-49cb-955c-e7148bc57c1b":{"description":"The account has run out of credits. Top up the balance and retry.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"insufficient-credits":{"title":"insufficient-credits","summary":"402 — the account has no credits left","value":{"error":{"type":"insufficient_quota","message":"More credits required to process this request. Visit https://naga.ac/dashboard/credits to add credits."}}}},"exampleType":"examples"}},"x-retry-safe":false,"exampleType":"examples"},"e21eac26-a6ec-4994-b528-bb3df5443417":{"description":"The model policy of the organization or of the key's workspace does not allow this model, a spending limit is reached, or the content was blocked by the moderation policy.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"generated"},"e591284a-f748-43ac-884f-fe7b5422fe4e":{"description":"The request body did not finish arriving within 15 minutes, or stalled for 60 seconds.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":true,"exampleType":"generated"},"dcfceaf9-b144-4da0-8eb7-6e475844bdeb":{"description":"The model is deprecated and no longer served. Pick a current one.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"generated"},"01f7206b-c1fa-4e88-8f59-b36915f37772":{"description":"The request body is larger than the 32 MiB this gateway accepts.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"generated"},"a4653372-f79d-46f2-aa50-a49f07d15cdc":{"description":"The request was understood but its usage could not be metered, so it was not served.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":false,"exampleType":"generated"},"cef72b2e-e89c-4387-b55f-162e1f10440c":{"description":"The account exceeded its rate limit. `Retry-After` carries the wait in seconds.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"How long to wait before retrying, in seconds."}},"content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"rate-limited":{"title":"rate-limited","summary":"429 — too many requests; `Retry-After` carries the wait","value":{"error":{"type":"rate_limit_exceeded","message":"Free model limit reached (100 requests per day and 10 per minute). Try again in 3s, or add credits at https://naga.ac/dashboard/credits to use paid models, which have no request limit."}}}},"exampleType":"examples"}},"x-retry-safe":true,"exampleType":"examples"},"2529944b-b95b-48a4-9104-bf4b940cce8f":{"description":"The gateway failed for a reason of its own. Report it — this status marks NagaAI's own bugs, never an upstream verdict.","content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":true,"exampleType":"generated"},"2ed6109d-4d7e-458a-bb98-8d3b9d7fc315":{"description":"No upstream is available, or the gateway is shedding load. `Retry-After` carries the suggested wait.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"How long to wait before retrying, in seconds."}},"content":{"application/json":{"schema":{"type":"object","description":"`{\"error\": {…}}` — the body of every non-2xx answer outside `/v1/messages`.","required":["error"],"properties":{"error":{"type":"object","description":"The failure itself, and the envelope's only member.","required":["type","message"],"properties":{"type":{"type":"string","description":"The class of the failure; a provider's own class can reach you unchanged.","examples":["invalid_request_error","authentication_required","invalid_api_key","invalid_provisioning_key","invalid_session_token","disabled_api_key","disabled_provisioning_key","expired_api_key","credit_limit_exceeded","rate_limit_exceeded","model_deprecated","inappropriate_content","billing_metering_incomplete","billing_request_id_invalid","billing_writer_missing","server_error"],"isRequired":true,"uniqueKey":"error.type","typeLabel":"string"},"message":{"type":"string","description":"The human-readable sentence shown to the caller.","isRequired":true,"uniqueKey":"error.message","typeLabel":"string"},"code":{"oneOf":[{"type":"string","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.0","typeLabel":"string"},{"type":"null","description":"The finer-grained code, when the failure has one.","uniqueKey":"error.code.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.code","typeLabel":"string | null"},"param":{"oneOf":[{"type":"string","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.0","typeLabel":"string"},{"type":"null","description":"The request field the failure is about, when it is about one.","uniqueKey":"error.param.oneOf.1","typeLabel":"null"}],"uniqueKey":"error.param","typeLabel":"string | null"}},"isRequired":true,"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"error":{"type":"invalid_request_error","message":"\u003cstring>","code":"\u003cstring>","param":"\u003cstring>"}}}},"exampleType":"generated"}},"x-retry-safe":true,"exampleType":"generated"}},"security":{"1a52ac18-71ef-4dce-877d-876c7a3b516a":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An account API key. Send it as `Authorization: Bearer \u003ckey>`.","scopes":[],"schemeName":"bearerAuth"}},"c2b95515-87a4-4acc-b552-17d77207bef5":{"xApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"An account API key. Send it as `x-api-key: \u003ckey>`, the header Anthropic-style clients use.","scopes":[],"schemeName":"xApiKeyAuth"}}},"servers":{"1f832259-cf6b-4a42-bbfa-27ea13bc5009":{"url":"https://api.naga.ac","description":"Production"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"An account API key. Send it as `Authorization: Bearer \u003ckey>`.","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"An account API key. Send it as `Authorization: Bearer \u003ckey>`.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"},{"schemes":[{"scheme":{"type":"apiKey","in":"header","name":"x-api-key","description":"An account API key. Send it as `x-api-key: \u003ckey>`, the header Anthropic-style clients use.","scopes":[],"schemeName":"xApiKeyAuth"},"schema":{"title":"x-api-key","type":"string","description":"An account API key. Send it as `x-api-key: \u003ckey>`, the header Anthropic-style clients use.","isRequired":true,"typeLabel":"string","deprecated":false},"schemeName":"xApiKeyAuth","name":"x-api-key"}],"title":"xApiKeyAuth"}]},"originalFileLocation":"openapi/naga-api.json"},"subdomain":"nagaai-60f8697b","siteName":"NagaAI Documentation","title":"Rerank documents - NagaAI Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-14T21:48:24.336Z","originalFileLocation":"api-reference/rerank/rerank-documents.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=\"description\" content=\"Ranks documents by their relevance to a query and charges the account for the tokens the model read. Requires an API key.\">\u003cmeta data-mint-head name=\"application-name\" content=\"NagaAI Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_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=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Rerank documents - NagaAI Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Ranks documents by their relevance to a query and charges the account for the tokens the model read. Requires an API key.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"NagaAI Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.naga.ac/api-reference/rerank/rerank-documents\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://nagaai-60f8697b.mintlify.site/_mintlify/api/og/v2?division=Rerank\u0026amp;title=Rerank+documents\u0026amp;description=Ranks+documents+by+their+relevance+to+a+query+and+charges+the+account+for+the+tokens+the+model+read.+Requires+an+API+key.\u0026amp;theme=53b53c58c5b757ba80c9164d\u0026amp;signature=f4bc31426b0f07fc0597c4f044092c4110297cec458ae9186a2349c1bb58d38a\">\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 documents - NagaAI Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Ranks documents by their relevance to a query and charges the account for the tokens the model read. Requires an API key.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://nagaai-60f8697b.mintlify.site/_mintlify/api/og/v2?division=Rerank\u0026amp;title=Rerank+documents\u0026amp;description=Ranks+documents+by+their+relevance+to+a+query+and+charges+the+account+for+the+tokens+the+model+read.+Requires+an+API+key.\u0026amp;theme=53b53c58c5b757ba80c9164d\u0026amp;signature=f4bc31426b0f07fc0597c4f044092c4110297cec458ae9186a2349c1bb58d38a\">\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=\"/mintlify-assets/_mintlify/favicons/nagaai-60f8697b/GL7s2nR26U7RrKZ8/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"NagaAI Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#5a5ae5\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.naga.ac/api-reference/rerank/rerank-documents\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/rerank/rerank-documents.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.naga.ac/#organization\",\"name\":\"NagaAI Documentation\",\"url\":\"https://docs.naga.ac\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/nagaai-60f8697b/3Tc2Ajidq18FPFoC/static/img/logo-light.svg?fit=max\u0026auto=format\u0026n=3Tc2Ajidq18FPFoC\u0026q=85\u0026s=18d579338bd90baa596e41e2e2322393\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.naga.ac#website\",\"name\":\"NagaAI Documentation\",\"url\":\"https://docs.naga.ac\",\"publisher\":{\"@id\":\"https://docs.naga.ac/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.naga.ac/api-reference/rerank/rerank-documents#webpage\",\"url\":\"https://docs.naga.ac/api-reference/rerank/rerank-documents\",\"name\":\"Rerank documents\",\"description\":\"Ranks documents by their relevance to a query and charges the account for the tokens the model read. Requires an API key.\",\"dateModified\":\"2026-11-14T21:48:24.336Z\",\"isPartOf\":{\"@id\":\"https://docs.naga.ac#website\"},\"breadcrumb\":{\"@id\":\"https://docs.naga.ac/api-reference/rerank/rerank-documents#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.naga.ac/api-reference/rerank/rerank-documents#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Endpoints\",\"item\":\"https://docs.naga.ac/api-reference/responses/create-a-response\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Rerank documents\",\"item\":\"https://docs.naga.ac/api-reference/rerank/rerank-documents\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.naga.ac/api-reference/rerank/rerank-documents#apireference\",\"headline\":\"Rerank documents\",\"name\":\"Rerank documents\",\"description\":\"Ranks documents by their relevance to a query and charges the account for the tokens the model read. Requires an API key.\",\"url\":\"https://docs.naga.ac/api-reference/rerank/rerank-documents\",\"mainEntityOfPage\":{\"@id\":\"https://docs.naga.ac/api-reference/rerank/rerank-documents#webpage\"},\"dateModified\":\"2026-11-14T21:48:24.336Z\",\"publisher\":{\"@id\":\"https://docs.naga.ac/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.naga.ac#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"NagaAI Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"NagaAI Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/rerank/rerank-documents.md","siteName":"NagaAI Documentation","nav":{"global":null,"tabs":[{"tab":"Docs","pages":[{"title":"Docs","href":"/get-started/quickstart"}]},{"tab":"API Reference","groups":[{"group":"Overview","pages":[{"title":"API reference","sidebarTitle":"Overview","icon":"book","href":"/api-reference/overview"}]},{"group":"Endpoints","pages":[{"group":"Responses","expanded":false,"pages":[{"title":"Create a response","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/responses","href":"/api-reference/responses/create-a-response"}]},{"group":"Chat Completions","expanded":false,"pages":[{"title":"Create a chat completion","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/chat/completions","href":"/api-reference/chat-completions/create-a-chat-completion"}]},{"group":"Messages","expanded":false,"pages":[{"title":"Create a message","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/messages","href":"/api-reference/messages/create-a-message"}]},{"group":"Models","expanded":false,"pages":[{"title":"List models","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/models","href":"/api-reference/models/list-models"}]},{"group":"Startups","expanded":false,"pages":[{"title":"List startups","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/startups","href":"/api-reference/startups/list-startups"}]},{"group":"Embeddings","expanded":false,"pages":[{"title":"Create embeddings","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/embeddings","href":"/api-reference/embeddings/create-embeddings"}]},{"group":"Moderations","expanded":false,"pages":[{"title":"Classify content","description":"Classifies text and images against a moderation model's categories and charges the account for the tokens it counted. Requires an API key.","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/moderations","href":"/api-reference/moderations/classify-content"}]},{"group":"Rerank","expanded":false,"pages":[{"title":"Rerank documents","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/rerank","href":"/api-reference/rerank/rerank-documents"}]},{"group":"Audio","expanded":false,"pages":[{"title":"Create speech","description":"Converts text into spoken audio and charges the account for what it counted. Requires an API key.","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/audio/speech","href":"/api-reference/audio/create-speech"},{"title":"Create a transcription","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/audio/transcriptions","href":"/api-reference/audio/create-a-transcription"},{"title":"Create a translation","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/audio/translations","href":"/api-reference/audio/create-a-translation"}]},{"group":"Images","expanded":false,"pages":[{"title":"Create an image","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/images/generations","href":"/api-reference/images/create-an-image"},{"title":"Edit an image","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/images/edits","href":"/api-reference/images/edit-an-image"}]},{"group":"Videos","expanded":false,"pages":[{"title":"Create a video","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/videos","href":"/api-reference/videos/create-a-video"},{"title":"Get a video job","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/videos/{id}","href":"/api-reference/videos/get-a-video-job"},{"title":"Download a video","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/videos/{id}/content","href":"/api-reference/videos/download-a-video"}]},{"group":"Requests","expanded":false,"pages":[{"title":"Get a request","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/requests/{id}","href":"/api-reference/requests/get-a-request"}]},{"group":"Account","expanded":false,"pages":[{"title":"Get the account balance","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/account/balance","href":"/api-reference/account/get-the-account-balance"},{"title":"Get account activity","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/account/activity","href":"/api-reference/account/get-account-activity"},{"group":"API Keys","expanded":false,"pages":[{"title":"List API keys","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/account/keys","href":"/api-reference/api-keys/list-api-keys"},{"title":"Create an API key","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json post /v1/account/keys","href":"/api-reference/api-keys/create-an-api-key"},{"title":"Get an API key","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json get /v1/account/keys/{key_id}","href":"/api-reference/api-keys/get-an-api-key"},{"title":"Update an API key","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json patch /v1/account/keys/{key_id}","href":"/api-reference/api-keys/update-an-api-key"},{"title":"Delete an API key","deprecated":null,"version":null,"openapi":"/openapi/naga-api.json delete /v1/account/keys/{key_id}","href":"/api-reference/api-keys/delete-an-api-key"}]}]}]}]},{"tab":"Integrations","pages":[{"title":"Integrations","href":"/integrations/agents/claude-code"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]}]},"basePath":"","title":"Rerank documents - NagaAI Documentation","buildId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","deploymentId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-DdEMm2kG.js","utils-BMo572L7.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-C-4m9KAx.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-DPLK2Oq9.js","snippetPresets-BKjfJMC9.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-DTsgtCEj.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-C8vmhyQM.js","shallow-r9w8LQGS.js","getApiPlaygroundDisplay-DjPI64HQ.js","CodeSnippet-C8Bvhl16.js","CodeSnippets-BtWUwcMy.js","Page-BIYvYBgk.js","getPastedJson-Dcm_3Pgl.js","icon-BXwrTpjc.js","MethodPill-CcjfVmmy.js","DuplicateIcon-BuKIbXAQ.js","createIcon-DaL9yXsO.js","DynamicMarkdown-Co5nikxh.js","SectionHeading-P4UNTsMZ.js","axios-vUo_bRtp.js","Markdown-CEfymfIH.js","clsx-Dq9TQuNi.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-D2J8knkn.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-BgZ2ThuU.js"]}