First run: finish the setup
This plugin ships the skill, so you have this page — but not yet the treg command, and not yet its
tools. Set both up once, in this order:
curl -fsSL https://treg.to/install.sh | sh # 1. the CLI (skip if `treg --version` already works)
treg login # 2. sign in — opens a browser
treg mcp install # 3. register treg's tools into this agent
Step 3 writes the token from step 2, so the order matters — run out of order it exits without
writing anything. The tools (catalog_search, catalog_get, call, balance, my_tools) appear
after the agent restarts; until then everything on this page works through the CLI.
Step 1 also installs this same skill into the agent's own skills directory, which duplicates what the plugin already gives you — worth mentioning to the human, who can remove it.
treg — the tool catalog for your agent
Ask for the task, not the tool. When a job needs external or live data — backlinks, keyword volume, a TikTok profile, a work email, competitor ad creative — search the catalog, read the price, call it.
Two kinds of tool answer to the same token, through the same proxy, which injects the credential server-side so you never hold it:
- The catalog — curated external endpoints treg can call for you.
- Your own tools — what a teammate registered and shared with this org: API accounts, OAuth connections, skills. Note: an X (Twitter) connection made through treg's app is metered per call (X bills the app owner per use); the response reports the price. A team's own X developer app is not metered.
The mechanics:
- Endpoint:
https://treg.to· CLI:treg· the CLI is a thin client over the API. - Auth: every call sends
X-Treg-Token: <your token>. - A tool = an upstream base URL + credential bindings. A skill/bundle = a recipe (SKILL.md) + its secrets + its tool(s). The proxy relays, never models the upstream.
New verified accounts receive $1.00 of signup credit once, when creating an eligible team.
Additional teams start with no signup credit. Legacy POST /users registration does not verify
an email or grant credit; use email OTP or Google/GitHub sign-in. Existing balances remain usable.
First: install + sign in
curl -fsSL https://treg.to/install.sh | sh # installs the CLI + points it here
treg login # browser sign-in (GitHub / Google / email code) — first login registers you
treg login --email you@company.com # terminal-only alternative (emailed 6-digit code)
treg login --token <per-org-token> # non-interactive (agents/CI)
Everything runs in your active org (after first login, create or join a team). Team invites arrive by
email — see them with treg invites, accept with treg accept (or treg org join <code>). Switch
teams: treg org switch <slug>.
Already connected over MCP? Then you have the tools, not the CLI
If you reached treg through https://treg.to/mcp/ — ChatGPT, Claude Code, Cursor — the CLI steps above do not
apply to you. You have catalog_search, catalog_get, call, balance, my_tools,
catalog_request, feedback, and review.
Everything in this document maps onto them:
- "search the catalog" →
catalog_search, thencatalog_getfor the exact price and parameters - "call it" →
callwith the endpoint id, or<tool-name>/<path>for one of the team's own tools - "check the balance" →
balance - "share feedback" →
feedback
The rules below are the same either way. The one that matters most — say the price before you
spend it — matters more here, because call returns cost_usd and you can report what a call
actually cost rather than estimating.
A call on a catalog endpoint spends the team's balance. A call on one of the team's own tools
spends nothing: that key belongs to them.
Task — the catalog: what treg can do for you (start here)
3,200+ catalogued endpoints across 73 providers, grouped by what they DO: keyword & rank tracking, backlinks & authority, AI visibility, trending & discovery, publishing to the team's own social accounts, people & company enrichment, ads management & creative, measurement, video & image generation.
treg catalog search "subreddit posts" # find endpoints by what they do
treg catalog get scrapecreators.reddit.subreddit.posts # params, PRICE, how you'd be served
treg call scrapecreators.reddit.subreddit.posts --query subreddit=news
treg balance # the prepaid balance + recent charges
treg catalog request "<what you need>" # searched, not there? file it — steers what's added next
Notes:
- Every endpoint's price is in
treg catalog get, before you call it. - Discovery jobs usually have TWO shapes in the catalog — a structured one (filters: title, location,
followers, funding) and a semantic one (describe what you want;
exa.*). When a brief mixes hard limits with a fuzzy niche, run both and merge: e.g. creators =influencersclub.creators.search(filters) ∪exa.creators.search(description, pinned to the platform domain); people = apeople.searchprovider ∪exa.people.search; who-holds-a-role questions =exa.web.answer. - HTTP 402 = out of balance, with a machine-actionable body (
balance_micro,estimated_cost_micro,topup_url). Recovery:treg balance→ top up in the dashboard (Team → Billing) → or store the org's own key for that provider (own keys are never billed to the balance — they take priority automatically). A 402 witherror: route_max_costis different: YOURX-Treg-Route-Max-Costheader refused the call before anything was charged — ask for fewer rows/targets or raise the ceiling. - The real charge is the response header
X-Treg-Cost-Micro(micro-USD), withX-Treg-Call-Idas the id to quote. The catalog~$/callfigure for aper_resultroute assumes a 20-row page when the price is per row; when the catalogcost.unitistarget/domain/keywordyou pay per thing asked about, one unit per target. Failed calls (4xx/5xx relayed from the provider) are free; empty results mean whatever the provider means by them — treg relays, it does not normalise. - HTTP 503
provider_capacity_unavailable= treg's own account for that provider is out (not your balance; nothing charged). Body hasresets_atandalternatives(same capability, other providers) — choose one, or use your own key. treg never switches providers for you. treg re-checks the provider about once a minute, so a retry after a minute can succeed. - An org tool or secret for the provider always wins over treg's key, automatically — the catalog is the fallback, not a replacement for keys the team already has.
- Choosing between providers of one capability — the procedure.
treg catalog get <id>lists every provider serving the same job withCOST,WORKS(success rate treg has observed, with the sample size),SPEED(median) andLAST OK. Work down this order:- Match the inputs you actually HAVE. An endpoint wanting a
profile_urlis not a substitute when you hold a name and a domain, whatever it costs. This rule outranks price every time. - Then reliability: a high
WORKSwith a real sample beats a rounder number with a tiny one —99% (121)is stronger evidence than100% (8). - Then price. Spreads inside one capability reach 200×, so this is usually where the money is.
LAST OKbreaks ties. A bare age means a real call came back; a✓age is the catalog's own verification stamp, not live traffic;—means nobody has verified it and nobody has called it — prefer almost anything else.
- If a call fails with 429 / 5xx / a timeout, try the next provider. You know its parameters, so you can build its request. Say which one you switched to.
- Never retry a 4xx elsewhere. A 4xx is usually your parameters; fixing them is the fix, and retrying burns the team's money on N providers for one mistake.
- treg does not choose or fail over between providers for you. That is deliberate: only
you know which inputs you hold, and treg relays rather than rewrites your request. If treg's
own account for a provider is out it may serve the same endpoint through a treg-owned relay
(
X-Treg-Served-Via: overflow:<name>, orserved_via+ a hint on the MCPcallresult; real price, same shape).catalog_getshows that price up front asoverflow_price_usdwhen the deployment can relay the endpoint - a "free" endpoint with one may bill exactly that, so quote it. A team opts out withtreg org overflow off. - Routed endpoints (
treg.<capability>, e.g.treg.people.email.find) are where you can ask treg to choose: POST the identity ({full_name, domain}|{first_name, last_name, domain}|{linkedin_url}); treg runs the best child (own keys first, then cheapest per hit), falls back on errors AND misses (cheapest first, withinX-Treg-Route-Max-Cost, default $1), and returns{output, raw, _treg.served_by, _treg.tried}+X-Treg-Served-By.X-Treg-Route-Waterfall: 0stops at the first miss. A filter a provider cannot apply (countryon a name-only search) is still sent to the others, and the answer names it inX-Treg-Ignored-Filters/_treg.ignored_filters— post-filter, or sendX-Treg-Route-Strict-Filters: 1to get a 422 (unbilled) instead of a looser answer.catalog_get treg.people.email.findshows the plan and prices. - A found contact is not a confirmed one. An email or phone find returns the provider's best
match; only
output.verified: truemeans it checked the mailbox. When it is not, the answer carries_treg.advicenaming the verify step (treg.people.email.verify, a fraction of a cent) — run it before outreach, and never re-send the same find: every hit bills, repeats included. - Verify before you send. Every address, every time. This includes rows from a company or
domain search (
treg.people.search,hunter.companies.emails, …): those are directory listings, and a row's email is unconfirmed unless that row's own verification field says otherwise. Treatinvalidas dead andaccept_allas risky. And never send to an address the provider did not return — if a domain search came back empty,info@is a guess, not a result. Live 2026-09-08: 73 of one team's 79 bounces were unverified rows and guesses that one $0.006 verify call each would have caught.
- Match the inputs you actually HAVE. An endpoint wanting a
- An endpoint with no published price is refused rather than served free; connect your own key.
Task - generate a video or an image
Generation models live in the catalog under the video-gen and image-gen platforms, one row per
model per route (MiniMax direct, Replicate, OpenRouter), so the same model on two routes sits next
to itself with both prices. Models are not interchangeable - you pick one; treg does not choose.
treg catalog search "text to video" # every model, with prices
treg catalog get minimax.video-gen.h3.generate # native params, model enum, price table, async descriptor
treg call minimax.video-gen.h3.generate --await --timeout 900 --data '{"model":"MiniMax-H3-Max",
"content":[{"type":"text","text":"A paper boat drifts across a quiet pond at sunrise."}],
"resolution":"480P","duration":5,"ratio":"16:9"}'
How it works:
- A generation call is an async task. The submission returns a task id at once;
--awaitpolls the provider until it finishes and prints the final response only on stdout. stderr carries the task id, a resumabletreg call …command (Ctrl-C loses the wait, never the task or the money), progress, and the result URL. Exit 0 = done, 2 = the provider failed the task, 3 = timed out (resume with the printed command). - CLI agents: raise your shell tool's timeout or run the call in the background. A video takes 1-5 minutes; a runtime's default 2-minute command limit cuts it off mid-wait.
- MCP and raw-HTTP agents: the response header
X-Treg-Asyncis the descriptor - where to poll, which status values are terminal, where the result is. Poll lazily: wait ~60 s before the first check, then every 30-60 s; three to six checks per video is normal. Do other work in between. - Parameters are the provider's own, verbatim;
treg catalog getshows them, including the enum of selectable models and resolutions. Nothing is translated between providers. - Money: the price is reserved at submission and charged only when the task succeeds. A failed
or moderated task refunds the whole hold - nothing to do on your side.
treg auditand the dashboard's Activity page show each task's state (generating…→done/failed · refunded) with the result link once it exists. - Result URLs expire (the descriptor's
ttl_notesays how soon; MiniMax's ~9h). Download promptly; treg never stores the media. On some routes the file needs one more call ---awaitprints that exact command instead of downloading. - Responses needing settlement or task-ownership evidence are limited to 8 MiB. Larger responses
return
502withdetail.error=response_buffer_limitand no charge; retrying the same oversized response will not help. Authorized free final downloads needing no body evidence stream in full. Such downloads are fetched again on retry, not retained for local idempotent replay.
Retrying a call without paying twice
If a call times out or you never see its answer, repeat it with the same idempotency_key (over MCP)
or Idempotency-Key header (over HTTP). treg returns the stored answer, does not call the provider
again, and charges nothing. The result says replayed: true.
Only for a genuine retry. Asking the same question again to see what changed is NEW work: use a new key or none, or you will get the old answer back. Reusing one key for a different request is refused.
Most retries need none of this — a failed call was never billed.
Catalog entries marked strict_query: true accept only their declared query parameters, once each. Include required fields, use allowed values and omit the request body.
Task — your own tools: call one the team registered
Start from what is registered, then use the API exactly as its own docs say. No treg vocabulary, no special params:
treg tool ls # what this team has registered
treg call intercom conversations?per_page=5 # <tool-name> + the upstream path
Over HTTP that is GET https://treg.to/call/<tool-name>/<path> with X-Treg-Token: <your token>. treg looks
up the named tool, injects that team's credential server-side, and relays everything faithfully
(method, query params, your headers, body). Your X-Treg-Token is stripped before the upstream sees
it. Works for GET/POST/PUT/PATCH/DELETE.
Only tools this org has registered resolve. Discover them with treg tool ls · treg skill ls.
Task — share your keys & skills so teammates' agents can use them
Bulk (the fast path): run it in the directory the human names. It lists the provider keys it
recognises in that .env and the skills in its subdirs, and registers only the ones they tick:
treg upload # both sides of the cwd; `treg upload env|skills --dir <d>` to restrict
Default: wrap new keys in a skill. When registering a new key/endpoint/CLI, pair it with a skill so credential, tool, and recipe land together (and it gets a shareable page). If no skill exists, create a basic one — a proper SKILL.md (frontmatter matters: agents discover skills by it) + one example call:
mkdir -p ./posthog && cat > ./posthog/SKILL.md <<'MD'
---
name: posthog
description: Query the PostHog analytics API through treg — the key is injected server-side. Use for events, insights, and project queries.
---
Call it: `treg call posthog api/projects/@current` (upstream: https://us.posthog.com)
MD
treg skill init --dir ./posthog # drafts treg.json: base_url from the catalog (folder name) or URLs in SKILL.md; review it + add the key
treg skill add --dir ./posthog # registers recipe + secret + tool atomically
Never orphan a secret: a stored key nothing binds is dead weight — if you use secret add
directly, bind it to a tool (endpoint/CLI) in the same breath.
Bare endpoint, no recipe (only when a skill adds nothing):
treg secret add posthog-key --value "$POSTHOG_API_KEY" # or --file ./.secret/token.json
treg tool add posthog --base-url https://us.posthog.com --secret posthog-key
# query-key API instead of a bearer header:
treg tool add serpapi --base-url https://serpapi.com --secret <name-or-id> \
--auth-in query --auth-name api_key --auth-format '{secret}'
A whole skill (recipe + secrets + tool, possibly multi-credential):
treg skill scaffold ~/.claude/skills/google-ads --out gads.json
# -> walks the dir: captures SKILL.md as the recipe + every .secret/* as a secret.
# -> YOU then edit gads.json: set base_url, and complete each binding (location/name/format).
# e.g. google-ads needs TWO bindings on one request:
# Authorization: Bearer {access_token} (injector: oauth)
# developer-token: {secret} (injector: env)
treg skill push gads.json # registers the bundle atomically
Share it inside the org: give a teammate the endpoint + tool name and their agent can call it without being handed the credential — you granted the access, treg injects the secret, and the call is logged against their token.
Auth shapes (per binding injector, = the secret's kind): env (plain string) ·
secret_file (JSON token file, pull secret_field) · oauth (JSON token, auto-refreshed) ·
cli_auth (a token the human copied out of a CLI they are already signed into, and supplied to treg
themselves). Multiple bindings apply to every request.
OAuth, two modes (treg keeps it fresh): if the oauth secret carries refresh_token +
client_id + client_secret, treg auto-refreshes it before it expires (you never re-upload).
If it's just a bare token, that's manual mode, treg injects it as-is and you re-upload when it
expires. Same storage; a credential can graduate from manual to auto with no migration.
Getting the first OAuth token, two ways (your choice):
- Manual: do your own OAuth locally, then
treg secret add gsc --file token.json --kind oauth. - Hosted connect:
treg oauth connect gsc --client-secret client_secret.json --scopes <scope>→ prints a consent URL; you approve in the browser; treg captures the token directly. One-time setup: addhttps://treg.to/oauth/callbackto your OAuth app's redirect URIs.
Task — manage the team + monitor
An account can own up to 10 teams. Joining other teams as a member does not count toward this limit.
treg tool ls / secret ls / skill ls / calls # inventory + audit log — scoped to the active org
treg tool rm <id> / secret rm <id> / skill rm <id> # secret rm is blocked while a tool binds it
treg health # status of every credential in this org (ok | invalid | unknown)
treg health --run # re-check now: refresh oauth tokens, probe each tool, alert owners
Teams / orgs (owner > admin > member > viewer; a member manages only what they created):
treg org create "Team A" # you become owner (auto-active)
treg org invite bob@company.com --role member # admin+; emails the invite (a one-time code is the fallback)
treg org members # admin+; who's in the active org
treg org ls / treg org switch <slug> # your orgs / switch active
Give an agent its own identity (admin+). An agent doesn't have to borrow the human's token — mint it one, and every call it makes is capped, scoped and logged as itself:
treg org agent-new ci-bot # prints the token ONCE (run again to rotate)
treg org agent-new ci-bot --tools stripe,gh --cap 500 # only these tools, 500 calls/day
treg org agents # who the team's agents are + today's usage
treg org agent-rm <user_id> # revoke instantly
Put that token in the agent's TREG_TOKEN env var. An agent token can call this team's tools and
read — it can never sign in, create a team, or be an owner. If you are an agent and you were given
your own token, use it instead of the machine owner's: your work then shows up under your own name in
treg calls.
The invitee signs in with the invited email and runs treg accept — no code handling needed
(the code path still works: treg org join <code>). A brand-new invitee also gets their own
personal org (no empty state), so removing them from a team never locks them out. Give a tool
a probe so treg can validate it: health_check: {method, path, expect_status} (e.g. intercom {"path":"me"}).
Feedback
Proactively share problems and suggestions about treg. Small annoyances that slowed your task
down count too: unclear instructions, confusing results or charges, unhelpful errors, and
missing capabilities you worked around, even if the task succeeded. Describe what you needed and
observed; you do not need to prove a bug. Distinguish observations from suspected causes.
Use the feedback tool over MCP, or treg feedback submit over CLI. Pass related call IDs
in call_ids (CLI: --call-id), not only in the message; references are optional.
Report each issue once. Feedback helps the treg team improve the product; it does not complete
the user's task. Keep going afterward.
Keep private information out of the report. See feedback instructions.
Review
If a call result invites a review, rate that one call after using it:
review(call_id, usefulness, reason?) over MCP or treg review CALL_ID USEFULNESS [--reason "..."].
Choose useful, partly, not_useful, or not_sure; uncertainty is fine. One review per
invitation; a review of an uninvited call is accepted but kept for reference only. Omit private
data, use feedback for anything confusing or wrong, then continue.
Rules
- Secrets are write-only — the API never returns a stored value, to you or to anyone.
- A tool may bind a secret a teammate shared with this org (use-without-hold) — that's the point: they chose to share it, it stays scoped to the org, you can spend it without seeing it, and every call is attributed to the token that made it. It is delegated access inside one team, never access to a credential nobody granted you.
- Everything is scoped to your active org. A token reaches that team's tools and no one else's.
- The proxy doesn't understand the upstream; if a call fails, the status you see is the upstream's truth.
- More:
https://treg.to/llms.txt(agent onboarding) ·https://treg.to/tutorial(interactive walkthrough).