# 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.

| SDK Version | NannyML Cloud Version |
| ----------- | --------------------- |
| >=0.1.6     | >=0.24.1              |
|             |                       |

## 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/product-tour/account-settings) page of your NannyML Cloud instance.

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

<figure><img src="https://content.gitbook.com/content/2wXpsFdZLc0Ed8e18KiO/blobs/uv3QbqMiNAhjFQezVwU7/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/2wXpsFdZLc0Ed8e18KiO/blobs/imySqe2QpcDLEQLId1fO/image.png" alt=""><figcaption><p>Create API token prompt</p></figcaption></figure> <figure><img src="https://content.gitbook.com/content/2wXpsFdZLc0Ed8e18KiO/blobs/hWjMXb8YXxXcw6E6zDgR/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 %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nannyml.com/cloud/nannyml-cloud-sdk/getting-started.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
