---
title: API token
summary: A long-lived secret ("BAT-" and forty hex characters) that an integration logs in with. Bound to one node, limited by scopes, an expiry date and optional CORS and IP allow-lists; shown once when created.
part: glossary
see-also: [glossary/auth-token, glossary/scope, glossary/node, explanation/tokens-and-delegation, how-to/auth/create-an-api-token]
---

# API token

An API token is the credential for software. It is created by an [[term:account]], never by another API token, and every request that presents it is checked against its record: status, expiry, IP and CORS rules. The secret is returned exactly once; the server stores only a hash and the last four characters.

Every token is bound to a [[term:node]]. It sees that node and everything below it and nothing else, the way a chroot limits a process to a directory. What it may *do* there is a list of [[term:scope|scopes]] such as `fs:read`, `query:run` or `model:upload`, or the universal [[scope:*]]. Tokens created before scopes existed carry the legacy READ/WRITE credentials instead; tokens older than that are refused and must be recreated.

Every token has an expiry date: one month ahead unless the creator chooses a date, and never more than three years ahead. Reminders go out seven, three and one day before. The token can also be restricted to a list of origins (`cors_enabled_domains`) and to a list of IP addresses. Logging in with the token yields an [[term:auth-token]]; the token itself is never sent on ordinary requests. See [[page:explanation/tokens-and-delegation]].
