# unikraft api

Make an authenticated HTTP request to the Unikraft Cloud API.

```
unikraft api <endpoint> [flags]
```

## Examples

List instances in the default metro:

```bash
unikraft api /v1/instances
```

Get the current user's quotas:

```bash
unikraft api /v1/users/quotas
```

Inspect a specific instance by UUID:

```bash
unikraft api /v1/instances/abc123-...-def456
```

Create a new 256MB volume in a specific metro:

```bash
unikraft api /v1/volumes --metro=fra -d '{"name":"data","size_mb":256}'
```

Create resources from a JSON file:

```bash
unikraft api /v1/volumes -d @volume.json
```

Delete an instance by UUID:

```bash
unikraft api /v1/instances/abc123-...-def456 -X DELETE
```

Pipe a request body in from stdin:

```bash
unikraft api /v1/volumes -d @-
```

Check the health of the API:

```bash
unikraft api /v1/healthz
```

## Options

```
  -d, --data DATA             HTTP request body. Use @path to read from a file, or @- to read from stdin.
  -H, --header HEADER         Add an HTTP header in 'Key: Value' format. May be repeated.
  -k, --insecure              Skip TLS certificate verification.
  -X, --method method         HTTP method to use. Defaults to GET, or POST if --data is set.
  --metro name                Metro to target. Defaults to the profile's default metro.
```

## Options inherited from parent commands

```
  --config file               Path to the configuration file.
  --log-level level           Set the logging level. (default info)
  --log-type type             Set the log type. (default text)
  --profile name              Set the current profile.
  --telemetry                 Toggle anonymous usage analytics. (default true)
```

## See Also

* [`unikraft`](../unikraft.mdx): The Unikraft Command-Line Interface.

