---
title: "Connect Environment"
method: POST
path: "/v1/accounts/{account_id}/environments/{environment_id}:connect"
tags: ["gateway.openapi_Gateway"]
---

# Connect Environment

`POST /v1/accounts/{account_id}/environments/{environment_id}:connect`

Connects the environment to a node pool.
Returns an error if there is an existing pending connection.

## Path parameters

- `account_id` string, required
- `environment_id` string, required

## Request body

- GatewayConnectEnvironmentBody
  - `connection` GatewayEnvironmentConnection, required
    - `nodePoolId` string, required — The resource id of the node pool the environment is connected to.
    - `numRanks` integer — For GPU node pools: one GPU per rank w/ host packing, for CPU node pools: one host per rank. If not specified, the default is 1.
    - `role` string — The ARN of the AWS IAM role that the connection should assume. If not specified, the connection will fall back to the node pool's node_role.
    - `zone` string — Current for the last zone that this environment is connected to. We want to warn the users about cross zone migration latency when they are connecting to node pool in a different zone as their persistent volume.
    - `useLocalStorage` boolean — If true, the node's local storage will be mounted on /tmp. This flag has no effect if the node does not have local storage.
  - `vscodeVersion` string

## Response `200`

A successful response.

- object

---

[API](https://skmtc.net/fw-ai-external/apis/gateway-rest-api.md) · [All operations](https://skmtc.net/fw-ai-external/apis/gateway-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/fw-ai-external/gateway-rest-api/revisions/29a1e4db152c/schema)
