Skip to main content

Access Token

What is Access Token?

Access tokens authenticate your identity and allow applications to perform actions based on token permissions. You can manage your access tokens in your settings.

accesstoken

You can click copy button to copy your access token, paste it in your application code, or use it in your HTTP requests.

Refreshing Access Token

Do not share your Access Tokens with anyone. The action might give access to your account and can be used to make changes to your data. If you leak your Access Token, you should refresh it immediately.

Click "Refresh Access Token" button to generate a new one.

How to use Access Tokens?

Access Tokens can be used in the following ways:

  • Used in place of a password to access the git services.
git lfs install
git clone https://demo:your_access_token@opencsg.com/datasets/demo/demo.git
  • Passed as a bearer token when calling the server API.
curl --location 'https://hub.opencsg.com/api/v1/user/user_name_1/run/mode' --header 'Authorization: Bearer your_access_token'
  • Used in the CSGHub SDK.
from pycsghub.snapshot_download import snapshot_download
token = "your_access_token"

endpoint = "https://hub.opencsg.com"
repo_id = 'OpenCSG/csg-wukong-1B'
cache_dir = '/Users/hhwang/temp/'
result = snapshot_download(repo_id, cache_dir=cache_dir, endpoint=endpoint, token=token)