From 362268050ff2a17d90cb88b7dad7df81500361a3 Mon Sep 17 00:00:00 2001 From: Alexander Ververis Date: Sun, 4 Oct 2026 01:20:26 +0800 Subject: [PATCH] fix: match Hermes provider grants to pinned source --- docs/hermes-gateway.md | 3 ++- examples/hermes-gateway.toml | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/hermes-gateway.md b/docs/hermes-gateway.md index 7978324..beecca6 100644 --- a/docs/hermes-gateway.md +++ b/docs/hermes-gateway.md @@ -24,7 +24,8 @@ exact hostname and operation grant. No wildcard/allow-all destination exists. | --- | --- | --- | | `auth.openai.com` | POST `/oauth/token`, `/api/accounts/deviceauth/usercode`, `/api/accounts/deviceauth/token` | Caller-owned device login and token refresh | | `chatgpt.com` | GET/POST `/backend-api/codex/` prefix | Caller-owned Codex OAuth, account/session headers, streaming | -| `portal.nousresearch.com` | POST `/api/oauth/device/code`, `/api/oauth/token`, `/oauth/code`, `/oauth/token` | Caller-owned Nous OAuth | +| `chatgpt.com` | GET `/backend-api/wham/usage` | Caller-owned Codex quota probe | +| `portal.nousresearch.com` | POST `/api/oauth/device/code`, `/api/oauth/token` | Caller-owned Nous OAuth | | `inference-api.nousresearch.com` | GET/POST `/v1/` prefix | Caller-owned Nous model credential | | `openrouter.ai` | GET/POST `/api/v1/` prefix | Caller-owned OpenRouter model credential | | `api.openai.com` | GET/POST/DELETE `/v1/` prefix | Caller-owned models and file uploads/downloads | diff --git a/examples/hermes-gateway.toml b/examples/hermes-gateway.toml index a525b88..ca4335a 100644 --- a/examples/hermes-gateway.toml +++ b/examples/hermes-gateway.toml @@ -55,12 +55,28 @@ path_prefix = "/backend-api/codex/" [routes.mediation] kind = "forward" +[[routes]] +name = "codex-usage" +host = "chatgpt.com" +scheme = "https" +methods = ["GET"] +paths = ["/backend-api/wham/usage"] +allow_query = false +caller_headers = ["authorization", "cookie"] +session_response_headers = ["set-cookie", "www-authenticate"] +max_request_bytes = 268435456 +max_response_bytes = 1073741824 +max_duration_seconds = 3600 +idle_timeout_seconds = 120 +[routes.mediation] +kind = "forward" + [[routes]] name = "nous-oauth" host = "portal.nousresearch.com" scheme = "https" methods = ["POST"] -paths = ["/api/oauth/device/code", "/api/oauth/token", "/oauth/code", "/oauth/token"] +paths = ["/api/oauth/device/code", "/api/oauth/token"] allow_query = true caller_headers = ["authorization", "cookie"] session_response_headers = ["set-cookie", "www-authenticate"]