Rerank — Vectors and ranking
Use a primary API key bound to the Embedding / Rerank group. GET /v1/models is authoritative for models available to this key; do not reuse an Audio or chat group key. Use bge-m3 for text embeddings when it is returned by your key.
2026-10-08 · GET /v1/models · Embedding / RerankGET /v1/models · Embedding / Rerank
- bge-reranker-large
- Qwen3-Reranker-8B
- Qwen3-Reranker-4B
- Qwen3-Reranker-0.6B
- bce-reranker-base_v1
- bge-reranker-v2-m3
curl "https://apixly.ai/v1/models" -H "Authorization: Bearer YOUR_API_KEY"Availability depends on the key and current route. jina-clip-v1 and jina-clip-v2 are compatibility entries, not currently advertised reachable routes; use them only if GET /v1/models explicitly returns them. A public price alone does not grant access.
Requests and counting
Embedding: a string or flat token-ID array is one input; a string array, nested token-ID arrays or multimodal object array counts outer entries. Each object counts once, including text plus image together. Rerank counts documents, not query or top_n. Sentence similarity counts inputs.sentences, not source_sentence. Nonempty inputs are required; embedding accepts up to 1000 entries and rerank/similarity up to 200 candidates. There is no 25-input request cap.
curl --max-time 120 "https://apixly.ai/v1/sentence-similarity" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "bge-reranker-large",
"inputs": {
"source_sentence": "fruit",
"sentences": [
"Database software",
"Apples and pears"
]
}
}'Parameters
Names may include a namespace, for example Qwen/Qwen3-Embedding-0.6B. Token IDs must be nonnegative integers. Only the four image models listed below accept image entries; URL/data URI support depends on the selected model. Qwen3 embedding dimensions are positive integers within each model's bound; omit dimensions for other models unless supported. Float is the default encoding; base64 contains little-endian IEEE 754 float32 values, not image data. Rerank results are sorted by relevance_score; index refers to the original documents array. top_n changes returned results, not billable candidate count; Qwen rerank instruction is optional.
| Model | endpoint |
|---|---|
| bge-reranker-large | /v1/rerank → /v1/sentence-similarity |
| all-mpnet-base-v2 · bce-reranker-base_v1 · bge-reranker-large · bge-reranker-v2-m3 | /v1/sentence-similarity |
USD pricing
A request with 1–25 inputs costs $0.000036 per input for every model. With 26 or more, native token-metered models use actual reported tokens at the rates below; ONLY the six input-billed models use $0.00004 per input for 26+ requests. The gateway splits those calls into groups of at most 25 and combines results. These are different units, not a universal 10% increase. Group multipliers and customer discounts apply; the current model catalog is authoritative. Usage preserves original tokens: zero tokens does not mean a free customer request. X-Billable-Inputs and X-Billing-Unit show the count and billing unit.
all-mpnet-base-v2 /v1/sentence-similarity uses the default per-input price in both count ranges (currently $0.000036/input); its /v1/embeddings still uses actual tokens from 26 inputs. BGE/BCE similarity costs $0.00004/input from 26. Response headers X-Billable-Inputs and X-Billing-Unit identify this request's count and unit.
| Model · 26+ | USD |
|---|---|
| Qwen3-Reranker-4B | $0.08 / 1M tokens |
| Qwen3-Reranker-8B | $0.17 / 1M tokens |
| Qwen3-VL-Embedding-8B | $0.21 / 1M tokens |
| Qwen3-Embedding-0.6B / 4B / 8B · Qwen3-Reranker-0.6B · other token models | $0.04 / 1M tokens |
| jina-clip-v1 · jina-clip-v2 · jina-embeddings-v4 · bge-reranker-large · bce-reranker-base_v1 · bge-reranker-v2-m3 | $0.00004 / input (26+) |
Examples
Discover models first, then use a returned model identifier. Python embeddings uses the OpenAI SDK; rerank and sentence similarity use ordinary HTTP. The response vectors below are illustrative, not full model output.
curl --max-time 120 "https://apixly.ai/v1/rerank" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "Qwen3-Reranker-0.6B",
"query": "Which document is about fruit?",
"documents": [
"Database software",
"Apples and pears"
],
"top_n": 1,
"instruction": "Rank documents relevant to the query."
}'import os
import requests
r = requests.post("https://apixly.ai/v1/rerank",
headers={"Authorization": "Bearer " + os.environ["API_KEY"]},
json={"model": "Qwen3-Reranker-0.6B", "query": "fruit",
"documents": ["Database software", "Apples and pears"], "top_n": 1},
timeout=120,
)
r.raise_for_status()
for row in r.json()["results"]:
print(row["index"], row["relevance_score"])Responses
These are illustrative values, not real model vectors or scores. Rerank defaults top_n to 3; scores are finite numbers and are not guaranteed to be within 0–1. index refers to the original input/document. Additional fields such as metadata and return_documents are not uniformly supported; do not rely on them across models. Raw usage may use promptTokens/totalTokens; some adapted responses omit usage. Do not assume unified token fields. Use X-Billable-Inputs and X-Billing-Unit for the count and billing unit; similarity scores follow the input order.
{
"model": "Qwen3-Reranker-0.6B",
"results": [
{
"index": 1,
"relevance_score": 0.9
}
],
"usage": {
"prompt_tokens": 18,
"total_tokens": 18
}
}[0.12, 0.87]Errors and lifecycle
All three endpoints return nonstreaming JSON. Set a client timeout and cancel the HTTP request when no longer needed; cancellation cannot guarantee upstream work or costs stop. 400: invalid input/unsupported parameters; 401: invalid key; 403: wrong group or policy; 429: rate limit, respect Retry-After; 502: invalid/missing upstream output or paid token usage; 503: no account or missing pricing. Retry transient errors with bounded backoff; avoid duplicate retries after an uncertain response.