> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nodepick.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Public IP Management API

> Dynamically attach and detach public IPv4 and IPv6 addresses to compute nodes.

Compute nodes receive private VPC networking upon creation. Routable public IPv4 and IPv6 addresses can be attached and detached dynamically post-provisioning.

## Endpoints

| Method | Endpoint | Description |
| - | - | - |
| `POST` | `/api/v1/nodes/{id}/network/ip` | Attach a public IPv4 or IPv6 address |
| `DELETE` | `/api/v1/nodes/{id}/network/ip` | Detach a public IP address from a node |

***

### Attach Public IP (`POST /api/v1/nodes/{id}/network/ip`)

```bash theme={null}
# Auto-allocate IPv4
curl -X POST https://api.nodepick.ai/api/v1/nodes/node_abc123/network/ip \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ip": "auto"}'

# Auto-allocate IPv6
curl -X POST https://api.nodepick.ai/api/v1/nodes/node_abc123/network/ip \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ip": "auto-ipv6"}'
```

#### Request Body

| Field | Type | Required | Description |
| - | - | - | - |
| `ip` | string | No | `"auto"` (IPv4), `"auto-ipv6"` (IPv6), or a specific public IP address string. Default: `"auto"`. |

#### Response (200 OK)

```json theme={null}
{
  "status": "attached",
  "ip": "184.105.163.137/26",
  "ipVersion": 4,
  "nodeId": "node_abc123"
}
```

***

### Detach Public IP (`DELETE /api/v1/nodes/{id}/network/ip`)

```bash theme={null}
curl -X DELETE https://api.nodepick.ai/api/v1/nodes/node_abc123/network/ip \
  -H "Authorization: Bearer YOUR_API_KEY"
```

To detach a specific IP address when a node has multiple attached IPs:

```bash theme={null}
curl -X DELETE "https://api.nodepick.ai/api/v1/nodes/node_abc123/network/ip?ip=184.105.163.137" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

***

## Python SDK

```python theme={null}
from nodepick import NodePickClient

client = NodePickClient(api_key="YOUR_API_KEY")

# Attach IPv4
client.attach_ip("node_abc123")

# Attach IPv6
client.attach_ip("node_abc123", version=6)

# Detach
client.detach_ip("node_abc123")
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.