Discovery of AI use outside Petawork
See which members use Claude Code and Codex, what those sessions would cost on the API, and how many of the seats you pay for are used, from what members' machines already send. No vendor API.
Members also use AI outside Petawork: Claude Code and OpenAI's Codex CLI on their own machines, on seats the organisation pays for. The Discovery page (/usage/discovery, under Usage & cost) shows that use next to the seats, so you can see who uses what and which seats nobody uses.
Everything on the page comes from two places:
- Session summaries that the Petawork plugin for Claude Code sends from members' machines, for Claude Code and for Codex sessions. They are redacted on the machine and sent only while your organisation collects session summaries.
- Subscriptions that an owner or admin types in on the page.
Petawork never calls Anthropic's, OpenAI's or any other vendor's API for seats, usage or prices.
What the page shows
Pick a period: this month, last month or one of the two months before.
| Section | What it says |
|---|---|
| Figures | Sessions, their API-equivalent cost, how many people had a session, and what unused seats cost a month. |
| By tool | Claude Code and Codex: sessions, people, API-equivalent cost, last active day. |
| By person | Each member: the tools they used, sessions, API-equivalent cost, last active day. The person is the member who created the key that sent the summary; a key with no known creator shows its name. |
| Subscriptions | Each subscription you recorded, with seats bought, seats used in the last 30 days, unused seats and what they cost a month. |
A section with nothing in it is left out. With no sessions and no subscriptions the page says to connect your tools first.
API-equivalent cost
The plugin prices each session on the member's machine from its tokens (input, output, cache writes and cache reads, per model) with Petawork's own price table. That figure is what the same tokens would cost on the API at list prices. A seat on Claude Max, a Team plan or ChatGPT pays a flat fee, so the figure is not a bill. Every place that shows it says "API-equivalent".
A model that is not in Petawork's table keeps its tokens, and its cost is left out (marked with *). Petawork's own sessions are not on this page: their spend is billed and is on the chargeback statement.
Seats against use
A seat counts as used when someone had a session from that tool in the last 30 days, whatever period you picked.
- Members assigned: when you record who holds each seat, a seat is used when its member had a session. The page lists assigned members with no session.
- No assignment recorded: the page compares the seat count with the number of distinct members who had a session from that tool, and says that this is what it compared. If two subscriptions are for the same tool, active members fill the first one recorded, then the next.
- Other tools (anything but Claude Code and Codex) are "not measured": Petawork receives no sessions from them.
Record a subscription
Owners and admins open Record a subscription under Subscriptions and fill in:
| Field | |
|---|---|
| Tool | Claude Code, Codex or Other tool. |
| Name and plan | What you call it, for example "Claude Team", "Premium". |
| Seats bought | 1 to 100,000. |
| Price per seat a month | In the currency you pay in. |
| Currency | A three-letter code, such as USD or EUR. |
| Renews on | Optional. |
| Assigned members | Optional: who holds a seat. |
Edit and Remove are on each subscription. Removing the record changes nothing at the vendor. Changes are recorded in the audit log as ai_subscription.created, ai_subscription.updated and ai_subscription.deleted.
API and agents
| Route | Permission | |
|---|---|---|
GET /api/admin/v1/discovery |
usage:read |
?period=this_month|last_month|YYYY-MM or ?from=&to=: tools, people, key groups, seats, totals. |
GET /api/admin/v1/ai-subscriptions |
usage:read |
The recorded subscriptions. |
POST /api/admin/v1/ai-subscriptions |
org:manage |
{tool, name, plan?, seats, price_per_seat, currency, renews_on?, assigned_uids?}. Price in major units (19.99); stored in cents. |
PATCH /api/admin/v1/ai-subscriptions/{id} |
org:manage |
Any of the fields. |
DELETE /api/admin/v1/ai-subscriptions/{id} |
org:manage |
Removes the record. |
Agents use admin_discovery_get, admin_aisubscription_list, admin_aisubscription_create, admin_aisubscription_update and admin_aisubscription_delete on the workspace MCP server.
Limits
- Discovery is as complete as members' installs. A member without the plugin, or an organisation that does not collect session summaries, shows no use.
- Summaries are kept for your retention setting (90 days unless changed under Sessions, History), so older periods may be incomplete.
- Codex sessions are read from the files Codex keeps on the machine. Their format belongs to Codex and changes between versions; see Codex sessions.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| "Connect your tools first" | No summaries arrived and no subscriptions are recorded. Turn on Collect session summaries under Sessions, History, and ask members to install the plugin. |
| A member uses Codex but shows nothing | Codex sessions are sent at the end of a Claude Code session or by /venom:codex-sync. Only sessions from the last 30 days are sent. |
Cost shows - or * |
The model is not in Petawork's price table. Its tokens still count. |
| "More members are assigned than there are seats." | Add seats or remove a member from the list. |