Skip to main content

Module embedding_api

Module embedding_api 

Source
Expand description

HTTP client for the OpenRouter embeddings API (direct HTTP, no CLI subprocess). HTTP client for the OpenRouter embeddings API.

Sends embedding requests to the OpenAI-compatible endpoint at openrouter.ai/api/v1/embeddings and returns dense Vec<f32> vectors. Handles retry with exponential backoff + jitter for transient failures (429, 5xx) and immediate abort for permanent errors (401, 400).

Structsยง

EmbedError
OpenRouterClient::embed_single / OpenRouterClient::embed_batch failure (reauditor addendum, mirrors crate::chat_api::ChatError).
OpenRouterClient