Parcourir la source

chore: route OpenRouter through proxy

刘立冬 il y a 20 heures
Parent
commit
6ced194da9

+ 1 - 1
.env.example

@@ -1,7 +1,7 @@
 # LLM: OpenRouter is the default provider.
 LLM_PROVIDER=openrouter
 OPENROUTER_API_KEY=
-OPENROUTER_BASE_URL=https://openrouter.ai/api/v1
+OPENROUTER_BASE_URL=https://openrouter.piaoquantv.com/api/v1
 CODEX_MODEL=openai/gpt-5.6-terra
 CODEX_REASONING_EFFORT=medium
 CODEX_TIMEOUT_SECONDS=300

+ 1 - 1
scripts/test_openrouter_key.py

@@ -15,7 +15,7 @@ def main() -> int:
     project_dir = Path(__file__).resolve().parents[1]
     load_dotenv(project_dir / ".env", override=True)
     api_key = os.getenv("OPENROUTER_API_KEY", "").strip()
-    base_url = os.getenv("OPENROUTER_BASE_URL", "https://openrouter.ai/api/v1").rstrip("/")
+    base_url = os.getenv("OPENROUTER_BASE_URL", "https://openrouter.piaoquantv.com/api/v1").rstrip("/")
     if not api_key:
         print("OpenRouter key: MISSING", file=sys.stderr)
         return 2

+ 1 - 1
src/data_query_agent/config.py

@@ -69,7 +69,7 @@ class Settings:
             codex_reasoning_effort=os.getenv("CODEX_REASONING_EFFORT", "medium").strip(),
             codex_timeout_seconds=_positive_int("CODEX_TIMEOUT_SECONDS", 300),
             openrouter_api_key=os.getenv("OPENROUTER_API_KEY", "").strip(),
-            openrouter_base_url=os.getenv("OPENROUTER_BASE_URL", "https://openrouter.ai/api/v1").rstrip("/"),
+            openrouter_base_url=os.getenv("OPENROUTER_BASE_URL", "https://openrouter.piaoquantv.com/api/v1").rstrip("/"),
             openai_api_key=os.getenv("OPENAI_API_KEY", "").strip(),
             odps_access_id=os.getenv("ODPS_ACCESS_ID", "").strip(),
             odps_access_key=(os.getenv("ODPS_ACCESS_KEY", "") or os.getenv("ODPS_ACCESS_SECRET", "")).strip(),

+ 1 - 1
tests/test_codex_worker.py

@@ -3,7 +3,7 @@ from data_query_agent.codex_worker import _provider_config
 
 def test_codex_can_read_skills_but_not_project_credentials() -> None:
     provider, config = _provider_config(
-        {"provider": "openrouter", "base_url": "https://openrouter.ai/api/v1"}
+        {"provider": "openrouter", "base_url": "https://openrouter.piaoquantv.com/api/v1"}
     )
 
     assert provider == "openrouter"