# Source: https://github.com/jina-ai/jina/blob/master/docs/jina-ai-cloud/login.md# Login & Token ManagementTo use Jina AI Cloud, you need to log in, either via a GitHub or Google account. This section describes how to log in Jina AI Cloud and manage the personal access token. You can do it via webpage, CLI or Python API.## via WebpageVisit [https://jina.ai](https://jina.ai) and click on the "login" button.### Login```{figure} login-1.png```After log in you can see your name and avatar in the top-right corner.```{figure} login-2.png```### Token ManagementYou can follow the GUI to create/delete personal access tokens for your Jina-serve applications.```{figure} pat.png```To use a token, set it as the environment variable `JINA_AUTH_TOKEN`.## via CLI### Login```shelljina auth login```This will open browser automatically and login via 3rd party. Token will be saved locally.### LogoutIf there is a valid token locally, this will disable that token and remove it from local config.```shelljina auth logout```### Token Management#### Create a new PAT```shelljina auth token create <name of PAT> -e <expiration days>```To use a token, set it as the environment variable `JINA_AUTH_TOKEN`.#### List PATs```shelljina auth token list```#### Delete PAT```shelljina auth token delete <name of PAT>```## via Python APIInstalled along with Jina-serve, you can leverage the `hubble` package to manage login from Python### Login```pythonimport hubble# Log in via browser or PAT. The token is saved locally.# In Jupyter/Google Colab, interactive login is used automatically.# To disable this feature, run `hubble.login(interactive=False)`.hubble.login()```### Check login status```pythonimport hubbleif hubble.is_logged_in():    print('yeah')else:    print('no')```### Get a personal access tokenNotice that the token you got from this function is always valid. If the token is invalid or expired, the result is `None`.```pythonimport hubblehubble.get_token()```If you are using inside an interactive environment, i.e. user can input via stdin:```pythonimport hubblehubble.get_token(interactive=True)```Mark a function as login required,```pythonimport hubble@hubble.login_requireddef foo():    pass```### Logout```pythonimport hubble# If there is a valid token locally,# this will disable that token and remove it from local config.hubble.logout()```### Token managementAfter calling `hubble.login()`, you can use the client:```pythonimport hubbleclient = hubble.Client(max_retries=None, jsonify=True)# Get current user information.response = client.get_user_info()# Create a new personal access token for longer expiration period.response = client.create_personal_access_token(name='my-pat', expiration_days=30)# Query all personal access tokens.response = client.list_personal_access_tokens()```### Artifact management```pythonimport hubbleimport ioclient = hubble.Client(max_retries=None, jsonify=True)# Upload artifact to Hubble Artifact Storage by providing path.response = client.upload_artifact(f='~/Documents/my-model.onnx', is_public=False)# Upload artifact to Hubble Artifact Storage by providing `io.BytesIO`response = client.upload_artifact(    f=io.BytesIO(b"some initial binary data: \x00\x01"), is_public=False)# Get current artifact information.response = client.get_artifact_info(id='my-artifact-id')# Download artifact to local directory.response = client.download_artifact(id='my-artifact-id', f='my-local-filepath')# Download artifact as an io.BytesIO objectresponse = client.download_artifact(id='my-artifact-id', f=io.BytesIO())# Get list of artifacts.response = client.list_artifacts(filter={'metaData.foo': 'bar'}, sort={'type': -1})# Delete the artifact.response = client.delete_artifact(id='my-artifact-id')```### Error handling```pythonimport hubbleclient = hubble.Client()try:    client.get_user_info()except hubble.excepts.AuthenticationRequiredError:    print('Please login first.')except Exception:    print('Unknown error')```