Skip to content
中文

Fixed egress IP

A sandbox can serve as a fixed egress IP, but only one kind: a persistent sandbox created on the Praxis own face with network.staticEgressIp: true. The egress IP of every other sandbox is not fixed and must not be put on a third party’s whitelist.

The default egress IP changes

A sandbox’s default egress IP belongs to the machine it currently runs on. It changes when the machine changes, see The two sandbox lifecycles:

  • An interruptible (spot) machine is reclaimed and another machine replaces it.
  • A persistent sandbox is paused and resumed: pausing stops the machine and releases its ordinary public IP, so the address after resume can differ.
  • A machine is rebuilt or recreated.

Create a sandbox with a fixed egress IP

终端窗口
curl https://api.deepraxis.com/sandbox/v1/sandboxes \
-H "Authorization: Bearer $PRAXIS_API_KEY" -H "X-Praxis-Face: own-v1" \
-H "content-type: application/json" \
-d '{"templateID": "base", "timeout": 600, "ephemeral": false, "autoPause": true,
"network": {"staticEgressIp": true}}'

Rules:

  • The sandbox must be persistent: send autoPause: true with it. An ephemeral sandbox (no autoPause: true) is refused with INVALID_PARAMS (400).
  • Only the own face (header X-Praxis-Face: own-v1) has this field. The E2B-compatible face (/e2b) answers PROVIDER_UNSUPPORTED (501); E2B itself offers no fixed egress IP, so users who need one bring their own proxy.
  • Such a sandbox is placed only on machines that are not interruptible and whose supplier line declares support for a fixed public IP. When no such supply exists, the create stays pending or is refused; it never falls back silently to an address that changes.

Read the address

On the own face, the answers of create, read and list carry network:

终端窗口
curl https://api.deepraxis.com/sandbox/v1/sandboxes/$SANDBOX_ID \
-H "Authorization: Bearer $PRAXIS_API_KEY" -H "X-Praxis-Face: own-v1" | jq .network
{ "staticEgressIp": true, "egressIp": "203.0.113.10" }

egressIp appears once the machine has its address, so right after create, read again until it is there. A sandbox that did not declare staticEgressIp never carries egressIp. The address stays the same across pause and resume.

Use it for a whitelist

WeCom trusted IP, the WeChat Official Account IP whitelist and a partner API’s source-IP allowlist all work the same way:

  1. Create a persistent sandbox as above and read its egressIp.
  2. Put that address into the third party’s whitelist.
  3. Make every outbound call that must be allowlisted from inside that sandbox (curl, or your service running there). Never allowlist the default egress IP.

Caveat: the fixed address belongs to this one sandbox’s machine. Deleting the sandbox releases the address back to the pool; it is not kept for you, and a sandbox you create later gets a different address, so the whitelist must be updated.

Cost

The fixed IP is its own usage item, sandbox:public_ip:hours, measured in hours from allocation to release and charged while the sandbox is paused too. Outbound traffic is metered as before under the egress item (sandbox:egress/<vendor>/<region>:gib). Prices are on the pricing page; this page states no numbers.

Next steps