Skip to main content
Publish an HTTP server running inside a runtime — a FastAPI app, Streamlit UI, Jupyter, or API docs — at an HTTPS URL on *.service.gravixlayer.ai. No tunnel and no local port forwarding. Each runtime and port gets a hostname. Open it in a browser, call it from code or CI, or share a short-lived link.
The process inside the runtime must already be listening on the port. Opening a service publishes a route. It does not start your server.

Publish an app

Start a small API in the runtime, open a private URL, then create and list items. Outbound traffic is denied by default, so the example attaches a temporary allow_all policy. That lets pip install reach PyPI. Prefer a narrower allowlist.
For production, replace allow_all with an allowlist that includes only the hosts you need (for example pypi.org and files.pythonhosted.org). See Limit outbound traffic.

Choose who can open it

Defaults

Private (default)
  • Programmatic clients send X-Gravix-Web-Service-Token: <token>.
  • Browsers use browser_url, which hits /_ws/auth once and sets an auth cookie for later page loads and API calls from that origin.
  • Your app never sees the Gravix service token. The header and cookie are removed before the request reaches the process inside the runtime.
Public (is_public=true / --public)
  • No token required. Anyone with the URL can reach that port until expiry or revoke.
  • Use only for intentionally open demos. Prefer private for APIs and anything with data.
The runtime must be running. Expired services are removed automatically; call open again (or rotate) for a fresh link.

Open a URL

Call the URL

The SDK handle adds the token header for private services automatically:

Revoke a URL

Open it in the console

On the runtime detail page, open the Web Service section, enter the port your server listens on, and open or copy the link. Private links use the same token/cookie model as the API. After expiry, open again for a fresh URL.

Keep it private

  1. Keep private by default — only use --public / is_public=True for deliberate demos.
  2. Treat tokens like secrets — store them in CI secrets; never commit them; prefer browser_url for humans so the token is not left in shared chat after auth.
  3. Short TTLs — use the smallest expires_in_seconds that fits the session; revoke when done.
  4. Rotate when leaked — rotate_token=True / --rotate-token invalidates the previous token and browser cookies.
  5. Bind the server carefully — listen on 0.0.0.0 only if you intend edge access; do not expose admin UIs without auth inside the app.
  6. Egress is separate — a web service is inbound HTTPS to a port inside the runtime. Outbound calls from the runtime still follow Limit outbound traffic.
A public web service URL is reachable by anyone who has it until it expires or you revoke it. Private tokens grant the same reachability for the TTL — share them only with intended clients.

Fix a failed request

Next

Limit outbound traffic

Allow or deny outbound hosts

Run commands

Start servers and install packages inside the runtime

Create Runtime

Create a sandbox to host your HTTP app

Store a credential

Attach a key your server needs

Endpoints