Skip to content

Access Sandbox Endpoints

This guide shows how to access services running inside your sandbox.

Every sandbox can expose multiple ports. Query the endpoint API to retrieve the gateway endpoint and routing information for a specific port.

Terminal window
curl {API_ENDPOINT}/sandboxes/{sandbox_id}/endpoints/{port} \
-H "OPEN-SANDBOX-API-KEY: YOUR_API_KEY"

This returns the gateway endpoint and the required header to route traffic to that port.

The gateway provides direct, high-throughput access to sandbox services. Add the OpenSandbox-Ingress-To header with the value {sandbox_id}-{port} to route your request to the correct service.

Terminal window
curl -H "OpenSandbox-Ingress-To: {sandbox_id}-{port}" \
{GATEWAY_ENDPOINT}/path

Alternatively, you can route requests through the API server using the proxy endpoint. This is simpler (no custom headers) but has lower throughput than the gateway.

Terminal window
curl {API_ENDPOINT}/sandboxes/{sandbox_id}/proxy/{port}/{path} \
-H "OPEN-SANDBOX-API-KEY: YOUR_API_KEY"

Trade-offs:

  • Gateway — Higher throughput, designed for data-plane traffic
  • API Proxy — Simpler (no custom headers), but routes through API server

Q: Getting 404 on endpoint access? A: Verify the sandbox is Running and the port number is correct. Check that your service is actually listening on that port.

Q: “Invalid ingress route” error? A: The gateway may be reconfiguring. Wait 10-30 seconds and retry.

Q: Can’t reach the endpoint? A: Ensure you’re using the correct endpoint URL and have included the required header for gateway access.