Command-line interface

The Proxygate CLI is built for token-efficient agents

Browse, call, and pay for any API in the marketplace from the terminal. CLI output is compact next to raw API JSON, so an agent spends fewer tokens per call and keeps more of its context window. Pay per request in USDC on Solana. Provider keys never leave the gateway.

Why an agent should use the CLI

  • Compact output, fewer tokens. A proxy call returns the upstream body plus a single cost and request-id line, not the full headers and JSON envelope a raw HTTP call would push into context. Discovery commands return trimmed rows, not whole catalog records.
  • Token-efficient docs drill-down. Pull docs on demand with proxygate listings docs <id> and narrow with -q, -c, --sort, and -l before you read, instead of loading an entire OpenAPI spec.
  • One identity, one balance. A single prepaid USDC balance covers every seller. No per-provider API keys, no subscriptions, no key management in your agent.
  • Machine-readable when you need it. Add --json for structured output your agent can parse directly.

Install

The CLI is published on npm as @proxygate/cli. Install it globally:

bash
npm install -g @proxygate/cli

Then authenticate with an API key:

bash
proxygate login --key pg_live_...

Key commands

Browse the marketplace

Semantic and keyword search across listings. Each row carries the composite listing handle, the per-request price, and callable endpoints.

bash
proxygate search weather
proxygate apis -q "postal lookup"
proxygate apis -c ai-models --verified

Call an API through the proxy

Pass a listing (composite handle, slug, or UUID) and a path. Proxygate injects the provider key server-side and charges your balance. The line that comes back is the cost and request id, not a wall of headers.

bash
proxygate proxy blockdb/blockdb-api /v1/forecast -X GET \
  -d '{"latitude":52.37,"longitude":4.90,"hourly":"temperature_2m"}'

# cost: $0.0012 | request: 905b1a53

Check your balance

Total, available, pending, and cooldown amounts for the wallet behind your auth.

bash
proxygate balance

Rate a seller

Thumbs up or down on a request you made, within 24 hours of the call.

bash
proxygate rate --request-id 905b1a53 --up

CLI: frequently asked questions

A raw HTTP call returns full response headers and verbose JSON envelopes that an agent has to read into its context. The Proxygate CLI prints a compact result instead: a proxy call returns the upstream body plus a single cost and request-id line, and discovery commands return trimmed rows rather than whole catalog records. Fewer tokens per call means lower model cost and more room in the context window for an agent in a loop.

Use proxygate listings docs <id> to pull documentation on demand, and the discovery filters (-q, -c, -s, --sort, -l) to narrow results before reading them. The CLI lazy-loads only the invoked command, so you fetch just the slice of docs you need instead of loading an entire OpenAPI spec into context.

Run proxygate login --key pg_live_... with an API key. For a spending agent the API key is the least-privilege choice: a scoped, revocable token tied to your wallet, not the wallet private key, with no per-request signing. Get one at app.proxygate.ai/wallets, no Solana wallet needed. Use a keypair only when the agent must sign on-chain deposits or withdrawals itself.

Each proxy call spends from your prepaid USDC balance on Solana and returns the exact amount charged with a request id. There is no subscription and no upstream API key to manage: Proxygate injects the provider key server-side per request.

For an agent in a hot loop, prefer the @proxygate/sdk: a long-lived client amortizes TLS and auth across calls instead of paying process and connection setup on every invocation. The CLI is best for terminal use, scripting, and agent shell calls where compact output matters more than per-call latency.

Ways to connect your agent

Four integration paths reach the same marketplace, one prepaid USDC balance, and the same provider keys kept server-side. Pick the one that fits how your agent runs.