Rerank documents
curl --request POST \
--url https://api.conare.ai/api/v1/rerank \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "How do I cancel a running agent safely?",
"documents": [
{
"id": "docs:checkpointing",
"text": "Persist the checkpoint before cancelling the run."
},
{
"id": "web:interrupts",
"text": "Cancellation interrupts execution immediately."
}
],
"limit": 2
}
'import requests
url = "https://api.conare.ai/api/v1/rerank"
payload = {
"query": "How do I cancel a running agent safely?",
"documents": [
{
"id": "docs:checkpointing",
"text": "Persist the checkpoint before cancelling the run."
},
{
"id": "web:interrupts",
"text": "Cancellation interrupts execution immediately."
}
],
"limit": 2
}
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({
query: 'How do I cancel a running agent safely?',
documents: [
{
id: 'docs:checkpointing',
text: 'Persist the checkpoint before cancelling the run.'
},
{id: 'web:interrupts', text: 'Cancellation interrupts execution immediately.'}
],
limit: 2
})
};
fetch('https://api.conare.ai/api/v1/rerank', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.conare.ai/api/v1/rerank",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'How do I cancel a running agent safely?',
'documents' => [
[
'id' => 'docs:checkpointing',
'text' => 'Persist the checkpoint before cancelling the run.'
],
[
'id' => 'web:interrupts',
'text' => 'Cancellation interrupts execution immediately.'
]
],
'limit' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.conare.ai/api/v1/rerank"
payload := strings.NewReader("{\n \"query\": \"How do I cancel a running agent safely?\",\n \"documents\": [\n {\n \"id\": \"docs:checkpointing\",\n \"text\": \"Persist the checkpoint before cancelling the run.\"\n },\n {\n \"id\": \"web:interrupts\",\n \"text\": \"Cancellation interrupts execution immediately.\"\n }\n ],\n \"limit\": 2\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))
}HttpResponse<String> response = Unirest.post("https://api.conare.ai/api/v1/rerank")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"How do I cancel a running agent safely?\",\n \"documents\": [\n {\n \"id\": \"docs:checkpointing\",\n \"text\": \"Persist the checkpoint before cancelling the run.\"\n },\n {\n \"id\": \"web:interrupts\",\n \"text\": \"Cancellation interrupts execution immediately.\"\n }\n ],\n \"limit\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.conare.ai/api/v1/rerank")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"How do I cancel a running agent safely?\",\n \"documents\": [\n {\n \"id\": \"docs:checkpointing\",\n \"text\": \"Persist the checkpoint before cancelling the run.\"\n },\n {\n \"id\": \"web:interrupts\",\n \"text\": \"Cancellation interrupts execution immediately.\"\n }\n ],\n \"limit\": 2\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"model": "<string>",
"provider": "<string>",
"results": [
{
"id": "<string>",
"index": 1,
"score": 123
}
],
"_timing": {
"providerMs": 123,
"totalMs": 123,
"candidateCount": 123,
"resultCount": 123,
"budgetMs": 80,
"budgetPassed": true
},
"usage": {
"totalChars": 123,
"approxInputTokens": 123
}
}{
"statusCode": 123,
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"statusCode": 123,
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"statusCode": 123,
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"statusCode": 123,
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"statusCode": 123,
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"statusCode": 123,
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": {}
}Reranking
Rerank documents
Rerank 1-64 caller-owned candidates with the same configured retrieval
reranker used by Conare search. Candidates are scored and returned;
nothing is stored and no endUserId is involved.
modelis a pin, not a selector. A name other than the one returned by the endpoint fails with400 model_not_served.- The memory plane enforces an 80 ms direct-rerank budget and reports
measured provider and total compute in
_timing. Network time to the Conare edge remains visible to the caller’s own wall clock. - Candidate IDs must be unique and are returned verbatim with both the original input index and the reranker score.
POST
/
api
/
v1
/
rerank
Rerank documents
curl --request POST \
--url https://api.conare.ai/api/v1/rerank \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "How do I cancel a running agent safely?",
"documents": [
{
"id": "docs:checkpointing",
"text": "Persist the checkpoint before cancelling the run."
},
{
"id": "web:interrupts",
"text": "Cancellation interrupts execution immediately."
}
],
"limit": 2
}
'import requests
url = "https://api.conare.ai/api/v1/rerank"
payload = {
"query": "How do I cancel a running agent safely?",
"documents": [
{
"id": "docs:checkpointing",
"text": "Persist the checkpoint before cancelling the run."
},
{
"id": "web:interrupts",
"text": "Cancellation interrupts execution immediately."
}
],
"limit": 2
}
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({
query: 'How do I cancel a running agent safely?',
documents: [
{
id: 'docs:checkpointing',
text: 'Persist the checkpoint before cancelling the run.'
},
{id: 'web:interrupts', text: 'Cancellation interrupts execution immediately.'}
],
limit: 2
})
};
fetch('https://api.conare.ai/api/v1/rerank', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.conare.ai/api/v1/rerank",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'query' => 'How do I cancel a running agent safely?',
'documents' => [
[
'id' => 'docs:checkpointing',
'text' => 'Persist the checkpoint before cancelling the run.'
],
[
'id' => 'web:interrupts',
'text' => 'Cancellation interrupts execution immediately.'
]
],
'limit' => 2
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.conare.ai/api/v1/rerank"
payload := strings.NewReader("{\n \"query\": \"How do I cancel a running agent safely?\",\n \"documents\": [\n {\n \"id\": \"docs:checkpointing\",\n \"text\": \"Persist the checkpoint before cancelling the run.\"\n },\n {\n \"id\": \"web:interrupts\",\n \"text\": \"Cancellation interrupts execution immediately.\"\n }\n ],\n \"limit\": 2\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))
}HttpResponse<String> response = Unirest.post("https://api.conare.ai/api/v1/rerank")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"How do I cancel a running agent safely?\",\n \"documents\": [\n {\n \"id\": \"docs:checkpointing\",\n \"text\": \"Persist the checkpoint before cancelling the run.\"\n },\n {\n \"id\": \"web:interrupts\",\n \"text\": \"Cancellation interrupts execution immediately.\"\n }\n ],\n \"limit\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.conare.ai/api/v1/rerank")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"query\": \"How do I cancel a running agent safely?\",\n \"documents\": [\n {\n \"id\": \"docs:checkpointing\",\n \"text\": \"Persist the checkpoint before cancelling the run.\"\n },\n {\n \"id\": \"web:interrupts\",\n \"text\": \"Cancellation interrupts execution immediately.\"\n }\n ],\n \"limit\": 2\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"model": "<string>",
"provider": "<string>",
"results": [
{
"id": "<string>",
"index": 1,
"score": 123
}
],
"_timing": {
"providerMs": 123,
"totalMs": 123,
"candidateCount": 123,
"resultCount": 123,
"budgetMs": 80,
"budgetPassed": true
},
"usage": {
"totalChars": 123,
"approxInputTokens": 123
}
}{
"statusCode": 123,
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"statusCode": 123,
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"statusCode": 123,
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"statusCode": 123,
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"statusCode": 123,
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": {}
}{
"statusCode": 123,
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"details": {}
}Authorizations
A scoped Integration key, prefixed cint_. Send as
Authorization: Bearer cint_... on every request. Server-side only.
Legacy personal cmem_... keys remain accepted during migration;
team/org-scoped cmem_... keys are not valid on this API.
Body
application/json
Required string length:
1 - 8192Required array length:
1 - 64 elementsShow child attributes
Show child attributes
Results to return; defaults to the document count and cannot exceed it.
Required range:
1 <= x <= 64Optional serving-model pin; any non-serving name fails loudly.
Minimum string length:
1