Skip to content

Proxy Router API: Automate Your Router

Ask AI

Ready taskDo it with me, step by step

Chat assistants

Open in ChatGPTNew tabOpen in ClaudeNew tab

Coding agents

Claude CodeOpens the desktop appCodexOpens the desktop appCursorOpens the app from the web

Copy

View as MarkdownPlain text for AI tools
See the prompt
Read https://xproxy.io/document/proxy-router-api.md, the XProxy guide "Proxy Router API: Automate Your Router". If you cannot open links, download them with curl. Then take me through it one step at a time: tell me exactly what to click or type, wait until I say it is done, and help me when what I see is different from the guide. Start by asking what I have (hardware, XProxy version, what I see now).
Other XProxy guides, each with a Markdown copy at its URL + .md, are listed in https://xproxy.io/llms.txt.

The app opens with the prompt filled in. Nothing runs until you press Enter.

Everything you can do in the Proxy Router dashboard you can also do from your own scripts with the REST API. Use it to give proxies to many devices, read the leak monitor, or change rules, behind the same dashboard password.

You need: the dashboard password, a computer that is plugged into the router and has no proxy (or is on the admin access list), and the router's address. The API listens on port 8080: http://192.168.1.1:8080.

How do I call it?

  1. Sign in with POST /auth/login. The answer sets a session cookie.
  2. Send that cookie with every other call. It stays valid until you have been away for 12 hours.
  3. Send every POST as JSON, with the header Content-Type: application/json. A body of {} is fine when there is nothing to send.
curl
# 1. sign in once and keep the session cookie
curl -c rp.cookies -X POST http://192.168.1.1:8080/auth/login \
  -H "Content-Type: application/json" \
  -d '{"password":"your-dashboard-password"}'

# 2. send the cookie with every other call
curl -b rp.cookies http://192.168.1.1:8080/clients

The rules

  • Only the router's own address works. Use the router's IP address or its name. Anything else gets 403.
  • Browsers only from the dashboard. Other web pages cannot call the API, even on your network.
  • Devices with a proxy cannot reach it: the router is invisible to them. Call it from a device without a proxy or one on the admin access list.
  • Proxy passwords are never returned. They show as ••••. Sending a proxy back with •••• keeps the saved password only if the host, port and user are unchanged; otherwise you get 400 and must send the password again.
  • One restart per change. Changing proxies or rules restarts the proxy service for all devices. Use the bulk calls for many devices at once.
  • Calls marked license need an active license.

The API page in the dashboard

The API page of the dashboard lists every call, with its parameters, a ready curl command and a sample answer. Click a call to open it, and use Copy. Copy all as curl copies every call at once.

The API page of the dashboard: the base address, the Copy all as curl button and the first call opened with its parameters, curl command and sample answer (demo data)
1 the base address of your router · 2 Copy all as curl · 3 one call, opened: parameters, curl command and sample answer

Examples

Give a device a proxy

curl
curl -b rp.cookies -X POST http://192.168.1.1:8080/client_proxy \
  -H "Content-Type: application/json" \
  -d '{"ip":"192.168.1.101","proxy":"socks5://user:[email protected]:1080","proxy_type":"SOCKS5","name":"Phone 01","remote_fakedns":true}'

Fields: ip (the device's address on the router), proxy (in any of the usual formats; an empty string clears it), proxy_type (SOCKS5 or HTTP), name (a label) and remote_fakedns (true for FakeDNS, false for DoH via proxy). Loopback, link-local, multicast and the router's own addresses are refused with 400.

Give many devices a proxy at once

curl
curl -b rp.cookies -X POST http://192.168.1.1:8080/client_proxy/bulk \
  -H "Content-Type: application/json" \
  -d '[{"ip":"192.168.1.101","proxy":"socks5://user:[email protected]:20145","proxy_type":"SOCKS5"},
       {"ip":"192.168.1.102","proxy":"user:[email protected]:8080","proxy_type":"HTTP"}]'

Pause a device

curl
curl -b rp.cookies -X POST http://192.168.1.1:8080/client_proxy/pause \
  -H "Content-Type: application/json" \
  -d '{"ip":"192.168.1.101"}'

Resume it with /client_proxy/resume and the same body.

Set routing rules

curl
curl -b rp.cookies -X POST http://192.168.1.1:8080/routing \
  -H "Content-Type: application/json" \
  -d '{"direct":["netgear.com"],"block":["analytics.example.com"],"presets":{"ads":true}}'

Read the leak monitor

curl
curl -b rp.cookies http://192.168.1.1:8080/leakmon

All calls

The same list as the dashboard's API page. Every call answers JSON.

