# API Keys

Create organization API keys so CI pipelines can publish your private extensions or deploy your custom provider configuration without using a person's account.

Organization API keys let your CI pipelines work with Raycast on behalf of the organization, not a person. A pipeline that uses one keeps working when the member who set it up leaves the organization or changes role.

Each key can only do what you allow when you create it:

- **Publish private extensions:** Run `ray publish` from CI to publish extensions to your organization's Private Store
- **Enterprise** **Deploy Custom Providers configuration:** Read and replace the `providers.yaml` that applies to every member. Only available when [Custom Provider Configuration](https://manual.raycast.com/enterprise/custom-provider) is enabled for your organization

## Create an API Key

1. In [Raycast Account Settings](https://www.raycast.com/settings/account), select your organization under **Organization**, then click **Manage API Keys**

![Manage API Keys in the organization's settings](https://fz1sd71lwhbqy6sh.public.blob.vercel-storage.com/raycast/images/teams/api-keys-menu.png)

2. Click **Create Key**
3. Enter a name for the key, such as the CI provider that will use it
4. Choose when the key expires: in 90 days, in 1 year, or never
5. Under **Permissions**, select what the key can do. If your organization can only use one permission, it's already selected
6. Click **Create Key**

![Create API Key form with permissions](https://fz1sd71lwhbqy6sh.public.blob.vercel-storage.com/raycast/images/teams/api-keys-create.png)

7. Copy the key and store it as a secret in your CI provider. This is the only time the key is shown

Permissions can't be changed after a key is created. To change them, create a new key with the permissions you need, update the secret in your CI provider, then revoke the old key.

## Use an API Key

### Publish Private Extensions

Set the key as the `RAY_TOKEN` environment variable in your CI job, then run `npx ray publish` in the extension's folder after installing its dependencies. For example, in GitHub Actions:

```yaml
- name: Install dependencies
  run: npm ci

- name: Publish to the Private Store
  env:
    RAY_TOKEN: ${{ secrets.RAYCAST_API_KEY }}
  run: npx ray publish
```

**Enterprise** If [Private Extension Publishing](https://manual.raycast.com/enterprise/private-extension-publishing) is set to **No one**, publishing with a key is refused too.

To learn how to build a private extension, see the [Publish a Private Extension guide](https://developers.raycast.com/teams/publish-a-private-extension).

### Deploy Custom Providers Configuration

Send the key as a bearer token to the custom provider configuration API. See [Manage the Configuration from CI](https://manual.raycast.com/enterprise/custom-provider#manage-the-configuration-from-ci) for the request, the responses, and a GitHub Actions example.

## Manage API Keys

![List of organization API keys](https://fz1sd71lwhbqy6sh.public.blob.vercel-storage.com/raycast/images/teams/api-keys-list.png)

The list shows each key's permissions, who created it, when it expires, and when it was last used, so you can spot keys that are no longer needed.

- Only Managers can create, see, and revoke API keys
- Every Manager gets an email when a key is created
- To revoke a key, click **Revoke** next to it. A revoked or expired key stops working immediately
- To rotate a key, create a new one, update the secret in your CI provider, then revoke the old key
- An organization can have up to 10 active API keys

Keys are stored hashed and can't be shown again after they're created.


---

## Need Help?

Contact Raycast Support if you have any questions or would like help with API Keys. Use the **Send Feedback** command directly in Raycast to report bugs and billing issues, log feature requests, or any other queries you would like to speak to us about.

You can view all Raycast Support contact options at https://manual.raycast.com/contact-support
