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

# Create Directory

> Create directories in an agent runtime

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

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

response = runtime.file.create_directory(
    "/workspace/projects/demo",
    recursive=True,
    mode="755",
)
print(response.message)
print(response.path)

runtime.kill()
```

`recursive` defaults to `true` (equivalent to `mkdir -p`). `mode` is an optional chmod-style octal string (e.g. `"755"` or `"0755"`).

## Parameters

| Parameter   | Type    | Required | Description                                 |
| ----------- | ------- | -------- | ------------------------------------------- |
| `path`      | string  | Yes      | Directory path to create                    |
| `recursive` | boolean | No       | Create parent directories (default: `True`) |
| `mode`      | string  | No       | Octal directory mode, e.g. `"755"`          |

## Response

| Field     | Type    | Description                      |
| --------- | ------- | -------------------------------- |
| `message` | string  | Confirmation message             |
| `path`    | string  | Created directory path           |
| `success` | boolean | Present when returned by the API |
