Check Studio credits from the command line
Retrieve the current balance and decide whether a job can start.
Run `npx -y @offlinecreator/mcp@0.1.2 balance` from a process that already receives `OFFLINECREATOR_API_KEY`. The published 0.1.2 CLI implementation defines the `balance` branch, while the immutable package README establishes `npx -y @offlinecreator/mcp` as the local fallback and requires that environment variable. The pinned form keeps this example on the exact registry artifact inspected on August 9, 2026. The command reads the current Studio credit balance; it does not ask for a model or prompt and does not enter the generation branch of the CLI parser.
Use the returned number as one input to a preflight decision, not as a complete affordability answer. Balance tells you what the account has now. The model-list command is the separate source of published per-model credit costs, so compare the balance with the intended model before starting paid work. No account command was executed during this research pass, and no example balance below should be read as observed account data.
- Researched command
- `npx -y @offlinecreator/mcp@0.1.2 balance`Pins the current registry release inspected for this page.
- Authentication input
- `OFFLINECREATOR_API_KEY`Supply it through approved process secret configuration, never as a command argument.
Read the JSON response as balance plus currency
The published CLI accepts both `balance` and `credits`; each alias calls the same `getCredits()` client method. On success, the CLI writes the returned object to standard output as indented JSON and returns code zero. The published type declaration describes that object as a numeric `balance` and a string `currency`. A schematic shape is `{ "balance": <number>, "currency": "<unit>" }`; placeholders are intentional because research did not access a Studio account.
For automation, parse fields rather than scraping spacing or assuming a particular currency label. Validate that the process succeeded and that both expected fields have usable types before making a decision. The public client sends this read to `/api/v1/credits`; its request helper uses the configured bearer credential, rejects redirects, and turns a non-success response into an error. The executable's top-level handler writes an error message to standard error and sets exit code one, so failed output must not be treated as a zero balance.
- Primary key
- `balance`Numeric current balance in the published client contract.
- Companion key
- `currency`String unit returned with the balance.
- Alias
- `credits`Uses the same client method as `balance` in the inspected release.
- OfflineCreator Studio package via UNPKG: @offlinecreator/mcp 0.1.2 published CLI implementation
- OfflineCreator Studio package via UNPKG: @offlinecreator/mcp 0.1.2 published API client
- OfflineCreator Studio package via UNPKG: @offlinecreator/mcp 0.1.2 published API client types
- OfflineCreator Studio package via UNPKG: @offlinecreator/mcp 0.1.2 published executable entrypoint
Grant the documented read scope, not generation authority
The public package distinguishes `models`, `read`, and `generate` scopes. Its MCP server maps `get_credits` to `read`, and the CLI's `balance` branch calls the same public `getCredits()` client method. Together, those first-party files establish `read` as the documented permission for credit-balance access. They do not establish that a balance check needs `generate`, so a process that only inspects account state should not receive generation authority merely to make this command pass.
This is a documented scope mapping, not a live authorization test. If a key can list models but the balance request is forbidden, do not infer that Studio is out of credits: model discovery and balance access are separate permission classes. Check whether the intended credential includes `read`, then rerun the non-generating command. This pass did not create, inspect, or modify a real key and does not claim a specific private Settings-screen layout.
- Balance access
- `read`Documented by the public package's equivalent credit tool mapping.
- Model discovery
- `models`Separate from reading the account balance.
- Starting work
- `generate`Not needed merely to inspect the balance.
Turn the balance into a bounded go or stop decision
A successful balance response answers only the inventory side of preflight. Next, run the model-list task and select the exact workflow and model whose published credit cost applies. Compare that cost with the parsed balance without rounding, guessing a price, or reusing a cost copied from an old log. If the balance is lower, stop before generation and choose an intentional next action; if it is sufficient, the generation page owns the later submission steps.
This separation matters in scripts: a successful HTTP read is not approval to spend, while an adequate numeric balance does not prove that the selected model, prompt, account limits, or later generation request will succeed. Keep the check close to submission when concurrent jobs or another Studio surface may use the same account. OfflineCreator's product page states that web, MCP, CLI, and API generations share the same account credit balance, but this research did not measure concurrency or promise reservation timing.
Canonical boundary for the CLI balance task
This page owns `offlinecreator cli balance`: the command and alias, expected response fields, documented read scope, failure boundary, and the decision path from current balance to model-cost comparison. The parent CLI directory owns broad command discovery; authentication owns key creation and storage; model listing owns current costs; preflight owns combined cost logic; generation pages own submission.
The route remains an unpublished, unreviewed researched draft with degraded recent-source coverage. The mandatory recent-evidence run stopped at preflight because the research runtime credential was unavailable, so no source was searched and no community silence, popularity, reliability, adoption, or customer outcome is inferred. Consolidate this page into `/cli/offlinecreator-cli` if current first-party evidence no longer supports a distinct balance command and read-scope task.