> ## Documentation Index
> Fetch the complete documentation index at: https://docs.comfy.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Comfy Cloud API Keys & Secrets: BYOK provider keys

> Add and manage provider API keys in Comfy Cloud secrets, including Runway and Google Gemini BYOK keys for partner nodes and tokens for private models.

> [!NOTE]
>
> This is a **Comfy Cloud** feature and is only available in the cloud version. To learn more about Comfy Cloud, see [Comfy Cloud](https://docs.comfy.org/get_started/cloud.md).

## Overview

**API Keys & Secrets** is the Comfy Cloud settings panel where you store the provider API keys Comfy Cloud uses on your behalf. Secret values are encrypted when you save them, and the value itself is never shown again.

The panel holds two kinds of credentials:

* **Model provider credentials**: a Hugging Face or Civitai token, used to download private and gated models during import. See [Import models](https://docs.comfy.org/cloud/import-models.md) for the full import flow.
* **BYOK provider keys**: a Runway or Google Gemini key, so that partner node calls run on your own provider account. See [BYOK provider keys](#byok-provider-keys).

## Open the Secrets panel

1. Sign in to [Comfy Cloud](https://cloud.comfy.org).
2. Open the settings dialog with `Ctrl + ,` (on macOS `Cmd + ,`), or click **Settings** in the Comfy Cloud menu.
3. Select **Secrets** in the settings sidebar.

The panel appears for signed-in accounts when secrets are enabled.

![The Secrets section of the Comfy Cloud settings dialog](https://mintcdn.com/dripart/dkKbceCnXIcxFyjM/images/cloud/import_model/setting_secerts-1.png?fit=max\&auto=format\&n=dkKbceCnXIcxFyjM\&q=85\&s=15ea8a8aeeb50da9bedc00429c9c05b1)

The list shows every stored secret with its name, provider, creation date, and the date it was last used, when that information is available.

## Add a secret

**1. Start a new secret**

Click **Add Secret**.

**2. Choose the provider**

Select the provider from the **Provider** dropdown. The list is loaded from Comfy Cloud, so providers added later appear here automatically. Selecting a provider shows its own guidance, for example where to find your Runway API key or how to generate a Google Gemini key in Google AI Studio.

**3. Choose the credential type**

Providers that accept more than one kind of credential show a **Credential Type** selector. Most providers take a single API key as text. Some take a JSON credential instead: paste the JSON or upload the file, which must be a JSON object of up to 1 MB.

**4. Name the secret**

Enter a name of your choice, up to 255 characters. Names must be unique, and each provider can hold one secret.

**5. Enter the value**

Paste the key or credential. The value is encrypted on save and cannot be viewed again, so keep your own copy.

**6. Save**

Click **Save**. Comfy Cloud can use the credential immediately.

![The Add Secret dialog with name, provider, and secret value fields](https://mintcdn.com/dripart/dkKbceCnXIcxFyjM/images/cloud/import_model/setting_secerts-2.png?fit=max\&auto=format\&n=dkKbceCnXIcxFyjM\&q=85\&s=b87a3c87203a4e3929ae41295281a823)

## Manage secrets

* **Edit**: click the edit icon on a secret to rename it or replace its value. Leaving the value blank keeps the current one, and neither the provider nor the credential type can be changed after the secret is created. To move a credential to another provider, delete the secret and add a new one.
* **Delete**: click the delete icon and confirm. Deleting a secret is permanent and cannot be undone.

## BYOK provider keys

Bring your own key (BYOK) runs partner nodes on your own provider account instead of on Comfy credits.

* For partner nodes in Comfy Cloud, Comfy supports BYOK for **Runway** and **Google Gemini** today. Other providers can be added on request for Enterprise customers.
* BYOK is turned on per workspace, and partner node calls that run on your own key are billed by that provider directly instead of drawing your Comfy credits.
* To enable BYOK for a workspace, [submit an Enterprise request](https://www.comfy.org/contact).

Once BYOK is enabled for a workspace, add the provider's API key in the Secrets panel. Partner node calls for that provider in the workspace then run on your key.

## Credentials for private models

A Hugging Face or Civitai token stored in Secrets is used automatically when you import a model, which is how private and gated repositories are downloaded. The token needs read access to the repository you are importing from, and only `.safetensors` files can be imported. The step-by-step flow, the supported model folders, and the import limits are on [Import models](https://docs.comfy.org/cloud/import-models.md).

> [!NOTE]
>
> The Secrets panel stores credentials for third-party providers. It is separate from your Comfy API key, which authenticates calls to the Comfy Cloud API. See [Getting an API Key](https://docs.comfy.org/development/api-development/getting-an-api-key.md).

## FAQ

> [accordion] Does using my own key still spend Comfy credits?
>
> No. Partner node calls that run on your own BYOK key are billed by that provider directly, so they do not draw your Comfy credits.

> [accordion] Which providers can I use with BYOK?
>
> For partner nodes in Comfy Cloud: Runway and Google Gemini today. Other providers can be added on request for Enterprise customers through the [Enterprise request form](https://www.comfy.org/contact).

> [accordion] How do I turn on BYOK for my workspace?
>
> BYOK is enabled per workspace. [Submit an Enterprise request](https://www.comfy.org/contact) and we will set it up, then add your provider key in the Secrets panel.

> [accordion] Can I read a secret value after saving it?
>
> No. Secrets are encrypted, and the stored value is never returned to the interface, so store your own copy of the key. You can replace the value at any time with **Edit**, or delete the secret and add a new one.

> [accordion] Why can I not add a second key for the same provider?
>
> Each provider holds one secret. Add the new key by editing the existing secret for that provider, or delete it first if you want a separate entry.

> [accordion] Why does my credential fail to save?
>
> Common causes are a missing name, a name longer than 255 characters, a name that is already in use, or a provider that already has a secret. For a JSON credential, the content must parse as a JSON object and stay within 1 MB.

> [accordion] My token is saved but the private model import still fails. What now?
>
> Check that the token has read access to the exact repository you are importing from. A token without access to a private or gated repository cannot download it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.