What Is treg? A Unified API Gateway for Agent Tools

GuidePublished 2026-08-30Author: DeepSeek Plugin Market
tregagent toolsAPI gatewayguide
treg is a DSH plugin for DeepSeek Harness giving an OpenRouter-like gateway for tools: one token, 2,896 endpoints across 60 providers, per call from a cent.

treg is a plugin in the DeepSeek Harness (DSH Plugin) ecosystem that provides an OpenRouter-like gateway for agent tools: point an agent at one base URL with one token and it can call 2,896 catalogued endpoints across 60 providers per call, from a cent — SEO and backlinks, social and trends, people and company enrichment, ads, and scraping, with no provider signup. Based on the official README, this article covers what it is, its core features, installation and enabling, typical usage, and common troubleshooting.

What Is treg?

treg solves the problem of agents needing to access many paid APIs for real work while being blocked by subscription walls, signup walls, or no public API at all: treg carries those provider accounts and bills fractions of a cent per call, so an agent needs only one token. The positioning and facts below all come from the official README (source):

treg (OpenRouter for Tools) is maintained by the superdesigndev team and open-sourced under Apache 2.0 with additional terms. The "OpenRouter" naming is deliberate — OpenRouter aggregates models, treg aggregates tools. You do not need to know which vendor sells backlink data or hold an account with them: search for the task, read the price, call it. treg carries two kinds of tool under one token: the catalog — external endpoints treg serves on its own key, metered against your team's prepaid balance (every new team gets $1.00 free); and your own tools — endpoints, CLIs, or skills (SKILL.md) that teammates registered, where your own key always wins over treg's and those calls are never metered.

What Are the Core Features of treg?

The core capability of treg is "find tools by task, call them with one token, keep credentials off your machines": natural-language catalog search, unified calling, registering your team's own tools, balance and health management, with all calls injecting auth server-side. These capabilities all come from the official README (source):

  • Search tools by task: treg catalog search "backlinks for a domain" finds tools by what they do and returns matches with prices, no vendor knowledge required; treg catalog get <tool> shows parameters, price, and an example response.
  • Unified token calling: all tools share the same token (the X-Treg-Token header); treg call tikhub.tiktok.user.profile --query uniqueId=tiktok calls it directly, across 2,896 endpoints and 60 providers.
  • Register your team's tools: treg upload scans your .env, skill directories, and installed CLIs and registers them in one pass, with treg scan for a read-only preview; your own key always wins over treg's and those calls are never metered.
  • Run CLIs with injected auth: treg run stripe -- get /v1/balance runs a vendor CLI with the team credential injected, so you never hold the key; treg shell start opens a subshell where registered CLIs inject automatically.
  • Share skills: treg skill install seo-blog-writer pulls a team-shared skill into your agent; treg upload skills registers a whole folder of skills in one pass.
  • Balance and health management: every new team gets $1.00 free credit, treg balance shows exactly what a call costs, treg topup adds funds; treg health checks credential health.

How to Install and Enable treg?

Installing treg has two steps: install the plugin with the DSH CLI, then install the treg CLI and sign in; alternatively, install it as a Claude Code plugin with zero configuration. The commands and facts below all come from the official README (source):

1. Install the treg plugin with DSH: run the install command in the DeepSeek Harness terminal:

bash
dsh plugin --profile web add github:superdesigndev/treg

Wait for the command to report a completed install, then restart dsh web and you can call treg from DSH.

2. Install the treg CLI and sign in: installing the CLI also points it at the registry; then sign in (GitHub by default; --email for a one-time code, --token for agents/CI):

bash
curl -fsSL https://treg.to/install.sh | sh
treg login

3. Connect to your agent (optional): after signing in, run treg mcp install to expose treg's tools to your agent; or install the skill with npx skills add superdesigndev/treg -s treg (the -s treg matters — without it you also get this repo's internal dev skills).

4. Update treg: update the plugin with the DSH update command (or re-run the install command to pin to the latest version):

bash
dsh plugin --profile web update treg

5. Uninstall treg: remove the plugin from the current profile:

bash
dsh plugin --profile web remove treg

Typical treg Usage

Typical treg usage is "search for the task, call by price, check the balance anytime": find tools by task rather than by vendor, call with the same token, and know the exact cost of every call. (source) The steps below cover daily usage from the first search to sharing team tools.

1. Search the catalog by task: when you do not know the vendor, use a natural-language search, then inspect a tool's parameters and price:

bash
treg catalog search "backlinks for a domain"
treg catalog get hunter.people.email.find

2. Call a catalog tool: use treg call with the tool ID and --query parameters:

bash
treg call tikhub.tiktok.user.profile --query uniqueId=tiktok
treg call hunter.people.email.find --query domain=reddit.com --query full_name="Alexis Ohanian"

3. Check balance and top up: every call has an exact price; out-of-balance catalog calls return HTTP 402 with a topup_url, which an agent can act on directly:

bash
treg balance
treg topup

4. Share your team's own tools: preview with treg scan, register with treg upload; once registered, any teammate's agent can call them and your own key is never metered:

