← all posts site ↗

an ai that heals its own api keys

kept seeing tweets and services advertising free api keys for all kinds of models and the idea was gorgeous. i don't want to track any of them, so why couldn't the ai sign up for me, plug the keys in, use them, and rotate to a fresh one or back to the default whenever one ran out. an auto-healing thing. the answer turned out to be half real and half fantasy.

the rotation half already exists. the assistant has a credential pool where you drop multiple keys per provider. on a rejected request, an exhausted balance, or a rate limit, it marks that key as exhausted with a cooldown and rotates to the next in line. billing exhaustion gets a longer timeout than a transient throttle. when the cooldown lapses, the key rolls back into rotation. if the whole pool is dry, it fails cleanly instead of hammering away. so the failover half is not a build project, it ships today. you just have to populate the pool with keys.

the sign-up half is where i drew the line. i'm not creating accounts in someone's name, and mass signing up to farm free tiers is a terms of service violation that gets keys revoked and accounts banned. most of those free key posts are scams anyway, email farms and credential bait. so the sane version is small. drop a few legitimate free tier keys into the pool as fallback. when a free key rate limits, it rotates; when the paid fallback takes over, you keep reliability. and honestly the main model is already nearly free, so this was never about saving money. it was about resilience, which is a much better excuse to wire the pool up in the first place.