---
title: "Open a public TCP port to a port of a sandbox: a database, a game server, anything that is not HTTP."
method: POST
path: "/v1/ports"
tags: ["ports"]
---

# Open a public TCP port to a port of a sandbox: a database, a game server, anything that is not HTTP.

`POST /v1/ports`

## Request

- Base URL: `https://api.withruntime.com`
- URL: `https://api.withruntime.com/v1/ports`
- Auth: HTTP bearer

Returns address:publicPort. Raw TCP, carried as it is; use your service's own authentication and TLS. Needs a kept top-up; at most 5 per sandbox and 20 per organization. Calling it again for the same sandbox and port returns the same public port.

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `sandboxId` string, required: The sandbox that serves it.
  - `port` integer, required: The port your server listens on inside the sandbox.

## Response `200`

Success

- object
  - `id` string
  - `sandboxId` string
  - `address` string: The public address to connect to.
  - `publicPort` integer
  - `connect` string: address:publicPort, for a client's host and port.
  - `protocol` string: tcp. UDP is not carried.
  - `disabled` boolean
  - `createdAt` string, date-time
  - `hint` string

## Other responses

- `default`: Error

---

[API](https://skmtc.dev/withruntime/apis/runtime-cloud-api.md) · [All operations](https://skmtc.dev/withruntime/apis/runtime-cloud-api/llms.txt) · [OpenAPI document](https://skmtc.dev/withruntime/apis/runtime-cloud-api/revisions/6f4012286988?raw)
