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§
- ApiKey
Auth - API key authentication (Bearer token).
- Choice
- A completion choice.
- Client
- OpenRouter API client.
- Client
Builder - Client builder.
- Create
Chat Completion Request - Request to create a chat completion.
- Create
Chat Completion Response - Response from creating a chat completion.
- Credits
Data - Credit balance data.
- Credits
Response - Credit balance response.
- Error
Detail - Error detail.
- Error
Response - Error response from the API.
- Function
Call - Function call details.
- Function
Definition - Function definition.
- Generation
Stats - Generation statistics (returned by /api/v1/generation).
- Message
- A message in the conversation.
- Model
- Model information from OpenRouter.
- Model
Architecture - Model architecture details.
- Model
List - List of models.
- Model
Pricing - Model pricing information.
- Provider
Preferences - Provider preferences for routing.
- Tool
- Tool definition.
- Tool
Call - Tool call made by the assistant.
- TopProvider
- Top provider details.
- Usage
- Token usage statistics.
Enums§
- Open
Router Error - OpenRouter API error type.
- Role
- Message role.
Traits§
- Auth
Strategy - Authentication strategy trait.
Type Aliases§
- Result
- Result type alias for OpenRouter operations.