<jupyter_start><jupyter_text>AuthenticationThis guide focuses on the basics of authentication in CARTOframes.Authentication is needed to store your data tables and map visualizations in your CARTO account, to use [Data Services](/developers/cartoframes/guides/Data-Services/) (geocoding, isolines) or the [Data Observatory](/developers/cartoframes/guides/Data-Observatory/) (download, enrichment). If you don't already have an account, you can [create one here](https://carto.com/signup/).> You don't need to be authenticated to visualize your local data with CARTOframes.  Getting your API KeyOnce you have created an account, you need to get your **Master API Key**. The API keys page can be accessed from your [CARTO Dashboard](https://carto.com/help/tutorials/your-dashboard-overview/). Once there, click on your avatar to open the dashboard menu. The API keys link will be shown.![API Keys link - CARTO Dashboard](img/credentials/dashboard.png)From here, copy the **Master** API Key to use in the next section.![Master API Key - CARTO Dashboard](img/credentials/api-keys.png)  Setting your credentials[Credentials](/developers/cartoframes/reference/heading-Auth) class is used to load your credentials in CARTOframes. This should be passed to every method that interacts with your CARTO account. You can create multiple instances of credentials to manage different CARTO accounts.There are different ways to set them but we recommend using the one that reads the credentials from a JSON file:```pyfrom cartoframes.auth import Credentialscreds = Credentials.from_file('creds.json')```With [set_default_credentials](/developers/cartoframes/reference/heading-Auth), the same user's authentication will be used by every CARTOframes component by default, so you don't need to pass the parameter to every method that requires it.```pyfrom cartoframes.auth import set_default_credentialsset_default_credentials('creds.json')```Example `creds.json` file using the credentials above:```json{  "username": "johnsmith",  "api_key": "<KEY>"}```  Credential parameters- `username`: your CARTO account username- `api_key`: your CARTO account API Key. If the data to be accessed is **public**, it can be set to `default_public`- `base_url`: only needed for on-premise or custom installations. Typically in the form of `https://username.carto.com/` for user `username`. On-premises installation (and others) may have a different URL pattern.  Google Cloud credentialsCARTO's [Data Observatory](/developers/cartoframes/guides/Data-Observatory/) is built on top of Google BigQuery, so every CARTO Enterprise organization has an associated Google Cloud account to run Data Observatory operations.In case you have an Enterprise account and want to perform data operations directly with the Python BigQuery client, you can obtain the credentials of the associated Google Cloud account and create a Google Credentials instance.<jupyter_code>from cartoframes.auth import Credentials
from google.oauth2.credentials import Credentials as GoogleCredentials

creds = Credentials.from_file('creds.json')

gcloud_project, gcloud_token = creds.get_gcloud_credentials()
gcloud_credentials = GoogleCredentials(gcloud_token)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07811531308121512, 'fraction_numerical': 0.00030998140111593303, 'mean_word_length': 5.895299145299146, 'pattern_counts': {'":': 2, '<': 6, '<?xml version=': 0, '>': 7, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '422383', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 862, 'n_tokens_neox': 827, 'n_words': 362, 'path': 'docs/guides/02-Authentication.ipynb', 'repo_name': 'CartoDB/cartoframes', 'size': '3261'}