Documentation Index
Fetch the complete documentation index at: https://docs.cognisafe.uk/llms.txt
Use this file to discover all available pages before exploring further.
API key format
Cognisafe API keys use thecsk_ prefix followed by a 48-character hex string:
Creating a key
- Sign in at cognisafe.uk
- Navigate to your project → API Keys
- Click Create key
- Copy the key immediately — it is shown only once
Passing the key
X-Cognisafe-Key header (recommended)
Authorization: Bearer header
X-Cognisafe-Key is preferred for clarity.
SDK (environment variable)
When using the Python or Node.js SDK, set the key as an environment variable rather than passing it toconfigure():
COGNISAFE_API_KEY automatically if api_key is not passed to configure().
Key rotation
Keys can be rotated without downtime:- Create a new key in the dashboard
- Update your environment variables / secrets manager with the new key
- Deploy / restart your application
- Delete the old key from the dashboard
Revoking a key
In the dashboard: API Keys → find the key → Revoke. The key is invalidated immediately. Any requests using the revoked key receiveHTTP 401 Unauthorized.
Internal API secret
TheINTERNAL_API_SECRET environment variable is a separate secret used for server-to-server authentication between the web (Next.js) and api (FastAPI) services. It is not an API key and is never exposed to end users or SDK clients. Generate it with:
api and web services.
