Create API token
Create a new named API token for the authenticated user. The key is returned only once and cannot be retrieved later. Creating more than one token requires an Enterprise plan.
Authorizations
API key authorization. Pass your API key in the Authorization header as a Bearer token. Both new (gsk_*) and legacy (gsk-) API keys are accepted, e.g. Authorization: Bearer gsk_... or Authorization: Bearer gsk-....
Body
Optional token name. Defaults to "default".
"ci-pipeline"
Response
API token created successfully
"apiToken_abc123"
"ci-pipeline"
Public identifier of the key (the uuid in gsk__)
Display-only public head of the key (gsk_<keyId>). Contains no secret.
"gsk_3d4d7d38-a5ec-4d9f-94a6-5a3f61db9d7d"
The generated API key in gsk_* format. Returned only once — store it securely.
^gsk[_-].+"gsk_abc123def456"