curl --request POST \
--url https://api.onkernel.com/org/api_keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "staging",
"days_to_expire": 30,
"project_id": "proj_abc123"
}
'{
"id": "ckv9w8q2f000001l5r3j7k9m4",
"name": "production",
"created_at": "2023-11-07T05:31:56Z",
"created_by": {
"id": "user-abc123",
"email": "user@example.com",
"name": "Jane Doe"
},
"expires_at": "2023-11-07T05:31:56Z",
"project_id": "proj_abc123",
"project_name": "Production",
"masked_key": "sk_1234...abcd",
"key": "sk_1234abcd"
}Create a new API key within the authenticated organization.
curl --request POST \
--url https://api.onkernel.com/org/api_keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "staging",
"days_to_expire": 30,
"project_id": "proj_abc123"
}
'{
"id": "ckv9w8q2f000001l5r3j7k9m4",
"name": "production",
"created_at": "2023-11-07T05:31:56Z",
"created_by": {
"id": "user-abc123",
"email": "user@example.com",
"name": "Jane Doe"
},
"expires_at": "2023-11-07T05:31:56Z",
"project_id": "proj_abc123",
"project_name": "Production",
"masked_key": "sk_1234...abcd",
"key": "sk_1234abcd"
}Documentation Index
Fetch the complete documentation index at: https://kernel.sh/docs/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
API key created successfully
API key returned immediately after creation. Includes the plaintext key once.
Unique API key identifier
"ckv9w8q2f000001l5r3j7k9m4"
API key name
"production"
When the API key was created
Show child attributes
When the API key expires
Project identifier for project-scoped API keys. Null means org-wide.
"proj_abc123"
Project name for project-scoped API keys. Null means the key is org-wide or the project name is unavailable.
"Production"
Masked version of the API key
"sk_1234...abcd"
Plaintext API key. Only returned once when the key is created.
"sk_1234abcd"