> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. # API keys > Create and manage API keys for CLI authentication in CI/CD environments. [Admins](/learn/dashboard/configuration/permissions) can create and manage API keys from the [Fern Dashboard](https://dashboard.buildwithfern.com/fern/tokens). API keys authenticate the Fern CLI in CI/CD pipelines, for example when publishing SDKs or documentation from GitHub Actions. > **Note** > > API keys don't expire. Rotate them periodically and delete any that are no longer in use. ## Create an API key #### Open the API keys page Navigate to the [Fern Dashboard](https://dashboard.buildwithfern.com/) and select **API Keys** from the sidebar. #### Create a new API key Select **Create key**, enter a name (e.g. `CI/CD pipeline`), then select **Generate**. The API key is displayed once. Copy it immediately; you won't be able to view it again. #### Store the API key as a secret Add the API key as a repository secret named `FERN_TOKEN` in your CI/CD provider (e.g. GitHub Actions, GitLab CI). The Fern CLI reads this value from the environment to authenticate, so any workflow that runs a `fern` command can reference it: **`GitHub Actions example`** ```yaml title="GitHub Actions example" env: FERN_TOKEN: ${{ secrets.FERN_TOKEN }} ``` The rest of the workflow depends on what you publish: the same token authenticates [publishing your docs](/learn/docs/preview-publish/publishing-your-docs) and [publishing an SDK to a package registry](/learn/sdks/generators/typescript/publishing). ## Manage API keys From the **API Tokens** page, you can: * **Delete an API key** — select the options menu next to an API key and choose **Delete**. Deleted API keys are immediately revoked and can't be restored. > **Note** > > All [members](/learn/dashboard/configuration/permissions) can view API key names and creation dates. Only Admins can create or delete API keys. > Create and manage API keys for CLI authentication in CI/CD environments.