# Getting Started

NannyML Cloud SDK is a Python package that enables programmatic interaction with NannyML Cloud. It allows you to automate all aspects of NannyML Cloud, including:

* Creating a model for monitoring.
* Logging inferences for analysis.
* Triggering model analysis

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1uRY74m_HwAjgwE4NmzlFjPh4TAS81tHl?usp=sharing)

If you prefer a video walkthrough, here's our YouTube guide:

{% tabs %}
{% tab title="Azure" %}
{% embed url="<https://youtu.be/P5XppzokFQ0>" %}

{% endtab %}

{% tab title="AWS" %}
{% embed url="<https://youtu.be/6b9TDjyHqTc>" %}
{% endtab %}
{% endtabs %}

## Installation

The `nannyml-cloud-sdk` package is available on PyPi and can be installed using your favorite package manager.&#x20;

## Compatibility

The following table shows which versions of the SDK are compatible with which versions of the NannyML Cloud product.

<table><thead><tr><th width="388">SDK version</th><th>NannyML Cloud version</th></tr></thead><tbody><tr><td>>=0.1.6</td><td>>=0.24.1</td></tr><tr><td></td><td></td></tr></tbody></table>

## Authentication

To use the NannyML Cloud SDK, you need to provide the URL of your NannyML Cloud instance and an API token to authenticate. You can obtain an API token on the [account settings](https://docs.nannyml.com/cloud/v0.24.1/product-tour/account-settings) page of your NannyML Cloud instance.

<figure><img src="https://content.gitbook.com/content/XHZtmbIWCoRBaGjIyKin/blobs/jl4q9w0Z2wsZnnC2jZTH/image.png" alt=""><figcaption><p>Link to account settings from the header</p></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/XHZtmbIWCoRBaGjIyKin/blobs/9RpsFKdJxurK2kAaKwaw/image.png" alt=""><figcaption><p>API tokens on account settings page</p></figcaption></figure>

After clicking the create button you'll be presented with a prompt to enter an optional description for the API token. We recommend describing what you intend to use the token for so you know which token to revoke later when you no longer need it. Copy the token from the prompt and store it in a secure location.

<div><figure><img src="https://content.gitbook.com/content/XHZtmbIWCoRBaGjIyKin/blobs/e1GsaHkPqUBZaeR8wWct/image.png" alt=""><figcaption><p>Create API token prompt</p></figcaption></figure> <figure><img src="https://content.gitbook.com/content/XHZtmbIWCoRBaGjIyKin/blobs/J6lGiJ71VdsTpb1yVoep/New%20api%20token.png" alt=""><figcaption><p>Generated token prompt</p></figcaption></figure></div>

Once you have an API token you can use it to authenticate the NannyML Cloud SDK. Either by inserting the token & URL directly into the python code:

```python
import nannyml_cloud_sdk as nml_sdk

nml_sdk.url = "https://beta.app.nannyml.com"
nml_sdk.api_token = r"api token goes here"
```

Or using environment variables:

```python
import nannyml_cloud_sdk as nml_sdk
import os

nml_sdk.url = os.environ['NML_SDK_URL']
nml_sdk.api_token = os.environ['NML_SDK_API_TOKEN']
```

{% hint style="info" %}
We recommend using an environment variable for the API token. This prevents accidentally leaking any token associated with your personal account when sharing code.
{% endhint %}
