---
id: "huggingface_access_token"
kind: "datatype"
status: "draft"
is_pii: false
categories: ["secrets"]
langs: ["common"]
quality: 70
url: "http://registry.apicrafter.io/datatype/huggingface_access_token"
---

# Hugging Face access token (`huggingface_access_token`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

User access token of the Hugging Face Hub, used in place of a password for git, as a bearer token for Inference Providers and in the Hugging Face Python libraries. It starts with hf_ followed by 34 letters and digits. Organization API tokens have the same length and the prefix api_org_.

- Parent datatype: `access_token`
- Personal data (PII): no
- Categories: Secrets and credentials (passwords, keys, tokens) (secrets)
- Countries: global
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^(?:hf_|api_org_)[A-Za-z0-9]{34}$
```

## Examples

- `hf_ExampleTokenNotReal` (invalid example) — Too short

## Supported by tools

- `gitleaks`
- `trufflehog`

## Sources

- doc: <https://huggingface.co/docs/hub/security-tokens>
- other: <https://github.com/gitleaks/gitleaks/blob/master/config/gitleaks.toml>
- other: <https://github.com/trufflesecurity/trufflehog/blob/main/pkg/detectors/huggingface/huggingface.go>

## Quality

Score 70/100. Missing: examples, mapping (Wikidata, Schema.org, ...), translation.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/huggingface_access_token.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/secrets/huggingface_access_token.yaml>
