Skip to main content

API Keys

Programmatic tokens (nat_sk_…) scoped to a project or account.

Overview

Keys are created and scoped through the API (or console) to a project — the default — or the whole account, plus a set of capabilities. The raw secret is returned exactly once, at creation (or rotation); every other read returns only key_prefix.

See the OpenAPI spec for the full endpoint and schema reference, or browse it rendered under API Reference → API Keys.

Data Model

ApiKeyRecord

FieldTypeDescription
idstringPublic API key ID.
namestringHuman-readable label.
key_prefixstringThe first characters of the secret, for identification without exposing it.
scopestringproject or account.
project_idstring, nullableSet when scope is project — see Projects.
capabilitiesstring[]The actions/resources this key is allowed to call.
created_atstring (date-time)
last_used_atstring (date-time), nullable

Key Concepts

The secret is write-only

ApiKeyCreated (the create/rotate response) is the only shape that includes the raw secret (nat_sk_…); it is never returned again. Losing it means rotating the key.

Rotation

POST /v1/api-keys/{api_key_id}:rotate issues a new secret for the same key record and invalidates the old one immediately.

Examples

naturali create-api-key --name ci-deploy --project-id proj_V1StGXR8Z5jdHi6B