KIE Get Remaining Credits [SL]
Know how much runway your KIE key has left
- raw_json
- credits_remaining
Every other node in this pack spends your KIE credits happily. This one tells you how many you have left. That's the whole job, and honestly it's a nice one to have - with a pay-as-you-go key, "did my batch drain me?" is a constant background worry when you're running long grid or video jobs.
It's about as thin as a node gets: one api_key input, no model, no uploads, no polling loop. It hits KIE's remaining-credits endpoint (api.kie.ai/api/v1/chat/credit) with your key as a bearer token and returns two outputs:
- raw_json - the unparsed response body, in case you want to inspect the full payload.
- credits_remaining - the integer balance, ready to feed into any INT input elsewhere in your graph.
There's also a log toggle (default on) that prints the balance to the console, and - here's the sneaky bit - the pack's other nodes log your remaining credits after every successful job anyway via the same endpoint. So you'll see this number scrolling past in your terminal whether you add the node or not.
The one real gotcha
A missing, expired, or wrong key makes this node error out - it doesn't return a friendly zero. That's actually useful as a key-validation canary: run this node once before a big batch and if it passes, your key is alive and your credentials are accepted. If you're automating a workflow that shouldn't die mid-batch, you can read credits_remaining into a conditional (like an if/switch node) and gate expensive calls on a minimum balance.
Install and wiring
Same as every node in this pack - ComfyUI Manager, search "Kie-API-Serverless", or:
cd ComfyUI/custom_nodes
git clone https://github.com/v3devv/ComfyUI-Kie-API-Serverless
Restart, then drag the node in, paste your key, and run it once to sanity-check before you start spending. No model files, no dependencies beyond what ComfyUI already bundles. It's the rare utility node worth having in a template workflow just for the peace of mind.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | — | |
| logopt | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| raw_json | STRING | — |
| credits_remaining | INT | — |