Place
Self-hosted
Role
Architecture and build
Team
Built by me with AI-assisted development
Stack
FastAPI · Python

My AI systems — the Vera memory and the Stepan sales agent among them — call many model providers. AIbroker is the single gateway in front of all of them: provider keys are kept in one place, with calls proxied or given time-limited lease access, every call is logged with an estimated cost, and dead or rate-limited keys are taken out of rotation automatically.

Why cost has to be checked, not trusted

On 27 June 2026 a library update silently changed how call costs were calculated, and every logged cost became $0. Later a gap of $122 appeared between logged spend and a provider invoice. Since then, logged costs are treated as estimates and checked against the provider’s own invoice.

Two ways to serve a project

Proxy mode: the broker calls the model and returns the answer, so the project never sees a key. Lease mode: for APIs that do not fit the standard interface, the broker hands out a short-lived key and records the usage when it comes back.

What keeps it running

A monitor runs every ten minutes: failing keys are re-checked on every pass, healthy ones about once an hour. A key that hits a rate limit is parked for a few minutes; one that runs out of a monthly quota is parked until the quota resets. Spending limits are set per project.

Live links

← Back to all work