API Stash Docs
Open app →

The local agent

The local agent lets API Stash reach APIs that aren't on the public internet — services behind your firewall, on a private network, or running on a build runner — without opening any ports or VPN-ing into prod.

What it is

The agent is a small binary you run on a dev machine or build runner. The web app talks to it over an authenticated WebSocket. When you send a request targeting a private host, API Stash dispatches it to the agent; the agent makes the call from inside your network and streams the response back.

How it works

  • You start the agent on a machine that can reach the target API.
  • The agent opens an outbound, authenticated WebSocket connection to API Stash — no inbound ports.
  • Requests routed through the agent are executed locally and their responses returned to the browser.
No firewall holes or VPN-into-prod. Because the agent connects outbound, you don't expose internal services to the internet or grant broad network access.

Install & run

Install the agent on a machine that can reach the target API (requires Node.js 18+):

curl -fsSL https://apistash.dev/install-agent.sh | sh

Then register an agent from the Agents menu in the app to get its connect URL, log in, and start it:

apistash-agent login '<ws-url from the app>'
apistash-agent run

Leave it running; it reconnects automatically if the connection drops. Pick the agent in the executor dropdown and requests you send will dispatch through that machine.

When to use it

  • Hitting internal services on a corporate or private network.
  • Targeting an API on localhost or a dev machine.
  • Running tests in CI against services only the build runner can reach.