Tool Gateway
The Tool Gateway lets AigenLabs route selected tools through a managed backend instead of direct per-vendor API keys.
AigenLabs still supports direct keys and local/self-hosted backends. Use the gateway only when you want a managed route for a specific tool and your configured account supports it.
What's includedโ
| Tool | What you get | |
|---|---|---|
| ๐ | Web search & extract | Agent-grade web search and full-page extraction via Firecrawl. No rate limits to worry about โ the gateway handles scaling. |
| ๐จ | Image generation | Nine models under one endpoint: FLUX 2 Klein 9B, FLUX 2 Pro, Z-Image Turbo, Nano Banana Pro (Gemini 3 Pro Image), GPT Image 1.5, GPT Image 2, Ideogram V3, Recraft V4 Pro, Qwen Image. Pick per-generation with a flag, or let AigenLabs default to FLUX 2 Klein. |
| ๐ | Text-to-speech | OpenAI TTS voices wired into the text_to_speech tool. Drop voice notes into Telegram, generate audio for pipelines, narrate anything. |
| ๐ | Cloud browser automation | Headless Chromium sessions via Browser Use. browser_navigate, browser_click, browser_type, browser_vision โ all the agent-driving primitives, no Browserbase account required. |
Use any combination โ run a managed route for web and images while keeping your own ElevenLabs key for TTS, or keep every tool on direct provider keys.
Why it's hereโ
Building an agent that can actually do things often means stitching together multiple API providers โ each with their own signup, rate limits, billing, and quirks. A managed gateway can simplify that:
- Fewer accounts. One managed route can cover several tool providers.
- Fewer long-lived keys. OAuth-backed routes can avoid storing every vendor key locally.
- Same quality. Same backends the direct-key route uses โ just fronted by us.
Bring your own keys anytime โ per-tool, whenever you want to. The gateway isn't a lock-in, it's a shortcut.
Get startedโ
There are three ways in โ pick whichever fits where you are:
aigenlabs tools # Enable gateway routes or direct providers per tool
aigenlabs model # Configure inference first if your gateway route depends on an OAuth provider
aigenlabs status # Check which tools are active and which backend each uses
aigenlabs tools is the recommended production path because it makes each backend choice explicit. Turn on just the tools you want, one at a time.
If a selected gateway backend needs OAuth and you are not signed in, AigenLabs starts the required login flow during tool setup. This path only enables the one tool you picked; it does not switch your inference provider or enable every other tool.
Check what's active at any time:
aigenlabs portal info # Portal auth + Tool Gateway routing summary
aigenlabs portal tools # Gateway catalog with current routing per tool
aigenlabs status # Full system status (Tool Gateway is one section)
aigenlabs portal info shows a routing summary like:
โ Tool Gateway
Managed tools โ available
Web tools โ active via managed route
Image gen โ active via managed route
TTS โ active via managed route
Browser โ active via Browser Use key
Tools marked "active via managed route" are going through the gateway. Anything else is using your own keys.
Eligibilityโ
The Tool Gateway depends on the managed-provider account configured in your AigenLabs install. If your account is not eligible, use direct provider keys through aigenlabs tools.
Some accounts are also entitled to a free tool pool โ a small managed-tool allowance that covers gateway tool calls without a paid subscription. When a free pool is available, the gateway surfaces it and shows a setup prompt on first use, so you can opt in and start using managed tools right away.
Mix and matchโ
The gateway is per-tool. Turn it on for just what you want:
- All tools through a managed route โ simplest when your account supports it.
- Gateway for web + images, bring your own TTS โ keep your ElevenLabs voice, use the gateway for the rest.
- Gateway only for things you don't have keys for โ "I already pay for Browserbase, but I don't want a Firecrawl account" works fine.
Switch any tool at any time via:
aigenlabs tools # Interactive picker for each tool category
Select the tool, pick a managed gateway provider or any direct provider you prefer. No config editing required. If the managed provider needs OAuth, AigenLabs starts that login inline.
Using individual image modelsโ
Image generation defaults to FLUX 2 Klein 9B for speed. Override per-call by passing the model ID to the image_generate tool:
| Model | ID | Best for |
|---|---|---|
| FLUX 2 Klein 9B | fal-ai/flux-2/klein/9b | Fast, good default |
| FLUX 2 Pro | fal-ai/flux-2-pro | Higher fidelity FLUX |
| Z-Image Turbo | fal-ai/z-image/turbo | Stylized, fast |
| Nano Banana Pro | fal-ai/nano-banana-pro | Google Gemini 3 Pro Image |
| GPT Image 1.5 | fal-ai/gpt-image-1.5 | OpenAI image gen, text+image |
| GPT Image 2 | fal-ai/gpt-image-2 | OpenAI latest |
| Ideogram V3 | fal-ai/ideogram/v3 | Strong prompt adherence + typography |
| Recraft V4 Pro | fal-ai/recraft/v4/pro/text-to-image | Vector-style, graphic design |
| Qwen Image | fal-ai/qwen-image | Alibaba multimodal |
The set evolves โ aigenlabs tools โ Image Generation shows the current live list.
Configuration referenceโ
Most users never need to touch this โ aigenlabs model and aigenlabs tools cover every workflow interactively. This section is for writing config.yaml directly or scripting setups.
Per-tool use_gateway flagโ
Each tool's config block takes a use_gateway boolean:
web:
backend: firecrawl
use_gateway: true
image_gen:
use_gateway: true
tts:
provider: openai
use_gateway: true
browser:
cloud_provider: browser-use
use_gateway: true
Precedence: use_gateway: true routes through the configured managed gateway regardless of any direct keys in .env. use_gateway: false (or absent) uses direct keys if available and only falls back to the gateway when none exist.
Disabling the gatewayโ
web:
use_gateway: false # AigenLabs now uses FIRECRAWL_API_KEY from .env
aigenlabs tools automatically clears the flag when you pick a non-gateway provider, so this usually happens for you.
Self-hosted gateway (advanced)โ
Running your own compatible gateway? Override endpoints in ~/.aigenlabs/.env:
TOOL_GATEWAY_DOMAIN=your-domain.example.com
TOOL_GATEWAY_SCHEME=https
TOOL_GATEWAY_USER_TOKEN=your-token
FIRECRAWL_GATEWAY_URL=https://... # override one endpoint specifically
These knobs exist for custom infrastructure setups such as enterprise deployments and dev environments.
FAQโ
Does it work with Telegram / Discord / the other messaging gateways?โ
Yes. Tool Gateway operates at the tool-execution layer, not the CLI. Every interface that can call a tool โ CLI, Telegram, Discord, Slack, IRC, Teams, the API server, anything โ benefits from it transparently.
What happens if my subscription expires?โ
Tools routed through the gateway stop working until the managed account is restored or you swap in direct API keys via aigenlabs tools. AigenLabs shows a clear error with the failing route.
Can I see usage or costs per tool?โ
Use your managed provider's dashboard or direct-provider billing page to inspect usage. Direct-key backends report usage at their own vendor.
Is Modal (serverless terminal) included?โ
Modal is available as an optional remote terminal backend, not part of the default Tool Gateway bundle. Configure it via aigenlabs setup terminal or directly in config.yaml when you want a remote sandbox for shell execution.
Do I need to delete my existing API keys when I enable the gateway?โ
No โ keep them in .env. When use_gateway: true, AigenLabs skips direct keys and uses the gateway. Flip the flag back to false and your keys become the source again. The gateway isn't a lock-in.