Skip to main content

Access Token

Prerequisites

  • A valid MatrixHub account.
  • Access to at least one private repository or public repository (e.g., my-matrixhub-project/test-mn).
  • Hugging Face CLI installed locally, and the command hf auth login is available in your terminal.

Steps

Create Access Token

  1. Log in to the MatrixHub platform. Go to the Personal Center -> Access Token page.

    Access Token Overview

  2. Click Create Access Token, fill in a name (e.g., demo), select the expiration time (e.g., Never expires or a specific duration), and click Confirm.

    Create Access Token

  3. Once created, a window will pop up displaying the Token. Copy and save it immediately, as it will not be shown again.

    Save Access Token

Use Access Token

  1. Configure the service endpoint in your local terminal using your MatrixHub address:

    export HF_ENDPOINT="matrixhub.url" # example: http://127.0.0.1:xxx
  2. Run the login command:

    hf auth login
  3. Enter your saved Token when prompted to complete authentication.

  4. Execute a download command to verify access to the MatrixHub repository:

    hf download my-matrixhub-project/test-mn

Revoke Access Token

  1. Go to the Personal Center -> Access Token page, find the target Token, and perform the delete operation.

  2. Once revoked, any CLI operations requiring authentication with that Token will prompt that you are not logged in or the authentication is invalid.

Configuration Parameters

ParameterDescription
NameA descriptive identifier for the Token, useful for distinguishing different purposes.
ExpirationCan be set to Never expires or a custom date. It will automatically become invalid after this period.
Token ValueThe actual secret string used for authentication. It is only fully displayed once upon creation and must be copied and saved immediately.