---
title: "Get started with the Anyscale SDK"
description: "Learn how to install, authenticate, and use the Anyscale Python SDK."
---

# Get started with the Anyscale SDK

This page provides an introduction to working with the Anyscale Python SDK. See [Anyscale Python SDK overview](/reference.md#sdk).

## 1\. Install the Python SDK

Anyscale packages the Python SDK with the Anyscale CLI. Use the following command to install the latest version of the Anyscale CLI and SDK:

```bash
pip install -U anyscale
```

## 2\. Authentication

The Python SDK uses an API key to authenticate to Anyscale. See [Manage API keys](/auth/api-keys.md).

Run the following Anyscale CLI command to authenticate to your organization:

```bash
anyscale login
```

API keys issued by `anyscale login` expire after 7 days.

:::caution
Be sure to keep your API key private and secure to prevent unwanted access to your Anyscale resources.
:::

## 3\. Test it out

To verify that everything is working, try creating a new Project using the SDK.

```python
import anyscale

project_id: str = anyscale.project.create(
    name="my-project",
    parent_cloud_id="my-cloud-id",
    description="my-project-description"
)

print(f"Project created successfully: https://console.anyscale.com/projects/{project_id}")
```

If everything is working, you should see the success statement as output.

```bash
Project created successfully: https://console.anyscale.com/projects/prj_1234
```

## SDK reference

Browse the full SDK reference by module:

-   [Aggregated instance usage](/reference/sdk/aggregated-instance-usage.md#aggregated-instance-usage-sdk)
-   [Cloud](/reference/sdk/cloud.md#cloud-sdk)
-   [Compute config](/reference/sdk/compute-config.md#compute-config-sdk)
-   [Image](/reference/sdk/image.md#image-sdk)
-   [Job](/reference/sdk/job.md#job-sdk)
-   [Job queue](/reference/sdk/job-queue.md#job-queue-sdk)
-   [Organization invitation](/reference/sdk/organization-invitation.md#organization-invitation-sdk)
-   [Policy](/reference/sdk/policy.md#policy-sdk)
-   [Project](/reference/sdk/project.md#project-sdk)
-   [Resource quotas](/reference/sdk/resource-quotas.md#resource-quotas-sdk)
-   [Schedule](/reference/sdk/schedule.md#schedule-sdk)
-   [Service](/reference/sdk/service.md#service-sdk)
-   [Service account](/reference/sdk/service-account.md#service-account-sdk)
-   [User](/reference/sdk/user.md#user-sdk)
-   [User group](/reference/sdk/user-group.md#user-group-sdk)
-   [Workspaces](/reference/sdk/workspaces.md#workspaces-sdk)

---

Previous: [Workspaces](/reference/cli/workspaces.md) | Next: [Aggregated instance usage](/reference/sdk/aggregated-instance-usage.md)