Skip to main content

opi_ai/
lib.rs

1//! Unified multi-provider LLM API with streaming support.
2//!
3//! Provides a standardized interface for interacting with multiple LLM providers:
4//! Anthropic, OpenAI Chat Completions, OpenAI Responses, Google Gemini, plus
5//! OpenAI-compatible profiles for OpenRouter and Mistral.
6
7pub mod anthropic;
8pub mod azure_openai;
9pub mod bedrock;
10pub mod config;
11pub mod gemini;
12pub mod http;
13pub mod message;
14pub mod mistral;
15pub mod model;
16pub mod openai_chat;
17pub mod openai_responses;
18pub mod openrouter;
19pub mod provider;
20pub mod registry;
21pub mod retry;
22pub mod stream;
23#[doc(hidden)]
24pub mod test_support;
25pub mod vertex;
26
27pub use config::{Config, Error};
28pub use model::Model;
29pub use provider::Provider;
30pub use registry::{ProviderRegistry, RegistrationError, RegistryError};
31pub use stream::AssistantStreamEvent;
32pub use stream::{CostBreakdown, CumulativeUsage, Pricing, calculate_cost};
33
34#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
35pub enum ApiKind {
36    Anthropic,
37    OpenAi,
38    Google,
39    Mistral,
40}