---
title: "Service account CLI reference"
description: "Customer-hosted cloud features"
---

# Service account CLI reference

#### Customer-hosted cloud features

:::note
Some features are only available on customer-hosted clouds. Reach out to [support@anyscale.com](mailto:support@anyscale.com) for info.
:::

## Service account CLI

### `anyscale service-account create`

**Usage**

`anyscale service-account create [OPTIONS]`

Create a service account.

**Options**

-   **`--name/-n`**: Name for the service account.

### `anyscale service-account create-api-key`

**Usage**

`anyscale service-account create-api-key [OPTIONS]`

Create a new API key for a service account.

**Options**

-   **`--email`**: Email of the service account to create the new key for.
-   **`--name`**: Name of the service account to create the new key for.

### `anyscale service-account list`

**Usage**

`anyscale service-account list [OPTIONS]`

List service accounts.

**Options**

-   **`--max-items`**: Max items to show in list.

### `anyscale service-account delete`

**Usage**

`anyscale service-account delete [OPTIONS]`

Delete a service account.

**Options**

-   **`--email`**: Email of the service account to delete.
-   **`--name`**: Name of the service account to delete.

## Service account models

### `ServiceAccount`

Service account

#### Fields

-   **`name` (str)**: Name of the service account.
-   **`created_at` (datetime)**: The timestamp when this service account was created.
-   **`permission_level` ([OrganizationPermissionLevel](#organizationpermissionlevel))**: The organization permission level of the service account.
-   **`email` (str)**: Email of the service account.

#### Python Methods

```python
def to_dict(self) -> Dict[str, Any]
    """Return a dictionary representation of the model."""
```

#### Examples

::::tabs

:::tab[Python]
```python
import anyscale
from anyscale.service_account.models import ServiceAccount

service_accounts: List[ServiceAccount] = anyscale.service_account.list()
```
:::

::::

### `OrganizationPermissionLevel`

Permission levels for service accounts in an organization.

#### Values

-   **`OWNER`**: Owner permission level for the organization
-   **`COLLABORATOR`**: Collaborator permission level for the organization

---

Previous: [SCIM](/reference/cli/scim.md) | Next: [Service](/reference/cli/service.md)