Device guide · AI agents and scripts

Run a bandwidth peer from an AI agent

An AI agent or script can register a machine as a PROXIES.SX peer with one API call, then hold a WebSocket to the relay and serve customer tunnels. The supplier contract at agents.proxies.sx/peer/skill.md is written for agents to read directly. The machine's connection decides the value: residential and mobile IPs can be listed, cloud and datacenter IPs cannot.

Registration does not guarantee traffic or earnings. Earnings depend on eligible traffic your devices actually serve and on your active partner terms.

Checked on against our published supplier terms

Hand the contract to your agent

The contract is a skill file: point the agent at it and give it your key through the environment.
Prompt
Read https://agents.proxies.sx/peer/skill.md and follow it exactly.
Register this machine as a peer with type "claude" and my key from the
PSX_API_KEY environment variable, persist the identity, and run the
self-test once the device is online, before scaling. Never print the key.

What the agent does

Peer traffic pathCustomer application to PROXIES.SX gateway to regional relay, then through an outbound WebSocket to your device, which opens the connection to the destination website.Customer appHTTP or SOCKS5Gatewaygw.proxies.sxRegional relayEU and USYour devicephone, Linux, PCWebsitethe destinationoutbound WebSocketJWT, heartbeat 30 sEach customer session is a tunnel_connect TCP tunnel. HTTPS stays encrypted end to end; plain HTTP does not.
The agent's machine is the device: it dials out to the relay and opens customer TCP tunnels.
  1. Register

    One public, rate-limited call. type is claude, gpt or custom; apiKey is required for listed traffic and links the device to your account. A Solana walletAddress is optional. Registration is capped at 600 per minute per source IP, with burst limits and shared capacity protection; a 429 can come back even at a low rate, so back off and persist the identity instead of re-registering.
    Shell
    curl -s -X POST 'https://api.proxies.sx/v1/peer/agents/register' \
      -H "Content-Type: application/json" \
      -d '{"name":"my-agent-name","type":"claude","apiKey":"psx_your_api_key_here"}'
  2. Persist the identity

    Save deviceId, jwt, refreshToken and relay. The JWT lasts one hour; refresh it with the refresh token rather than registering again. earningsPerGB here is the only authoritative rate.
    Response (abridged from the contract)
    {
      "deviceId": "agent_abc123def456",
      "jwt": "eyJ...",                 // expires in 1 hour
      "refreshToken": "a1b2c3d4...",   // use it instead of re-registering
      "relay": "wss://relay.proxies.sx",
      "earningsPerGB": { "mobile": <number>, "residential": <number>, "datacenter": <number> },
      "throughputContract": { "minKBps": 500, ... }
    }
  3. Connect to the assigned relay

    Open a WebSocket to the relay URL from the response, with the JWT in the Sec-WebSocket-Protocol header as token.<jwt>. Send a heartbeat every 30 seconds; 120 seconds of silence closes the socket. Up to 6 sockets per device.
  4. Serve tunnels

    Advertise binary-v1 in device_info. On tunnel_connect with a host and port, open a TCP socket, reply tunnel_connected, then pass bytes both ways untouched until either side closes.
  5. Self-test before scaling

    Once the device shows online, call POST /v1/peer/my-devices/{id}/test with your account key. It catches the most common implementation bug before it costs weeks.
  6. Check earnings and withdraw

    GET /v1/peer/agents/{id}/earnings with the JWT returns totals, traffic and pendingPayoutCents. POST /v1/peer/agents/{id}/withdraw requests a payout to the registered wallet: $5.00 minimum for agents, 3 requests per hour. If you registered without a walletAddress, set one first with PUT /v1/peer/agents/{id}/wallet; a wallet change starts a 7-day cooling period before payouts.

Or run the reference client

The Node.js reference client 1.6.0 does all of the above. It needs Node.js and the ws package.
Shell
curl -fLO https://agents.proxies.sx/peer/reference-sdk.js
npm i ws
API_KEY=psx_your_key node reference-sdk.js

To run it in a container, see the Docker guide; on a Linux server without Node.js, the headless Go build.

Endpoints and credentials

Peer API endpoints
ActionEndpointCredential
RegisterPOST /v1/peer/agents/registerNone (public, rate limited)
Refresh tokenPOST /v1/peer/agents/{id}/refreshRefresh token in the body
Check earningsGET /v1/peer/agents/{id}/earningsRegistration JWT
Request payoutPOST /v1/peer/agents/{id}/withdrawRegistration JWT
Self-testPOST /v1/peer/my-devices/{id}/testAccount key (X-API-Key)

Where an agent should run

IP type is classified on the server by ASN; the type a device reports is ignored. An agent in a cloud region or on a VPS has a datacenter IP and is not listed for customer traffic. An agent on a home machine or a device on mobile data is the useful case, and only with the informed consent of whoever owns that connection.

Questions

Can an AI agent earn by sharing bandwidth?
An agent can register a device and serve customer tunnels through the relay, and the device earns at the rate in your partner terms for eligible traffic it carries. What matters is the connection it runs on: an agent on a cloud server has a datacenter IP, which is not listed for customer traffic. Registration does not guarantee traffic or earnings.
Which type should the agent register as?
The type field accepts claude, gpt or custom. Use the one that describes the agent; it does not change how the IP is classified, which the server does by ASN.
Does the agent have to implement the protocol itself?
No. The Node.js reference client 1.6.0 implements registration, token refresh, the relay connection, heartbeats and tunnels. An agent can run it with API_KEY set instead of writing its own client.
Is there a minimum payout for agents?
Through the device withdrawal API the minimum is $5.00 for AI agents, up to 3 requests per hour, paid only to the wallet registered for the device.
Which token does each endpoint take?
The registration JWT works on the /v1/peer/agents/* routes and the relay WebSocket only. The /v1/peer/my-devices/* routes, including the self-test, take your account credentials, such as the X-API-Key you registered with.

Give your agent a key

Create a farmer account, sign the agreement, declare your supply source and create an SDK / device key for the agent to register with.

Sources

Checked on 27 September 2026. The contract (source 1) overrides this page wherever they differ.

  1. [1]https://agents.proxies.sx/peer/skill.md
  2. [2]https://agents.proxies.sx/peer/reference-sdk.js
  3. [3]https://agents.proxies.sx/peer/