Skip to main content
The registry proxy connector lets an agent discover and call a large catalogue of third-party API endpoints (SEO, enrichment, social data, scraping, ads) through a single token — vendor credentials are injected server-side by the registry, so the agent never holds keys.
Bring your own account. PraisonAI ships no registry code and no default endpoint. You supply your own account token or a self-hosted base URL. The connector is disabled until TOOL_PROXY_URL is set.

Quick Start

1

Install and configure

2

Give the three functions to an agent

The agent searches the catalogue, describes a matching endpoint, then calls it — one token, no vendor keys in the agent.

How It Works

The connector exposes three functions over the registry’s plain-HTTP surface. The registry HTTP routes the connector talks to:

Self-Hosting the Registry

treg is an external, self-hostable tool registry. These are the exact steps to stand up a local registry for testing.
1

Clone treg

2

Install (Python 3.12–3.13)

3

Boot the server

4

Mint an API token

Auth on all authenticated routes is the raw token in the X-Treg-Token header — set TOOL_PROXY_AUTH_HEADER=X-Treg-Token so the connector sends the raw token instead of Bearer {token}.

The Three Functions

Each function is an agent tool that defaults to the TOOL_PROXY_URL / TOOL_PROXY_TOKEN environment variables. Free capability search returning catalogue matches for a natural-language query.

registry_describe

Free read returning an endpoint’s parameters, HTTP method, price-per-call and an example response.

registry_call

Paid invoke. The registry injects the upstream vendor credential server-side. The HTTP method is auto-derived from the describe doc; GET params are sent as the query string, POST/PUT as a JSON body.

Configuration Options

Configure the connector with environment variables (zero-code) or per-call keyword arguments.

Environment Variables

Constructor / Per-Call Options

RegistryProxyTool accepts these options; the same names work as optional keyword arguments on registry_search, registry_describe and registry_call.

Spend Guards

registry_call accepts optional budget guards that deny and report a call as a tool-result error before any money is spent.
  • Per-call price is read from registry_describe, so guards work without vendor-specific configuration.
  • Guards fail closed: if a budget is set but the price cannot be read (or is non-finite/negative), the call is denied.
  • max_session_spend persists across separate registry_call invocations in the same process, scoped per (proxy_url, token) so distinct accounts never share a budget.

Security Model

The connector is designed so a prompt-injected agent cannot leak the proxy token or spend uncontrolled money.
The registry injects the upstream vendor credential — the agent only ever holds the single proxy token, never vendor keys.
The env TOOL_PROXY_TOKEN is attached only when the URL is also env-derived. If an agent supplies proxy_url at call time, the ambient token is not sent — a prompt-injected agent cannot exfiltrate the token to an attacker-controlled endpoint.
If a price cannot be read (or is non-finite/negative), a guarded call is denied rather than allowed.
Auth, insufficient-balance, upstream and timeout failures are returned as {"error": ...} tool results, so a failed call never crashes the agent.

Examples

Direct three-step flow (no agent)

Explicit method and class form

Different registry wire-format (non-treg deployment)


Troubleshooting

If TOOL_PROXY_URL is unset, every call returns: Tool registry proxy is not configured. Set TOOL_PROXY_URL (and optionally TOOL_PROXY_TOKEN) to enable the connector.
Calls return httpx not installed. Install with: pip install 'praisonai-tools[registry-proxy]'. Install the extra to add httpx.
A 404 on registry_describe usually means the deployment uses a different describe route. Set TOOL_PROXY_DESCRIBE_PATH (or pass describe_path) to the correct template — it must contain {tool_id}.
Current main auto-derives the HTTP method from the describe doc. Older installs may reject a mislabelled verb; pass method="GET" (or the endpoint’s declared method) explicitly to registry_call.
A message like “no credential in this org” means the registry org has no vendor key connected — connect one on the registry side.
Registering an upstream (POST /tools) with a loopback or private address is refused by the registry’s SSRF guard by design — use a public https upstream.
All failures come back as {"error": ...} tool results: authentication failed (HTTP 401/403), insufficient balance (HTTP 402), upstream 4xx/5xx passed through, and request timeouts.

Tools Overview

Browse PraisonAI tool documentation

Custom Tools

Build your own agent tools