You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -64,6 +64,87 @@ model = AutoModel.from_pretrained("private/model", token=access_token)
64
64
> [!WARNING]
65
65
> Try not to leak your token! Though you can always rotate it, anyone will be able to read or write your private repos in the meantime which is 💩
66
66
67
+
### Token rotation
68
+
69
+
You can rotate a token to generate a new token value while keeping the same name, permissions, and scopes. This is useful if a token may have been compromised. Rotate a token via the UI in your [Access Tokens settings](https://huggingface.co/settings/tokens), or programmatically via the API:
70
+
71
+
```
72
+
POST https://huggingface.co/api/settings/tokens/{token_id}/rotate
73
+
```
74
+
75
+
For fine-grained tokens, you can also retrieve an overview of the token's permissions and scopes:
76
+
77
+
```
78
+
GET https://huggingface.co/api/settings/tokens/{token_id}/fine-grained-overview
79
+
```
80
+
81
+
### Fine-grained token permission scopes
82
+
83
+
When creating a fine-grained token, you can select from the following permission scopes:
84
+
85
+
**Repository permissions** (applied per-repo or per-org):
0 commit comments