---
title: "Expose a container port at a public HTTPS URL"
method: POST
path: "/preview/nodes/{name}/endpoints"
tags: ["nodes"]
---

# Expose a container port at a public HTTPS URL

`POST /preview/nodes/{name}/endpoints`

## Request

- Base URL: `https://autoresearch.sfcompute.com`
- URL: `https://autoresearch.sfcompute.com/preview/nodes/{name}/endpoints`
- Auth: HTTP bearer

Expose a port on a RUNNING node at a public HTTPS URL, so anything that can curl can reach a server inside the node (TensorBoard, Jupyter, a vLLM endpoint serving a model to a judge). Returns {endpoint_id, url, port, auth, expires_at}. Default auth is the capability URL itself: anyone holding the URL reaches the port, so treat it like a secret. auth:"bearer" additionally requires `Authorization: Bearer <token>` at the edge; the token rides the response ONCE and is never shown again. The endpoint is bound to the node's current container: node stop kills it, and a wake never resurrects it (re-call expose_port for a fresh URL). Traffic through the endpoint does NOT keep the node awake and is not billed; the server process (a detached run_command) is what holds the node running. Re-calling for an already-exposed port is idempotent: same URL, refreshed expiry. This tool never wakes a stopped node. A run_command wakes it, and the wake bills. Then call expose_port. Raw byte pipe behind the URL: streaming, SSE, and WebSocket all pass through. `vanity: "<label>"` additionally claims a human-readable hostname (`https://<label>.<ingress host>`) beside the capability URL - a PUBLIC alias, reachable by name with no secret (bearer auth still enforced), global first-come, freed when the endpoint dies; the same vanity on a re-expose keeps the name.

## Path parameters

- `name` string, required: Node name (from `list_nodes`).

## Query parameters

- `workspace` string

## Request body

- object
  - `auth` string, nullable: "capability-url" (default: anyone holding the returned URL reaches the port) or "bearer" (additionally require `Authorization: Bearer <token>` at the edge; the token is returned once).
  - `port` integer, required: The container port to expose (1024–65535).
  - `vanity` string, nullable: Claim a vanity hostname for this endpoint: a DNS label (lowercase letters, digits, '-'; 3-63 chars) served at `https://<vanity>.<ingress host>` beside the capability URL. A vanity name is GUESSABLE, so claiming one deliberately makes the port reachable by name alone (auth "bearer" still enforces its token at the edge). The namespace is global and first-come; reserved words and product prefixes are refused. The label frees when the endpoint dies (stop, expiry, unexpose_port); idempotent re-expose with the same vanity keeps it.

## Response `200`

The capability's JSON result.

- Result: The capability's result: the same object the MCP tool returns as structuredContent. Resources carry an `object` type discriminator and an immutable id; money is integer micro-dollars in `*_usd_micros` fields.
  - `object` string: The resource type, when the result is one resource.

## Other responses

- `400`: Malformed request: bad JSON, a parameter that does not parse, or a value outside its range. Code `invalid`.
- `401`: No bearer token, or one this API cannot verify. Code `unauthenticated`.
- `403`: Authenticated, but the token's scopes or the account's role do not reach this operation. The message names the scope word to request. Code `forbidden`.
- `404`: No such route. Code `not_found`; the body names the OpenAPI document.
- `422`: A well-formed request the platform declined: no such node, a cap reached, a state that forbids the move. The message says which, and what to do instead. Code `refused`.
- `429`: Over this door's per-customer budget. Wait `Retry-After` seconds. Code `rate_limited`.
- `500`: Our fault. Retry; if it persists, quote the request-id. Code `internal`.

---

[API](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api.md) · [All operations](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/givemeanode/apis/autoresearch-customer-api/revisions/f88dcb70ac6c?raw)
