All Products
Search
Document Center

Data Management:Obtain the API key of DMS Dify

Last Updated:May 16, 2025

When you call applications published in Dify Studio or integrate the private LLM, Embedding, or Rerank model services on the Model Provider page, you need to obtain the API key of Data Management (DMS) Dify first. This topic describes how to obtain the API key of DMS Dify.

Usage notes

  • You can create only one API key for each Dify instance.

  • If your role in the workspace is developer, you do not have permission to create an API key.

  • If your role in the workspace is visitor, you do not have permission to create and view an API key.

Obtain an API key

  1. Go to the workspace as an O&M engineer, workspace administrator, or developer.

  2. In the left-side navigation pane, choose image > Dify.

  3. On the Dify tab, click API KEY to view the existing API keys or create an API key.

    Note

    Currently, you cannot delete an API key. The API key deletion feature will be available in the future. The deleted API key will become invalid.

    image

Related information

You can use the the Dify API key to call applications that are published on the open-source Dify platform. To fulfill security compliance requirements, you must include the API header DifyApiKey: xxxx-xxxxxxx in your code or API tool. For more information, see Developing with APIs.

For example, add the API header to the request. Example code:

curl -X POST 'https://dify-{region_id}-dms.aliyuncs.com/v1' \
--header 'Authorization: Bearer app-xxxx' \
--header 'DifyApiKey: xxxx-xxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
    "inputs": {},
    "query": "What are the specs of the iPhone 13 Pro Max?",
    "response_mode": "streaming",
    "conversation_id": "",
    "user": "abc-123"
}'