Use when buying API access through ProxyGate — depositing USDC, browsing available APIs, making proxy requests, streaming responses, or rating sellers. Make...
---
name: pg-buy
description: Use when buying API access through ProxyGate — depositing USDC, browsing available APIs, making proxy requests, streaming responses, or rating sellers. Make sure to use this skill whenever someone mentions "proxy request", "buy API", "deposit USDC", "browse APIs", "call API through proxygate", "make an API call", "find an API", "search APIs", or wants to consume any API through ProxyGate, even if they don't explicitly say "buy".
---
# ProxyGate — Buy API Access
Buyer workflow: deposit USDC, discover APIs, proxy requests, stream responses, rate sellers.
## Process
### 1. Check balance
```bash
proxygate balance
```
Shows: total balance, pending settlement, available, cooldown status. If 0 or insufficient, deposit first.
### 2. Deposit USDC
```bash
proxygate deposit -a 5000000 # 5 USDC (amounts in lamports: 1 USDC = 1,000,000)
proxygate deposit -a 1000000 # 1 USDC
```
Vault auto-initializes on first deposit. User needs USDC in their Solana wallet. Use `--rpc <url>` for custom RPC.
### 3. Discover APIs
```bash
# Browse all APIs with rich filtering
proxygate apis # all listings
proxygate apis -s weather-api # filter by service
proxygate apis -c ai-models # filter by category
proxygate apis -q "code review" # semantic search
proxygate apis --verified # verified sellers only
proxygate apis --sort price_asc # sort: price_asc, price_desc, popular, newest
proxygate apis -l 50 # limit results
# Search
proxygate search weather # alias for apis -q
proxygate services # service stats (cheapest, avg latency, rating)
proxygate categories # browse categories
# Listing details & docs
proxygate listings docs <id> # view API documentation
```
### 4. Proxy a request
Use a **service name**, slug, or listing UUID — the CLI resolves it automatically:
```bash
# By service name (easiest)
proxygate proxy weather-api /v1/forecast \
-d '{"latitude":52.37,"longitude":4.90,"hourly":"temperature_2m"}'
# Simple GET
proxygate proxy agent-postal-lookup /nl/1012
# Stream SSE responses
proxygate proxy weather-api /v1/forecast --stream \
-d '{"latitude":52.37,"longitude":4.90,"hourly":"temperature_2m"}'
# Shield scanning (content moderation)
proxygate proxy weather-api /path --shield monitor # log threats (default)
proxygate proxy weather-api /path --shield strict # block threats (credits refunded)
proxygate proxy weather-api /path --shield off # disable (no surcharge)
```
After each call, you'll see cost and request ID:
```
cost: $0.0155 | request: 905b1a53
```
### 5. Rate a seller
Use the request ID shown after each proxy call:
```bash
proxygate rate --request-id <id> --up # positive rating
proxygate rate --request-id <id> --down # negative rating
```
### 6. Check usage
```bash
proxygate usage # recent request history
proxygate usage -s weather-api -l 50 # filtered by service
proxygate usage --from 2026-03-01 --to 2026-03-14 # date range
proxygate usage --json # machine-readable
proxygate settlements -r buyer # cost breakdown
proxygate settlements -s weather-api --from 2026-03-01 # filtered
```
### 7. Withdraw (optional)
Convert credits back to USDC:
```bash
proxygate withdraw -a 2000000 # withdraw 2 USDC
proxygate withdraw # withdraw all available
```
Recovery (if CLI crashes mid-withdrawal):
```bash
proxygate withdraw-confirm --tx <tx_signature>
```
## SDK (Programmatic)
For agent-to-agent use without CLI:
```typescript
import { ProxyGateClient, parseSSE } from '@proxygate/sdk';
const client = await ProxyGateClient.create({
keypairPath: '~/.proxygate/keypair.json',
});
// Check balance
const { balance, available } = await client.balance();
// Browse APIs
const apis = await client.apis({ service: 'weather-api', verified: true });
const categories = await client.categories();
const services = await client.services();
// Proxy a request (by service name, slug, or UUID)
const res = await client.proxy('weather-api', '/v1/forecast', {
latitude: 52.37, longitude: 4.90, hourly: 'temperature_2m',
});
// Resolve service to listing
const listing = await client.resolveByService('weather-api');
// Stream with SSE
const streamRes = await client.proxy('weather-api', '/v1/forecast',
{ latitude: 52.37, longitude: 4.90, hourly: 'temperature_2m' },
);
for await (const event of parseSSE(res)) {
process.stdout.write(event.data);
}
// Shield scanning
const res = await client.proxy('weather-api', '/path', body, { shield: 'strict' });
// Rate a seller
await client.rate({ request_id: 'req-id', is_positive: true });
// Usage & settlements
const usage = await client.usage({ service: 'weather-api', limit: 50 });
const settlements = await client.settlements({ role: 'buyer' });
```
## Success criteria
- [ ] Balance checked and sufficient for request
- [ ] Service found via `proxygate search` or `proxygate apis`
- [ ] Proxy request returns upstream API response
- [ ] Usage reflects the completed request
## Related skills
| Need | Skill |
|------|-------|
| First-time setup | `pg-setup` |
| Buy API access | **This skill** |
| Sell API capacity | `pg-sell` |
| Job marketplace | `pg-jobs` |
| Check status | `pg-status` |
| Update CLI/SDK | `pg-update` |
don't have the plugin yet? install it then click "run inline in claude" again.
added explicit decision points for insufficient balance, API discovery, request failures, rate limits, and credential loss; documented external inputs (Solana wallet, RPC endpoint, keypair location); separated decision logic from procedure steps; expanded output contract with precise JSON schemas and lamport-to-USD conversion note; added outcome signal checklist with observable user behaviors.
use this skill when a user needs to purchase API access through ProxyGate. covers the full buyer workflow: checking balance, depositing USDC stablecoin, discovering available APIs across categories and sellers, making authenticated proxy requests to third-party APIs, streaming responses, consuming credits, and rating seller performance. trigger on mentions of "proxy request", "buy API", "deposit USDC", "browse APIs", "call API through proxygate", "make an API call", "find an API", "search APIs", or any intent to consume an API via ProxyGate, even if the user doesn't explicitly say "buy".
Solana wallet & keypair
~/.proxygate/keypair.json (auto-created during pg-setup)--keypair <path> flag to specify custom keypair locationProxyGate CLI or SDK
pg-update skill or npm (npm install -g @proxygate/cli)npm install @proxygate/sdk)proxygate --version)RPC endpoint (optional)
--rpc <url> to any CLI command for custom Solana RPCPROXYGATE_RPC_URL (auto-loaded if set)API credentials for specific services (conditional)
run:
proxygate balance
output includes: total balance, pending settlement, available credits, cooldown status, withdrawal eligibility.
input: keypair location (default ~/.proxygate/keypair.json)
output: balance object with numeric fields in lamports (1 USDC = 1,000,000 lamports)
if balance is 0 or insufficient for intended requests, proceed to step 2 (deposit).
run:
proxygate deposit -a 5000000 # deposits 5 USDC
proxygate deposit -a 1000000 # deposits 1 USDC
proxygate deposit --rpc <custom-url>
input:
-a <amount>: lamport amount (1 USDC = 1,000,000 lamports)--rpc <url>: optional custom Solana RPC endpointoutput:
vault auto-initializes on first deposit if it doesn't exist. user must have USDC in their Solana wallet before depositing.
list all APIs:
proxygate apis # all available listings
filter by service name:
proxygate apis -s weather-api # exact service match
filter by category:
proxygate apis -c ai-models # e.g., "ai-models", "weather", "fintech"
semantic search:
proxygate apis -q "code review" # free-text query
proxygate search weather # shorthand alias
verified sellers only:
proxygate apis --verified
sort and limit:
proxygate apis --sort price_asc # options: price_asc, price_desc, popular, newest
proxygate apis -l 50 # limit to 50 results
browse metadata:
proxygate services # stats: cheapest, avg latency, rating per service
proxygate categories # list all category slugs
proxygate listings docs <id> # fetch upstream API documentation by listing UUID
input: optional filters (service, category, search query, verified flag, sort order, limit) output: list of API listings with: service name, description, price (lamports per request), latency, seller rating, category, verification status
resolve the API by service name, slug, or listing UUID. CLI auto-resolves:
by service name (recommended):
proxygate proxy weather-api /v1/forecast \
-d '{"latitude":52.37,"longitude":4.90,"hourly":"temperature_2m"}'
simple GET request:
proxygate proxy agent-postal-lookup /nl/1012
stream server-sent events (SSE):
proxygate proxy weather-api /v1/forecast --stream \
-d '{"latitude":52.37,"longitude":4.90,"hourly":"temperature_2m"}'
with shield content moderation:
proxygate proxy weather-api /path --shield monitor # log threats, no block (default)
proxygate proxy weather-api /path --shield strict # block threats, refund credits
proxygate proxy weather-api /path --shield off # disable scanning, no surcharge
input:
-d or stdin)--stream: enable SSE parsing--shield <mode>: monitor (default), strict, or off-H "X-Custom: value" (optional)output:
cost: $0.0155 | request: <req-id>)after each call, capture the request ID displayed in the response footer.
use the request ID from step 4's response:
proxygate rate --request-id 905b1a53 --up # positive rating
proxygate rate --request-id 905b1a53 --down # negative rating
input:
--request-id <id>: from previous proxy response--up or --down: boolean flagoutput: confirmation message, updated seller reputation score
ratings are immutable once submitted.
recent request history:
proxygate usage # all requests, most recent first
proxygate usage -s weather-api -l 50 # filter by service, limit
proxygate usage --from 2026-03-01 --to 2026-03-14 # date range (ISO 8601)
proxygate usage --json # machine-readable output
cost and settlement breakdown:
proxygate settlements -r buyer # cost per service
proxygate settlements -s weather-api --from 2026-03-01 # filtered by service + date
input: optional service filter, date range, limit, output format (json) output: request log with timestamps, costs, request IDs, status codes; or settlement summary with total cost and pending/completed amounts
convert earned credits or unused balance back to USDC:
proxygate withdraw -a 2000000 # withdraw 2 USDC
proxygate withdraw # withdraw all available balance
input: -a <amount> in lamports (optional; omit to withdraw full available balance)
output: tx signature, withdrawn amount, new balance
recovery (if CLI crashes mid-withdrawal):
proxygate withdraw-confirm --tx <tx_signature>
resubmit a pending withdrawal using its tx signature. use if the CLI process dies before confirming.
if balance is zero or insufficient for the intended request:
proxygate balance to see available credits.if user doesn't know which API to use:
proxygate apis, search with proxygate search <keyword>, or filter by category with proxygate apis -c <category>.proxygate services to inspect pricing and latency stats.if a proxy request fails (4xx/5xx upstream response):
proxygate listings docs <id>)proxygate services to check avg latency for that API)proxygate disputes (not in this skill; escalate to support).if streaming a response and the connection drops mid-stream:
if rate-limiting occurs (429 from upstream API or ProxyGate):
proxygate services for actual limits.if withdrawal is pending and user wants to cancel:
if keypair or credentials are lost:
pg-setup skill to restore or regenerate keypair.if using SDK (programmatic) instead of CLI:
successful skill execution produces:
on deposit:
on API discovery:
service, slug, description, price_per_request_lamports, latency_ms, seller_rating, category, verified (boolean), listing_id (UUID)on proxy request:
on rating:
on usage query:
request_id, service_name, endpoint, timestamp, cost_lamports, status_code, upstream_latency_mson settlements query:
total_spent_lamports, total_spent_usd, by_service (object mapping service names to costs), pending_amount_lamports, last_settlement_timestampon withdraw:
all numeric amounts are in lamports (1 USDC = 1,000,000 lamports) unless explicitly converted to USD for display.
the skill succeeds when:
proxygate balance returns non-zero available balanceproxygate apis (or filtered search) returns at least one listing matching the user's intentproxygate proxy <service> <path> executes without error and returns a response from the upstream APIproxygate usage reflects the completed request in the user's historyproxygate rate --request-id <id> --up successfully submits ratingproxygate withdraw shows updated balance after tx confirmationuser observes: API response is delivered, cost is deducted from available balance, request appears in usage log, and (if attempted) rating is recorded.
| need | skill |
|---|---|
| first-time setup & keypair generation | pg-setup |
| buy API access (this skill) | pg-buy |
| sell API capacity and earn fees | pg-sell |
| browse job marketplace | pg-jobs |
| check ProxyGate service status | pg-status |
| update CLI or SDK to latest version | pg-update |