Skip to content

Instantly share code, notes, and snippets.

@kuc-arc-f
Created July 17, 2025 09:10
Show Gist options
  • Save kuc-arc-f/be5a2c17cc31da73c04811c33aeb4bba to your computer and use it in GitHub Desktop.
Save kuc-arc-f/be5a2c17cc31da73c04811c33aeb4bba to your computer and use it in GitHub Desktop.
Dify , API-example python
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"
}'
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