Access Sandbox Endpoints
This guide shows how to access services running inside your sandbox.
Get Service Endpoint
Section titled “Get Service Endpoint”Every sandbox can expose multiple ports. Query the endpoint API to retrieve the gateway endpoint and routing information for a specific port.
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.
Access via Gateway
Section titled “Access via Gateway”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.
curl -H "OpenSandbox-Ingress-To: {sandbox_id}-{port}" \ {GATEWAY_ENDPOINT}/pathAccess via API Proxy
Section titled “Access via API Proxy”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.
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
Troubleshooting
Section titled “Troubleshooting”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.
Next Steps
Section titled “Next Steps”- Pause & Resume — Manage sandbox lifecycle
- Delete Sandbox — Clean up when done