From 9b9f952f852bc3e52868c26eaf1f7c5506489981 Mon Sep 17 00:00:00 2001 From: Sushant Gautam Date: Fri, 9 Oct 2026 14:46:51 +0200 Subject: [PATCH] Point DecisionTarget.openrouter at /api/v1/systemone The /api/alpha/decisions endpoint and /api/v1/systemone are the same System One wire format; /v1/systemone is the promoted, superset route (bare "jev-1.13" ids auto-map to "typesafe/", provider routing and usage.cost in the response). It is also the route vLLM and Ollama expose, so the target now uses one canonical endpoint for OpenRouter-hosted decision models. Fixes gap 1 of SimulaMet/SimpleAudit#107. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- simpleaudit/targets/decision.py | 6 +++--- tests/test_decision_target.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/simpleaudit/targets/decision.py b/simpleaudit/targets/decision.py index 96999d6..9aa426c 100644 --- a/simpleaudit/targets/decision.py +++ b/simpleaudit/targets/decision.py @@ -45,8 +45,8 @@ #: Ollama's request-body cap for System One requests without images. OLLAMA_MAX_BODY_BYTES = 64 * 1024 -#: OpenRouter's Decisions API (alpha). -OPENROUTER_DECISIONS_URL = "https://openrouter.ai/api/alpha/decisions" +#: OpenRouter's System One endpoint (``POST /api/v1/systemone``). +OPENROUTER_SYSTEMONE_URL = "https://openrouter.ai/api/v1/systemone" class DecisionTarget: @@ -97,7 +97,7 @@ def openrouter(cls, model: str, api_key: str | None = None, **kwargs: Any) -> De ``{"provider": {"zdr": True}}``) can be passed as ``extra_body``. """ return cls( - OPENROUTER_DECISIONS_URL, + OPENROUTER_SYSTEMONE_URL, model, api_key=api_key or os.environ.get("OPENROUTER_API_KEY"), **kwargs, diff --git a/tests/test_decision_target.py b/tests/test_decision_target.py index f26f6cb..79edcc0 100644 --- a/tests/test_decision_target.py +++ b/tests/test_decision_target.py @@ -280,7 +280,7 @@ def test_ollama_constructor(): def test_openrouter_constructor_reads_the_key_from_the_environment(monkeypatch): monkeypatch.setenv("OPENROUTER_API_KEY", "sk-env") target = DecisionTarget.openrouter("typesafe/jev-1.13", extra_body={"provider": {"zdr": True}}) - assert target.url == "https://openrouter.ai/api/alpha/decisions" + assert target.url == "https://openrouter.ai/api/v1/systemone" assert target.headers["Authorization"] == "Bearer sk-env" assert target.max_body_bytes is None assert target.extra_body == {"provider": {"zdr": True}}