bash
treg scan
treg upload
treg run stripe -- get /v1/balance

5. Check credential health: when a tool call fails, run treg health first to confirm your team's keys are valid:

bash
treg health

treg Troubleshooting

The four most common treg issues, their typical symptoms, and how to Fix them: invalid credentials, an empty balance, a refused catalog endpoint, and unclear key priority, addressed respectively with health, balance/topup, connecting your own key, and understanding the credential ladder. (source)

1. Tool calls fail or return 401: run treg health first to check credential health and confirm whether your team's registered keys are expired or invalid; then run treg balance to confirm the balance is sufficient.

2. Catalog calls return HTTP 402: the balance is out. The response body carries balance_micro, estimated_cost_micro, and a topup_url, so an agent can act on it without reading prose: run treg topup to add funds or set up automatic top-ups.

3. An endpoint is refused: treg refuses, rather than serves free, endpoints it has no published price for, telling you to connect your own key instead. Once your team credential is connected, those calls go through your key and stop drawing from the balance.

4. Key priority: the credential ladder is "your team's registered tool → a team-stored secret → treg's own key". After connecting a key you already pay for, calls prefer your credential and skip the balance — treg balance confirms the cost.

Use Cases and Notes

treg fits scenarios where your agent needs real-world paid data and services but signing up for every provider is unrealistic; note that keys are hosted server-side, and teams with strict controls can self-host. (source)

Use cases: SEO backlinks and keyword/rank tracking, social trends and publishing, people and company enrichment, ads management and creative, scraping — any agent workflow that needs to call paid APIs per use. Notes:

  1. Catalog calls are metered against the team's prepaid balance; every new team gets $1.00 free credit, and out-of-balance calls return 402 instead of silently failing.
  2. Your own key always wins over treg's and is never metered, but keys are hosted on treg's server (encrypted at rest) — teams with strict key control can self-host, which the project encourages.
  3. The proxy relays, never models, the upstream and injects auth server-side, so callers never hold keys; to proxy an API outside the catalog, prefix the real upstream URL with https://treg.to/call/.
  4. treg never silently picks or fails over between providers for you — catalog search lists providers that serve the same capability side by side with prices, and choosing is yours.

treg is an open-source project maintained by superdesigndev (Apache 2.0 with additional terms). Plugin details: treg plugin details.

This page is an independent guide rewritten from the plugin's official README — for the authoritative documentation and the latest changes, defer to the source: superdesigndev/treg. A plugin is third-party code that runs on your machine once installed; inclusion is not an endorsement — review the source before installing.

FAQ

How do I use the treg catalog search command, and what can I search for?

Use a natural language query like `treg catalog search 'backlinks for a domain'` without knowing the specific vendor. It returns matching tools, prices, and more. The catalog covers 2,896 endpoints across 60 providers, including SEO, social, people and company enrichment, ads, and scraping.

How do I pass parameters when calling a tool with treg, for example a TikTok user profile?

Use the `treg call` command followed by the tool ID and a `--query` parameter, e.g., `treg call tikhub.tiktok.user.profile --query uniqueId=tiktok`. All tools share the same token, and each call identifies you via the `X-Treg-Token` header.

What is the free credit for treg, and how do I check costs with the balance command?

Every new team using treg gets $1.00 free credit for calling external catalog endpoints. Run `treg balance` to see the exact cost of each call. Once the credit is used up, you'll need to top up to continue using paid catalog tools.

How do I register my team's own tools with treg, and will my keys be exposed?

With treg, teams can register endpoints, CLIs, or skills (SKILL.md). Once registered, any teammate's agent can call them, and your own key always wins over treg's, with those calls never metered. All calls inject auth server-side, so credentials never leave the server.

How do I configure treg after installing it as a Claude Code plugin?

Install via `/plugin marketplace add superdesigndev/treg` and `/plugin install treg@treg` with no token or configuration. On first run, it walks your agent through CLI sign-in and `treg mcp install`, so you end up with both the command line and treg's tools.

What does the treg health command do in DeepSeek Harness, and how do I troubleshoot credential issues?

`treg health` checks the health of your credentials, helping you confirm whether your team's registered keys are valid. If a tool call fails, run this command first to see if any credentials are expired or invalid, then check your balance.

Related Terms

treg
treg (OpenRouter for Tools) is a plugin for DeepSeek Harness (DSH) that provides a unified API gateway for agent tools: one token calls 2,896 endpoints across 60 providers, priced per call from a cent.— treg README
catalog
The catalog is the set of external endpoints treg serves on its own key, metered against your team's prepaid balance; every new team gets $1.00 free credit.— treg README
treg call
treg call is the CLI command to invoke a tool by ID with --query parameters, whether from the catalog or your team's own tools; every call identifies you via the X-Treg-Token header.— treg README
treg upload
treg upload scans your .env, skill directories, and installed CLIs and registers them as team tools in one pass; treg scan gives a read-only preview first.— treg README
Server-side auth injection
Server-side auth injection is treg's security model: the proxy relays rather than models the upstream and injects the team credential server-side, so callers never hold keys and credentials never leave the server.— treg README

Sources

View all articles