Created
July 17, 2025 09:10
-
-
Save kuc-arc-f/be5a2c17cc31da73c04811c33aeb4bba to your computer and use it in GitHub Desktop.
Dify , API-example python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X POST 'https://api.dify.ai/v1/chat-messages' \ | |
--header 'Authorization: Bearer YOUR_API_KEY' \ | |
--header 'Content-Type: application/json' \ | |
--data-raw '{ | |
"inputs": {}, | |
"query": "こんにちは", | |
"response_mode": "blocking", | |
"conversation_id": "", | |
"user": "abc-123" | |
}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
url = 'https://api.dify.ai/v1/chat-messages' | |
headers = { | |
'Authorization': 'Bearer YOUR_API_KEY', | |
'Content-Type': 'application/json', | |
} | |
data = { | |
"inputs": {}, | |
"query": "hello", | |
"response_mode": "blocking", | |
"conversation_id": "", | |
"user": "abc-123" | |
} | |
response = requests.post(url, headers=headers, data=json.dumps(data)) | |
print(response.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment