> For the complete documentation index, see [llms.txt](https://platformdocs.lattica.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://platformdocs.lattica.ai/how-to-guides/access-control/how-to-assign-token-to-workload.md).

# How-To: Assign Token to Workload

A **User Access Token** provides access permission for a specific user to a specific workload. Tokens can be assigned to a workload either during their [creation ](/how-to-guides/access-control/how-to-create-user-access-token.md)or later if the token is unassigned. This guide explains how to assign a token to a model using the **web console**, focusing on assignment from the **Workload's Details Management Screen**

## Via Token's Attributes Modification (Web Console or Python SDK)

Tokens can be assigned to models by modifying their attributes. This method allows you to assign tokens from the **Tokens Page** in the web console or through the Python SDK.\
For detailed instructions, see: \[How-To: [Modify Token's Parameters](/how-to-guides/access-control/how-to-modify-user-access-token-setting.md)].

## Via the Workload's Details Management Screen

{% tabs %}
{% tab title="🌐Console " %}
Follow these steps to assign a token directly from the model's details screen:

<figure><img src="/files/L95QrT2Zhp8PH82HgeI2" alt=""><figcaption><p>Assign Token to a Model</p></figcaption></figure>

{% stepper %}
{% step %}

### **Navigate to Workload's Details Management**

Go to the Models section. Find and click the model you want. Then click the button showing the model's token information.
{% endstep %}

{% step %}

### **Access the Token Tab**

In the model's details screen, navigate to the **Token** tab.
{% endstep %}

{% step %}

### **Start Typing the Token's Name**

Begin typing the name of the unassigned token you want to assign.
{% endstep %}

{% step %}

### **Select the Required Token**

A dropdown list will appear showing unassigned tokens that match the substring you typed.

* Choose the desired token from the list.
* If the required token does not exist, you can create a new one using the "Add Token" option.

{% hint style="warning" %}
**Unassigned Tokens Only**: Only unassigned tokens can be linked to a model. If a token is currently assigned, remove the existing assignment first (see: \[How-To: [Remove Token's Assignment](/how-to-guides/access-control/how-to-remove-tokens-assignment.md)]).
{% endhint %}
{% endstep %}

{% step %}

### **Save the Assignment**

Click the **Save** button to confirm the token assignment. The token will now be linked to the model.
{% endstep %}
{% endstepper %}
{% endtab %}

{% tab title="🧊 Python SDK" %}

```python
# Assign Token to Model

import LatticaManagement

# Authenticate
lattica = LatticaManagement("your_license_from_lattica_console")

# Get a model_id and a token_id...
model_id = lattica.list_models()[0].model_id
token_id = lattica.list_tokens()[0].token_id

# Assign token to model
lattica.assign_token_to_model(token_id, model_id)
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
When a token is reassigned from one model to another, a **new Evaluation Key (EVK)** must be generated for the new model. For instructions, refer to: \[[How-To: Generate Evaluation Key](/how-to-guides/secure-query-processing/how-to-upload-evaluation-key.md)].
{% endhint %}
