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

# Terminate Runtime

> Terminate a runtime and release resources

```python theme={null}
from gravixlayer import GravixLayer

client = GravixLayer()
runtime = client.runtime.create(template="python-3.14-base-small")

response = client.runtime.kill(runtime.runtime_id)
print(response.message)
```

## Parameters

| Parameter    | Type   | Required | Description          |
| ------------ | ------ | -------- | -------------------- |
| `runtime_id` | string | Yes      | Runtime to terminate |

## Response

| Field        | Type   | Description           |
| ------------ | ------ | --------------------- |
| `message`    | string | Confirmation message  |
| `runtime_id` | string | Terminated runtime ID |

<Warning>
  Termination is immediate. Download any files you need before calling `kill`.
</Warning>

Use `try/finally` to guarantee cleanup:

```python theme={null}
from gravixlayer import GravixLayer

client = GravixLayer()
runtime = client.runtime.create(template="python-3.14-base-small")

try:
    result = runtime.run_code(code="print('working')")
    print(result.text)
finally:
    runtime.kill()
```
