treg
superdesigndev/treg
OpenRouter for agent tools: one token for thousands of external APIs, with server-side credential injection and per-call billing. Source-available under Apache-2.0 plus additional terms.
What Treg is
Treg is the OpenRouter for agent tools. It provides a unified gateway, server-side credential injection, and per-call billing to connect AI agents with thousands of external APIs.
The problem it solves
Building autonomous AI agents that interact with real-world software is currently a logistical nightmare. Every developer must register separate developer accounts, negotiate OAuth flows, securely store customer API tokens, and maintain custom integration code for dozens of services (GitHub, Slack, Google Calendar, Notion, Stripe, Linear).
When external APIs change schema or rate-limit requests, agents silently crash. Hosted agent tool platforms charge aggressive per-tool and per-execution markups, while handling sensitive customer API credentials in closed third-party clouds poses serious enterprise security concerns.
How Treg solves it
Treg operates as an "OpenRouter for tools"—providing a single unified endpoint and authentication token to give AI agents instant access to thousands of pre-configured external tools and actions. It handles server-side credential injection, schema conversion for OpenAI/Anthropic function calling, and automated per-call metering.
Because it can be fully self-hosted, sensitive enterprise credentials never leave your infrastructure, while agent developers get instant plug-and-play access to actions across the entire modern SaaS ecosystem.
Who it is for
- AI agent developers & autonomous bot creators wanting instant tool calling without custom integrations
- B2B SaaS teams embedding AI assistants that need to take actions inside customer software (Slack, Jira, CRM)
- AI agency builders deploying automated workflows for clients across multiple third-party accounts
- Developers building with Model Context Protocol (MCP) seeking a centralized tool registry
Key features
- Unified Multi-Tool API Token Call thousands of external actions and APIs through a single standardized endpoint with automatic credential injection.
- Instant Function Calling Schemas Automatically converts tool definitions into native JSON schemas for OpenAI Function Calling, Anthropic Tool Use, and LangChain.
- Server-Side Credential Vault Safely injects OAuth tokens and API secrets at execution time without exposing raw API keys to models or client devices.
- Per-Call Metering & Cost Tracking Tracks execution latency, status codes, and per-tool usage down to the penny to enable usage-based resale to end users.
- Self-Hostable Architecture Run entirely on your own cloud or Docker infrastructure to meet enterprise compliance, HIPAA, and SOC-2 data residency rules.
- Model Context Protocol (MCP) Compatible Expose any connected tool directly as an MCP server for instant use inside Cursor, Windsurf, Claude Desktop, and Antigravity.
License at a glance
Apache-2.0: Source-available / commercial restrictions. Inspect repository license terms for commercial hosted resale.
Careful: Source-available terms: Verify commercial resale boundaries before launching a public hosted multi-tenant API gateway on top.
Caveats before you build
- Check specific license additions in the repository: contains custom terms regarding multi-tenant commercial resale.
- Managing hundreds of OAuth tokens requires reliable Redis and encrypted PostgreSQL database backends.
- Third-party APIs (Twitter, LinkedIn, Slack) have independent rate limits and terms of service that must be respected.
SaaS ideas you could build on Treg
Managed Agent Tool Gateway
Who pays: AI indie developers, Cursor/Claude agent builders, and startup dev teams
How to charge: $19 to $39 per month (includes 50,000 tool calls + $0.0005/call thereafter)
What you would add:
- Hosted multi-tenant Treg instance with Stripe subscription billing
- Web dashboard to toggle integrations (Slack, Linear, GitHub, Google Drive, Notion)
- Usage analytics, latency graphs, and rate-limiting per API key
No-Code Agent Action Marketplace
Who pays: Non-technical founders, Zapier/Make automators, and small agencies
How to charge: $25 to $49 per month per connected agent
What you would add:
- Visual connector catalog with one-click OAuth authentication wizards
- Pre-built tool definitions compatible with OpenAI Function Calling and Anthropic Tool Use
- Webhook response listener for async agent actions and background tasks
Enterprise Tool Access & Credential Vault
Who pays: AI consultancies and software agencies managing client AI workflows
How to charge: $39 to $79 per month per agency workspace
What you would add:
- Multi-tenant client workspaces with role-based access control (RBAC)
- Tamper-proof audit logs recording every API tool call, payload, and agent identity
- Client-specific credential isolation so developers never see raw API secrets
Managed MCP (Model Context Protocol) Cloud
Who pays: Developers using Cursor, Windsurf, Claude Desktop, and Antigravity
How to charge: $15 to $29 per month
What you would add:
- Cloud-hosted MCP server bridge converting Treg tool endpoints into SSE/stdio streams
- One-click copy/paste configuration snippet for Cursor / Claude Desktop / Antigravity
- Real-time connection health monitor and latency alerts
Usage-Based API Monetization Gateway for Tools
Who pays: Developer tool authors and micro-SaaS builders wanting to sell tools to AI agents
How to charge: $29 to $59 per month + 5% platform fee on agent payments
What you would add:
- Developer portal for tool creators to list endpoints and set per-call pricing
- Micro-billing engine that debits agent wallets and pays out creators via Stripe Connect
- Automated OpenAPI schema validation and uptime monitoring
Commercial tools it replaces
- Composio ($29 to $199+/mo based on active tool integrations and execution limits): Popular hosted platform providing pre-built integrations for LLM agents. Proprietary hosted platform that stores sensitive customer credentials in a third-party cloud.
- Toolhouse (Freemium with per-execution charges after monthly allowances): Cloud-based function execution infrastructure for LLMs. Per-call transaction costs scale quickly as agent fleets handle high-volume automated workflows.
- Arcade AI ($50+/mo with enterprise custom quotes): Security and auth gateway connecting AI agents to user accounts. Early-stage proprietary SaaS with high enterprise tiers and closed infrastructure.
Good fit if
- You are building AI agents, autonomous bots, or copilots that need to interact with external SaaS platforms.
- You want to avoid building and maintaining 50 separate OAuth integrations and API wrappers.
- You want an open-source tool gateway that can be self-hosted to keep customer credentials private.
Skip it if
- Your AI application only does text generation and has no need to read or write external API data.
- You are unable to manage encrypted database storage for secure credential vaults.
Quick start
git clone https://github.com/superdesigndev/treg.git
cd treg && pip install -r requirements.txt
python main.py
Requires Python 3.10+ and Redis for token caching and rate limiting.
Replaces
- Composio
- Toolhouse
- Arcade AI
- Langfuse Tooling
- Zapier Central
OpenRouter for agent tools: one token for thousands of external APIs, with server-side credential injection and per-call billing. Source-available under Apache-2.0 plus additional terms. In our API & Backend collection it ranks #103 of 412 by stars, and most of the code is Python. Maintained in the open by superdesigndev.
Why teams pick treg
The core idea is momentum. Instead of building API & backend toolkit from a blank repository, you fork treg and keep what fits: every file in there exists because someone needed it in production, which is exactly what makes it a fast, low-risk place to start.
- Community-backed 8,680 stars and 853 forks: real production use, active issues and answers when you get stuck
- Python codebase the bulk of the project is Python, so contributors can plug in without a stack switch
- In the TopSAAS catalog curated for our API & Backend catalog alongside its license, activity and self-hosting signals
Key facts
- Category: API & Backend
- Owner: superdesigndev
- Stars: 8,680
- Forks: 853
- Last verified: Nov 20, 2026
- Main language: Python
- Repository: github.com/superdesigndev/treg
treg fits naturally into a stack when you're structuring the server side of a product. The numbers back it up: 8,680 stars and 853 forks, and its community keeps it maintained.
Related API & Backend projects
- public-apis: A collective list of free APIs
- fastapi: FastAPI framework, high performance, easy to learn, fast to code, ready for production
- gin: Gin is a HTTP web framework written in Go
- hoppscotch: Open-Source API Development Ecosystem
Browse the full open-source SaaS ideas list, or explore the product directory for launched SaaS tools.