Skip to main content
POST
/
auth
/
apiTokens
Create API token
curl --request POST \
  --url https://api.galtea.ai/auth/apiTokens \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "ci-pipeline"
}
'
{
  "id": "apiToken_abc123",
  "name": "ci-pipeline",
  "keyId": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "keyPreview": "gsk_3d4d7d38-a5ec-4d9f-94a6-5a3f61db9d7d",
  "apiKey": "gsk_abc123def456"
}

Authorizations

Authorization
string
header
required

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

application/json
name
string

Optional token name. Defaults to "default".

Example:

"ci-pipeline"

Response

API token created successfully

id
string
required
Example:

"apiToken_abc123"

name
string
required
Example:

"ci-pipeline"

keyId
string
required

Public identifier of the key (the uuid in gsk__)

createdAt
string<date-time>
required
keyPreview
string
required

Display-only public head of the key (gsk_<keyId>). Contains no secret.

Example:

"gsk_3d4d7d38-a5ec-4d9f-94a6-5a3f61db9d7d"

apiKey
string
required

The generated API key in gsk_* format. Returned only once — store it securely.

Pattern: ^gsk[_-].+
Example:

"gsk_abc123def456"