Delegator — The Complete Guide
One gateway, 100+ endpoints, the whole network behind it
Delegator is a plain-Python HTTP router (stdlib, no FastAPI) that runs on port 3900 on my VPS. It centralizes 100+ endpoints: email (Resend — free tier 100/day, then pay-per-use), SMS (Twilio — pay-per-message), calendar (Hebcal free + Google Calendar), Drive, research (Perplexity Pro API + Gemini), content-studio, landing-pages, campaigns, pipeline orchestration, and auto-routing. Auth is handled today with a simple API key (JWT-ready in middleware), and everything is logged to Qdrant. For me it fronts all 10 agents behind a single gateway — for you it can replace Zapier (free tier 100 tasks/month, Starter ~$29/mo, Professional ~$73/mo in 2026) or Make, and serve as an API gateway for any multi-agent architecture, without scattering credentials across five different .env files.
What this guide covers
What is the Delegator? The single entry point to the whole network
A Python HTTP router that replaces Zapier, Make, and 5 credential files
Delegator is what you'd call an 'API gateway' in technical jargon — a central switchboard that sits in front of any system with many background services. It's a small program written in plain Python (no fancy framework like FastAPI or Express), running as a background service on my server, listening for requests that come in over HTTP. Every agent in my network — Kami, Kaylee, Box, Hermes, Adopter, and all the rest — whenever they want to send an email, fire off an SMS, check a calendar, or call an LLM — they don't talk to the provider directly. They talk to the Delegator, and the Delegator is the one that knows which API key to use and how to speak to each service.
Over 100 endpoints — what's inside the gateway
Not just a pipe — real business logic too
An endpoint is a specific server address that answers a specific request. For example POST /email/send to send an email, or GET /calendar/check to check a schedule. Delegator hosts 100+ of them, grouped by responsibility. It's not just middleware (a pass-through layer that forwards requests to another service) — there's real business logic in here too, like a gate that checks whether publishing is allowed right now, or a router that picks which LLM to call based on cost.
The Gateway Pattern — centralized responsibility instead of scattered
When everyone goes through the same gate, you can manage them from one place
The Gateway pattern is a software architecture principle where, instead of every component in the network talking directly to external services, they all route through a single central gateway. The payoff: anything you want to check or enforce across the whole network — you add it once in the gateway, and the change applies to everyone automatically. Want to add a log line for every request? One line. Want to rate-limit how many requests per minute each agent can send? One line.
The Hebrew calendar gate — essential in Israel
Automatic blocking of publishing on Shabbat, holidays, Memorial Day
This is a unique protection layer I added to the Delegator after a few embarrassing incidents. The idea: before any publishing endpoint carries out the action, it checks the Hebrew-Israeli calendar via a service called Hebcal. If it's currently Shabbat, a holiday, Memorial Day for fallen soldiers, or Holocaust Remembrance Day — it simply refuses to publish marketing content and returns a polite message with the time publishing will resume. It works as middleware on every publishing endpoint in the network.
Cost tracking — which agent is eating how much
A dashboard showing in real time which agent spent how much on LLMs
LLM calls (language models like Claude, Gemini, GPT) are the biggest line item in an autonomous agent network, and without tracking it can explode into an imaginary bill at the end of the month. I added a mechanism to the Delegator that records every LLM call that goes through it: which tier was used, which model, which agent asked, how many tokens went in, how many came out, and how long it took. Later you can slice the data and see, say, 'Kami consumed 40% of this month's LLM budget'.
LLM routing — always free first
One endpoint, 4 automatic fallback tiers, $0 most of the time
Instead of every agent deciding on its own which LLM to call (and when to fall back to a different model if it fails), the Delegator exposes a single endpoint called `/llm/route`. The agent sends its prompt along with a system prompt and a token limit, and the Delegator decides for itself: try the cheapest model first (free), fall back to the next one if it fails, and so on until something works. The response also includes which tier and which model actually answered, so the agent knows.
Advanced tips from 6 months in production
The nuances that turn a simple API gateway into something stable and reliable
This isn't a theoretical guide — everything here was forged from failures I hit along the way. These are the lessons from running the Delegator in maintenance for half a year.

