Rerank documents
https://my.neuronai.uz/api/v1/rerankOrders documents by how relevant each is to a query.
It works with Cohere's SDKs, at /api/v1/rerank and /api/v2/rerank. Billed per token, for the query and every document.
Нужен API-ключ с rerank:write.
Стоимость
за 1000 токенов- Input
- 0,1 кредита
Тело запроса
application/jsonJSON-объект.
modelstringОбязательноМакс. длина: 128
querystringОбязательноtop_ninteger | nullНеобязательныйМинимум: 1
return_documentsboolean | nullНеобязательныйdocumentsstring[]Обязательно
Ответ
200application/jsonThe documents, most relevant first. index is each one's position in documents, and usage counts the tokens billed.
idstringОбязательноmodelstringОбязательноresultsobject[]ОбязательноmetaobjectОбязательноusageobjectОбязательно
Заголовки
X-CostnumberНеобязательныйThe price billed, in credits.
X-Request-IdstringНеобязательныйIdentifies this request. A JSON body carries it as
request_idtoo; quote it to support.Формат: uuid
X-RateLimit-LimitintegerНеобязательныйThe requests a minute the rate limit on this endpoint allows. Sent once the limit has counted the request, so not when the key itself is refused.
X-RateLimit-RemainingintegerНеобязательныйHow many of them are left this minute.
Ошибки
- 401
The API key is missing or not recognized (
invalid_api_key), revoked (api_key_revoked), disabled (api_key_disabled) or expired (api_key_expired). - 402
Not enough balance (
insufficient_balance), or over the key's monthly spend limit (spend_limit_exceeded). Nothing is charged. - 403
The key lacks the permission this endpoint needs (
insufficient_permissions), or the client IP is not in its allowlist (ip_not_allowed). - 404
modelis not a rerank model this API serves:model_not_found. - 422
The request failed validation (
invalid_request), it has too many documents (too_many_documents), the query with a document is too long (input_too_large), or the model refused the input (upstream_rejected_input). Nothing is charged. - 429
The model is busy (
upstream_rate_limited), or a rate or concurrency limit was reached (rate_limit_exceeded,concurrency_limit_exceeded). Retry afterRetry-Afterseconds. Nothing is charged. - 502
The rerank model failed or could not be reached:
upstream_error. Nothing is charged. - default
Any other error, in the same shape, such as
server_error(500) orservice_unavailable(503).