diff --git a/crates/ui-egui/src/agent_chat/agents.rs b/crates/ui-egui/src/agent_chat/agents.rs index 5448bebc9..c8efd4211 100644 --- a/crates/ui-egui/src/agent_chat/agents.rs +++ b/crates/ui-egui/src/agent_chat/agents.rs @@ -316,6 +316,7 @@ pub const OPENAI_PRESETS: &[ApiPreset] = &[ ApiPreset { name: "OpenCode Go", base_url: "https://opencode.ai/zen/go/v1" }, ApiPreset { name: "DeepSeek", base_url: "https://api.deepseek.com" }, ApiPreset { name: "Qwen", base_url: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1" }, + ApiPreset { name: "Cheaper Inference", base_url: "https://api.cheaperinference.com/v1" }, ApiPreset { name: "OpenRouter", base_url: "https://openrouter.ai/api/v1" }, ]; @@ -393,6 +394,7 @@ mod tests { fn keys_go_only_over_https_or_to_this_computer() { assert!(key_safe_for("https://api.openai.com/v1")); assert!(key_safe_for("https://api.mammouth.ai/v1")); + assert!(key_safe_for("https://api.cheaperinference.com/v1")); assert!(key_safe_for("http://localhost:11434/v1")); assert!(key_safe_for("http://127.0.0.1:1234/v1")); assert!(key_safe_for("http://[::1]:8080/v1")); @@ -503,6 +505,7 @@ mod tests { assert!(presets(Protocol::OpenAi).iter().all(|p| !p.name.is_empty() && p.base_url.starts_with("http"))); assert!(presets(Protocol::OpenAi).iter().any(|p| p.name == "Mammouth AI" && key_safe_for(p.base_url))); assert!(presets(Protocol::OpenAi).iter().any(|p| p.name == "Mistral AI" && p.base_url == "https://api.mistral.ai/v1")); + assert!(presets(Protocol::OpenAi).iter().any(|p| p.name == "Cheaper Inference" && key_safe_for(p.base_url))); assert!(presets(Protocol::Anthropic).iter().any(|p| p.base_url == "https://api.anthropic.com/v1")); for name in ["DeepSeek", "Qwen"] { assert!(presets(Protocol::OpenAi).iter().any(|p| p.name == name), "OpenAI-compatible preset for {name}"); diff --git a/docs/agent-chat.md b/docs/agent-chat.md index 9e269104e..387dccd82 100644 --- a/docs/agent-chat.md +++ b/docs/agent-chat.md @@ -292,7 +292,8 @@ Grok Build also supports `XAI_API_KEY` for users who choose API authentication. `http://localhost:1234/v1`, OpenClaw `http://localhost:18789/v1`, OpenAI, Mistral AI `https://api.mistral.ai/v1`, Mammouth AI `https://api.mammouth.ai/v1`, OpenCode Go `https://opencode.ai/zen/go/v1`, DeepSeek `https://api.deepseek.com`, - Qwen `https://dashscope-intl.aliyuncs.com/compatible-mode/v1`, OpenRouter + Qwen `https://dashscope-intl.aliyuncs.com/compatible-mode/v1`, Cheaper Inference + `https://api.cheaperinference.com/v1`, OpenRouter `https://openrouter.ai/api/v1`) or a custom URL, the model name, and an optional key. OpenCode Go models are routed to their endpoint by themselves (`/responses`, `/messages` or Gemini for those families, `/chat/completions` for the rest),