Skip to main content

Crate openrouter2

Crate openrouter2 

Source
Expand description

Typed clients for the OpenRouter API.

openrouter2 exposes route-complete async and blocking clients for the current non-deprecated OpenRouter API surface. Async support is enabled by default through AsyncOpenRouterClient. Enable the blocking Cargo feature for BlockingOpenRouterClient.

Client values can store an optional default ApiKey alongside the injected HTTP client and normalized base URL. Per-call RequestOptions can override that key or explicitly suppress authentication for no-auth routes.

Re-exports§

pub use types::*;

Modules§

streaming
types

Structs§

ApiError
ApiKey
AsyncOpenRouterClient
MultipartFile
OpenRouterApiError
RawJsonRequest
RawMultipartRequest
RequestOptions
RouteSpec

Enums§

HttpMethod
OpenRouterError
RequestAuth

Constants§

DEFAULT_BASE_URL
NON_DEPRECATED_ROUTES
SPEC_SNAPSHOT_DATE

Traits§

IntoQueryParams

Functions§

endpoint_url_from_base
normalize_base_url
normalize_unchecked_base_url