curl --request POST \
--url https://api.example.com/api/ai/chat \
--header 'Content-Type: application/json' \
--data '
{
"history": [
{}
]
}
'{
"reply": "<string>",
"history": [
{}
],
"tasksCreated": true
}Send a message to the AI assistant and receive a response
curl --request POST \
--url https://api.example.com/api/ai/chat \
--header 'Content-Type: application/json' \
--data '
{
"history": [
{}
]
}
'{
"reply": "<string>",
"history": [
{}
],
"tasksCreated": true
}role field (“user” or “model”) and either a text field or parts field with the message content.curl -X POST https://api.example.com/api/ai/chat \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{
"history": [
{
"role": "user",
"text": "What tasks do I have in progress?"
}
]
}'
{
"reply": "You have 3 tasks in progress:\n- Implement user authentication (Project: Website Redesign, Type: Feature)\n- Fix login bug (Project: Website Redesign, Type: Bug Fix)\n- Update documentation (Project: Mobile App, Type: Documentation)",
"history": [
{
"role": "user",
"text": "What tasks do I have in progress?"
},
{
"role": "model",
"text": "You have 3 tasks in progress:\n- Implement user authentication (Project: Website Redesign, Type: Feature)\n- Fix login bug (Project: Website Redesign, Type: Bug Fix)\n- Update documentation (Project: Mobile App, Type: Documentation)",
"parts": "[...]"
}
],
"tasksCreated": false
}
{
"error": "Bad Request",
"message": "Gemini API key not configured"
}
{
"error": "Bad Request",
"message": "Gemini API rate limit exceeded. Please try again later."
}
{
"error": "Bad Request",
"message": "Invalid Gemini API key"
}
{
"error": "Unauthorized",
"message": "Invalid or missing authentication token"
}
{
"error": "Not Found",
"message": "User not found"
}