From 7628dbfecf12e35082021f6cdeb0181393bc5eda Mon Sep 17 00:00:00 2001 From: Thibault Jaigu Date: Wed, 1 Jul 2026 12:16:51 +0100 Subject: [PATCH] Add Requesty as an LLM provider Mirror the existing API-key providers to add Requesty (https://router.requesty.ai/v1), an OpenAI-compatible LLM router. Adds a first-class requesty ProviderConfig, setup-wizard entry, default model fallback, and optional-env-var docs. Signed-off-by: Thibault Jaigu --- gauss_cli/auth.py | 8 ++++++++ gauss_cli/config.py | 17 +++++++++++++++++ gauss_cli/models.py | 2 ++ gauss_cli/setup.py | 40 ++++++++++++++++++++++++++++++++++++++-- 4 files changed, 65 insertions(+), 2 deletions(-) diff --git a/gauss_cli/auth.py b/gauss_cli/auth.py index 0260b37..73dbd09 100644 --- a/gauss_cli/auth.py +++ b/gauss_cli/auth.py @@ -156,6 +156,14 @@ class ProviderConfig: api_key_env_vars=("DEEPSEEK_API_KEY",), base_url_env_var="DEEPSEEK_BASE_URL", ), + "requesty": ProviderConfig( + id="requesty", + name="Requesty", + auth_type="api_key", + inference_base_url="https://router.requesty.ai/v1", + api_key_env_vars=("REQUESTY_API_KEY",), + base_url_env_var="REQUESTY_BASE_URL", + ), } diff --git a/gauss_cli/config.py b/gauss_cli/config.py index 3855106..f74d154 100644 --- a/gauss_cli/config.py +++ b/gauss_cli/config.py @@ -420,6 +420,14 @@ def ensure_gauss_home(): "category": "provider", "advanced": True, }, + "REQUESTY_API_KEY": { + "description": "Requesty API key (OpenAI-compatible router across many models)", + "prompt": "Requesty API key", + "url": "https://app.requesty.ai/api-keys", + "password": True, + "category": "provider", + "advanced": True, + }, "GLM_API_KEY": { "description": "Z.AI / GLM API key (also recognized as ZAI_API_KEY / Z_AI_API_KEY)", "prompt": "Z.AI / GLM API key", @@ -514,6 +522,13 @@ def ensure_gauss_home(): "password": False, "category": "provider", }, + "REQUESTY_BASE_URL": { + "description": "Custom Requesty API base URL (advanced)", + "prompt": "Requesty Base URL", + "url": "", + "password": False, + "category": "provider", + }, # ── Tool API keys ── "FIRECRAWL_API_KEY": { @@ -1042,6 +1057,7 @@ def load_config() -> Dict[str, Any]: # kimi-coding (KIMI_API_KEY) — Kimi / Moonshot # minimax (MINIMAX_API_KEY) — MiniMax # minimax-cn (MINIMAX_CN_API_KEY) — MiniMax (China) +# requesty (REQUESTY_API_KEY) — Requesty (OpenAI-compatible router) # # For custom OpenAI-compatible endpoints, add base_url and api_key_env. # @@ -1072,6 +1088,7 @@ def load_config() -> Dict[str, Any]: # kimi-coding (KIMI_API_KEY) — Kimi / Moonshot # minimax (MINIMAX_API_KEY) — MiniMax # minimax-cn (MINIMAX_CN_API_KEY) — MiniMax (China) +# requesty (REQUESTY_API_KEY) — Requesty (OpenAI-compatible router) # # For custom OpenAI-compatible endpoints, add base_url and api_key_env. # diff --git a/gauss_cli/models.py b/gauss_cli/models.py index 766d41d..a9e02e9 100644 --- a/gauss_cli/models.py +++ b/gauss_cli/models.py @@ -94,6 +94,7 @@ "minimax-cn": "MiniMax (China)", "anthropic": "Anthropic", "deepseek": "DeepSeek", + "requesty": "Requesty", "custom": "Custom endpoint", } @@ -143,6 +144,7 @@ def list_available_providers() -> list[dict[str, str]]: _PROVIDER_ORDER = [ "openrouter", "nous", "openai-codex", "zai", "kimi-coding", "minimax", "minimax-cn", "anthropic", "deepseek", + "requesty", ] # Build reverse alias map aliases_for: dict[str, list[str]] = {} diff --git a/gauss_cli/setup.py b/gauss_cli/setup.py index dcaa7ae..4d0fe18 100644 --- a/gauss_cli/setup.py +++ b/gauss_cli/setup.py @@ -60,6 +60,7 @@ def _set_default_model(config: Dict[str, Any], model_name: str) -> None: "kimi-coding": ["kimi-k2.5", "kimi-k2-thinking", "kimi-k2-turbo-preview"], "minimax": ["MiniMax-M2.5", "MiniMax-M2.5-highspeed", "MiniMax-M2.1"], "minimax-cn": ["MiniMax-M2.5", "MiniMax-M2.5-highspeed", "MiniMax-M2.1"], + "requesty": ["openai/gpt-4o-mini", "openai/gpt-4o", "anthropic/claude-sonnet-4-5", "google/gemini-2.5-flash", "deepseek/deepseek-chat"], } @@ -723,6 +724,7 @@ def setup_model_provider(config: dict): "MiniMax (global endpoint)", "MiniMax China (mainland China endpoint)", "Anthropic (Claude models — API key or Claude Code subscription)", + "Requesty (OpenAI-compatible router across many models)", ] if keep_label: provider_choices.append(keep_label) @@ -1231,7 +1233,40 @@ def setup_model_provider(config: dict): _set_model_provider(config, "anthropic") selected_base_url = "" - # else: provider_idx == 9 (Keep current) — only shown when a provider already exists + elif provider_idx == 9: # Requesty + selected_provider = "requesty" + print() + print_header("Requesty API Key") + pconfig = PROVIDER_REGISTRY["requesty"] + print_info(f"Provider: {pconfig.name}") + print_info(f"Base URL: {pconfig.inference_base_url}") + print_info("Get your API key at: https://app.requesty.ai/api-keys") + print() + + existing_key = get_env_value("REQUESTY_API_KEY") + if existing_key: + print_info(f"Current: {existing_key[:8]}... (configured)") + if prompt_yes_no("Update API key?", False): + api_key = prompt(" Requesty API key", password=True) + if api_key: + save_env_value("REQUESTY_API_KEY", api_key) + print_success("Requesty API key updated") + else: + api_key = prompt(" Requesty API key", password=True) + if api_key: + save_env_value("REQUESTY_API_KEY", api_key) + print_success("Requesty API key saved") + else: + print_warning("Skipped - agent won't work without an API key") + + # Clear custom endpoint vars if switching + if existing_custom: + save_env_value("OPENAI_BASE_URL", "") + save_env_value("OPENAI_API_KEY", "") + _set_model_provider(config, "requesty", pconfig.inference_base_url) + selected_base_url = pconfig.inference_base_url + + # else: provider_idx == 10 (Keep current) — only shown when a provider already exists # Normalize "keep current" to an explicit provider so downstream logic # doesn't fall back to the generic OpenRouter/static-model path. if selected_provider is None: @@ -1268,6 +1303,7 @@ def setup_model_provider(config: dict): "minimax": "MiniMax", "minimax-cn": "MiniMax CN", "anthropic": "Anthropic", + "requesty": "Requesty", "custom": "your custom endpoint", } _prov_display = _prov_names.get(selected_provider, selected_provider or "your provider") @@ -1401,7 +1437,7 @@ def setup_model_provider(config: dict): _set_default_model(config, custom) _update_config_for_provider("openai-codex", DEFAULT_CODEX_BASE_URL) _set_model_provider(config, "openai-codex", DEFAULT_CODEX_BASE_URL) - elif selected_provider in ("zai", "kimi-coding", "minimax", "minimax-cn"): + elif selected_provider in ("zai", "kimi-coding", "minimax", "minimax-cn", "requesty"): _setup_provider_model_selection( config, selected_provider, current_model, prompt_choice, prompt,