---
title: "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.

<Tip>
You can also use multiple credentials to configure load balancing for a model. For more information, see [Configure Load Balancing](/en/guides/model-configuration/load-balancing).
</Tip>

## 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>

    ![Manage credentials for predefined models](/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>

    ![Manage credentials for a single custom model](/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.

    ![Manage credentials for all custom models](/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.

    ![Removed models displayed for quick re-add](/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>

{/*
Contributing Section
DO NOT edit this section!
It will be automatically generated by the script.
*/}

---

[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/guides/model-configuration/manage-model-credential.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

