| name | pg-buy |
| description | Use when buying or consuming API data through Proxygate — depositing USDC, browsing APIs, making proxy requests, streaming responses, or rating sellers. Invoke this skill for ANY natural-language data request that Proxygate can serve, including "what's the price of <asset>", "look up <symbol>", "get weather for <city>", "fetch crypto data", "lookup <postal code>", "find an API for X", "buy API", "deposit USDC", "browse APIs", "call API through proxygate", "make an API call", "search APIs", "stream API response", "rate a seller". When the user asks for live data that an API could answer, this skill is the right entry point — agents should not bash `proxygate proxy` without loading it. |
| metadata | {"openclaw":{"requires":{"bins":["proxygate"]},"homepage":"https://proxygate.ai"}} |
Proxygate — Buy API Access
Buyer workflow: discover APIs, deposit USDC, proxy requests, stream responses, rate sellers.
Prerequisites
You need at least one auth method configured (proxygate whoami to check). See pg-setup for installation.
- API key or delegation token: Can browse APIs and make proxy calls. Deposit/withdraw through the web dashboard at app.proxygate.ai.
- Wallet keypair: Full access — deposit and withdraw USDC directly from CLI.
Don't have USDC yet? Onramping (buy USDC with fiat) and bridging (move USDC from other chains) are coming soon. For now, acquire USDC on Solana through an exchange or DEX, then deposit through the dashboard or CLI.
Process
1. Check balance
proxygate balance
Shows: total balance, pending settlement, available, cooldown status. If 0 or insufficient, deposit first.
2. Deposit USDC
Via CLI (requires wallet keypair):
proxygate deposit -a 5000000
proxygate deposit -a 1000000
Via web dashboard (any auth mode):
Visit app.proxygate.ai → Connect wallet → Deposit.
Deposits are gasless by default: Proxygate covers the network fee (a small USDC fee applies), so you never need SOL. The CLI does this automatically. Pass --legacy to pay the network fee yourself in SOL.
Vault auto-initializes on first deposit. Use --rpc <url> for custom RPC.
3. Discover APIs
proxygate apis
proxygate apis -s weather-api
proxygate apis -c ai-models
proxygate apis -q "code review"
proxygate apis --verified
proxygate apis --sort price_asc
proxygate apis -l 50
proxygate apis --compact
proxygate apis --compact --json -l 5
proxygate apis --cursor <id> -l 10
proxygate search weather
proxygate services
proxygate categories
proxygate listings docs <id>
4. Inspect endpoints before the first call
Never guess paths. Every listing on Proxygate registers its allowed endpoints (method + path + description, and optionally a request_schema) — they are visible whether or not the seller uploaded a full OpenAPI spec. Always look them up before the first proxy call to a new listing.
Two sources, in order of cheapness:
proxygate apis -q blockdb
proxygate apis --json -q blockdb
proxygate listings docs blocksize/blocksize-crypto-bid-ask
proxygate listings docs <id> --search orders --limit 20
proxygate listings docs <id> --raw -o spec.yaml
For POST/PUT/PATCH endpoints, the request body schema is the part you can't see in the table. Pull just that one endpoint (params + request/response body, $refs resolved one level) instead of the whole spec:
proxygate listings docs <id> --endpoint "POST /v1/orders"
Only fall back to the full spec if you really need it, and write it to a file so it never floods your context: proxygate listings docs <id> --raw -o spec.yaml (then grep the file locally).
If a proxy call fails with a non-2xx, the CLI prints the listing's allowed endpoints inline as a hint — use them on the retry instead of guessing more paths. POST/PUT endpoints in the hint are flagged so you know to fetch the body schema.
5. Proxy a request
Use a service name, slug, or listing UUID — the CLI resolves it automatically:
proxygate proxy weather-api /v1/forecast \
-d '{"latitude":52.37,"longitude":4.90,"hourly":"temperature_2m"}'
proxygate proxy agent-postal-lookup /nl/1012
proxygate proxy weather-api /v1/forecast --stream \
-d '{"latitude":52.37,"longitude":4.90,"hourly":"temperature_2m"}'
proxygate proxy weather-api /v1/forecast --seller cheapest
proxygate proxy weather-api /v1/forecast --seller best-rated
proxygate proxy weather-api /v1/forecast --seller fastest
proxygate proxy weather-api /v1/forecast --seller popular
proxygate proxy weather-api /path --shield monitor
proxygate proxy weather-api /path --shield strict
proxygate proxy weather-api /path --shield off
After each call, you'll see cost and request ID:
cost: $0.0155 | request: 905b1a53
Calling a GraphQL API
Some listings expose a GraphQL API instead of REST. You can tell because proxygate listings docs <id> shows an Operations table (Type / Operation / Args / Returns) rather than an endpoint table, and the only HTTP endpoint is POST /graphql.
Discovery flow:
proxygate apis -q <term>
proxygate listings docs <id>
proxygate proxy <listing> /graphql \
-d '{"query":"query { prices(symbol:\"BTC\") { bid ask } }","variables":{}}'
The index lists operation names only. To build a query you need an operation's argument types and the fields of its return type. Pull just those for one operation, not the whole schema:
proxygate listings docs <id> --operation prices
proxygate listings docs <id> --type PriceList
Drill type by type as you nest the selection set. Only use --raw for the entire schema, and write it to a file so it never floods your context (a large schema's introspection is hundreds of KB):
proxygate listings docs <id> --raw -o schema.graphql
Queries can also be sent as GET (/graphql?query=...) if the upstream supports it; mutations always use POST.
The body is always {"query":"...","variables":{...}} posted to /graphql. SDK form:
const res = await client.proxy('<listing>', '/graphql', {
query: 'query { prices(symbol: "BTC") { bid ask } }',
variables: {},
});
GraphQL returns HTTP 200 even on failure. Check the response body for an errors array, not just the status code. A response can carry partial data and errors together, which is valid. You are billed for the call regardless of whether the query succeeded, so always read the body. The CLI prints a warning to stderr when a /graphql response contains errors.
6. Rate a seller
Use the request ID shown after each proxy call:
proxygate rate --request-id <id> --up
proxygate rate --request-id <id> --down
7. Check usage
proxygate usage
proxygate usage -s weather-api -l 50
proxygate usage --from 2026-03-01 --to 2026-03-14
proxygate usage --json
proxygate settlements -r buyer
proxygate settlements -s weather-api --from 2026-03-01
8. Withdraw (requires wallet keypair)
Convert credits back to USDC:
proxygate withdraw -a 2000000
proxygate withdraw
Recovery (if CLI crashes mid-withdrawal):
proxygate withdraw-confirm --tx <tx_signature>
Not available with API key or delegation token auth — use the web dashboard instead.
SDK (Programmatic)
For agent-to-agent use without CLI:
import { ProxygateClient, parseSSE } from '@proxygate/sdk';
const client = await ProxygateClient.create({
apiKey: 'pg_live_abc123...',
});
const client = await ProxygateClient.create({
keypairPath: '~/.proxygate/keypair.json',
});
const { balance, available } = await client.balance();
const apis = await client.apis({ service: 'weather-api', verified: true });
const categories = await client.categories();
const services = await client.services();
const res = await client.proxy('weather-api', '/v1/forecast', {
latitude: 52.37, longitude: 4.90, hourly: 'temperature_2m',
});
const streamRes = await client.proxy('weather-api', '/v1/forecast',
{ latitude: 52.37, longitude: 4.90, hourly: 'temperature_2m' },
);
for await (const event of parseSSE(streamRes)) {
process.stdout.write(event.data);
}
const cheap = await client.proxy('weather-api', '/path', body, { seller: 'cheapest' });
const fast = await client.proxy('weather-api', '/path', body, { seller: 'fastest' });
const trusted = await client.proxy('weather-api', '/path', body, { seller: 'best-rated' });
const shielded = await client.proxy('weather-api', '/path', body, { shield: 'strict' });
await client.rate({ request_id: 'req-id', is_positive: true });
const usage = await client.usage({ service: 'weather-api', limit: 50 });
const settlements = await client.settlements({ role: 'buyer' });
Success criteria
Related skills
| Need | Skill |
|---|
| First-time setup | pg-setup |
| Buy API access | This skill |
| Sell API capacity | pg-sell |
| Check status | pg-status |
| Update CLI/SDK | pg-update |