Skip to main content
POST
/
service_accounts
/
{clientId}
/
api_keys
Create service account API key
curl --request POST \
  --url https://api.blaxel.ai/v0/service_accounts/{clientId}/api_keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "expires_in": "<string>",
  "name": "<string>"
}
'
{
  "createdAt": "<string>",
  "updatedAt": "<string>",
  "createdBy": "<string>",
  "updatedBy": "<string>",
  "apiKey": "<string>",
  "expires_in": "30d",
  "id": "ak_abc123def456",
  "name": "CI/CD Pipeline Key",
  "sub": "<string>",
  "sub_type": "user"
}

Documentation Index

Fetch the complete documentation index at: https://docs.blaxel.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

OAuth2 authentication with JWT tokens

Path Parameters

clientId
string
required

Service account client ID

Body

application/json
expires_in
string

Expiration period for the API key. Supports formats like '30d' (30 days), '24h' (24 hours), '1w' (1 week). If not set, the API key never expires.

name
string

Name for the API key

Response

200 - application/json

successful operation

Long-lived API key for accessing Blaxel

createdAt
string
read-only

The date and time when the resource was created

updatedAt
string
read-only

The date and time when the resource was updated

createdBy
string
read-only

The user or service account who created the resource

updatedBy
string
read-only

The user or service account who updated the resource

apiKey
string
read-only

Api key

expires_in
string

Duration until expiration. Supports formats like '30d' (30 days), '24h' (24 hours), '1w' (1 week). If not set, the API key never expires.

Example:

"30d"

id
string
read-only

Api key id, to retrieve it from the API

Example:

"ak_abc123def456"

name
string

Name for the API key

Example:

"CI/CD Pipeline Key"

sub
string
read-only

User subject identifier

sub_type
string

Subject type (user or service_account)

Example:

"user"

Last modified on May 27, 2026