1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//! OpenRouter API clients (Completions and Responses).
//!
//! This module provides two OpenRouter API client implementations:
//! - **Completions API** (`completions`): Standard, stable Chat Completions API with provider routing
//! - **Responses API** (`responses`): Alpha API with advanced reasoning features
//!
//! Both clients implement the unified `LlmClient` trait and support automatic reasoning
//! preservation, tool calling, and streaming.
//!
//! # Examples
//!
//! ## Using Completions API with provider routing
//! ```no_run
//! use appam::llm::openrouter::{OpenRouterConfig, ReasoningConfig, ProviderPreferences};
//! use appam::llm::openrouter::completions::OpenRouterCompletionsClient;
//! use appam::prelude::*;
//!
//! let cfg = OpenRouterConfig {
//! model: "anthropic/claude-sonnet-4-5".to_string(),
//! ..Default::default()
//! };
//!
//! let reasoning = ReasoningConfig::high_effort(32000);
//!
//! let provider_prefs = ProviderPreferences {
//! order: Some(vec!["anthropic".to_string()]),
//! ..Default::default()
//! };
//!
//! let client = OpenRouterCompletionsClient::new(
//! cfg,
//! Some(reasoning),
//! Some(provider_prefs)
//! )?;
//! # Ok::<(), anyhow::Error>(())
//! ```
//!
//! ## Using Responses API with reasoning
//! ```no_run
//! use appam::llm::openrouter::{OpenRouterConfig, ReasoningConfig};
//! use appam::llm::openrouter::responses::OpenRouterClient;
//!
//! let cfg = OpenRouterConfig {
//! model: "anthropic/claude-sonnet-4-5".to_string(),
//! reasoning: Some(ReasoningConfig::high_effort(63999)),
//! ..Default::default()
//! };
//!
//! let client = OpenRouterClient::new(cfg)?;
//! # Ok::<(), anyhow::Error>(())
//! ```
// Submodules
// Re-export commonly used types for convenience
pub use ;
pub use ;
pub use OpenRouterCompletionsClient;
pub use OpenRouterClient as OpenRouterResponsesClient;