Nodes/ComfyUI-ZMongo/05 Test Gemini API Key
ComfyUI Node

05 Test Gemini API Key

Proving the key works before the real calls start

By CentralFloridaAttorney·Created 5 months ago·Updated 2 months ago· 1
05 Test Gemini API Key
  • session
  • json
  • success
  • text
gemini_prefix/gemini
modelgemini-2.5-flash
refresh_token

05 Test Gemini API Key fires a real, tiny Gemini call through the ZMongo backend and reports whether the stored key actually works. It's the difference between "a key is saved" (that's Gemini Key Status) and "this key can generate responses" - which is the thing you actually need to know before building a workflow around Gemini.

This is the node to run when you first set up ZMongo's Gemini side. Paste the key with Save Gemini API Key, wire a session into Test, run, and read the text output. If you get actual model text back, you're done - every other Gemini node will work. If not, you've isolated the problem to credentials before you've built anything elaborate on top.

How it works

Required input is just session (from the API Key Session node). Optional inputs:

  • model - which model to ping, default gemini-2.5-flash.
  • gemini_prefix - default /gemini.
  • refresh_token - to force a re-test when wired from another node's refresh.

It POSTs to /gemini/api/key/test with the model name and lets the backend make a real Gemini request. Outputs:

  • json - the full backend payload.
  • success - boolean: did the test call succeed?
  • text - the model's actual response text, extracted from the payload. Success + real text = working key. This is also your first chance to confirm the model string you plan to use is one your key has access to.

Notes

  • It costs a (tiny) call. Every run sends a real request to Gemini, so it's not free in the abstract - but a test call is pennies and worth it as a gate. Don't put it in an every-frame loop; use it as a setup/sanity node.
  • The default model is gemini-2.5-flash. If you primarily use a different model, change model here so the test reflects your real usage - a key that works for Flash might still be blocked for other models (permissions, quotas, regional availability).
  • Pair it with Gemini List Models when a test fails: List Models shows what your account can actually reach, so you can see whether the failure is "bad key" or "model not available to this key."

Install

ComfyUI Manager → ComfyUI-ZMongo, or:

cd ComfyUI/custom_nodes
git clone https://github.com/CentralFloridaAttorney/ComfyUI-ZMongo

then restart. The Gemini nodes here are thin HTTP clients to the ZMongo backend - Gemini itself runs server-side, so you won't be installing local Google SDK plumbing to make this work, even though the pack's full requirements.txt is heavy.

CategoryZMongo/06 Gemini

Inputs (4)

NameTypeDefaultDescription
sessionZMONGO_API_SESSION
gemini_prefixoptSTRING/gemini
modeloptSTRINGgemini-2.5-flash
refresh_tokenoptSTRING

Outputs (3)

NameTypeDescription
jsonSTRING
successBOOLEAN
textSTRING