Configure
Several keys and fallback
Two things keep note writing going when your chosen service hits a limit: more than one key for the same service, and a second service that takes over.
Several keys
Gemini, OpenRouter and OpenAI-compatible services accept a pool of keys. Put your main key in its usual setting and the rest in the matching list setting:
| Service | Main key | Extra keys |
|---|---|---|
| Gemini | MEMINDEX_GEMINI_API_KEY |
MEMINDEX_GEMINI_API_KEYS |
| OpenRouter | MEMINDEX_OPENROUTER_API_KEY |
MEMINDEX_OPENROUTER_API_KEYS |
| OpenAI-compatible | MEMINDEX_OPENAI_COMPAT_API_KEY |
MEMINDEX_OPENAI_COMPAT_API_KEYS |
Separate keys with commas, semicolons, spaces or line breaks. Duplicates are dropped, and a pool holds up to 32 keys.
When a key is rate limited, out of allowance or refused, MemIndex rests that key and tries the next one at once. The rest lasts as long as the service says, or 60 seconds if it does not say. A key out of allowance rests for 30 minutes, and a refused key for 6 hours. When every key is resting, MemIndex uses the one that frees up first. A success ends a key's rest.
Resting keys are remembered in api-key-cooldown.json in your memory folder. It holds a short fingerprint of each key, never the key.
Fallback
MEMINDEX_QUOTA_FALLBACK_PROVIDER names the service that takes over while your chosen one cannot serve. It is claude by default. Choices are claude, gemini, openrouter, openai-compatible or off.
Work moves to the fallback when your chosen service is resting after a rate limit or an outage, and the fallback can serve. A fallback needs its own credential, so Claude needs a sign-in or a key. A short rest ends after about 90 seconds, then MemIndex tries your chosen service again and moves back when it works.
Two things to know before you leave it on:
- The fallback receives the same activity your chosen service would have. If that matters, set
MEMINDEX_QUOTA_FALLBACK_PROVIDERtooff. Notes then wait for your chosen service. - A fallback can have its own cost or limit.
MEMINDEX_QUOTA_FALLBACK_MODEL sets the Claude model for a Claude fallback. Empty uses your normal Claude model.
If you use your Claude plan
Subscription note writing pauses before you run out, so your own work keeps its share. The thresholds MEMINDEX_QUOTA_THRESHOLD_FIVE_HOUR (0.95) and MEMINDEX_QUOTA_THRESHOLD_SEVEN_DAY (0.93) are fractions used. Restarting does not clear a pause. All the thresholds are in Settings.