Skip to main content
POST
/
api-keys
Create API key
curl --request POST \
  --url https://api.spikelabs.com/v1/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "scopes": [
    "*"
  ]
}
'
{
  "id": "key_abc123",
  "object": "api_key",
  "name": "Production API Key",
  "key_prefix": "sk_live_",
  "scopes": [
    "*"
  ],
  "created_at": "2023-11-07T05:31:56Z",
  "secret": "sk_live_abc123xyz789...",
  "last_used_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

API key authentication. Use your secret key (starts with sk_) as a Bearer token.

Body

application/json
name
string
required

Display name for the key

Maximum string length: 100
scopes
enum<string>[]

Permissions to grant

Available options:
*,
read,
write,
conversations,
chat,
voice,
video

Response

API key created

id
string
required

Unique identifier

Example:

"key_abc123"

object
enum<string>
required
Available options:
api_key
name
string
required

Display name for the key

Example:

"Production API Key"

key_prefix
string
required

First 8 characters of the key for identification

Example:

"sk_live_"

scopes
enum<string>[]
required

Permissions granted to this key

Available options:
*,
read,
write,
conversations,
chat,
voice,
video
created_at
string<date-time>
required
secret
string
required

The full secret key. Only returned at creation time.

Example:

"sk_live_abc123xyz789..."

last_used_at
string<date-time> | null