Account tools¶
Three tools that read account state and estimate costs without making image-generation API calls. They’re safe to call frequently — they don’t consume Anlas.
get_subscription¶
Return the account’s subscription details and Anlas balance.
Parameters¶
None.
Returns¶
dict mirroring NovelAI’s /user/subscription response. The keys and
types below were observed on a live account:
Key |
Type |
Notes |
|---|---|---|
|
|
0 = free, 1 = starter, 2 = …, 3 = Opus. |
|
|
Whether the subscription is currently active. |
|
|
Account kind reported by NovelAI. |
|
|
Subscription expiry, as returned by the API. |
|
|
Whether the subscription is in a grace period. |
|
|
Whether the account is a first-time subscriber. |
|
|
Whether the account pays through PayPal. |
|
|
Payment processor id. |
|
|
Was |
|
|
Tier feature flags. |
|
|
Max-priority actions included with the tier. |
|
|
Queue priority the tier starts at. |
|
|
Context-token allowance. |
|
|
Whether max priority is unlimited. |
|
|
Module training steps included. |
|
|
Remaining Anlas-equivalent steps. |
|
|
Fixed (non-purchased) steps remaining. |
|
|
Purchased steps remaining. |
Example¶
sub = await ctx.session.call_tool("get_subscription", {})
print(sub["tier"], sub["trainingStepsLeft"]["fixedTrainingStepsLeft"])
CLI¶
uv run python -m novelai_image_mcp info
get_user_data¶
Return the authenticated account’s user data. Useful to confirm which account the server is authenticated as before issuing generation commands.
Parameters¶
None.
Returns¶
dict with:
Key |
Type |
Notes |
|---|---|---|
|
|
The account’s registered email. |
|
|
Registration source (e.g. |
|
|
Internal epoch. |
Example¶
user = await ctx.session.call_tool("get_user_data", {})
print(f"Authenticated as: {user['email']}")
estimate_anlas_cost¶
Estimate the Anlas cost of a generation without calling the API. Mirrors NovelAI’s public web-client cost formula.
Parameters¶
Name |
Type |
Default |
Notes |
|---|---|---|---|
|
|
required |
Image width (px). |
|
|
required |
Image height (px). |
|
|
required |
Sampler steps. |
|
|
|
Number of images. |
|
|
|
Target model. |
|
|
|
|
|
|
|
Required for |
|
|
|
SMEA enabled. |
|
|
|
Dynamic SMEA enabled. |
|
|
|
Auto SMEA. |
|
|
|
Apply Opus-tier free-sample rules. |
Returns¶
dict with:
Key |
Type |
Notes |
|---|---|---|
|
|
Estimated Anlas cost. |
|
|
|
Example¶
cost = await ctx.session.call_tool("estimate_anlas_cost", {
"width": 832,
"height": 1216,
"steps": 28,
"n_samples": 4,
"model": "nai-diffusion-4-5-full",
})
# cost: {"anlas": 80, "opus_free_sample": False}
Cost table (typical)¶
For reference — single sample, nai-diffusion-4-5-full, 28 steps. Measured
with this tool.
txt2img (action="generate")
Resolution |
|
|
|---|---|---|
512 × 768 |
8 |
0 |
832 × 1216 |
20 |
0 |
1024 × 1024 |
20 |
0 |
1536 × 1024 |
30 |
30 |
img2img (action="img2img", strength=0.5)
Resolution |
|
|
|---|---|---|
512 × 768 |
4 |
0 |
832 × 1216 |
10 |
0 |
1024 × 1024 |
10 |
0 |
1536 × 1024 |
15 |
15 |
Note
Opus-tier subscribers get free samples for small generations (≤1024²,
≤28 steps): inside that window opus=True returns anlas: 0 and
opus_free_sample: true. Outside it, opus does not change the estimate.
infill (inpaint) is priced like generate: 832 × 1216 at 28 steps with
strength=0.5 is 20 Anlas.
Costs scale linearly with n_samples — the example above (4 samples at
832 × 1216) is 4 × 20 = 80.
Warning
On V5 models, Opus free generations are capped by NovelAI’s refillable
usage limit and the API silently bills Anlas once exhausted. Check
get_subscription’s trainingStepsLeft before costly V5 runs — the
subscription response carries no separate usage field.
See also¶
Configuration — set generation defaults to control cost