# Command-line interface

Source: https://docs.oiy.ai/docs/developers/cli

Inspect services, adjust resources, and protect a subprocess.



Install the [Python package from source](/docs/developers/python). It provides the `oiy` command.

## Read account state [#read-account-state]

```sh
oiy services
oiy balance
oiy billing
oiy metrics SERVICE_ID --minutes 15
oiy storage list
```

Set `OIY_API_KEY` in your environment. Do not put secrets in command arguments.

## Manage a service [#manage-a-service]

```sh
oiy create service.json --request-id my-create-request-001
oiy pause SERVICE_ID --request-id my-pause-request-001
oiy wake SERVICE_ID --request-id my-wake-request-001
oiy restart SERVICE_ID --request-id my-restart-request-001
oiy resize SERVICE_ID --gpu 1 --gpu-model h200 --gpu-memory 141 --cpu 8 --memory 32 --request-id my-resize-request-001
```

Use the [service API schema](/docs/api/services) for `service.json`. Replace `SERVICE_ID` with a real service UUID. Whenever `--gpu` is greater than zero, supply a supported `--gpu-memory` for the selected model.

## Protect a process [#protect-a-process]

```sh
oiy run --service SERVICE_ID -- python train.py
```

The CLI runs `python train.py` **where you invoke the CLI** and protects the specified Oiy service with activity tracking. It is not a remote execution or code-upload command. Run it inside the managed instance when the subprocess should execute there.

## Independent storage [#independent-storage]

```sh
oiy storage create --name models --size 100 --region economy --geography oceania --request-id models-create-001
oiy storage get VOLUME_ID
oiy storage rename VOLUME_ID --revision 1 --name checkpoints --request-id models-rename-001
oiy storage resize VOLUME_ID --revision 2 --size 200 --request-id models-expand-001
```

Read the current revision before each update; the numbers above are illustrative. Pause an attached service before expansion. Storage cannot shrink.

## Destructive commands [#destructive-commands]

`oiy delete SERVICE_ID --yes` deletes a service and its service-owned workspace. Independent volumes are retained. `oiy storage delete VOLUME_ID --yes` removes an unattached independent volume. Verify the exact resource and maintain backups before running either command.

Use a unique request ID per intent and the same ID only for an identical retry.

## Billing reports [#billing-reports]

`oiy billing --from 2026-09-01 --to 2026-09-29` reads a full-window summary. Add `--view ledger --limit 30` for a page, then repeat the same dates and filters with `--cursor` for continuation. `--service` selects compute, `--volume` selects storage, and `--kind` selects a posting type. Dates are inclusive UTC dates; these reads do not initiate payment.
