MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / with_config

Method with_config

crates/opencode-provider/src/openrouter.rs:36–133  ·  view source on GitHub ↗
(config: OpenRouterConfig)

Source from the content-addressed store, hash-verified

34 }
35
36 pub fn with_config(config: OpenRouterConfig) -> Self {
37 let models = vec![
38 ModelInfo {
39 id: "anthropic/claude-sonnet-4".to_string(),
40 name: "Claude Sonnet 4 (OpenRouter)".to_string(),
41 provider: "openrouter".to_string(),
42 context_window: 200000,
43 max_output_tokens: 16000,
44 supports_vision: true,
45 supports_tools: true,
46 cost_per_million_input: 3.0,
47 cost_per_million_output: 15.0,
48 },
49 ModelInfo {
50 id: "anthropic/claude-3.5-sonnet".to_string(),
51 name: "Claude 3.5 Sonnet (OpenRouter)".to_string(),
52 provider: "openrouter".to_string(),
53 context_window: 200000,
54 max_output_tokens: 8192,
55 supports_vision: true,
56 supports_tools: true,
57 cost_per_million_input: 3.0,
58 cost_per_million_output: 15.0,
59 },
60 ModelInfo {
61 id: "openai/gpt-4o".to_string(),
62 name: "GPT-4o (OpenRouter)".to_string(),
63 provider: "openrouter".to_string(),
64 context_window: 128000,
65 max_output_tokens: 16384,
66 supports_vision: true,
67 supports_tools: true,
68 cost_per_million_input: 2.5,
69 cost_per_million_output: 10.0,
70 },
71 ModelInfo {
72 id: "openai/gpt-4o-mini".to_string(),
73 name: "GPT-4o Mini (OpenRouter)".to_string(),
74 provider: "openrouter".to_string(),
75 context_window: 128000,
76 max_output_tokens: 16384,
77 supports_vision: true,
78 supports_tools: true,
79 cost_per_million_input: 0.15,
80 cost_per_million_output: 0.6,
81 },
82 ModelInfo {
83 id: "google/gemini-2.5-pro-preview".to_string(),
84 name: "Gemini 2.5 Pro (OpenRouter)".to_string(),
85 provider: "openrouter".to_string(),
86 context_window: 1000000,
87 max_output_tokens: 65536,
88 supports_vision: true,
89 supports_tools: true,
90 cost_per_million_input: 1.25,
91 cost_per_million_output: 10.0,
92 },
93 ModelInfo {

Callers

nothing calls this directly

Calls 1

newFunction · 0.85

Tested by

no test coverage detected