> ## Documentation Index
> Fetch the complete documentation index at: https://cobo-docs-feature-cobo-cli.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get started with Python SDK

## Overview

This guide introduces how to get started with using the Cobo WaaS 2.0 Python SDK, which allows you to integrate the WaaS service into your existing application using the Python programming language.

To learn more about the initial setup steps necessary for utilizing the WaaS API, see [Get started with Wallet-as-a-Service (WaaS) 2.0](/v2/guides/get-started/get-started-with-waas).

## Prerequisites

* You have installed Python 3.7 or newer.
* Follow the instructions in [Quick start guide](https://manuals.cobo.com/en/portal/quick-start-guide) to set up your Cobo account and create your organization. If an organization has already been set up, ask your organization admin to invite you to join the organization.
* You have [generated an API key](/v2/guides/overview/cobo-auth#generate-an-api-key), and [registered the API key](https://manuals.cobo.com/en/portal/developer-console/create-api-key) on Cobo Portal.

## Install the SDK

1. Install the SDK using the pip install command.
   Open a terminal window and run the following command:

   ```shell
   pip install cobo-waas2=={VERSION}
   ```

<Note>Replace \{VERSION} with the lastest version number, for example, `1.2.0`. Obtain the latest version number from the [GitHub repository](https://github.com/CoboGlobal/cobo-waas2-python-sdk/tags).</Note>

2. Import the package in your project files as follows:

   ```python
   import cobo_waas2
   ```

## Configure API key and HTTP host

You can refer to the [configuration.py file](https://github.com/CoboGlobal/cobo-waas2-python-api/blob/master/cobo_waas2/configuration.py) in the SDK repository for all supported configuration parameters.

```python
configuration = cobo_waas2.Configuration(

  # Replace `<YOUR_PRIVATE_KEY>` with your private key.
  api_private_key="<YOUR_PRIVATE_KEY>",

  # To use the development environment, set the host to `https://api.dev.cobo.com/v2`.
  # To use the production environment, set the host to `https://api.cobo.com/v2`.
  host="https://api.dev.cobo.com/v2"

)
```

## Code samples

For operation-specific documentation and sample code, see the [docs](https://github.com/CoboGlobal/cobo-waas2-python-api/tree/master/docs) folder in the WaaS SDK GitHub repository.

### List supported chains

```python
import cobo_waas2
from pprint import pprint

configuration = cobo_waas2.Configuration(
   # Replace `<YOUR_PRIVATE_KEY>` with your private key
   api_private_key="<YOUR_PRIVATE_KEY>",
   # Use the development environment
   host="https://api.dev.cobo.com/v2"
)

# Enter a context with an instance of the API client
with cobo_waas2.ApiClient(configuration) as api_client:
   # Create an instance of the API class
   api_instance = cobo_waas2.WalletsApi(api_client)
   try:
       # List all supported chains
       api_response = api_instance.list_supported_chains()
       print("The response of WalletsApi->list_supported_chains:\n")
       pprint(api_response)
   except Exception as e:
       print("Exception when calling WalletsApi->list_supported_chains: %s\n" % e)
```

### Create a wallet

```python
import cobo_waas2
from pprint import pprint

from cobo_waas2 import CreateCustodialWalletParams, WalletType, WalletSubtype

configuration = cobo_waas2.Configuration(
    # Replace `<YOUR_PRIVATE_KEY>` with your private key
    api_private_key="<YOUR_PRIVATE_KEY>",
    # Use the development environment
    host="https://api.dev.cobo.com/v2"
)
# Enter a context with an instance of the API client
with cobo_waas2.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = cobo_waas2.WalletsApi(api_client)
    create_wallet_params = cobo_waas2.CreateWalletParams(
        actual_instance=CreateCustodialWalletParams(
            name="New Custodial Wallet",
            wallet_type=WalletType.CUSTODIAL,
            wallet_subtype=WalletSubtype.ASSET,
        ),
    )
    try:
        # Create a Custodial Wallet
        api_response = api_instance.create_wallet(create_wallet_params=create_wallet_params)
        print("The response of WalletsApi->create_wallet:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling WalletsApi->create_wallet: %s\n" % e)
```
