Neither endpoint routes. A vector index is only comparable to vectors from the model that built it, and a relevance score means something only against other scores from the same model, so nothing here chooses a model on evidence.
What a request may name is the routing policy's pool, the same pool chat models live in. Name a model the pool holds, or send auto and get the first model of that type in the pool's order. The model that served is in the response.
Embeddings
| Method and path | POST /embeddings |
| Purpose | Embeddings from the served embedding catalog, OpenAI shape. |
| Authentication | API key or session |
| Limits | input is a string or a list of up to 512 strings. Billed on input tokens. |
Request
| Field | Meaning |
|---|---|
model | An embedding model the policy's pool holds, or auto for the first one in it. Required. policy:<slug> runs the request under another routing policy the key may call. |
input | A string or a list of strings. |
encoding_format | float or base64. |
dimensions, user | Forwarded when set. |
input_type, task, task_type, title, embedding_types, output_dtype, normalized, truncate, truncation, late_chunking, output_dimension, output_dimensionality, dimensionality | Provider-specific parameters that are part of an embedding's identity, forwarded untouched for the provider to accept or reject. |
A misspelled field is a 422, as on chat completions.
Example
curl https://api.inferbase.ai/api/v1/inference/embeddings \
-H "Authorization: Bearer inf_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-embedding-4b",
"input": ["first text to embed", "second text to embed"]
}'Response
The OpenAI shape: data carries one embedding per input, in input order, and usage carries input tokens, what the request cost your organization (cost_micros, micro-dollars, 0 on your own provider key or cloud account) and its wall time (latency_ms). The response adds served_by: your connection when it ran on your own provider key or cloud account (null on an Inferbase route), the route, and whether the policy pinned the provider or the call fell back to another. Tag an index with the route, because the same model on another provider is not the same embedding space.
Policy
The pool decides. A model outside it is refused with 403, and auto on a pool holding no embedding model is refused the same way, naming the pool. When a model is served by more than one provider, the cheapest route wins and a substitute has to be the same model and the same variant; a different quantisation is a different embedding space.
Rerank
| Method and path | POST /rerank |
| Purpose | Score documents against a query, best first, from the served rerank catalog. Cohere shape. |
| Authentication | API key or session |
| Limits | Up to 1,000 documents per call. Billed on input tokens. |
The request and response follow Cohere's shape, because OpenAI defines no rerank endpoint and Cohere's is what the providers that serve this surface mirror. Errors stay in the Inferbase envelope.
Request
| Field | Meaning |
|---|---|
model | A rerank model id from GET /models, or auto for the first rerank model in the policy's pool. Required. policy:<slug> runs the request under another routing policy the key may call. |
query | The query string, up to 8,192 characters. |
documents | Up to 1,000 strings. |
top_n | Keep only the best N. |
return_documents | Echo each document's text beside its score. |
user | Forwarded when set. |
max_tokens_per_doc, max_chunks_per_doc | Provider-specific (Cohere): truncate each document, or split it into chunks. Forwarded untouched. |
Example
curl https://api.inferbase.ai/api/v1/inference/rerank \
-H "Authorization: Bearer inf_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3-reranker-4b",
"query": "What is the capital of France?",
"documents": [
"Paris is the capital of France.",
"Bananas are yellow.",
"Berlin is the capital of Germany."
],
"top_n": 2
}'Response
results comes back ranked. Each row carries index, into the documents you sent, and relevance_score. usage carries the input tokens, cost_micros and latency_ms, as on embeddings. served_by names the route that scored them, and your connection when it ran on your own credential.
Two things to know before comparing scores. Providers disagree about the scale even when they agree about the order, so a threshold tuned on one provider is not portable to another. And not every provider meters this surface; where the provider reports no token count, Inferbase bills its own estimate of what the model read, the query once per document plus the documents.
Policy
The pool decides, exactly as it does for embeddings: a model outside it is refused, and auto takes the first rerank model in it. Scores differ between providers of one model even when the ordering agrees, so a caller comparing scores across calls should name the model rather than reorder the pool.
Errors
A chat model on either endpoint, or an embedding model on the other, is a 404. A pinned provider that is down with fallback refused is a 503. See Errors.
Last updated October 6, 2026.