Project secret API keys are server-to-server credentials scoped to a single project. They're the right choice when a backend service needs scoped, project-level access without being tied to anyone's user account.
Unlike a personal API key, a project secret API key doesn't represent a user—it isn't affected when a teammate leaves, and it only has the scopes you grant it.
Today, they're supported on a growing set of scopes:
- Feature flag local evaluation and remote config (
feature_flag:readscope) - Endpoints execution (
endpoint:readscope) - Support external tickets API reads (
support_ticket:readscope) - Datasets and items:
dataset:readfor datasets, items, and revision history. Usedataset:writeto manage them or extend retention. Dataset exports require a personal API key withdataset:read. - Offline experiment uploads:
offline_evaluation_ingestion:writeto create experiments, upload items and results, and complete or fail runs. - Offline experiment reads and corrections:
evaluation:readto read experiments and items, orevaluation:writeto edit accepted data and tags. Reading results and scorer summaries, changing results or their payloads, and deleting an item also requirellm_analytics:read. - Scorer definitions and versions and trace review scores:
llm_analytics:readfor reads andllm_analytics:writefor writes, labeled AI observability in project key settings.
Project secret API keys replace the legacy feature flags secure API key. If you're currently using one, we'll migrate it to a project secret API key without impacting your application.
How to obtain a project secret API key
- Go to the Project secret API keys section in your project settings.
- Click Create project secret API key.
- Give your key a label to describe its purpose.
- Choose the scopes for your key. We recommend selecting only the scopes the service really needs. This is a security best practice. See API scopes for what each scope covers.
- Immediately copy the key's value, as you'll never see it again after refreshing the page.
How to authenticate using the project secret API key
Pass the key in the Authorization header using Bearer authentication:
PostHog detects the kind of key you sent from its phs_ prefix and authenticates accordingly.





