aisplice

API reference

Rerank

No model serves this yet

Nothing in the model catalogue supports this route right now. The page stays for reference.
POST/v1/rerank

Score a list of candidate documents against one query. Results are returned in descending relevance order and retain each document’s original index.

#Request parameters

  • modelstringrequired

    Exact rerank model identifier from the live model catalogue.

  • querystringrequired

    The search query or question used to score candidates.

  • documentsstring[]required

    Candidate passages to rank. Keep their original order in your application.

  • top_nintegeroptional

    Maximum number of ranked results to return.

  • return_documentsbooleanoptional

    When supported, include document text in each result.

#Related errors

  • 400 invalid_request_errorquery or documents is missing, empty, or unsupported by this model.
  • 401Invalid or missing bearer token. No error.code on this path — match the status.
  • 402 insufficient_user_quotaWallet balance cannot cover the pre-reserved estimate.
  • 429Per-key throttle. Empty body; wait for Retry-After. A 429 that does carry insufficient_user_quota is a daily spend cap instead.
  • 503 model_not_foundUnknown model, or no healthy channel serves it right now.

Full error-code table →

#Request example

curl https://www.aisplice.store/v1/rerank \
  -H "Authorization: Bearer sk-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YOUR_RERANK_MODEL",
    "query": "What is the capital of France?",
    "documents": [
      "Paris is the capital of France.",
      "Berlin is in Germany."
    ],
    "top_n": 2
  }'

#Response

response.json
{
  "results": [
    { "index": 0, "relevance_score": 0.9821 },
    { "index": 1, "relevance_score": 0.1034 }
  ]
}

Still stuck?

Send us the request ID or the error message and we will look into it.