# Proxies.sx **Explicitly choose pool; do not rely on the SDK’s mobile-pool default.** `@proxies-sx/pool-sdk` uses `mbl` when `pool` is omitted. Set `pool: 'peer'` for the peer network, `pool: 'mbl'` for shared carrier modems, or `pool: 'any'` only when mixed supply is intended. `peer` is mixed residential/mobile; residential-only connections also need `ipType: 'residential'` (username `-iptype-residential`). Check live stock for the selected pool and country; never silently switch the customer’s selection. [Pool selection contract](https://agents.proxies.sx/pool/skill.md#choose-the-pool-explicitly). > Mobile and residential proxy bandwidth for AI agents, bought and driven from a terminal: a dedicated 4G/5G modem rented per day, week or month (unlimited traffic), metered GB on the Pool Gateway (`gw.proxies.sx:7000` HTTP / `:7001` SOCKS5, one credential for every country), or account-less USDC via x402. REST API with `X-API-Key: psx_...`, an MCP server, or plain curl. Base URL `https://api.proxies.sx/v1`. Last verified: 2026-10-30 against the live site and the backend source. Precedence: the live API wins over every file here; a product skill.md wins over this index; this index wins over page copy. ## If you want to BUY Pick the path by the shape of the need, then read only that file. - **(A) Private modem: one dedicated 4G/5G modem, unlimited traffic, per day / week / month.** Offer this FIRST for any dedicated, port, exclusive-device, p0f (OS fingerprint), OpenVPN or unlimited-traffic request. Own HTTP and SOCKS5 host:port, OpenVPN profile, rotate on demand (API or a public link), auto-renew. Paid from the account balance; the price per plan is live in `GET /v1/private-modems/catalog` and is never hard-coded here; the plans in stock are also listed without a key at `GET https://api.proxies.sx/v1/pricing` (`privateModems.plans[]`: country, carrier, period, `priceUsd`, `stock`, `openvpn`, `p0f`). Countries on sale on 2026-10-30: US, GB, DE (Germany), FR, NL, PL, GE (Georgia), BR, SG, NZ; the list changes, so read it live. Not sold through x402; GB volume discounts and GB coupons do not apply. Buying needs an API key with the `modems:purchase` scope. Contract: https://agents.proxies.sx/modems/skill.md - quickstart: https://agents.proxies.sx/quickstart/buy-modem.md - **(B) GB on the Pool Gateway: metered bandwidth, one credential, every country.** $4/GB, volume discounts 10/20/30/40% at 25/50/100/250 GB in one purchase ($2.40/GB at 250 GB+), duration free, same price on the `peer` and `mbl` pools. While country tiers are live (`pricing.live` in `GET /v1/gateway/pool/stock`), a GB of traffic uses 1.00 / 0.375 / 0.1875 GB of balance by exit country (Premium $4, Plus $1.50, Standard $0.75 per GB of traffic at the base price). From 1 TB on the peer pool, volume deals go to $0.50/GB by quote only, not a checkout price: contact maya@proxies.sx with the committed volume and countries. Contract: https://agents.proxies.sx/pool/skill.md - quickstart: https://agents.proxies.sx/quickstart/buy-gb.md - **(C) x402: USDC on Base or Solana, no account, no API key.** `GET https://api.proxies.sx/v1/x402/pool?tier=peer&country=us&traffic=1` answers HTTP 402 with the exact payment; pay, retry with `Payment-Signature: `, receive a ready credential. $4 per GB of traffic in every country (no country tiers), minimum 0.1 GB. A dedicated port is also sold this way at `/v1/x402/proxy`. Contract: https://agents.proxies.sx/pool/skill.md (x402 section) and https://agents.proxies.sx/.well-known/x402.json What a key can and cannot do (so you never promise more): - An account needs one human step: the signup email carries a verification link, and `POST /v1/login/signin` answers 401 until it is clicked (or `GET /v1/login/verify-email?token=...` is called with the token from that link). - API keys are created by a human in the dashboard (https://client.proxies.sx/account, API keys, tick the scopes) or with a dashboard JWT at `POST /v1/api-keys`. A key cannot create or edit keys. `modems:purchase` and `billing:topup` are opt-in and never in the default set; a key without them gets 403 `scope_missing` naming the scope. - Card top-up by API: `POST /v1/stripe/create-balance-checkout {"amount": 20}` with a `billing:topup` key returns a Stripe Checkout `url` that a HUMAN opens and pays; it is not headless. Per-key daily cap `spendCapUsdPerDay`, default 100 USD (403 `spend_cap_reached` above it). Poll `GET /v1/stripe/balance-checkout//receipt` until `credited: true`. Quickstart: https://agents.proxies.sx/quickstart/topup.md - A customer API key cannot buy GB. Balance becomes GB in the dashboard (https://client.proxies.sx/purchase) or with a dashboard JWT at `POST /v1/billing/purchase-traffic`; reseller and admin keys may automate it. Everything after that (proxy password, credentials, stock, usage) is key-drivable. - Every spend carries an `Idempotency-Key` and the `expectedPriceUsd` you were shown; 409 `price_changed` means re-read the price and confirm with the user. Every money step needs the user's approval of the amount. - Peer exit IPs are never published. Stock endpoints return counts per country only; examples mask addresses as `x.x`. ## Prices and errors (machine-readable) - [pricing.json](https://agents.proxies.sx/pricing.json): the GB price table generated from the backend source (base price, volume tiers, country tiers, the 1 TB quote line, payment routes), in the shape of the live `GET https://api.proxies.sx/v1/pricing`, which wins when they disagree - [Live prices](https://api.proxies.sx/v1/pricing): no auth; the GB table plus `privateModems.plans[]`, every Private modem plan in stock with its `priceUsd` per day, week or month (no `tariffId`: buy from the catalog) - [Live pool stock and country tiers](https://api.proxies.sx/v1/gateway/pool/stock): counts per pool and country plus the `pricing` block (`live`, `basePricePerGB`, `volumeDiscounts`, `tiers[]` with `burnRate`, `pricePerGB`, `countries`), no auth, never an IP - [Live x402 pricing](https://api.proxies.sx/v1/x402/pricing): the $4/GB base and volume discounts for wallet purchases, no auth - [Error table](https://agents.proxies.sx/errors.md): every gateway `E_*` code, purchase-API code and the x402 402 body with HTTP status, meaning, exact fix and whether a retry helps ## Quickstarts (curl first, every step verified) - [Shared-pool lifecycle and session contract](https://agents.proxies.sx/build/skill.md#shared-pool-lifecycle-and-session-contract): explicit pool, raw-MB quota, holds, durable mutation recovery, scoped inventory and generation-conditioned release; r86 backend/gateway are deployed; SDK publication status is stated separately - [Buy GB and connect](https://agents.proxies.sx/quickstart/buy-gb.md): sign up, verify the email, key, top up, buy GB in the dashboard, proxy password, connect through `gw.proxies.sx:7000` - [Rent a private modem](https://agents.proxies.sx/quickstart/buy-modem.md): catalog, quote, buy with `Idempotency-Key` and `expectedPriceUsd`, poll, connect, rotate, renew - [Top up the balance by API](https://agents.proxies.sx/quickstart/topup.md): checkout link, human pays, poll the receipt, balance credited - [Pool quickstart (HTML)](https://agents.proxies.sx/pool-quickstart.html): the shortest path to a working pool credential - [Rotation cookbook](https://agents.proxies.sx/pool/rotation-cookbook.md): copy-paste IP rotation in curl/python/node and the footguns that trip LLMs; read before writing rotation code ## Product contracts (one skill.md per product) - [Private modems](https://agents.proxies.sx/modems/skill.md): catalog, quote, buy, poll, credentials (HTTP, SOCKS5, OpenVPN), rotate, auto-rotate, renew, auto-renew, OS fingerprint, replace; page https://agents.proxies.sx/modems/ - [Pool Gateway](https://agents.proxies.sx/pool/skill.md): API-key path, deposited GB, country tiers, username DSL, stock, sessions, errors, the x402 alternative; page https://agents.proxies.sx/pool/ - [Dedicated port (legacy)](https://agents.proxies.sx/marketplace/skill.md): the older per-port modem pool (`POST /v1/ports`, `/v1/x402/proxy`) in US, GB, FR, NL, PL, GE (Georgia); nearly full, so start at https://agents.proxies.sx/modems/ - [Private Pool](https://agents.proxies.sx/private-pool/skill.md): named country-scoped credentials and Reserved IPs held exclusively for you - [Task market](https://agents.proxies.sx/tasks/skill.md): wallet-only x402 catalog of bounded egress tasks; the 402 response is the quote - [Data subscriptions](https://agents.proxies.sx/data-works/subscriptions/skill.md): only-new records of a house dataset (first: Kavak Mexico used cars with VIN) as CSV or JSON, by API key or in the dashboard, delivered daily when new records exist and billed monthly from the balance; set up by our team after a sample and a rate (maya@proxies.sx); includes the field list and a troubleshooting table keyed by HTTP status; page https://agents.proxies.sx/data-works/subscriptions/ - [Master skill file](https://agents.proxies.sx/skill.md): the whole machine contract in one file (buy steps, x402 402 shape, username DSL, MCP catalog, peer protocol, compute, reseller keys) - [Agent research index](https://agents.proxies.sx/index.md): one screen, every page and which question it answers ## Use it from a tool - [MCP server](https://agents.proxies.sx/mcp/): `npx -y @proxies-sx/mcp-server` with `PROXIES_API_KEY=psx_...`, or nothing to install: the hosted server `https://api.proxies.sx/mcp` (Streamable HTTP, header `Authorization: Bearer psx_...`; without a key it lists only the 5 public tools). Version 3.2.0 on npm exposes a default toolset of 20 tools: buy (`proxies_modem_catalog`, `proxies_modem_quote`, `proxies_modem_buy`, `proxies_modem_renew`, `proxies_topup_checkout`, `proxies_topup_status`, `get_pricing`), use (`pool_get_stock`, `pool_get_my_credentials`, `pool_build_proxy_url`, `pool_explain_error`, `proxies_modem_mine`, `proxies_modem_rotate`) and manage (account, usage, proxy password, status, tickets). The full set (96 API-key tools plus 16 wallet tools) loads with `--toolset=full` or `PROXIES_TOOLSET=full` (hosted: `?toolset=full`). Claude Code plugin: `/plugin marketplace add bolivian-peru/proxies-sx-mcp-server`, then `/plugin install proxies-sx@proxies-sx`. Wallet-only x402 mode with `AGENT_WALLET_KEY` runs locally only. Call `tools/list` for the authoritative catalog. npm: https://www.npmjs.com/package/@proxies-sx/mcp-server - source: https://github.com/bolivian-peru/proxies-sx-mcp-server - [Integrations](https://agents.proxies.sx/integrations/skill.md): Playwright, browser-use, LangChain, CrewAI, n8n, Make/Zapier, OpenAI Agents SDK, Vercel AI SDK, Stagehand, CloakBrowser (https://agents.proxies.sx/integrations/cloakbrowser/) - [Pool Gateway Swagger](https://api.proxies.sx/docs/gateway): public OpenAPI for the gateway surface; the reseller API is at https://api.proxies.sx/v1/reseller/docs/openapi ## Gateway username (the thing agents get wrong) `psx_--[-rot-][-sid-]`, password = your proxy password (set once with `PATCH /v1/account/proxy-password`; the account login password is never accepted). `pool` is `peer` (flagship: residential and mobile, every country with stock), `mbl` (carrier modems in US, GB, FR, NL, PL, GE = Georgia; `mbl-de` always fails, use `peer-de`), `any` or `best`. `sticky` and `hard` pin the modem, not the IP; `sticky`/`auto*` need a `-sid-` to persist; unknown tokens are dropped silently (there is no `-session-` token). Limits: 500 concurrent connections and 250 sessions per account. ## Build and resell - [Build & resell](https://agents.proxies.sx/build/skill.md): mint per-customer `pak_` keys, set your own retail price, embed a dashboard or ship a storefront; kit https://github.com/bolivian-peru/proxy-reseller-kit, npm `@proxies-sx/pool-sdk` and `@proxies-sx/pool-portal-react` ## Bundles (one fetch) - [llms-full.txt](https://agents.proxies.sx/llms-full.txt): this file plus the modem skill, the quickstarts, the error table, the rotation cookbook and the data subscription skill, under 100 KB (the Pool Gateway skill is in the pool bundle below) - Per-area bundles, each this file plus that area's skill: [peer (earn)](https://agents.proxies.sx/peer/llms-full.txt), [compute](https://agents.proxies.sx/compute/llms-full.txt), [build](https://agents.proxies.sx/build/llms-full.txt), [integrations](https://agents.proxies.sx/integrations/llms-full.txt), [dedicated port](https://agents.proxies.sx/marketplace/llms-full.txt), [private pool](https://agents.proxies.sx/private-pool/llms-full.txt), [tasks](https://agents.proxies.sx/tasks/llms-full.txt) ## Machine discovery - [x402 discovery](https://agents.proxies.sx/.well-known/x402.json): x402 services, wallets, pricing and management endpoints - [Agent card (A2A)](https://agents.proxies.sx/.well-known/agent-card.json): discovery-only card; act through the HTTP endpoints - [ERC-8004 registration](https://agents.proxies.sx/.well-known/erc8004-registration.json): on-chain agent registration record - [docs-manifest.json](https://agents.proxies.sx/docs-manifest.json): the numbers behind the docs - [Live status](https://api.proxies.sx/v1/x402/status): component health as JSON; human page https://agents.proxies.sx/status/ - [Sign up](https://client.proxies.sx/signup), [API keys](https://client.proxies.sx/account), [Buy GB](https://client.proxies.sx/purchase), [Private modems in the dashboard](https://client.proxies.sx/private-modems) ## Company - [About](https://agents.proxies.sx/about/), [Where our IPs come from](https://www.proxies.sx/where-our-ips-come-from), [Terms](https://www.proxies.sx/terms), [Privacy](https://www.proxies.sx/privacy) - [Contact](https://www.proxies.sx/contact): support and sales, maya@proxies.sx; [Telegram](https://t.me/proxies_sx); [X](https://x.com/sxproxies); [GitHub](https://github.com/bolivian-peru) ## Optional - [Earn: peer network](https://agents.proxies.sx/peer/skill.md): share bandwidth from consenting devices and get paid per GB; the live rate is `earningsPerGB` in the register response, never a hard-coded number. Go SDK 1.6.8 https://agents.proxies.sx/peer/go/ (Linux amd64 and arm64; Chinese steps https://agents.proxies.sx/peer/go/linux-zh.md), Node reference 1.6.6 https://agents.proxies.sx/peer/reference-sdk.js?v=1.6.6, Windows https://agents.proxies.sx/peer/windows/, Android https://github.com/bolivian-peru/android-peer-sdk (JitPack 1.3.2). Sign Partner Agreement 2.0 at https://farmer.proxies.sx/agreement first; devices are admitted only after approval (relay close 1013 until then). Payouts: https://farmer.proxies.sx/payouts. Supplier introductions carry no automatic commission. - [Mac compute](https://agents.proxies.sx/compute/skill.md): rent one approved Apple Silicon Mac for 30 days of inference (Starter 24 GB, Pro 48 GB, Max 96 GB; Qwen3.8 27B), or supply one. Early access, no SLA, no x402 checkout; purchases need `compute:purchase`, an `Idempotency-Key`, `expectedPriceUsd` and `pricingVersion`. Live tiers https://api.proxies.sx/v1/peer/compute/tiers, marketplace https://api.proxies.sx/v1/peer/compute/marketplace - [$SX token](https://agents.proxies.sx/sx-token/ecosystem.md): the Proxies.sx token on Solana; planned settlement unit per access layer, each with a status word; token ownership is separate from service access and supplier earnings. Overview https://agents.proxies.sx/sx-token/ - [Ground Truth](https://agents.proxies.sx/news/feed.md): source-backed research posts for agents (Atom: https://agents.proxies.sx/news/feed.xml). Latest: https://agents.proxies.sx/news/context-is-capacity/ - [The infrastructure thesis](https://agents.proxies.sx/thesis/), [System map](https://agents.proxies.sx/system-map/), [Bot detection scanner](https://www.proxies.sx/tools/bot-detection-scanner), [Username builder](https://www.proxies.sx/tools/proxy-username-builder), [x402 SDK](https://github.com/bolivian-peru/x402-sdk) (`@proxies-sx/x402-core`, `-hono`, `-solana` 1.0.1; do not use 1.0.0), [@proxies-sx/lucid-agents](https://www.npmjs.com/package/@proxies-sx/lucid-agents), [Customer portal](https://client.proxies.sx) --- # Source: https://agents.proxies.sx/build/skill.md --- name: proxies-sx-pool-portal description: Build a branded mobile-proxy reseller business or embed Proxies.sx mobile/residential proxies into any user-facing app. Trigger this skill whenever the user wants to resell proxies, mint per-customer access keys (pak_*), embed a proxy dashboard into their site, deploy a Next.js proxy storefront, integrate the Proxies.sx Pool Gateway, build a customer-facing proxy product, or add 4G/5G mobile proxies to ANY stack - JavaScript, TypeScript, React, Next.js, Python, PHP, Ruby, Go, Rust, or plain curl. Use it the moment the user says "mobile proxy", "proxy reseller", "pak_ keys", "pool gateway", "proxy dashboard", "embed proxies", "white-label proxy", or anything implying customer-facing proxy delivery - even if they don't explicitly ask for "this skill". --- # Proxies.sx Pool Portal - Build and Resell ## Shared-pool lifecycle and session contract **Release status — 4 November 2026, 11:21 UTC:** backend `301cef19-20261104-r86-shared-pool` and gateway `cf0b62ce-20261104-r86` are deployed. All seven API workers, the cron worker and four gateway workers were verified before public traffic reopened. This release includes durable lifecycle operations, PAK-scoped binding identity, exact binding lookup, generation-conditioned release and receipt-based accounting. Initial live accounting observations were checked at 11:21:50 UTC; this is release acceptance, not an uptime or zero-overshoot guarantee. `@proxies-sx/pool-sdk` and `@proxies-sx/pool-portal-react` 0.15.0 are published and were verified in the npm registry at 11:31 UTC. The reseller kit source and `v0.15.0` tag are at `2caffe653c344d21eaad78cb04e1a25b53409a47`. The HTTP contracts below do not require SDK adoption. These contracts work with custom HTTP clients; SDK adoption is optional. Resolve every customer request to its server-owned PAK record ID. Keep reseller secrets server-side. Preserve existing exported URLs, passwords and paid entitlements. ### Raw usage and holds `trafficUsedMB` is raw bytes / 1024², including upload and download; GB = MB / 1024. `trafficCapGB` is a cumulative cap. Top-up does not reset usage or automatically resume a shared key. `trafficUsedGB` is rounded and must not decide exact quota eligibility. Raw key usage and country-weighted reseller billing are separate meters. Missing, malformed or stale counter/expiry evidence is unknown, not zero or unlimited. Retain the last valid reading with its time. Enabled alone does not establish remaining quota, valid expiry, account funding or stock. Daily history is per PAK and uses UTC processing-day buckets. Requests allow up to 365 days while storage retains about 90 days; zero-filled gaps do not establish measured zero. The API supplies `usageState`, `expiryState` and history `coverage`, `observed`, `observedAt`, `rawMB`. Even an observed row does not prove complete daily coverage. No authoritative per-session historical billing is promised. ### Durable operations and recovery Persist immutable operation intent and an `Idempotency-Key` before create, update, top-up, regeneration or deletion. Use 8–128 characters from `[A-Za-z0-9_-]`, unique across actions/targets within the reseller account. Serialize writes for the same customer/key. Payment settlement, entitlement grant, provider effect and local delivery are separate records. | Method | Endpoint | Contract | |---|---|---| | GET | `/v1/reseller/pool-keys/operations/lookup` | Read by the original `Idempotency-Key` header | | GET | `/v1/reseller/pool-keys/operations/:operationId` | Read secret-free operation evidence | | POST | `/v1/reseller/pool-keys/:id/resume` | Body `{expectedLifecycleVersion}` and saved operation header; release only a sole cap hold when current version, quota and expiry still match | The operation journal retains accepted/submitted/applied/uncertain/rejected states without a TTL. Changed intent under one token returns `409 IDEMPOTENCY_CONFLICT`. Retained submitted/uncertain work is reconciled, not dispatched again after a timeout or restart. SDK 0.15.0 makes one attempt for mutations. Regardless of client, a timeout, 429 or 5xx does not authorize another write. The earlier cached sequential replay did not guarantee concurrency or crash recovery. Old ambiguous operations do not gain new guarantees retroactively; `404` lookup is not proof that an old operation had no effect. Routine sync and payment callbacks must not send `enabled:true`. Top-up preserves holds. The shared-key PATCH returns `RESUME_REVIEW_REQUIRED`; an authorized conditional resume checks the same key's lifecycle version and sole `cap` hold. Manual/security/payment/legacy holds require separate review, and clearing one must preserve the others. Account eligibility remains a separate check, not an atomic guarantee against a later account ban. After ambiguous regeneration, read the current owned key with `GET /v1/reseller/pool-keys/:id` or an authorized `POST /:id/reveal`. Encrypt and save that current secret; never regenerate again solely because the earlier response or local save failed. Historical operation evidence is not the current credential. There is no promised fixed password-cache propagation or open-socket termination deadline. ### Binding observation and release Persist a unique opaque SID per customer/logical configuration, plus explicit pool, country, targeting, protocol, mode and TTL. Timed modes require a stable SID. Logical changes get a new SID. Different SIDs do not reserve different devices or guarantee distinct exit IPs. `GET /v1/gateway/pool/my-sessions?pakId=:ownedRecordId` is bounded; preserve `truncated`, errors and freshness. Read errors fail rather than returning false-empty success. Empty inventory still does not revoke exported URLs or prove no live sockets. Exact binding observation is available at: `GET /v1/gateway/pool/my-sessions/:encodedKey?pakId=:ownedRecordId`. It returns `contractVersion:2`, `observedAt`, `success:true` and an allowlisted `binding`: `sessionKey`, `accountId`, `pakKeyId`, `sessionId`, `bindingGeneration`, `createdAt`, `expiresAt`. No exit IP or secret is included. Use `DELETE` on that same path with the owned `pakId` and observed `generation`. A changed generation returns HTTP 409; missing binding is not a successful deletion; unavailable reads return 503. Without a caller generation the backend observes once and makes one conditional delete. Never blindly retry a timed-out release. Check `success`, including HTTP 200 responses; bulk results can be partial and `count` records acknowledged deletions only. The namespace uses stable PAK record identity, separate from password version; password regeneration preserves it. Account-password bindings have a separate namespace. Existing URLs remain valid; legacy bindings are adopted only when stored account and PAK ownership match. All gateway writers must use the compatible namespace; mixed old/new writers are not supported. A binding generation changes on endpoint/configuration/timer replacement, not passive activity or password rotation. Binding release does not terminate established sockets, revoke a password, prevent a URL rebinding or guarantee a different IP. Keep ambiguous results durable in your own application. Use live facets scoped to the selected pool/country, refuse known-zero targets without silently widening them, and keep unknown stock distinct from zero. A diagnostic must inspect `ok`, not only HTTP status; one request is not capacity or uptime proof. Gateway limits are current account configuration, not a per-key fairness or RPS guarantee. Continue polling unless an actual PAK webhook delivery contract is released. ## Choose the pool explicitly **Explicitly choose pool; do not rely on the SDK’s mobile-pool default.** Pass `pool` in every `buildProxyUrl` call and `` configuration, and include the pool token in every hand-built proxy username and exported connection. | Intended supply | Explicit configuration | |---|---| | Peer network (mixed residential/mobile) | `pool: 'peer'` | | Residential-only peer exits | `pool: 'peer', ipType: 'residential'` (username `-peer--iptype-residential`) | | Shared carrier modems | `pool: 'mbl'` — shared access, not a dedicated modem rental | | Deliberately mixed supply | `pool: 'any'` | `@proxies-sx/pool-sdk` defaults to `mbl` when `pool` is omitted. A raw gateway username with no pool instead falls back to `any`. These are different interfaces; neither default is an integration recommendation. Set `pool` explicitly for MCP URL generation too, and `tier` explicitly for x402 purchases. Stock carrier/city/facet discovery is a separate interface: omitted pool scope defaults to `peer`; use `mbl` for modem discovery and `all` for both pools. The SDK maps discovery `any` to `all`; proxy usernames use `any`, not `all`. Always pass a matching discovery scope. `PoolPortal` has no `ipType` prop: for residential-only exports, use the SDK URL builder with `pool: 'peer', ipType: 'residential'` in a custom UI. `pool=peer` alone is not a residential-only guarantee. For example, preserve the selected product in SDK code: ```ts const residentialUrl = proxies.buildProxyUrl(customerPak, { pool: 'peer', ipType: 'residential', country: 'us', rotation: 'sticky', sid: connectionSid, }); ``` Check live stock for the selected pool/country and retain all targeting filters. No match means unavailable, not permission to change pool, country or carrier. A PAK with `qualityTier: 'safe'` forces `mbl` upstream, so it cannot be used to promise peer/residential routing. Pool selection alone does not reserve a device or guarantee a fixed IP. **What this is:** an open-source toolkit for reselling [Proxies.sx Pool Gateway](https://client.proxies.sx/pool-proxy) proxies under your own brand, or embedding them into any user-facing app. You mint one `pak_` key per paying customer; that key is the **password** half of a proxy URL against `gw.proxies.sx:7000` (HTTP) / `7001` (SOCKS5). **Why:** you set your own retail price. Wholesale rates are volume-tiered and change - read them live from `GET https://api.proxies.sx/v1/billing/pricing` (with your `psx_` API key - the account-path source of truth) or the public no-auth mirror `GET https://api.proxies.sx/v1/x402/pricing`. Never hardcode them. Since 2026-10-12 traffic on your wholesale balance is tier-weighted by exit country (1.00 / 0.375 / 0.1875 GB of balance per GB; lists in the `pricing` block of `GET https://api.proxies.sx/v1/gateway/pool/stock`), while a `pak_` key's own cap counts raw GB. **If this file disagrees with the live API, the live API wins.** > **Rotation cookbook** (copy-paste IP rotation in curl/python/node + the footguns that trip LLMs): https://agents.proxies.sx/pool/rotation-cookbook.md ## First request Requires a reseller `psx_` API key (see Prerequisites below). ```bash curl -s -X POST "https://api.proxies.sx/v1/reseller/pool-keys" \ -H "X-API-Key: psx_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"label":"customer:alice@example.com","trafficCapGB":10}' ``` Response: ```json { "id": "65f...", "key": "pak_a1b2c3...", "label": "customer:alice@example.com", "trafficCapGB": 10, "trafficUsedGB": 0, "enabled": true, "createdAt": "..." } ``` Then: 1. **Persist two fields:** `id` (your management handle) and `key` (the `pak_` secret the customer will use). 2. **Build the proxy URL** the customer plugs into their HTTP client (grammar below): `http://RESELLER_USERNAME-mbl-us:pak_a1b2c3@gw.proxies.sx:7000` 3. **Verify it routes:** `curl -x "http://RESELLER_USERNAME-mbl-us:pak_a1b2c3@gw.proxies.sx:7000" https://api.ipify.org` should return a US mobile IP. 4. **Pick an integration path** (A/B/C/D below) for the production build. ## The three layers 1. **`@proxies-sx/pool-sdk`** - typed REST client (npm). For JS/TS code that mints `pak_` keys, lists usage, and builds proxy URLs. 2. **`@proxies-sx/pool-portal-react`** - drop-in `` component + headless hooks + `createPoolApiHandlers()` Next.js route factory. 3. **REST API** - language-agnostic. Anyone with an HTTP client (Python, PHP, Go, Ruby, bash + curl, ...) can integrate. Source: . License: MIT. --- ## When to use this skill Use it for any of these intents: - "I want to resell mobile proxies under my own brand" - "Embed a proxy dashboard in my customer portal" - "Mint a sub-key per paying customer" - "Add proxy access to my [SaaS / scraping shop / ad platform]" - "Wire Proxies.sx into my [Next.js / React / Vue / PHP / Python / Go] app" - "I want a Stripe-paid proxy storefront" - "Build a `pak_` key minting flow" If the user mentions Pool Gateway, `pak_` keys, `psx_` reseller keys, `gw.proxies.sx:7000`, or any of the SDK/component names above, this skill applies. --- ## The three credentials (know which is which) | Credential | Format | Sensitivity | Where it lives | |---|---|---|---| | Reseller API key | `psx_...` (from the API keys page) | **Secret. Server-side only.** Mints and manages `pak_` keys. | Env var / secrets manager, never the browser | | Reseller username | `psx_` | Public. It is the username half of every customer proxy URL. | Safe in client code and proxy URLs | | pak key | `pak_...` | Per-customer secret. It is the **password** half of that customer's proxy URL. | Your DB; hand to exactly one customer; rotate via regenerate | --- ## Decide the integration path FIRST Before writing code, ask which path they want. Don't guess - the implementation differs significantly. ``` Q1: Does the user already have an app, or are they starting fresh? Starting fresh -> PATH A: clone the full Next.js starter storefront (apps/starter/) Existing app -> Q2: What stack is it? React / Next.js -> PATH B: embed the component Anything else -> Q3: Is the backend JavaScript/TypeScript? JS/TS backend (Express, Fastify, Hono, Bun, Workers, ...) -> PATH C: SDK only, no UI Not JS (PHP, Python, Go, Ruby, ...) -> PATH D: direct REST API, any language ``` Confirm the choice with the user before generating code. Each path follows. --- ## Prerequisites (all paths) The user needs ONE thing first: a Proxies.sx reseller API key. - Sign up / log in at [client.proxies.sx](https://client.proxies.sx) - Visit [client.proxies.sx/account](https://client.proxies.sx/account) - Click "Create API key" with scopes `customers:read` + `customers:write` (every `/reseller/pool-keys/*` route checks them) plus `ports:read` + `ports:write` for the live-session routes - Save the `psx_...` value - **server-side only, never expose to the browser** The user will also have a "reseller username" of the form `psx_` shown in the same dashboard. That value is safe to reference in proxy URLs (it's the public part of the proxy auth) - it's NOT the secret API key. If the user doesn't have an API key yet, instruct them to mint one before any code runs. Don't try to mock it. ### Quality tier - decide once, set per customer key Every `pak_` key carries a `qualityTier`, chosen at mint time: - `qualityTier: 'safe'` -> the gateway silently rewrites `peer-*` pool tokens in that customer's proxy URL to `mbl-*`. The customer always lands on a production modem (a carrier modem we operate). Use for paying customers with strict SLAs. - `qualityTier: 'standard'` (default) -> routes across both pools by health and load. Cheaper average, more variance. Use for hobby / best-effort use cases. Set it via `POST /v1/reseller/pool-keys` with `{"qualityTier":"safe"}` in the body. Default is `standard`. Every rewrite is logged to the pak audit trail, so the reseller can see when it fired. --- ## PATH A - Deploy the full Next.js storefront **Payment-delivery gate:** the starter is a demo, not production payment fulfillment. Its webhook records a purchase before provider delivery; after a provider or local-save failure, a retry can find that purchase and skip unfinished delivery. Add durable delivery states, recovery and failure/race tests before accepting real payments. Provider operation deduplication alone does not repair this local gap. Track [starter issue #4](https://github.com/bolivian-peru/proxy-reseller-kit/issues/4). This limitation concerns the independently hosted starter, not integrations using their own payment flow. Use when the user wants a **complete branded reseller site** (landing page, magic-link login, Stripe checkout, customer dashboard) and is starting from scratch. ```bash git clone https://github.com/bolivian-peru/proxy-reseller-kit.git my-shop cd my-shop/apps/starter cp .env.example .env # Edit .env: PROXIES_SX_API_KEY, PROXIES_SX_USERNAME, STRIPE_SECRET_KEY, # STRIPE_WEBHOOK_SECRET, AUTH_SECRET, DATABASE_URL pnpm install docker compose up -d db # local Postgres on :5432 pnpm db:migrate # idempotent schema bootstrap pnpm dev # -> http://localhost:3000 ``` In another terminal: ```bash stripe listen --forward-to localhost:3000/api/stripe/webhook ``` **What you get out of the box:** - `/` - landing + pricing tiers (configured in `src/config.ts`) - `/login` - NextAuth (Auth.js v5) magic-link auth (in dev, the link prints to server console - no SMTP required) - `/dashboard` - `` showing the customer's `pak_` key, country selector, copy-to-clipboard proxy URLs - `/api/stripe/checkout` + `/api/stripe/webhook` - Stripe checkout that mints a `pak_` key on payment success - `/api/pool/[...path]` - proxies SDK calls server-side (keeps `psx_` key off the client) **Customize:** edit `apps/starter/src/config.ts`: ```ts export const config = { brand: { name: 'AcmeProxies', primaryColor: '#7c3aed', supportEmail: '...' }, pricing: [ { id: 'starter', displayName: 'Starter', gb: 5, priceUsd: 35 }, { id: 'pro', displayName: 'Pro', gb: 25, priceUsd: 150 }, { id: 'scale', displayName: 'Scale', gb: 100, priceUsd: 500 }, ], countries: ['us', 'nl', 'pl', 'fr', 'ge', 'gb'], // as-of example - check live stock }; ``` Check live per-country stock at `GET https://api.proxies.sx/v1/gateway/pool/stock` before choosing retail countries - the set shifts with supply, and some countries (e.g. de, es) currently have peer-pool coverage only while the starter defaults to the mbl pool. **Deploy:** `docker compose up --build -d` on a VPS with Caddy/nginx terminating TLS in front. Full per-task guide: see `apps/starter/CLAUDE.md` in the repo. --- ## PATH B - Embed `` in an existing React/Next.js app Use when the user already has auth, billing, and a UI shell, and just wants to drop a proxy dashboard onto a page. ```bash npm install @proxies-sx/pool-portal-react @proxies-sx/pool-sdk ``` **Two pieces:** the component (client) + an API route (server, holds the secret). ### 1. Server route (Next.js App Router example) `app/api/pool/[...path]/route.ts`: ```ts import { createPoolApiHandlers } from '@proxies-sx/pool-portal-react/server'; import { ProxiesClient } from '@proxies-sx/pool-sdk'; import { auth } from '@/lib/auth'; // your existing auth import { db } from '@/lib/db'; const handlers = createPoolApiHandlers({ proxies: new ProxiesClient({ apiKey: process.env.PROXIES_SX_API_KEY!, proxyUsername: process.env.PROXIES_SX_USERNAME!, }), // CRITICAL: scope each request to the logged-in user so customer A // can never see customer B's keys. getSessionUserId: async () => (await auth())?.user?.id ?? null, getUserKeyId: async (userId) => (await db.customers.get(userId))?.pakKeyId ?? null, }); export const GET = handlers.GET; export const POST = handlers.POST; export const DELETE = handlers.DELETE; ``` ### 2. Page `app/dashboard/page.tsx`: ```tsx 'use client'; import { PoolPortal } from '@proxies-sx/pool-portal-react'; import '@proxies-sx/pool-portal-react/styles.css'; export default function Dashboard() { return ( ); } ``` For non-Next.js React apps (CRA, Vite, Remix, etc.), implement the same handlers in your own backend framework - see headless hooks below for finer control. ### Headless hooks (custom UI) If `` doesn't fit your design, use the hooks directly: ```tsx import { usePoolKey, usePoolStock, useIncidents, useCopyToClipboard } from '@proxies-sx/pool-portal-react'; const { data: me, loading, refetch } = usePoolKey('/api/pool'); // GET {apiRoute}/me const { data: stock } = usePoolStock('/api/pool'); // GET {apiRoute}/stock // me.pakKey, me.usage.usedGB, me.usage.capGB - all hooks return { data, loading, error, refetch } // rotate the key via POST {apiRoute}/regenerate ``` --- ## PATH C - Just the SDK (any JS/TS server) Use when the user has a non-React frontend (Vue, Svelte, plain HTML) but a JS backend (Express, Fastify, Hono, Bun, Cloudflare Workers, ...). ```bash npm install @proxies-sx/pool-sdk ``` ```ts import { ProxiesClient } from '@proxies-sx/pool-sdk'; // Server-side ONLY. Never bundle PROXIES_SX_API_KEY into a browser build. const proxies = new ProxiesClient({ apiKey: process.env.PROXIES_SX_API_KEY!, proxyUsername: process.env.PROXIES_SX_USERNAME!, }); // 1. Mint a key for a customer who just paid const key = await proxies.poolKeys.create({ label: `customer:${customerId}`, trafficCapGB: 10, // null/omit = unlimited within reseller's pool }); // 2. Store key.id (for management) and key.key (the pak_ secret) in your DB await db.update(customerId, { pakKeyId: key.id, pakKey: key.key }); // 3. Build the proxy URL the customer uses in their HTTP client const proxyUrl = proxies.buildProxyUrl(key.key, { pool: 'mbl', // Explicit shared carrier-modem selection country: 'us', sid: connectionSid, // persisted opaque SID for this customer/configuration rotation: 'sticky', }); // -> "http://psx_abc-mbl-us-sid-cust_7a3f9b-rot-sticky:pak_xyz@gw.proxies.sx:7000" ``` **Other operations:** ```ts await proxies.poolKeys.list(); // list all keys with usage + isExpired flag await proxies.poolKeys.update(keyId, { label }); // update label / cap / enabled / expiresAt await proxies.poolKeys.topUp(keyId, { addTrafficGB: 10, idempotencyKey }); // one intended grant; preserve holds, reconcile an uncertain result await proxies.poolKeys.regenerate(keyId); // change secret once; no fixed cache/open-socket cutoff await proxies.poolKeys.delete(keyId); // permanent await proxies.pool.getStock(); // live endpoint count by country await proxies.pool.getIncidents(); // active pool incidents ``` **Time-bounded credits with `expiresAt` (v0.2.0+):** ```ts // Mint a 60-day "use it or lose it" credit const key = await proxies.poolKeys.create({ label: 'customer:alice', trafficCapGB: 10, expiresAt: new Date(Date.now() + 60 * 86_400_000).toISOString(), }); // On top-up, bump cap AND push expiry forward in one call await proxies.poolKeys.update(key.id, { trafficCapGB: 25, expiresAt: new Date(Date.now() + 60 * 86_400_000).toISOString(), }); // Remove the expiry (perpetual key) await proxies.poolKeys.update(key.id, { expiresAt: null }); // Helpers import { isPoolKeyExpired, daysUntilPoolKeyExpiry } from '@proxies-sx/pool-sdk'; isPoolKeyExpired(key); // boolean daysUntilPoolKeyExpiry(key); // number | null ``` The gateway checks expiry during authentication; do not promise immediate open-socket termination or a fixed cache deadline. The platform's daily cron (03:30 UTC) sets `enabled=false` on past-expiry keys for tidier admin queries. --- ## PATH D - Direct REST API (PHP / Python / Go / Ruby / any language) Use when the user's backend is **not JavaScript**. The SDK is a thin wrapper around a public REST API - anyone with an HTTP client can integrate. **Auth:** `X-API-Key: psx_...` header on every request. **Endpoints:** | Method | Path | Purpose | |---|---|---| | `POST` | `/v1/reseller/pool-keys` | Mint a `pak_` key (accepts optional `expiresAt` ISO datetime; persist `Idempotency-Key` before dispatch; recovery depends on the released lifecycle contract above) | | `GET` | `/v1/reseller/pool-keys` | List keys + usage (returns `expiresAt`, server-computed `isExpired`) | | `PATCH` | `/v1/reseller/pool-keys/{keyId}` | Update `label` / `enabled` / `trafficCapGB` / `expiresAt` | | `POST` | `/v1/reseller/pool-keys/{keyId}/topup` | Atomic top-up: `addTrafficGB` and/or `extendDays` (optional `Idempotency-Key` header; prefer over PATCH for credit extensions) | | `POST` | `/v1/reseller/pool-keys/{keyId}/regenerate` | Change secret once; recover the current scoped key after ambiguity; no fixed cache cutoff | | `DELETE` | `/v1/reseller/pool-keys/{keyId}` | Delete permanently | Base URL: `https://api.proxies.sx/v1`. Public docs: Pool Gateway Swagger + Reseller OpenAPI . (The full customer Swagger at /docs/api is basic-auth gated - not public.) ### Mint a key - minimum viable curl ```bash curl -X POST "https://api.proxies.sx/v1/reseller/pool-keys" \ -H "X-API-Key: psx_YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"label":"customer:alice@example.com","trafficCapGB":10}' # Response: # { # "id": "65f...", # "key": "pak_a1b2c3...", # "label": "customer:alice@example.com", # "trafficCapGB": 10, # "trafficUsedGB": 0, # "enabled": true, # "createdAt": "..." # } ``` Persist `id` (management handle) and `key` (the `pak_` secret). ### Per-language patterns **Python:** ```python import requests resp = requests.post( "https://api.proxies.sx/v1/reseller/pool-keys", headers={"X-API-Key": "psx_YOUR_API_KEY"}, json={"label": "customer:alice", "trafficCapGB": 10}, ) key = resp.json()["key"] # "pak_..." ``` **PHP:** ```php $ch = curl_init('https://api.proxies.sx/v1/reseller/pool-keys'); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'X-API-Key: psx_YOUR_API_KEY', 'Content-Type: application/json', ], CURLOPT_POSTFIELDS => json_encode(['label' => 'customer:alice', 'trafficCapGB' => 10]), ]); $key = json_decode(curl_exec($ch), true)['key']; // pak_... ``` **Go:** ```go body := strings.NewReader(`{"label":"customer:alice","trafficCapGB":10}`) req, _ := http.NewRequest("POST", "https://api.proxies.sx/v1/reseller/pool-keys", body) req.Header.Set("X-API-Key", "psx_YOUR_API_KEY") req.Header.Set("Content-Type", "application/json") resp, _ := http.DefaultClient.Do(req) ``` **Ruby:** ```ruby require 'net/http'; require 'json' uri = URI('https://api.proxies.sx/v1/reseller/pool-keys') req = Net::HTTP::Post.new(uri, 'X-API-Key' => 'psx_YOUR_API_KEY', 'Content-Type' => 'application/json') req.body = { label: 'customer:alice', trafficCapGB: 10 }.to_json resp = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) } ``` --- ## The proxy URL grammar (every path uses this) The customer's HTTP/SOCKS5 client connects to: ``` {protocol}://{username}:{pakKey}@gw.proxies.sx:{port} ``` | Field | Value | |---|---| | `protocol` | `http` or `socks5` | | `port` | `7000` for HTTP, `7001` for SOCKS5 | | `username` | `psx_RESELLER_USERNAME` + routing fields, `-`-separated | | `pakKey` | The `pak_*` secret minted via the API - it goes in the **password** field, never in the username | **Username structure:** the reseller username comes first, then **pool** and **country** as positional routing fields, then optional named `token-value` pairs in any order: | Position / token | Example | Meaning | |---|---|---| | Pool | `mbl`, `peer` | `mbl` = production mobile modems, `peer` = mixed residential/mobile peers; add `ipType: 'residential'` for residential-only. Always specify `pool`; SDK omission uses `mbl`, raw gateway omission uses `any`. | | Country | `us`, `nl`, `pl`, `fr`, `ge`, `gb` | ISO 3166-1 alpha-2 (as-of examples - live set at `GET /v1/gateway/pool/stock`) | | `sid-{id}` | `sid-alice_session1` | Binding preference under the same SID; not a reservation or fixed-IP guarantee. No `sid` = no cross-connection stickiness. | | `rot-{mode}` | `rot-sticky`, `rot-hard`, `rot-auto5`, `rot-auto10`, `rot-auto20`, `rot-auto60`, `rot-ondemand` | IP rotation policy | | `city-{name}` | `city-newyork` | Hard city filter, `peer` only (modems never match); no match refuses with `E_NO_STOCK_COUNTRY` | | `carrier-{name}` | `carrier-tmobile` | Hard carrier filter: an exact name from `GET /v1/gateway/pool/stock/carriers`, lowercased with spaces and punctuation removed | **Example URL:** ``` http://psx_acme-mbl-us-sid-customer123-rot-sticky:pak_a1b2c3@gw.proxies.sx:7000 ``` This requests a US carrier-modem binding for that SID. It does not reserve a device or guarantee an unchanged public IP. **Sharp edge to teach your customers:** sticky pins the **modem**, not the IP. Mobile carriers re-issue NAT egress IPs on their own schedule, so a pinned modem can still surface different exit IPs across requests. That is carrier behavior, not a routing failure. The SDK's `buildProxyUrl(pakKey, opts)` generates the URL. In other languages, build the string manually: ```python def build_proxy_url(reseller, pak_key, country='us', sid=None, rotation='sticky'): parts = [reseller, 'mbl', country] if sid: parts.append(f'sid-{sid}') if rotation: parts.append(f'rot-{rotation}') return f"http://{'-'.join(parts)}:{pak_key}@gw.proxies.sx:7000" ``` --- ## Error handling The REST API returns standard HTTP codes. Map them like this: | Status | Meaning | Action | |---|---|---| | `200` / `201` | Success | Use the response body | | `400` | Validation error | Show error details to the user, don't retry | | `401` | API key invalid or revoked | Re-mint key from `client.proxies.sx/account` | | `403` | Scope insufficient, or the account is not a reseller | On `/reseller/pool-keys/*` add `customers:read` (reads) / `customers:write` (mint, top-up, regenerate, delete). On `/gateway/pool/my-sessions` add `ports:read` (GET) / `ports:write` (DELETE) | | `404` | Key doesn't exist | Stop - don't loop | | `429` | Rate-limited | Back off reads; inspect mutation outcome before any new dispatch | | `500-599` | Server error | Bound read retries; mutations stay uncertain until reconciled, never blindly repeat | The SDK ships these as typed errors: ```ts import { ProxiesApiError, ProxiesTimeoutError } from '@proxies-sx/pool-sdk'; try { await proxies.poolKeys.create({ label: 'x' }); } catch (err) { if (err instanceof ProxiesApiError) { if (err.isAuth) { /* 401/403 */ } if (err.isRateLimited) { /* 429 */ } if (err.isServer) { /* 5xx */ } } else if (err instanceof ProxiesTimeoutError) { /* request exceeded timeout */ } } ``` Gateway-side errors (from `gw.proxies.sx` itself) come back as `CODE: message (req: uuid)`. Support: maya@proxies.sx or https://t.me/proxies_sx - quote the req id. --- ## Security non-negotiables DO NOT skip these. Burn them into any code generated for the user: 1. **`PROXIES_SX_API_KEY` is server-only.** Never inline it in `next.config.js`, never `NEXT_PUBLIC_*` it, never ship it to the browser bundle. The trust boundary lives at your backend. 2. **Scope every request** by the authenticated customer. In the React PATH B example, `getSessionUserId` MUST read the session - without it, customer A can read/regenerate customer B's keys. 3. **Use parameterized SQL** if you're storing keys (the starter app does this - `$1`, `$2` placeholders, never string interpolation). 4. **Verify Stripe webhook signatures.** The starter app's webhook handler does this; if you adapt it, do not comment out the signature check "to test". 5. **Rotate leaked `pak_` keys immediately** via `regenerate()` - recover a lost response from the current scoped key; do not promise immediate revocation or fixed cache/open-socket termination. 6. **Store `psx_` keys in a secrets manager**, not in source. The starter uses `.env`; production deployments should use 1Password / Doppler / AWS Secrets Manager / etc. --- ## Common patterns ### Customer pays -> mint key (Stripe webhook) ```ts // Pseudocode - works in any framework async function onStripeCheckoutCompleted(event) { const session = event.data.object; const customerId = session.client_reference_id; const gbPurchased = Number(session.metadata.gb); const key = await proxies.poolKeys.create({ label: `customer:${customerId}`, trafficCapGB: gbPurchased, idempotencyKey: event.id, // persist this intent before dispatch; reconcile uncertain outcomes }); await db.update(customerId, { pakKeyId: key.id, pakKey: key.key }); } ``` The webhook sketch above omits your durable intent/locking layer. Do not use a payment callback replay to repeat an uncertain provider write. Save and reconcile the operation before issuing the request. ### Customer wants to rotate their own credentials ```ts async function rotateForCustomer(customerId) { const customer = await db.get(customerId); const { id, key } = await proxies.poolKeys.regenerate(customer.pakKeyId); await db.update(customerId, { pakKey: key }); return key; // hand to UI } ``` Persist the regeneration operation before the call above. After timeout or failed local persistence, recover the current scoped key; do not call regeneration again. ### Show usage on dashboard ```ts const keys = await proxies.poolKeys.list(); const ours = keys.find(k => k.id === customer.pakKeyId); console.log(`${ours.trafficUsedGB} / ${ours.trafficCapGB ?? 'unlimited'} GB used`); ``` ### Top-up: customer pays for more, increase the cap ```ts // Atomic server-side increment - no read-modify-write race await proxies.poolKeys.topUp(customer.pakKeyId, { addTrafficGB: additionalGB, idempotencyKey: `topup_${invoiceId}`, // stable saved operation token; do not blindly redispatch }); ``` --- ## Pricing (do NOT pin numbers in code or docs) Wholesale rates from Proxies.sx have volume tiers and are configured by the platform - they can change at any time. Do not hardcode dollar amounts in the user's app. To get current rates programmatically: - `GET https://api.proxies.sx/v1/billing/pricing` (with the reseller's `psx_` API key, scope `billing:read` - the account-path source of truth, includes volume discounts + tier info) - `GET https://api.proxies.sx/v1/x402/pricing` (public, no auth - convenient mirror when no key is at hand) - Or check the user's [client.proxies.sx](https://client.proxies.sx) dashboard The user sets their **retail** price (whatever they charge their own customers) - that lives in their own app config (`apps/starter/src/config.ts` in the starter, or wherever they put it). The wholesale price affects their margin, not their pricing UI. --- ## Reference files (deeper detail) When the user needs more than this skill provides, point them to the right file in the repo: | File | When to read | |---|---| | `README.md` | Marketing-friendly overview, FAQ, license | | `packages/sdk/README.md` | Full SDK API surface, all methods, error types, language-by-language REST examples | | `packages/react/README.md` | `` props, all hooks, server handler details, theming | | `apps/starter/README.md` | Full Next.js storefront deployment guide | | `apps/starter/CLAUDE.md` | Per-task instructions for AI agents customizing the starter (change brand, add country, add admin page, change DB schema) | | `CLAUDE.md` | Repo-wide architecture + invariants for AI agents working ON the SDK code itself | | `SECURITY.md` | Production hardening checklist | --- ## Quick smoke test (run before reporting "done" to the user) After generating code, verify the integration works end-to-end. Don't trust types alone. ```bash # 1. Mint a real key (replace YOUR_KEY with the user's real psx_ key) RESPONSE=$(curl -s -X POST "https://api.proxies.sx/v1/reseller/pool-keys" \ -H "X-API-Key: psx_YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"label":"smoke-test","trafficCapGB":1}') # pak_ keys are "pak_" + lowercase hex, so this grep extraction is safe to port to other shells PAK=$(echo "$RESPONSE" | grep -oE 'pak_[a-z0-9]+') echo "Got key: $PAK" # 2. Use it through the gateway (USERNAME = the user's psx_ reseller username) curl -x "http://USERNAME-mbl-us:$PAK@gw.proxies.sx:7000" https://api.ipify.org # Should return a US mobile IP. # 3. Clean up KEY_ID=$(echo "$RESPONSE" | grep -oE '"id":"[^"]+"' | cut -d'"' -f4) curl -X DELETE "https://api.proxies.sx/v1/reseller/pool-keys/$KEY_ID" \ -H "X-API-Key: psx_YOUR_KEY" ``` If step 2 returns a real US IP via the proxy, the integration works. --- ## Final checklist before handing off - [ ] User has a `psx_*` API key from `client.proxies.sx/account` - [ ] The key is in a server-side env var, never in client code - [ ] If using PATH B/C, the API route scopes by authenticated user - [ ] Stripe webhook signature is verified (if using Stripe) - [ ] User can mint a `pak_*`, build a proxy URL, and route real traffic through it - [ ] User knows how to regenerate a leaked `pak_*` - [ ] No specific pricing numbers were hardcoded - UI either reads live pricing (`/v1/billing/pricing` with the reseller key, or public `/v1/x402/pricing`) or shows the user's own retail tiers