Fency.ai

Secret keys

Server-side keys for authenticating backend requests to the Fency API.

Secret keys authenticate server-to-server requests from your backend to the Fency.ai API. They must never be exposed in client-side code or public repositories. Use secret keys when creating sessions, managing memories, or making any API calls from your server.

A secret key always starts with sk_ and is longer than a publishable key:

sk_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef

Creating a secret key

To create a secret key, navigate to your Fency.ai dashboard and go to the API Keys section. Click "Create new key" and select "Secret key" as the key type.

Storing your secret key

Store your secret key as a server-side environment variable. For local development, add it to your .env or .env.local file:

FENCY_SECRET_KEY=sk_...

In production, prefer injecting it via your hosting platform's environment variable settings or a dedicated secrets manager (such as AWS Secrets Manager, Google Cloud Secret Manager, or HashiCorp Vault) rather than committing it to a file.

Never expose it to the browser — do not include it in client-side bundles, public environment variables, or any other mechanism that makes it accessible from the browser.

For a full overview of operations, see the API Reference.

On this page