# How-To: Create User Access Token

* **Workload-Specific**: Tokens created are specific to one user and one workload. Unassigned tokens can be linked to a workload later.
* **Expiration**: Tokens are valid for 30 days and must be renewed upon expiration.
* **Token Management**: After creation, tokens can be updated, or reassigned, or their status (active/cancelled) can be changed as needed.

{% tabs %}
{% tab title="🌐 Console - For a Specific Model" %}
Follow these steps to create a token for a specific model through the LatticaAI web console:

<figure><img src="https://1094188974-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVQmLdqLyUJqGzvb6ZjlN%2Fuploads%2Fy0CaSpvSA7mPt30sHgae%2FCreateToken.png?alt=media&#x26;token=86cd4a7d-56d5-4edf-b1a3-ff678a0afd65" alt=""><figcaption><p>Create Token Flow</p></figcaption></figure>

{% stepper %}
{% step %}

### Navigate to Workload's Token Management

Go to the **Token Management** section of the specific Workload on the dashboard.
{% endstep %}

{% step %}

### Create a New Token

* Click **Create Token**.
* Enter a **name** for the token for easy identification.
* Specify the **Workload** to which the token will be linked.

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><em>Optional</em>: Leave the workload field empty if you want to create an unassigned token.</p></div>

{% endstep %}

{% step %}

### Generate

Click **Generate** to generate the token.\
The new token will appear in the list, where you can manage its attributes, status, or assignment.
{% endstep %}

{% step %}

### Copy the Token Value

After the token is generated, the system displays the token value. Copy this token value for future use.&#x20;

{% hint style="warning" %}
The token is not stored in the system and cannot be retrieved later.
{% endhint %}
{% endstep %}

{% step %}

### Review and Confirm

* Verify all token details.
* Click **Done** to save the token.
  {% endstep %}

{% step %}

### Delete if Incorrect

If the token details were entered incorrectly, click **Delete** to remove the token and start the process again.
{% endstep %}
{% endstepper %}
{% endtab %}

{% tab title="🌐 Console - From the Tokens List Page" %}
You can create tokens directly from the **Tokens List** page. This process is useful for creating unassigned tokens or managing tokens centrally.

<figure><img src="https://1094188974-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVQmLdqLyUJqGzvb6ZjlN%2Fuploads%2FqgJJZ0xErNzWM2BJwScb%2FTokensList.png?alt=media&#x26;token=188e1ea5-88eb-4021-bdb2-ecc0c9a64bcc" alt=""><figcaption></figcaption></figure>

1. **Navigate to the Tokens Page**\
   Log in to the web console and go to the **Tokens** section.
2. **Click "Add Token"**
   * Click the **Add Token** button to open the token creation window.
   * Fill in the token details
     * &#x20;Note: The end user cannot use unassigned tokens until they are linked to a model.
3. **Generate the Token**\
   Click **Generate Token** to create the token.
4. **Copy the Token Value**
   * After the token is generated, the system displays the token value.
   * **Important**: Copy this token value for future use. The token is not stored in the system and cannot be retrieved later.
5. **Review and Confirm**
   * Verify all token details.
   * Click **Done** to save the token.
6. **Delete if Incorrect**
   * If the token details were entered incorrectly, click **Delete** to remove the token and start the process again.
     {% endtab %}

{% tab title="🧊 Python SDK" %}
{% hint style="info" %}
Keep the generated token in a secure place!
{% endhint %}

```python
# Generate Token

import LatticaManagement

# Authenticate
lattica = LatticaManagement("your_license_from_lattica_console")

# Register a new model...
model_id = lattica.create_model("model_name")

# Generate a token
token_id, token = lattica.generate_query_token(model_id, "token_name")

```

{% endtab %}
{% endtabs %}
