Skip to content

Commit 73a4553

Browse files
gershamclaude
andcommitted
Document 1-credit meter and screen exemption
Teach the canonical skill the 1-credit control-plane meter, the screen-message exemption, and how to branch on credits_low plus payment_required (HTTP 402). Did not rebuild the locked bundle. python3 scripts/check-public-repo.py passed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 502aae5 commit 73a4553

1 file changed

Lines changed: 43 additions & 2 deletions

File tree

‎skills/screenrig/SKILL.md‎

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ marketplace plugin. If installation or lookup still fails, report the failing
7272
runtime command and the canonical repository URL to the user. Do not
7373
substitute a globally installed command or download an executable.
7474

75-
Use `--json` for agent work. Branch on `ok`, `error.status`, and `error.code`;
76-
do not parse prose. The first authenticated command enrolls automatically when
75+
Use `--json` for agent work. Branch on `ok`, `error.status`, `error.code`,
76+
and `warnings[].code`; do not parse prose. The first authenticated command enrolls automatically when
7777
the durable user credential is absent, stores that credential outside the
7878
replaceable plugin directory, and resumes the same command. `SCREENRIG_CONFIG`
7979
overrides the path. Otherwise the CLI uses `config.local-dev.json` in the
@@ -310,6 +310,47 @@ body under the same key is `idempotency_mismatch`. A 429 surfaces
310310
`Retry-After` as `retry_after_seconds`. Probe support through
311311
`capabilities.features.feedback`; `doctor` reports that check.
312312

313+
## Credits
314+
315+
The control-plane meter is 1 credit per billed authenticated command and 1
316+
credit per billed account-stream event. Remaining is a whole integer credit
317+
count. Read it from `data.credit_remaining` on `account show`, or from the
318+
warning message. Remaining below 1 credit is `payment_required` (HTTP 402).
319+
320+
Use `--json`. Branch on `ok`, `error.status`, `error.code`, and
321+
`warnings[].code`.
322+
323+
- `warnings[].code === "credits_low"`: remaining is below 1000 credits. The
324+
warning message includes the integer remaining. Surface remaining to the
325+
user. Do not retry the same billed command as a fix. Do not invent a pay
326+
command.
327+
- `error.code === "payment_required"` or `error.status === 402`: remaining is
328+
below 1 credit. Billed commands are rejected. `error.next` points at
329+
`screenrig --json account show`. Stop; do not spin. A 402 envelope may also
330+
include `credits_low` in `warnings[]` when remaining is present and below
331+
1000.
332+
333+
These commands do not debit the 1-credit API meter, so they still work when
334+
remaining is 0:
335+
336+
- `account show`
337+
- `auth revoke --yes`
338+
- `screen toast`
339+
- `screen screenshot` (request, status poll, and WebP download)
340+
341+
Exempt listen-stream events (not billed after subscribe): `screen.*`,
342+
`runtime.*`, `application.event`, and heartbeats.
343+
344+
Billed: other authenticated control-plane commands, including media, playlist,
345+
app, kv, playback, feedback, operations, screen pair/update/assign, and
346+
`events list`. Opening `events follow` costs 1 credit as the listen
347+
subscribe. Later billed events on that stream cost 1 credit each
348+
(`playlist.*`, `media.*`, `kv.*`, `application.published`, `operation.*`,
349+
`account.*`, `feedback.*`, `stream.cursor`, `stream.resync_required`).
350+
Reconnect replay is free.
351+
352+
v1 does not collect money in this CLI. There is no pay command.
353+
313354
## Commands
314355

315356
```text

0 commit comments

Comments
 (0)