Crate lib_client_openrouter

Crate lib_client_openrouter 

Source
Expand description

OpenRouter API client library.

A type-safe, async client for the OpenRouter API. OpenRouter provides access to multiple AI models through a unified OpenAI-compatible API.

Structs§

ApiKeyAuth
API key authentication (Bearer token).
Choice
A completion choice.
Client
OpenRouter API client.
ClientBuilder
Client builder.
CreateChatCompletionRequest
Request to create a chat completion.
CreateChatCompletionResponse
Response from creating a chat completion.
CreditsData
Credit balance data.
CreditsResponse
Credit balance response.
ErrorDetail
Error detail.
ErrorResponse
Error response from the API.
FunctionCall
Function call details.
FunctionDefinition
Function definition.
GenerationStats
Generation statistics (returned by /api/v1/generation).
Message
A message in the conversation.
Model
Model information from OpenRouter.
ModelArchitecture
Model architecture details.
ModelList
List of models.
ModelPricing
Model pricing information.
ProviderPreferences
Provider preferences for routing.
Tool
Tool definition.
ToolCall
Tool call made by the assistant.
TopProvider
Top provider details.
Usage
Token usage statistics.

Enums§

OpenRouterError
OpenRouter API error type.
Role
Message role.

Traits§

AuthStrategy
Authentication strategy trait.

Type Aliases§

Result
Result type alias for OpenRouter operations.