Keys / Typesense

TYPESENSE_API_KEY

The bootstrap admin key a self-hosted Typesense server starts with. Apps also use the name for a key made with /keys or Typesense Cloud.

Expires
the bootstrap key never; others when you set expires_at
API
create, list and delete, with an admin key or the Cloud Management API

Get it

Create one on cloud.typesense.org. The steps aren't recorded yet.

Set it

TYPESENSE_API_KEY=...

The Typesense server reads it at launch, as it reads --api-key. The client libraries don't; your app passes the key in as apiKey or api_key. Or keep it out of .env with keypin: keypin run -- npm run dev

Replace it

  1. Typesense recommends using the bootstrap key only to create other keys. Create an admin key with /keys for daily use, so you can rotate and revoke it.
  2. On Typesense Cloud, Typesense manages the bootstrap key; Generate API Keys in the cluster dashboard creates an admin and a search-only key.
  3. Create a key with the same actions, collections and expiry as the old one. Its value is shown only in the create response.
  4. Deploy it everywhere that reads TYPESENSE_API_KEY. Check that nothing still uses the old key, then delete it with DELETE /keys/<id>.
  5. To change a self-hosted bootstrap key, restart the server with a new --api-key or TYPESENSE_API_KEY.

Set rotate_every on the key in keypin.toml and a rotated date on its vault item, and keypin status shows when it's due.

Sources, checked 2026-11-16