-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: marcopeix <[email protected]>
- Loading branch information
Showing
18 changed files
with
1,211 additions
and
1,907 deletions.
There are no files selected for viewing
427 changes: 11 additions & 416 deletions
427
nbs/docs/getting-started/1_getting_started_short.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,16 +4,16 @@ | |
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Setting Up Your Authentication Token " | ||
"# Setting Up Your Authentication API Key" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"A **token**, also known as an **API Key**, is a unique string of characters that serves as a key to authenticate your requests to `TimeGTP`. This tutorial will explain how to set up your token when using the Nixtla SDK. \n", | ||
"An **API key** is a unique string of characters that serves as a key to authenticate your requests to `TimeGTP`. This tutorial will explain how to set up your API key when using the Nixtla SDK. \n", | ||
"\n", | ||
"Upon [registration](https://dashboard.nixtla.io/), you will recibe an email asking you to confirm your signup. After confirming, you will receive access to your dashboard. There, under `API Keys`, you will find your token. To integrate your token into your development workflow with the Nixtla SDK, you have two methods. " | ||
"Upon [registration](https://dashboard.nixtla.io/), you will recibe an email asking you to confirm your signup. After confirming, you will receive access to your dashboard. There, under `API Keys`, you will find your API key. To integrate your API key into your development workflow with the Nixtla SDK, you have two methods. " | ||
] | ||
}, | ||
{ | ||
|
@@ -22,27 +22,18 @@ | |
"source": [ | ||
"## 1. Direct copy and paste \n", | ||
"\n", | ||
"- **Step 1**: Copy the token found in the `API Keys` of your [dashboard]((https://dashboard.nixtla.io/)). \n", | ||
"- **Step 2**: Instantiate the `NixtlaClient` class by directly pasting your token into the code, as shown below:" | ||
"- **Step 1**: Copy the API key found in the `API Keys` of your [dashboard]((https://dashboard.nixtla.io/)). \n", | ||
"- **Step 2**: Instantiate the `NixtlaClient` class by directly pasting your API key into the code, as shown below:" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stderr", | ||
"output_type": "stream", | ||
"text": [ | ||
"/home/ubuntu/projects/nixtla/nixtlats/nixtla_client.py:56: FutureWarning: `'token'` is deprecated; use `'api_key'` instead.\n", | ||
" warnings.warn(\n" | ||
] | ||
} | ||
], | ||
"outputs": [], | ||
"source": [ | ||
"from nixtlats import NixtlaClient \n", | ||
"nixtla_client = NixtlaClient(token = 'your token here')" | ||
"nixtla_client = NixtlaClient(api_key ='your API key here')" | ||
] | ||
}, | ||
{ | ||
|
@@ -63,26 +54,15 @@ | |
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"- **Step 1:** Store your token in an environment variable named `NIXTLA_API_KEY`. This can be done for a session or permanently, depending on your preference.\n", | ||
"- **Step 1:** Store your API key in an environment variable named `NIXTLA_API_KEY`. This can be done for a session or permanently, depending on your preference.\n", | ||
"- **Step 2:** When you instantiate the `NixtlaClient` class, the SDK will automatically look for the `NIXTLA_API_KEY` environment variable and use it to authenticate your requests." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"True" | ||
] | ||
}, | ||
"execution_count": null, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"outputs": [], | ||
"source": [ | ||
"#| hide\n", | ||
"from dotenv import load_dotenv\n", | ||
|
@@ -123,7 +103,7 @@ | |
"Use the `export` command to set `NIXTLA_API_KEY`. \n", | ||
"\n", | ||
"``` bash\n", | ||
"export NIXTLA_API_KEY=your_token\n", | ||
"export NIXTLA_API_KEY=your_api_key\n", | ||
"```" | ||
] | ||
}, | ||
|
@@ -133,11 +113,11 @@ | |
"source": [ | ||
"### b. Using a `.env` file\n", | ||
"\n", | ||
"For a more persistent solution that can be version-controlled if private, or for ease of use across different projects, place your token in a `.env` file.\n", | ||
"For a more persistent solution that can be version-controlled if private, or for ease of use across different projects, place your API key in a `.env` file.\n", | ||
"\n", | ||
"``` bash\n", | ||
"# Inside a file named .env\n", | ||
"NIXTLA_API_KEY=your_token\n", | ||
"NIXTLA_API_KEY=your_api_key\n", | ||
"```" | ||
] | ||
}, | ||
|
@@ -165,50 +145,32 @@ | |
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"This approach is more secure and suitable for applications that will be deployed or shared, as it keeps tokens out of the source code." | ||
"This approach is more secure and suitable for applications that will be deployed or shared, as it keeps API keys out of the source code." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"::: {.callout-important}\n", | ||
"Remember, your token is like a password - keep it secret, keep it safe!\n", | ||
"Remember, your API key is like a password - keep it secret, keep it safe!\n", | ||
"::: " | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Validate your token\n", | ||
"## Validate your API key\n", | ||
"\n", | ||
"You can always find your token in the `API Keys` section of your dashboard. To check the status of your token, use the `validate_api_key` method of the `Nixtla` class. This method will return `True` if the token is valid and `False` otherwise. " | ||
"You can always find your API key in the `API Keys` section of your dashboard. To check the status of your API key, use the `validate_api_key` method of the `NixtlaClient` class. This method will return `True` if the API key is valid and `False` otherwise. " | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stderr", | ||
"output_type": "stream", | ||
"text": [ | ||
"INFO:nixtlats.nixtla_client:Happy Forecasting! :), If you have questions or need support, please email [email protected]\n" | ||
] | ||
}, | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"True" | ||
] | ||
}, | ||
"execution_count": null, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"outputs": [], | ||
"source": [ | ||
"nixtla_client.validate_api_key()" | ||
] | ||
|
@@ -217,7 +179,7 @@ | |
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"You don't need to validate your token every time you use `TimeGPT`. This function is provided for your convenience to ensure its validity. For full access to `TimeGPT`'s functionalities, in addition to a valid token, you also need sufficient credits in your account. You can check your credits in the `Usage` section of your [dashboard]((https://dashboard.nixtla.io/)). " | ||
"You don't need to validate your API key every time you use `TimeGPT`. This function is provided for your convenience to ensure its validity. For full access to `TimeGPT`'s functionalities, in addition to a valid API key, you also need sufficient credits in your account. You can check your credits in the `Usage` section of your [dashboard]((https://dashboard.nixtla.io/)). " | ||
] | ||
} | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
"source": [ | ||
"## Table of contents\n", | ||
"- [TimeGPT](#timegpt)\n", | ||
"- [TimeGPT Token](#timegpt-token)\n", | ||
"- [TimeGPT API Key](#timegpt-api-key)\n", | ||
"- [Features and Capabilities](#features-and-capabilities)\n", | ||
"- [Fine-tuning](#finetuning)\n", | ||
"- [Pricing and Billing](#pricing-and-billing)\n", | ||
|
@@ -57,35 +57,35 @@ | |
"\n", | ||
"- Via the `TimeGPT` API. For instructions on how to call the API using different languages, please refer to the [API documentation](https://docs.nixtla.io/reference/timegpt_timegpt_post)\n", | ||
"\n", | ||
"Both methods require you to have a [token](#timegpt-token), which is obtained upon registration and can be found in your dashboard under `API Keys`." | ||
"Both methods require you to have a [API key](#timegpt-api-key), which is obtained upon registration and can be found in your dashboard under `API Keys`." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## TimeGPT Token" | ||
"## TimeGPT API Key" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### What is a token?\n", | ||
"### What is an API key?\n", | ||
"\n", | ||
"A token, also known as an API Key, is a unique string of characters that serves as a key to authenticate your requests when using the Nixtla SDK. It ensures that the person making the requests is authorized to do so.\n", | ||
"An API key is a unique string of characters that serves as a key to authenticate your requests when using the Nixtla SDK. It ensures that the person making the requests is authorized to do so.\n", | ||
"\n", | ||
"### Where can I get a token? \n", | ||
"### Where can I get an API key? \n", | ||
"\n", | ||
"Upon registration, you will receive a token that can be found in your [dashboard](https://dashboard.nixtla.io/) under `API Keys`. Remember that your token is personal and should not be shared with anyone.\n", | ||
"Upon registration, you will receive an API key that can be found in your [dashboard](https://dashboard.nixtla.io/) under `API Keys`. Remember that your API key is personal and should not be shared with anyone.\n", | ||
"\n", | ||
"### How do I use my token?\n", | ||
"### How do I use my API key?\n", | ||
"\n", | ||
"To integrate your token into your development workflow, please refer to the tutorial on [Setting Up Your Authentication Token](https://docs.nixtla.io/docs/setting_up_your_authentication_token). \n", | ||
"To integrate your API key into your development workflow, please refer to the tutorial on [Setting Up Your Authentication API Key](https://docs.nixtla.io/docs/setting_up_your_authentication_api_key). \n", | ||
"\n", | ||
"### How can I check the status of my token?\n", | ||
"### How can I check the status of my API key?\n", | ||
"\n", | ||
"If you want to check the status of your token, you can use the [`validate_token` method](https://nixtlaverse.nixtla.io/nixtla/timegpt.html#timegpt-validate-token) of the `TimeGPT` class. " | ||
"If you want to check the status of your API key, you can use the [`validate_api_key` method](https://nixtlaverse.nixtla.io/nixtla/timegpt.html#timegpt-validate-api-key) of the `NixtlaClient` class. " | ||
] | ||
}, | ||
{ | ||
|
@@ -216,15 +216,6 @@ | |
"Billing is done within the first five days of each month. We have partnered with Stripe to handle all payment processing. You can view your invoices and payment history in your [dashboard](https://dashboard.nixtla.io/) under `Billing`. " | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"::: {.callout-warning}\n", | ||
"Don't confuse the input, output, and finetune tokens with the TimeGPT token or API Key. The input, output, and finetune tokens are used to calculate your usage costs, while the TimeGPT token is used to authenticate your requests.\n", | ||
"::: " | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
|
@@ -271,7 +262,7 @@ | |
"ApiError: status_code: 401, body: {'data': None, 'message': 'Invalid API key', 'details': 'Key not found', 'code': 'A12', 'requestID': 'E7F2BBTB2P', 'support': 'If you have questions or need support, please email [email protected]'}\n", | ||
"```\n", | ||
"\n", | ||
"**Solution:** This error occurs when your `TimeGPT` token is either invalid or has not been set up correctly. Please use the `validate_token` method to verify it or make sure it was copied correctly from the `API Keys` section of your [dashboard](https://dashboard.nixtla.io/)." | ||
"**Solution:** This error occurs when your `TimeGPT` API key is either invalid or has not been set up correctly. Please use the `validate_api_key` method to verify it or make sure it was copied correctly from the `API Keys` section of your [dashboard](https://dashboard.nixtla.io/)." | ||
] | ||
}, | ||
{ | ||
|
Oops, something went wrong.