Programmatic access
Clavitor has no public REST or HTTP API. There are no endpoints to call with an API key. Programs reach the vault through clavitor-cli, using a client identity you create in the vault.
What a vault answers
A vault answers only two kinds of request:
GET /guard: an empty204response. It says the vault is up and nothing else.POST /gate: one encrypted, authenticated request inside one handshake of Clavitor's hybrid post-quantum channel (P-256 + ML-KEM-768).
Every other path returns 404. The vault web app, the CLI, the browser extension and the proxy all talk to /gate. Its message format is internal to Clavitor's clients and is not published as a supported API.
How a client authenticates
- You create a client in the vault (Clients → + New client) and get a blob and a key. See agent setup.
clavitor-cli initopens the blob with the key. The blob holds the client's agent ID, its credential key, the vault ID, the address of the vault's home server and that server's public key. The CLI saves these to its config.
- Every request is a fresh handshake to the server's public key, so the CLI only talks to the server named in the blob. Inside the handshake it sends a token minted from the client's key and agent ID.
- The vault checks the client: known and not revoked, not locked, from an allowed IP, and within its scopes and read quota. It records the request in the audit log under the client's name.
There is no request without an identity. Admin actions, such as creating clients, need the vault holder's own session in the browser.
When a server gets a new key
Each server has a key pair for its encrypted connections. Every client keeps the server's public key on file (it pins it), which is how it knows it is talking to that server. The private half never leaves the server.
A server can get a new key with nobody doing anything: you run no command and enter nothing again. Every server gets a new key every 90 days, and at once whenever the need arises. It keeps only its one previous key, so an old key lives at most 90 days, and for one job only: answering "I have a new key, here it is". That answer comes over a connection opened on the key the client already trusts, so the client can safely save the new key and retry. A connection on the old key gets no other service.
If we ever find a key stolen, we destroy it at once, so it can't vouch for anything. The client then asks the vault's other server (every vault lives on two). That server checks the client's own token and answers only with that vault's two current server keys.
The client saves nothing from an answer it can't authenticate. If both servers are unreachable it shows a clear error and changes nothing. Nobody else is involved: clients only talk to their own vault's two servers.
CLI and proxy from 1.7.10 and the browser extension from 1.8.2 do this. An older one shows an "update" message after a key change; update it and carry on.
Calling Clavitor from a program
Run the CLI as a subprocess and read its stdout. Check the exit code: 0 means you got the value, anything else means you did not, with the reason on stderr.
Python:
import subprocess
key = subprocess.check_output(
["clavitor-cli", "get", "Stripe", "--field", "key"]
).decode()Go:
key, err := exec.Command("clavitor-cli", "get", "Stripe", "--field", "key").Output()Fetch the value when you need it, rather than at startup into an environment variable. Entries from code covers JSON input and output.