API keys and tokens
An API key is a long-lived secret you exchange for short-lived tokens whose scope says what they allow.
An API key is a long-lived secret that does one thing: get tokens from the exchange. Every other call uses a token, which expires within an hour and carries a scope: a list of grants that say which operations it allows. How clients authenticate shows what each client sends. An admin creates one key per application, with the grants it needs:
nova credential create --name orders-writer \
--scope 'nova:append:apps:orders%2F* nova:read:apps:*'
nova credential listapi_key: nova_sk_ce97b839f9cae1f3_… (shown once — only the secret's hash is stored)
key_id: ce97b839f9cae1f3
name: orders-writer
scope: nova:append:apps:orders%2F* nova:read:apps:*
bb7b765c37f9c279 root active 2026-11-22T18:09:24Z nova:admin
ce97b839f9cae1f3 orders-writer active 2026-11-22T18:09:34Z nova:append:apps:orders%2F* nova:read:apps:*This credential appends to every stream whose key starts with orders/ in the bucket apps, and reads every stream there.
Two credentials keep the key out of your data calls. The key stays on your server, and only the exchange ever receives it. A token that leaks expires within an hour and allows only its scope.
API keys
An API key is 74 characters: nova_sk_, a 16-character key ID in lowercase hex, _, a 43-character secret, and a 6-character checksum. The key ID is the public part: listings and logs show it, and it is the sub of every token issued from the key.
Nova shows the whole key once. It stores the key ID, a SHA-256 hash of the secret, the scope, the creation time, whether the key is revoked, and a name that says what the key is for. A name is 1 to 64 bytes of UTF-8, with no control characters and no space at either end, and two credentials can share one.
Managing credentials needs the admin grant; see credential commands. A change of grants applies from the next exchange. Revoking a key stops new exchanges at once, but tokens already issued work until they expire.
The exchange
The SDKs and the CLI exchange keys for you. Call the exchange yourself when a backend gives another application, such as a browser, a token narrower than its key. Over HTTP it is POST /v1/token/exchange, the one route that takes no token, and over gRPC nova.v1.AuthService/ExchangeToken. nova token exchange prints a token in a shell.
The exchange takes the key in two parts. In bash and zsh, ${NOVA_API_KEY:8:16} is the key ID and ${NOVA_API_KEY:25:43} the secret:
curl -s localhost:8080/v1/token/exchange -d "{
\"key_id\": \"${NOVA_API_KEY:8:16}\",
\"secret\": \"${NOVA_API_KEY:25:43}\",
\"bucket\": \"apps\",
\"key\": \"orders/eu\",
\"ttl_seconds\": 300
}"{
"token": "eyJhbGciOiJIUzI1NiIsImtp…",
"expires_at_unix_ms": 1795371280000,
"scope": "nova:append:apps:orders%2Feu nova:read:apps:orders%2Feu"
}The response's scope is exactly what the token allows. The token goes in an Authorization: Bearer <token> header.
| Status | When |
|---|---|
401 | The key ID is unknown or the secret is wrong. Both get the same answer, so a caller cannot probe for key IDs |
403 | The key is revoked, or it covers nothing in the bucket, or the asked scope goes beyond its grants |
400 | Neither or both of bucket and scope, key without bucket, or a scope that does not parse |
501 | The cluster verifies tokens but does not sign them, so it has no exchange |
Scopes
A scope is a space-separated list of grants. Each grant starts with nova::
nova:<action>:<bucket-match>:<key-match> a grant on streams
nova:admin every operation- The action is one of
append,read,list,create,delete,trim. - The bucket match is a bucket name. A trailing
*makes it a prefix:acme-*. - The key match is a stream key with every byte outside
A-Z a-z 0-9 - . _ ~percent-encoded:orders/euisorders%2Feu, and a literal*is%2A. A trailing, unencoded*makes it a prefix, and a lone*matches every key.
A token allows what any one of its grants allows. There are no deny rules. Nova skips a nova: entry it cannot parse, ignores entries without nova:, and refuses a token with more than 64 nova: entries. The markers nova:node and nova:gateway belong to the cluster's own processes, and no API key can hold them.
What each action covers
| Action | Streams and buckets | Queues |
|---|---|---|
append | Append, producer sessions, fence | Send, replay dead letters |
read | Read, subscribe, check the tail, get a stream or bucket, read plans, list a stream's ranges | Get a queue, claim, ack, nack, extend, work sessions, read dead letters |
list | List a bucket's streams, list buckets | List a bucket's queues |
create | Create or reconfigure a stream, create or update a bucket | Create or update a queue |
delete | Delete a stream or a bucket | Delete a queue |
trim | Trim | Purge |
No action includes another: a token that appends cannot trim. Cluster and credential operations need nova:admin. When a bucket creates streams on first use, the first append or read needs only append or read.
An operation on a bucket itself, such as getting or updating it, needs a grant whose key match is the lone *.
A listing needs one grant that covers everything it can return. Listing apps with the key prefix orders/ needs nova:list:apps:orders%2F* or wider. Listing buckets named acme-… needs nova:list:acme-*:*, and listing every bucket needs nova:list:*:*. A bucket name without * never covers a name prefix, because acme would also match acmecorp. To give a tenant its own buckets, name them with a shared prefix and grant that prefix.
Prefix listings over HTTP
A prefix grant lists over gRPC only. Over HTTP, a node or a Gateway that checks tokens refuses that listing with 403, and needs list on the whole bucket (nova:list:apps:*), or on every bucket for the bucket listing.
Settings beyond the scope
A token your own issuer signs can carry a nova_aux claim; tokens from the exchange carry none. Its fencing_token pins the caller to one fencing token: every producer session and one-shot append under the token must present exactly that value. Its limits (rps, connections, read_Bps, write_Bps) cap the caller at each Gateway that enforces limits. Nodes ignore the limits, and Nova ignores fields it does not know.