embedding capability.
The backend must implement an OpenAI-compatible
POST /v1/embeddings endpoint. Infinity is the documented embedding backend, but any compatible engine can be used through an agent registered with --capability embedding.How embedding requests are routed
For each request, Hivenet Router:- authenticates the client when API authentication is enabled
- applies the configured request-rate quota
- reads and validates the top-level
modelfield - checks that the API key may use that model
- filters for agents registered with the
embeddingcapability - applies the routing policy and capacity checks
- forwards the original request to
POST /v1/embeddingson the selected backend - returns the backend response to the client
Request headers
If
X-Request-ID is absent or is not a valid UUID, Hivenet Router generates one and returns it in the response.
Request body
The minimal request contains a model and input:
The model name must:
- match a model registered by an embedding agent
- be allowed by the caller’s API key when model restrictions are enabled
- contain no more than 256 characters
model field. The selected backend validates the input content, batch size, token limits, and any optional embedding parameters.
Request-body size
Hivenet Router limits/v1/* request bodies to 10485760 bytes, or 10 MiB, by default. This limit includes the complete JSON body, so large embedding batches can reach it before the backend’s own batch or token limits.
Requests above the configured limit receive HTTP 413 before routing. Configure the limit with HIVENET_ROUTER_MAX_REQUEST_BYTES, or set it to 0 to disable the built-in check. A proxy or ingress may still enforce a smaller limit.
Handle HTTP 413 by reducing the batch or input size. Do not depend on a specific JSON error envelope for this early rejection.
Single input
Batch input
Send several strings in one request:index field identifies the position of the corresponding input in the original array.
Use the OpenAI Python client
encoding_format="float" asks the backend to return numeric arrays. Other encoding formats work only when the selected backend supports them.
Additional request fields
Hivenet Router forwards the original JSON body to the backend. You can therefore include additional OpenAI-compatible fields such as:- output-dimension selection
- base64 encoding
- token-array input
- user identifiers
- engine-specific extensions
Response
A successful OpenAI-compatible response resembles:id, created, or usage, or may return additional fields.
Hivenet Router returns the successful backend response without reshaping the embedding vectors.
No streaming support
Embedding requests are synchronous. The endpoint does not use server-sent events, and the request does not accept a Hivenet Router streaming mode. The router waits for the selected backend to return the complete embedding response. For large batches, use an appropriate request timeout and keep batch size within the backend’s limits.Authentication and model access
When API authentication is enabled, send:403:
Quotas
Embedding requests participate in request-rate quota enforcement. When a finite request quota is configured, responses may include:429.
The current embedding path does not charge input or output tokens against the daily token quota. It records successful embedding requests with zero input and output tokens for quota accounting.Embedding requests are also exempt from the LLM admission gates, including per-request token caps, KV-occupancy budgets, and serverless token rates. These gates model KV-cache-bound generation, which prefill-only embedding work does not perform. Request-rate, body-size, and agent-concurrency limits still protect this path.
Routing policies
Embedding agents can be selected using the same metadata and live signals as other agents. For example:llm or reranker.
You can also use fallback chains when more than one compatible embedding backend serves the same model.
Discover embedding models
List the models available through the router:Error responses
Router errors use this envelope:
See Error codes for the complete reference.
Troubleshooting
The model is not found
List available embedding models:- the agent uses
--capability embedding - the requested model matches the registered model exactly
- the agent is healthy
- the API key may access the model
The request reaches the wrong backend type
Inspect the agent registration:The backend rejects the input
Test the backend directly:- empty strings
- unsupported input formats
- batches that are too large
- inputs above the model’s token limit
- unsupported optional fields
The batch response has fewer items than expected
Check the backend response directly. Hivenet Router does not combine, remove, reorder, or deduplicate input strings. It returns the successful backend response as received.Requests time out
Reduce the batch size or increase the router and agent request timeout where appropriate. The agent’s backend HTTP timeout defaults to two minutes:- model loading state
- backend queue pressure
- agent capacity
- input length
- accelerator memory
The request is rate-limited
Check the returned header:Next steps
Reranking
Score and reorder documents by relevance to a query.
Models
Discover models, capabilities, engines, and healthy capacity.
Infinity agent
Configure embedding and reranking models through Infinity.

