Create an API key
Creates an API key. When project_id is set the key is scoped to that project (the default and recommended stance); omit it for an account-scoped key. capabilities narrows what the key may do; when omitted the key inherits the creator's capabilities. The raw key (nat_sk_…) is returned only in this response. A project-scoped key requires membership of that project. The key carries no role of its own — every request it makes resolves its holder's membership again — so it can never reach past what its minter already had. An account-scoped key requires a credential that is not itself confined to one project. A connected app cannot create keys at all: a grant is revocable and a key is not, so a key minted under a grant would still work after the app was disconnected. Reading and revoking keys stay available.
Request
- Base URL: https://api.naturali.ai
- URL: https://api.naturali.ai/v1/api-keys
- Auth: HTTP bearer
Request body
Example request
{
"name": "CI/CD Pipeline",
"project_id": "proj_V1StGXR8Z5jdHi6B",
"capabilities": [
"agents:read",
"sessions:write"
]
}Response
API key created. The raw key value is only returned here.
Example response
{
"id": "key_V1StGXR8Z5jdHi6B",
"name": "CI/CD Pipeline",
"key_prefix": "nat_sk_a1b2c3",
"scope": "project",
"project_id": "proj_V1StGXR8Z5jdHi6B",
"capabilities": [
"agents:read",
"sessions:write"
],
"created_at": "2026-07-17T00:00:00.000Z",
"last_used_at": "2026-07-17T09:12:00.000Z",
"key": "nat_sk_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4"
}Changes
No recorded changes to this operation across all 1 revision of this API.