{
"results": [
{
"index": 1,
"relevance_score": 0.91
},
{
"index": 0,
"relevance_score": 0.12
}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}重排文档
请求参数、响应与渠道兼容边界。
{
"results": [
{
"index": 1,
"relevance_score": 0.91
},
{
"index": 0,
"relevance_score": 0.12
}
]
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<unknown>"
}
}POST /v1/rerank
发送 JSON,提供 model、非空 query 和候选 documents。建议显式设置 top_n、return_documents,并查看指南中的渠道差异;这些参数不保证原样转发。
results[].index 指向原输入数组位置,relevance_score 是模型相关的排序分数。document 和 usage 的实际形状与可用性依赖渠道,客户端允许额外字段,且不能依赖回传原文。此接口只排序传入候选,不生成向量或回答。
完整指南与可运行示例
Read in English授权
模型调用 API Key,不是控制台登录凭据 / Model API key, not console login credentials
请求体
支持此接口且当前密钥可用的模型 / Model available to this key and supporting this endpoint
"YOUR_MODEL_ID"
非空查询文本 / Nonempty query text
1非空候选列表;优先字符串,对象字段由渠道决定 / Nonempty candidates; prefer strings, object fields depend on channel
11建议正整数且不超过候选数;Cohere 省略或非正数时转为 1,其他渠道默认不同 / Use a positive count no larger than candidates; Cohere maps omitted/nonpositive to 1, other defaults differ
x >= 1请求回传原文;Cohere 强制 true,Ali 省略时默认 true;不能作为通用不回传保证 / Request source text; Cohere forces true, Ali defaults to true when omitted; not a universal suppression guarantee
可选渠道参数;注意单数拼写,部分适配器不转发 / Optional channel parameter; singular spelling, not forwarded by all adaptors
可选分块重叠参数;支持情况由渠道决定 / Optional chunk overlap; support depends on channel