Login

CallWhat it does
POST /auth/loginSign in with {"password": "..."}. Sets the session cookie.
GET /auth/statusWhether a password is set and whether this session is signed in.
POST /auth/logoutEnd this session.

Devices and proxies

CallWhat it does
GET /dhcp_clientsDevices with an address. “online” tells whether the device is connected now.
POST /client/forgetForget an offline device: name, proxy, fixed IP and traffic. 409 while it is online.
GET /clientsThe saved settings of every device. Proxy passwords show as ••••. “paused” and “exit_ip” are included.
GET /client_proxy/:iplicenseThe proxy settings of one device.
POST /client_proxylicenseAssign a proxy to a device, or clear it with an empty proxy.
POST /client_proxy/bulklicenseAssign or clear many devices with one restart of the proxy service. Every item is checked first.
POST /client_proxy/pauselicensePause a device’s proxy: it keeps its proxy and settings but has no internet until resumed.
POST /client_proxy/resumelicenseResume a paused device with exactly the proxy it had.
POST /client_proxy/pause/bulklicensePause many devices (at most 256) with one restart.
POST /client_proxy/resume/bulklicenseResume many paused devices with one restart.
POST /client/bind_ip_macFix or release a device’s IP (the DHCP static lease).
GET /client/dhcp_reservationsThe fixed IPs.
GET /clients/trafficTotal traffic per device.
POST /clients/traffic/resetReset the traffic of one device, or of all devices when no ip is sent.

Proxy testing

CallWhat it does
POST /proxy/testCheck a proxy: alive, exit IP, delay and place.
POST /proxy/speedtestDownload and upload speed through a proxy (30 to 60 seconds).

Protection

CallWhat it does
GET /killswitchThe kill switch: protected devices, the block-devices-without-a-proxy switch, the direct-access list and packets stopped.
POST /killswitchTurn Block devices without a proxy on or off ({"block_unassigned": true}).
POST /killswitch/directAdd or remove a device on the direct-access list.
GET /leakmonThe leak monitor: status and blocked attempts per device and kind.
GET /leakmon/:ipOne device, with 24 hourly buckets.

Routing rules

CallWhat it does
GET /routingThe router-wide Go direct and Block lists, the presets and the memory.
POST /routingSave and apply the router-wide rules. A bad line makes the whole call fail with 400 and nothing changes.
GET /routing/device/:ipThe rules of one device.
POST /routing/device/:ipSave one device’s rules. Empty lists and no presets remove them.

Logs

CallWhat it does
GET /logs/leaksBlocked attempts, newest first (filters: ip, category, since, limit).
GET /logs/connectionsRecorded connections, while the connection log is on.
GET /logs/connections/settingsWhether the connection log is on.
POST /logs/connections/settingsTurn the connection log on or off. Restarts the proxy service.
GET /logs/systemThe newest lines of the router log. Passwords masked.

Network

CallWhat it does
GET /network/wanInternet status: link, address, gateway, DNS, uptime, public IP.
GET /network/lanRouter IP, mask, device range and lease time.
POST /network/lanChange them. A new router IP disconnects every device.

System and updates

CallWhat it does
GET /healthIs the router service up. Needs no login.
GET /linux_resourceCPU %, RAM %, uptime in hours and the version.
GET /license/infoLicense status, customer, expiry and days left.
POST /license/saveSave a license key.
POST /license/verifyCheck the license now.
POST /system/restartRestart the proxy service.
POST /system/rebootReboot the router.
GET /system/versionThe installed version and whether a previous one can be restored.
GET /system/update/checklicenseThe latest version.
POST /system/update/applylicenseInstall the latest version, or a specific one.
GET /system/update/statusUpdate progress.
POST /system/update/rollbacklicenseRestore the previous version.

Error codes

CodeWhat it means
401No session, or it ended. Sign in again with /auth/login.
403The address you used is not the router’s own, or a valid license is required.
415A POST was not sent as Content-Type: application/json.
429Too many wrong passwords from your address (wait 5 minutes), or too many logins at once.
400A field is wrong. The answer names it, and the router changed nothing.
409The action does not fit the state, for example forgetting a device that is online.

FAQ

I get 403 on every call

Use the router's own address (for example 192.168.1.1), not a name your computer made up. If you reach the router through a VPN or a host name, ask support to allow that name.

I get 401

Your session ended or you did not send the cookie. Sign in again with /auth/login and send the cookie with -b rp.cookies.

What next?

Everything the API does has a page in the dashboard.

Still stuck?A technician can look at your device with a one-time PIN, or chat with us on Telegram.