> ## 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.

# DELETE /nodes/{id} — Delete a nodepick.ai Compute Node

> DELETE /nodes/{id} permanently terminates a nodepick.ai compute node and stops billing immediately. This action cannot be undone.

Sending a `DELETE` request to `/nodes/{id}` permanently terminates the specified compute node and halts per-second billing at that exact moment. The node transitions to a `deleting` status as it is torn down, and all data stored on it is wiped. Because this action is irreversible, make sure you have saved any work you need before calling this endpoint.

## Endpoint

```
DELETE https://api.nodepick.ai/nodes/{id}
```

## Path Parameters

<ParamField path="id" type="string" required>
  The unique node ID you want to delete. This is the `id` value returned when you created the node. Example: `node_abc123`
</ParamField>

## Request Example

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

## Response

A successful deletion returns HTTP `204 No Content` with an empty response body. There is no JSON payload to parse — a `204` status code alone confirms the node has been scheduled for termination and billing has stopped.

## Python SDK

The `delete_node()` method on the nodepick.ai client wraps this endpoint:

```python theme={null}
client.delete_node("node_abc123")
print("Node deleted successfully")
```

<Warning>
  Deletion is permanent and immediate — all data stored on the node is lost the moment it is terminated. There is no recovery option. Billing stops at the exact moment of deletion, so always delete nodes as soon as you are finished with them.
</Warning>

## Guaranteed Cleanup with try/finally

When you provision nodes programmatically, use a `try/finally` block to ensure every node you create is deleted even if your script raises an exception partway through:

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

client = nodepick(api_key="YOUR_API_KEY")
nodes_to_cleanup = []

try:
    node = client.create_node()
    nodes_to_cleanup.append(node["id"])
    # ... do your work ...
finally:
    for node_id in nodes_to_cleanup:
        client.delete_node(node_id)
    client.close()
```

This pattern guarantees that your cleanup logic runs regardless of whether the main body of your script succeeds or fails, preventing orphaned nodes from accruing unexpected charges.

## Error Responses

| Code  | Description                                                                                                                       |
| ----- | --------------------------------------------------------------------------------------------------------------------------------- |
| `401` | Unauthorized — your API key is missing or invalid.                                                                                |
| `404` | Not found — no node with the given ID exists on your account. The node may have already been deleted, or the ID may be incorrect. |
