Use cases
What you can build on Agent Tank
Agent Tank serves your coding agents’ usage limits as local JSON. Here is how people use it, from a production integration to a one-line CI gate. Everything runs on machines you control.
Built on Agent Tank: ProPR
ProPR is GitHub orchestration for AI coding agents: it runs Claude Code, Codex and other agents on your own server, and each task lands as a pull request. It uses Agent Tank to see how much subscription capacity each of those agents has left. The integration is off by default and best effort: when Agent Tank cannot be reached, ProPR hides its usage bars and keeps working.
What ProPR does with the data
- Usage bars. The sidebar shows each provider’s windows (Claude session and weekly, Codex 5-hour and weekly, Antigravity per model) with reset countdowns, refreshed every 60 seconds.
- Usage per run. ProPR reads usage before and after each agent call and stores the difference next to that call’s log entry.
- Pausing unattended runs. Before a scheduled or triggered agent run starts, ProPR compares the provider’s session and weekly usage with a pause threshold (90% by default) and defers or skips the run when it is over.
- History. Its usage charts prefer Agent Tank’s own
GET /history/:idwhen the instance records SQLite history.
How it connects
ProPR has two modes. In external mode it reads an Agent Tank you run on the host over HTTP: GET /status for every account, GET /status/:id and POST /refresh/:id for one. ProPR’s backend runs in Docker, so it is pointed at http://host.docker.internal:3456 (the address its setup detection probes), which reaches Agent Tank through its default Docker bridge binding. In bundled mode ProPR instead runs agent-tank --once --json in a short-lived container, with the agents’ credential directories mounted read-only, so nothing listens on a port.
services:
backend:
extra_hosts:
- "host.docker.internal:host-gateway"
// Every account in one request. Any failure means "no usage data", never an error.
const AGENT_TANK_URL = process.env.AGENT_TANK_URL ?? 'http://host.docker.internal:3456';
async function readAllStatuses() {
try {
const res = await fetch(`${AGENT_TANK_URL}/status`, { signal: AbortSignal.timeout(25_000) });
if (!res.ok) return undefined;
const { providers } = await res.json();
return providers; // windows[].used_percent, resets_at, ... per account
} catch {
return undefined; // Agent Tank not running: hide the usage bars, keep working
}
}
See ProPR’s Agent Tank integration docs for the full setup.
Status bars
Every status bar script reads GET /status with a two-second timeout. They need curl and jq. All integration examples are on the API reference.
tmux
Keep the highest usage of each account in your tmux status line, next to the clock, so you see it in every terminal without switching windows. The script prints tank off when Agent Tank is not running. Full setup.
#!/bin/sh
# Highest used_percent per account, e.g. "claude 28% · work 54%".
URL="${TANK_URL:-http://127.0.0.1:3456}"
json=$(curl -sf --max-time 2 "$URL/status") || { echo "tank off"; exit 0; }
printf '%s' "$json" | jq -r '
[.providers[]
| select(.windows | length > 0)
| "\(.id) \([.windows[].used_percent] | max | round)%"]
| join(" · ")'
Waybar
A Waybar custom module on Linux: the highest usage as the label, every window in the tooltip, and a warning class above 80% that you can colour in your stylesheet. Full setup.
#!/bin/sh
# Waybar custom module: {"text", "tooltip", "class"}; class "warning" above 80%,
# "pending" with "n/a" while no account has usage yet.
URL="${TANK_URL:-http://127.0.0.1:3456}"
json=$(curl -sf --max-time 2 "$URL/status") || {
echo '{"text":"tank off","tooltip":"Agent Tank is not running","class":"offline"}'
exit 0
}
printf '%s' "$json" | jq -c '
[.providers[].windows[].used_percent] as $all
| if ($all | length) == 0 then
{text: "n/a", tooltip: "No usage yet: waiting for the first refresh", class: "pending"}
else
($all | max) as $top
| {
text: "\($top | round)%",
tooltip: ([.providers[] | .id as $id | .windows[]
| "\($id) · \(.label): \(.used_percent)%"] | join("\n")),
class: (if $top > 80 then "warning" else "normal" end)
}
end'
SwiftBar and xbar
A macOS menu bar item with the highest usage, and a dropdown listing every window, a link to the dashboard and a refresh item. Full setup.
#!/bin/bash
# SwiftBar / xbar plugin, refreshed every 5 minutes (the "5m" in the file name).
export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
URL="${TANK_URL:-http://127.0.0.1:3456}"
if ! json=$(curl -sf --max-time 2 "$URL/status"); then
echo "AT off"
echo "---"
echo "Agent Tank is not running"
exit 0
fi
printf '%s' "$json" | jq -r --arg url "$URL" '
[.providers[].windows[].used_percent] as $all
| if ($all | length) > 0 then "AT \($all | max | round)%" else "AT n/a" end,
"---",
if ($all | length) == 0 then "No usage yet: waiting for the first refresh" else empty end,
(.providers[] | .id as $id | .windows[]
| "\($id) · \(.label): \(.used_percent)% | font=Menlo size=12"),
"---",
"Open dashboard | href=\($url)/",
"Refresh | refresh=true"'
Scripts and CI gates
agent-tank --once --json refreshes every agent, prints the GET /status body and exits, with no server running. jq -e exits 1 when its expression is false, so this line fails a CI step or a shell && chain when any window is above 90%:
agent-tank --once --json | jq -e '[.providers[].windows[] | select(.used_percent > 90)] | length == 0'
Against a running instance, a Node.js script can apply its own threshold. This one exits 1 when any weekly window is above it (Node.js alert script):
// Exit 1 when any weekly window is above the threshold (default 80%).
// Usage: node check-weekly.mjs [threshold] (Node.js 18+)
const url = process.env.TANK_URL ?? 'http://127.0.0.1:3456';
const threshold = Number(process.argv[2] ?? 80);
const res = await fetch(`${url}/status`, { signal: AbortSignal.timeout(5000) });
if (!res.ok) throw new Error(`GET /status returned ${res.status}`);
const { providers } = await res.json();
const over = providers.flatMap((p) => p.windows
.filter((w) => w.type === 'weekly' && w.used_percent > threshold)
.map((w) => `${p.id} · ${w.label}: ${w.used_percent}%`));
if (over.length > 0) {
console.error(`Weekly usage above ${threshold}%:\n${over.join('\n')}`);
process.exit(1);
}
console.log(`All weekly windows at or below ${threshold}%.`);
Agents in local containers
When you run coding agents or tools in containers, they can read usage from the Agent Tank on their host. With no --host, Agent Tank binds 127.0.0.1 and the Docker bridge gateway addresses, so containers on the same host reach it while it stays off your public interfaces. Only --no-docker turns this off (Docker bridge bind).
# On the host
agent-tank
# From any container on the same host
docker run --rm --add-host=host.docker.internal:host-gateway curlimages/curl \
-s http://host.docker.internal:3456/status
On Linux, --add-host=host.docker.internal:host-gateway (or extra_hosts in Compose, as ProPR does) maps host.docker.internal to the bridge gateway address that Agent Tank listens on.
Self-hosted team dashboard
A pattern, not a feature: each developer runs Agent Tank on their own machine, bound to an address on your internal network with a Bearer token (--host and AGENT_TANK_TOKEN). A page you host on that network polls each instance’s /status and shows them together. Each instance and its credentials stay on its owner’s machine, the aggregation is something you run yourself, and no Agent Tank service is involved.
// team-usage.mjs: run on a machine on your own network (Node.js 18+).
const instances = [
{ name: 'ana', url: 'http://10.0.0.21:3456', token: process.env.TANK_TOKEN_ANA },
{ name: 'ben', url: 'http://10.0.0.22:3456', token: process.env.TANK_TOKEN_BEN },
];
const results = await Promise.all(instances.map(async ({ name, url, token }) => {
try {
const res = await fetch(`${url}/status`, {
headers: { Authorization: `Bearer ${token}` },
signal: AbortSignal.timeout(5000),
});
return { name, providers: (await res.json()).providers };
} catch {
return { name, providers: null }; // that instance is offline
}
}));
for (const { name, providers } of results) {
console.log(name, providers?.map((p) => `${p.id} ${Math.max(0, ...p.windows.map((w) => w.used_percent))}%`).join(' · ') ?? 'offline');
}
Personal dashboard
No code at all: run agent-tank and open http://127.0.0.1:3456. The built-in dashboard shows every account with reset countdowns, pace indicators and usage sparklines. It also updates the browser tab’s title and favicon, so you can keep an eye on usage from the tab strip.
Next steps
-
Every endpoint, the response schema and copy-paste integrations.
-
Install Agent Tank and open the dashboard in a few minutes.