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

# Manage Model Credentials

## Introduction

You can add multiple credentials for a model provider's predefined and custom models, and easily switch between, delete, or modify these credentials.

Here are some scenarios where adding multiple credentials is particularly helpful:

* **Environment Isolation**: Configure separate model credentials for different environments, such as development, testing, and production. For example, use a rate-limited credential in the development environment for debugging, and a paid credential with stable performance and a sufficient quota in the production environment to ensure service quality.

* **Cost Optimization**: Add and switch between multiple credentials from different accounts or model providers to maximize the use of free or low-cost quotas, thereby reducing application development and operational costs.

* **Model Testing**: During model fine-tuning or iteration, you may create multiple model versions. By adding credentials for these different versions, you can quickly switch between them to test and evaluate their performance.

## Procedure

<Tabs>
  <Tab title="Predefined Model">
    After installing a model provider and configuring the first credential, click **Config** in the upper-right corner to perform the following actions:

    * Add a new credential
    * Select a credential as the default for all predefined models
    * Edit a credential
    * Delete a credential

    <Note>
      If the default credential is deleted, you must manually specify a new one.
    </Note>

    <img src="https://mintcdn.com/dify-4171f9f9/mZ12wIe1vYw_wFxp/images/predefined_model_credential.png?fit=max&auto=format&n=mZ12wIe1vYw_wFxp&q=85&s=c3d7312c140485fa8b6c5b9aab78f0dc" alt="Manage credentials for predefined models" width="1538" height="678" data-path="images/predefined_model_credential.png" />
  </Tab>

  <Tab title="Custom Model">
    ### Manage Credentials for a Single Custom Model

    After installing a model provider and adding a custom model, follow these steps:

    1. In the model list, click the corresponding **Config**.

    2. In the **Specify model credential** panel, click the default credential to open the credential list, then perform the following actions:

       * Add a new credential

       * Select a credential as the default for that custom model

       * Edit a credential

       * Delete a credential

    <Warning>
      If you delete the only credential for a custom model, the model will also be deleted.
    </Warning>

    <img src="https://mintcdn.com/dify-4171f9f9/vMKCXdVD-5Kdilzi/images/custom_model_credential.png?fit=max&auto=format&n=vMKCXdVD-5Kdilzi&q=85&s=6acb914403e344004edfd8f673f93fa3" alt="Manage credentials for a single custom model" width="1328" height="722" data-path="images/custom_model_credential.png" />

    <Info>
      When you add a new custom model with a name and type identical to an existing custom model, the system will add the new credential to that existing model rather than creating a duplicate.
    </Info>

    ### Manage Credentials for All Custom Models

    You can click **Manage Credentials** to view, edit, or delete the credentials for all custom models.

    <img src="https://mintcdn.com/dify-4171f9f9/vMKCXdVD-5Kdilzi/images/custom_model_credential_list.png?fit=max&auto=format&n=vMKCXdVD-5Kdilzi&q=85&s=38ff0ca0741e917cca534d770d046e6a" alt="Manage credentials for all custom models" width="1528" height="692" data-path="images/custom_model_credential_list.png" />

    After a custom model is removed, its credentials will remain in the **Manage Credentials** list. When you click **Add Model**, the system will display all removed custom models whose credentials still exist, allowing you to quickly re-add them.

    <img src="https://mintcdn.com/dify-4171f9f9/mZ12wIe1vYw_wFxp/images/removed_custom_model_re-add.png?fit=max&auto=format&n=mZ12wIe1vYw_wFxp&q=85&s=64934cabb8efd92ce5053424b9d6cdd4" alt="Removed models displayed for quick re-add" width="1534" height="564" data-path="images/removed_custom_model_re-add.png" />

    If you delete all credentials for a removed custom model from the **Manage Credentials** list, that model will no longer appear when you click **Add Model**.
  </Tab>
</Tabs>
