This is an automated email from the ASF dual-hosted git repository.
hsluoyz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/casbin-gateway.git
The following commit(s) were added to refs/heads/master by this push:
new f078161 docs(readme): lead with a feature list, improve badges
f078161 is described below
commit f0781614506e00adeea5702cbefee49d423b007a
Author: Yang Luo <[email protected]>
AuthorDate: Thu Sep 3 23:38:46 2026 +0800
docs(readme): lead with a feature list, improve badges
---
README.md | 82 ++++++++++++++++++++++++++----------------------------------
README_zh.md | 80 +++++++++++++++++++++++++---------------------------------
2 files changed, 69 insertions(+), 93 deletions(-)
diff --git a/README.md b/README.md
index 025d77c..d5eee9e 100644
--- a/README.md
+++ b/README.md
@@ -1,36 +1,15 @@
<h1 align="center" style="border-bottom: none;">📦⚡️ Casbin Gateway</h1>
<h3 align="center">An open-source gateway for the AI coding agents on your
machine, developed by Go and React.</h3>
<p align="center">
- <a
href="https://github.com/apache/casbin-gateway/actions/workflows/golangci-lint.yml">
- <img alt="Lint"
src="https://github.com/apache/casbin-gateway/actions/workflows/golangci-lint.yml/badge.svg">
- </a>
- <a
href="https://github.com/apache/casbin-gateway/actions/workflows/build.yml">
- <img alt="Build"
src="https://github.com/apache/casbin-gateway/actions/workflows/build.yml/badge.svg">
- </a>
- <a href="https://pkg.go.dev/github.com/apache/casbin-gateway">
- <img alt="Go Reference"
src="https://pkg.go.dev/badge/github.com/apache/casbin-gateway.svg">
- </a>
- <a href="https://github.com/apache/casbin-gateway/releases/latest">
- <img alt="GitHub Release"
src="https://img.shields.io/github/v/release/apache/casbin-gateway.svg">
- </a>
-</p>
-
-<p align="center">
- <a href="https://github.com/apache/casbin-gateway/blob/master/LICENSE">
- <img alt="license"
src="https://img.shields.io/github/license/apache/casbin-gateway">
- </a>
- <a href="https://github.com/apache/casbin-gateway/issues">
- <img alt="GitHub issues"
src="https://img.shields.io/github/issues/apache/casbin-gateway">
- </a>
- <a href="https://github.com/apache/casbin-gateway/stargazers">
- <img alt="GitHub stars"
src="https://img.shields.io/github/stars/apache/casbin-gateway">
- </a>
- <a href="https://github.com/apache/casbin-gateway/network">
- <img alt="GitHub forks"
src="https://img.shields.io/github/forks/apache/casbin-gateway">
- </a>
- <a href="https://discord.gg/S5UjpzGZjN">
- <img alt="Discord"
src="https://img.shields.io/discord/1022748306096537660?logo=discord&label=discord&color=5865F2">
- </a>
+ <a
href="https://github.com/apache/casbin-gateway/actions/workflows/golangci-lint.yml"><img
alt="Lint"
src="https://img.shields.io/github/actions/workflow/status/apache/casbin-gateway/golangci-lint.yml?branch=master&style=flat-square&logo=github&logoColor=white&label=lint"></a>
+ <a
href="https://github.com/apache/casbin-gateway/actions/workflows/build.yml"><img
alt="Build"
src="https://img.shields.io/github/actions/workflow/status/apache/casbin-gateway/build.yml?branch=master&style=flat-square&logo=github&logoColor=white&label=build"></a>
+ <a href="https://pkg.go.dev/github.com/apache/casbin-gateway"><img alt="Go
Reference"
src="https://img.shields.io/badge/go.dev-reference-00ADD8?style=flat-square&logo=go&logoColor=white"></a>
+ <a href="https://github.com/apache/casbin-gateway/releases/latest"><img
alt="Release"
src="https://img.shields.io/github/v/release/apache/casbin-gateway?style=flat-square&logo=github&logoColor=white&color=3b82f6"></a>
+ <a href="https://github.com/apache/casbin-gateway/blob/master/LICENSE"><img
alt="License"
src="https://img.shields.io/github/license/apache/casbin-gateway?style=flat-square&color=3b82f6"></a>
+ <a href="https://github.com/apache/casbin-gateway/issues"><img alt="Issues"
src="https://img.shields.io/github/issues/apache/casbin-gateway?style=flat-square&logo=github&logoColor=white&color=3b82f6"></a>
+ <a href="https://github.com/apache/casbin-gateway/stargazers"><img
alt="Stars"
src="https://img.shields.io/github/stars/apache/casbin-gateway?style=flat-square&logo=github&logoColor=white&color=3b82f6"></a>
+ <a href="https://github.com/apache/casbin-gateway/network/members"><img
alt="Forks"
src="https://img.shields.io/github/forks/apache/casbin-gateway?style=flat-square&logo=github&logoColor=white&color=3b82f6"></a>
+ <a href="https://discord.gg/S5UjpzGZjN"><img alt="Discord"
src="https://img.shields.io/discord/1022748306096537660?style=flat-square&logo=discord&logoColor=white&label=discord&color=5865F2"></a>
</p>
<p align="center">
@@ -41,23 +20,14 @@
<a href="https://cdn.casbin.org/img/casbin-gateway.gif"><img alt="Casbin
Gateway" src="https://cdn.casbin.org/img/casbin-gateway.gif" width="900"></a>
</p>
-## The killer feature: is the API behind that key what it was sold as?
-
-A reseller can sell a frontier model and serve a cheaper one, count a cached
prefix as fresh input, or answer in an API it only pretends to speak. None of
that shows up in the traffic, so **Authenticity** asks the upstream directly.
Every provider is probed on its own — when it is added, when its endpoint, type
or key changes, when it has never been probed, and again whenever its report
goes stale — and comes back with a score out of 100 and a grade from A to F, on
the Authenticity page [...]
-
-[](https://cdn.casbin.org/img/casbin-gateway-authenticity.png)
-
-The score is only a summary of the test cases behind it, and every one of them
is on the page: whether the model that answers is the one that was asked for,
whether a two-level tool schema survives a forced call, whether the event
stream carries everything the API documents, whether the prompt cache is really
accounted for, whether two identical requests are billed the same, whether the
vendor's own headers are there. Each case names the question it puts to the
upstream, the exact reques [...]
-
-[](https://cdn.casbin.org/img/casbin-gateway-authenticity-cases.png)
+## Features
-Reweight a case, turn it off, rewrite its question, or add one of your own —
the questions worth asking of a reseller are not the same everywhere, and a
score whose method is not published is not evidence. **Restore defaults** puts
the shipped suite back and leaves your own cases alone.
-
-The report has a second half that costs nothing and sends no request: what the
records Gateway already kept say
-about that upstream — how much of the cache it really accounted for, how many
attempts failed, how long it took
-to answer, and how much of what it served has no price.
-
-A probe spends a few cents of that provider's own credit, which is on the
report next to the finding. `providerProbeIntervalHours` sets how often a
report goes stale, `providerProbeMode = "manual"` probes only when asked, and
`"off"` never probes.
+- **[Is the API behind that key what it was sold
as?](#the-killer-feature-is-the-api-behind-that-key-what-it-was-sold-as)** — a
reseller can quietly swap in a cheaper model or fake a cache hit, and none of
it shows up in the traffic. Authenticity asks the upstream directly and grades
it A–F.
+- **[Switch every agent's provider from one
place](#send-an-agents-traffic-through-gateway)** — change an API key or base
URL once, and every agent pointed at Gateway picks it up.
+- **[Run several instances of one agent side by side](#what-to-do-next)** —
e.g. multiple Claude Desktop instances, each signed in to a different account.
+- **[See the whole request, not just a count](#recording-prompts)** — every
prompt, message and tool schema an agent sent, kept on this machine.
+- **[Know what every agent spent, even off
Gateway](#what-the-agents-spend-including-what-never-went-through-gateway)** —
read straight from the agents' own transcripts.
+- **[Compare and copy skills, MCP servers and prompts across
agents](#what-to-do-next)** — every agent's install list in one table.
## Screenshots
@@ -117,13 +87,31 @@ Gateway installed some other way, or in a directory it
cannot write to, says so
| **Sessions** | Every session those agents have had, read from the
transcripts they leave on disk: the whole conversation, message by message. |
Nothing |
| **Activity** | What a monitored agent is doing as it does it — each tool
call, its target and how long it took. | Monitoring on for an agent |
| **Providers** | One endpoint in front of your model vendors. Gateway holds
the API key, so the agents never have it — or forwards the agent's own sign-in
and holds nothing. | A vendor API key, or nothing at all |
-| **Authenticity** | A score out of 100 and a grade for every provider,
measured without being asked — see [the section
above](#the-killer-feature-is-the-api-behind-that-key-what-it-was-sold-as). | A
provider with an API key |
+| **Authenticity** | A score out of 100 and a grade for every provider,
measured without being asked — see [the section
below](#the-killer-feature-is-the-api-behind-that-key-what-it-was-sold-as). | A
provider with an API key |
| **LLM Records** | Every request an agent relayed: the full system prompt,
every message and tool call, the schema of every tool the model was offered,
plus tokens and cost. | A provider, and `llmRecordMode` — see [Recording
prompts](#recording-prompts) |
| **Usage** | What every agent on this machine spent, over time and broken
down by model and by agent, read from the agents' own transcripts — so it
counts the requests that never went through Gateway. A second tab shows what
Gateway relayed, which is the only account that knows which provider answered
and whether it failed. | Nothing |
| **Model pricing** | What a million tokens costs, which is what every figure
on the Usage page is worked out from. Edit a price by hand, or let Gateway
reprice the models this machine has run from the
[models.dev](https://models.dev) catalogue on a schedule; a price you edited
yourself is left alone. | Nothing |
Agents are found by reading the user accounts, home directories and install
paths of **the machine Gateway runs on**, so run it on the machine whose agents
you want to watch.
+### The killer feature: is the API behind that key what it was sold as?
+
+A reseller can sell a frontier model and serve a cheaper one, count a cached
prefix as fresh input, or answer in an API it only pretends to speak. None of
that shows up in the traffic, so **Authenticity** asks the upstream directly.
Every provider is probed on its own — when it is added, when its endpoint, type
or key changes, when it has never been probed, and again whenever its report
goes stale — and comes back with a score out of 100 and a grade from A to F, on
the Authenticity page [...]
+
+[](https://cdn.casbin.org/img/casbin-gateway-authenticity.png)
+
+The score is only a summary of the test cases behind it, and every one of them
is on the page: whether the model that answers is the one that was asked for,
whether a two-level tool schema survives a forced call, whether the event
stream carries everything the API documents, whether the prompt cache is really
accounted for, whether two identical requests are billed the same, whether the
vendor's own headers are there. Each case names the question it puts to the
upstream, the exact reques [...]
+
+[](https://cdn.casbin.org/img/casbin-gateway-authenticity-cases.png)
+
+Reweight a case, turn it off, rewrite its question, or add one of your own —
the questions worth asking of a reseller are not the same everywhere, and a
score whose method is not published is not evidence. **Restore defaults** puts
the shipped suite back and leaves your own cases alone.
+
+The report has a second half that costs nothing and sends no request: what the
records Gateway already kept say
+about that upstream — how much of the cache it really accounted for, how many
attempts failed, how long it took
+to answer, and how much of what it served has no price.
+
+A probe spends a few cents of that provider's own credit, which is on the
report next to the finding. `providerProbeIntervalHours` sets how often a
report goes stale, `providerProbeMode = "manual"` probes only when asked, and
`"off"` never probes.
+
### Send an agent's traffic through Gateway
This is what fills **LLM Records**, and what lets Gateway keep the vendor key
instead of the agent.
diff --git a/README_zh.md b/README_zh.md
index 887b141..f3dea79 100644
--- a/README_zh.md
+++ b/README_zh.md
@@ -1,36 +1,15 @@
<h1 align="center" style="border-bottom: none;">📦⚡️ Casbin Gateway</h1>
<h3 align="center">一个开源网关,管理你机器上的 AI 编程 Agent,由 Go 和 React 开发。</h3>
<p align="center">
- <a
href="https://github.com/apache/casbin-gateway/actions/workflows/golangci-lint.yml">
- <img alt="Lint"
src="https://github.com/apache/casbin-gateway/actions/workflows/golangci-lint.yml/badge.svg">
- </a>
- <a
href="https://github.com/apache/casbin-gateway/actions/workflows/build.yml">
- <img alt="Build"
src="https://github.com/apache/casbin-gateway/actions/workflows/build.yml/badge.svg">
- </a>
- <a href="https://pkg.go.dev/github.com/apache/casbin-gateway">
- <img alt="Go Reference"
src="https://pkg.go.dev/badge/github.com/apache/casbin-gateway.svg">
- </a>
- <a href="https://github.com/apache/casbin-gateway/releases/latest">
- <img alt="GitHub Release"
src="https://img.shields.io/github/v/release/apache/casbin-gateway.svg">
- </a>
-</p>
-
-<p align="center">
- <a href="https://github.com/apache/casbin-gateway/blob/master/LICENSE">
- <img alt="license"
src="https://img.shields.io/github/license/apache/casbin-gateway">
- </a>
- <a href="https://github.com/apache/casbin-gateway/issues">
- <img alt="GitHub issues"
src="https://img.shields.io/github/issues/apache/casbin-gateway">
- </a>
- <a href="https://github.com/apache/casbin-gateway/stargazers">
- <img alt="GitHub stars"
src="https://img.shields.io/github/stars/apache/casbin-gateway">
- </a>
- <a href="https://github.com/apache/casbin-gateway/network">
- <img alt="GitHub forks"
src="https://img.shields.io/github/forks/apache/casbin-gateway">
- </a>
- <a href="https://discord.gg/S5UjpzGZjN">
- <img alt="Discord"
src="https://img.shields.io/discord/1022748306096537660?logo=discord&label=discord&color=5865F2">
- </a>
+ <a
href="https://github.com/apache/casbin-gateway/actions/workflows/golangci-lint.yml"><img
alt="Lint"
src="https://img.shields.io/github/actions/workflow/status/apache/casbin-gateway/golangci-lint.yml?branch=master&style=flat-square&logo=github&logoColor=white&label=lint"></a>
+ <a
href="https://github.com/apache/casbin-gateway/actions/workflows/build.yml"><img
alt="Build"
src="https://img.shields.io/github/actions/workflow/status/apache/casbin-gateway/build.yml?branch=master&style=flat-square&logo=github&logoColor=white&label=build"></a>
+ <a href="https://pkg.go.dev/github.com/apache/casbin-gateway"><img alt="Go
Reference"
src="https://img.shields.io/badge/go.dev-reference-00ADD8?style=flat-square&logo=go&logoColor=white"></a>
+ <a href="https://github.com/apache/casbin-gateway/releases/latest"><img
alt="Release"
src="https://img.shields.io/github/v/release/apache/casbin-gateway?style=flat-square&logo=github&logoColor=white&color=3b82f6"></a>
+ <a href="https://github.com/apache/casbin-gateway/blob/master/LICENSE"><img
alt="License"
src="https://img.shields.io/github/license/apache/casbin-gateway?style=flat-square&color=3b82f6"></a>
+ <a href="https://github.com/apache/casbin-gateway/issues"><img alt="Issues"
src="https://img.shields.io/github/issues/apache/casbin-gateway?style=flat-square&logo=github&logoColor=white&color=3b82f6"></a>
+ <a href="https://github.com/apache/casbin-gateway/stargazers"><img
alt="Stars"
src="https://img.shields.io/github/stars/apache/casbin-gateway?style=flat-square&logo=github&logoColor=white&color=3b82f6"></a>
+ <a href="https://github.com/apache/casbin-gateway/network/members"><img
alt="Forks"
src="https://img.shields.io/github/forks/apache/casbin-gateway?style=flat-square&logo=github&logoColor=white&color=3b82f6"></a>
+ <a href="https://discord.gg/S5UjpzGZjN"><img alt="Discord"
src="https://img.shields.io/discord/1022748306096537660?style=flat-square&logo=discord&logoColor=white&label=discord&color=5865F2"></a>
</p>
<p align="center">
@@ -41,22 +20,14 @@
<a href="https://cdn.casbin.org/img/casbin-gateway.gif"><img alt="Casbin
Gateway" src="https://cdn.casbin.org/img/casbin-gateway.gif" width="900"></a>
</p>
-## 杀手锏:那个 Key 背后的 API,真是卖给你的那个吗?
-
-中转商可以卖着前沿模型、跑着便宜模型,可以把缓存过的前缀当新输入计费,也可以假装自己会说某套 API。这些在流量里都看不出来,所以
**Authenticity** 直接去问上游。每个 Provider
都会被单独探测——加入时、端点/类型/密钥变更时、从未探测过时,以及报告过期后——测出来的是一个 100 分制的分数和一个 A 到 F 的等级,显示在
Authenticity 页面上,也显示在首页 Agent 列表的正上方。不用点按钮,也不用配置什么。
-
-[](https://cdn.casbin.org/img/casbin-gateway-authenticity.png)
-
-分数只是背后那些测试用例的汇总,而用例全都摆在页面上:作答的模型是不是点名的那个、强制调用时两层嵌套的工具 schema
能不能扛住、事件流里该有的事件是不是都到齐了、提示词缓存是不是真的在计费上体现出来、两个完全相同的请求计费是否一致、厂商自己的响应头在不在。每条用例都写明它问上游什么、实际发出去的请求长什么样、答案怎么判、占多少权重。
+## 功能特性
-[](https://cdn.casbin.org/img/casbin-gateway-authenticity-cases.png)
-
-可以改权重、停用、重写问题,也可以自己加一条——该问中转商什么,各家情况并不一样,而评分方法不公开就算不上证据。**恢复默认**会把内置用例恢复原样,你自己写的不受影响。
-
-报告还有不花钱、也不发任何请求的另一半:直接读 Gateway 已经留下的记录,看这个上游到底表现如何 —— 缓存实际被
-计入了多少、有多少次请求失败、响应有多快、有多少跑过的模型还没有价格。
-
-一次探测会花掉该 Provider 一点点额度,具体花了多少就写在报告上。`providerProbeIntervalHours`
决定报告多久算过期,`providerProbeMode = "manual"` 表示只在手动触发时探测,`"off"` 表示从不探测。
+- **[查一查那个 Key 背后的 API 是不是真的](#杀手锏那个-key-背后的-api真是卖给你的那个吗)** ——
中转商可以偷偷换成便宜模型、伪造缓存命中,流量里根本看不出来。Authenticity 直接问上游,测出 A 到 F 的等级。
+- **[一个地方切换所有 Agent 的 API 供应商](#让-agent-的流量走-gateway)** —— 改一次 Key 或 base
URL,接进 Gateway 的每个 Agent 都跟着换。
+- **[同一个 Agent 开多个实例](#接下来做什么)** —— 比如同时跑好几个 Claude Desktop,各自登录不同账号。
+- **[看到完整的请求,而不只是一个数字](#记录提示词)** —— 每一条 prompt、消息和工具 schema,都留在这台机器上。
+- **[统计每个 Agent 花了多少,包括没走 Gateway 的部分](#每个-agent-花了多少包括没走-gateway-的那部分)** ——
直接读 Agent 自己写的会话记录。
+- **[跨 Agent 对比、复制技能 / MCP / 提示词](#接下来做什么)** —— 一张表看到所有 Agent 装了什么。
## 界面预览
@@ -114,13 +85,30 @@ Gateway 会在自己的窗口里打开 —— 不用登录:它只服务本机
| **Sessions** | 这些 Agent 的每一次会话,从它们留在磁盘上的会话记录里读出来:完整的对话,一条一条。 | 无 |
| **Activity** | 被监控的 Agent 正在做什么:每一次工具调用、调用的目标,以及耗时。 | 给某个 Agent 打开监控 |
| **Providers** | 挡在模型厂商前面的统一入口。API Key 由 Gateway 持有,Agent 拿不到;也可以转发 Agent
自己的登录,什么都不持有。 | 一个厂商的 API Key,或者什么都不用 |
-| **Authenticity** | 每个 Provider 一个 100 分制的分数和一个等级,不用点按钮就会自动测出来 ——
见[上面那一节](#杀手锏那个-key-背后的-api真是卖给你的那个吗)。 | 一个带 API Key 的 Provider |
+| **Authenticity** | 每个 Provider 一个 100 分制的分数和一个等级,不用点按钮就会自动测出来 ——
见[下面这一节](#杀手锏那个-key-背后的-api真是卖给你的那个吗)。 | 一个带 API Key 的 Provider |
| **LLM Records** | Agent 转发的每一次请求:完整的 system prompt、每一条消息和工具调用、模型可用的每个工具的
schema,以及 token 数和费用。 | 一个 Provider,以及 `llmRecordMode` —— 见[记录提示词](#记录提示词) |
| **Usage** | 本机每个 Agent 花了多少:按时间、按模型、按 Agent 分别统计,数据来自 Agent 自己写的会话记录 —— 所以没走
Gateway 的请求也算得上。另一个页签是 Gateway 转发过的部分,那是唯一知道由哪个 Provider 作答、是否失败的账。 | 无 |
| **Model pricing** | 每百万 Token 多少钱,Usage 页面上的每一个金额都由它算出来。可以手工改某个价格,也可以让
Gateway 按计划从 [models.dev](https://models.dev) 的目录给本机跑过的模型重新定价;你手工改过的价格不会被覆盖。 |
无 |
Agent 是通过读取 **Gateway 所在机器**的用户账户、home 目录和安装路径发现的,所以要在你想观察的那台机器上运行它。
+### 杀手锏:那个 Key 背后的 API,真是卖给你的那个吗?
+
+中转商可以卖着前沿模型、跑着便宜模型,可以把缓存过的前缀当新输入计费,也可以假装自己会说某套 API。这些在流量里都看不出来,所以
**Authenticity** 直接去问上游。每个 Provider
都会被单独探测——加入时、端点/类型/密钥变更时、从未探测过时,以及报告过期后——测出来的是一个 100 分制的分数和一个 A 到 F 的等级,显示在
Authenticity 页面上,也显示在首页 Agent 列表的正上方。不用点按钮,也不用配置什么。
+
+[](https://cdn.casbin.org/img/casbin-gateway-authenticity.png)
+
+分数只是背后那些测试用例的汇总,而用例全都摆在页面上:作答的模型是不是点名的那个、强制调用时两层嵌套的工具 schema
能不能扛住、事件流里该有的事件是不是都到齐了、提示词缓存是不是真的在计费上体现出来、两个完全相同的请求计费是否一致、厂商自己的响应头在不在。每条用例都写明它问上游什么、实际发出去的请求长什么样、答案怎么判、占多少权重。
+
+[](https://cdn.casbin.org/img/casbin-gateway-authenticity-cases.png)
+
+可以改权重、停用、重写问题,也可以自己加一条——该问中转商什么,各家情况并不一样,而评分方法不公开就算不上证据。**恢复默认**会把内置用例恢复原样,你自己写的不受影响。
+
+报告还有不花钱、也不发任何请求的另一半:直接读 Gateway 已经留下的记录,看这个上游到底表现如何 —— 缓存实际被
+计入了多少、有多少次请求失败、响应有多快、有多少跑过的模型还没有价格。
+
+一次探测会花掉该 Provider 一点点额度,具体花了多少就写在报告上。`providerProbeIntervalHours`
决定报告多久算过期,`providerProbeMode = "manual"` 表示只在手动触发时探测,`"off"` 表示从不探测。
+
### 让 Agent 的流量走 Gateway
这是 **LLM Records** 的数据来源,也是让 Gateway 而不是 Agent 持有厂商 Key 的方式。
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]