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:
Key |
Type |
Notes |
|---|---|---|
|
|
0 = free, 1 = starter, 2 = …, 3 = Opus. |
|
|
Whether the subscription is currently active. |
|
|
|
|
|
Anlas-equivalent steps that don’t count per-use. |
|
|
Whether steps are deducted per generation. |
|
|
Internal subscription id. |
Example¶
sub = await ctx.session.call_tool("get_subscription", {})
print(sub["tier"], sub["trainingStepsLeft"]["fixed"])
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": 20, "opus_free_sample": False}
Cost table (typical)¶
For reference — single sample, Opus tier, nai-diffusion-4-5-full, 28 steps:
Resolution |
Anlas (txt2img) |
Anlas (img2img, strength=0.5) |
|---|---|---|
512 × 768 |
2 |
1 |
832 × 1216 |
5 |
3 |
1024 × 1024 |
5 |
3 |
1536 × 1024 |
7 |
4 |
Note
Opus-tier subscribers get free samples for small generations (≤1024²,
≤28 steps). Set opus=True to estimate with free samples applied.
See also¶
Configuration — set generation defaults to control cost