> ## Documentation Index
> Fetch the complete documentation index at: https://developers.arg.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# treg

> Reach thousands of third-party API endpoints through one token and one prepaid balance.

treg is an API gateway rather than a single service: one token fronts a catalogue of thousands of third-party endpoints across dozens of providers, and treg supplies each provider's credential on your behalf. You connect treg once instead of holding a key per provider.

That is why treg does not have one action per endpoint the way other integrations do. The catalogue is far too large to enumerate and grows continuously, so the assistant discovers the endpoint it needs at run time.

## What you can do

**Actions** - search the catalogue, read one endpoint's full contract, list platforms, list your team's own registered tools, check the balance, and call an endpoint.

**Triggers** - none. Use it through the assistant in chat or as an action node in an automation.

## Get your credential

<Steps>
  <Step title="Open treg">Sign in at [treg.to](https://treg.to) and open **Team → Settings**.</Step>

  <Step title="Copy a token">
    Copy your team token, or mint one scoped to automated use with `treg org agent-new arg`. An
    org-scoped agent token is the better choice - it keeps working if you move teams.
  </Step>
</Steps>

## Connect

<Steps>
  <Step title="Open Integrations">
    In arg.ai, go to **Settings → Integrations** and click **Connect** on **treg**.
  </Step>

  <Step title="Paste the token">Enter your token in the API token field.</Step>
  <Step title="Save">arg.ai verifies it against your treg team and connects it.</Step>
</Steps>

## Use it

* **In chat:** *"Find a treg endpoint for TikTok profiles, check what it costs, then pull @tiktok."*
* **In an automation:** add a **treg** action node that calls a known endpoint id, and chain later steps off its `body`.

## How a call works

* **Find the endpoint first.** Search the catalogue by capability ("enrich a company by domain"), then read the endpoint's contract for its parameters, example request, and exact per-call price.
* **Call it by id.** A call returns the provider's response under `body`, along with `status`, the `call_id` for your audit trail, and `cost_micro` / `cost_usd` for what it actually drew.
* **Provider errors come back as data.** If the upstream provider rejects the request, you get `ok: false` and its own error body, so the arguments can be corrected and retried.
* **treg's own refusals fail the run.** A rejected token, a spent balance, or an unknown endpoint id stops the action instead of returning an empty result.
* **Calls are tagged for your ledger.** Each call carries the arg.ai organization and workspace it came from, so `treg usage by-tag` attributes the spend back to the team and workspace that caused it.

## What it costs

Catalogue calls draw from your prepaid treg balance - new teams start with \$1 of credit. Endpoints you reach through a key your team registered with treg bill nothing, because your own credential is used. An exhausted balance fails the action with a top-up prompt rather than degrading silently.
