Array of previous messages for conversation context. Each message should have ‘role’ (“user” or “assistant”) and ‘content’ (string).
Copy
curl -X POST 'https://api.d1g.qzz.io/api/v1/ai/chat' \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "message": "Suggest trending topics for fitness content this week", "conversationHistory": [ {"role": "user", "content": "I create fitness content"}, {"role": "assistant", "content": "Great! I can help you with fitness content ideas."} ] }'
Copy
{ "success": true, "data": { "response": "Based on current trends, here are some trending topics for fitness content this week:\n\n1. **Home Workout Challenges** - Short, intense home workouts are trending\n2. **Post-Workout Recovery** - Recovery techniques and stretching content\n3. **Fitness Tech Reviews** - Smart fitness equipment reviews\n4. **Seasonal Fitness Goals** - Winter fitness motivation\n5. **Mental Health & Fitness** - Connection between wellness and fitness\n\nThese topics tend to perform well for fitness creators!" }}
{ "success": true, "data": { "script": "**[Hook]**\nStop hitting snooze! Transform your mornings with this 5-minute routine that'll energize your entire day!\n\n**[Main Content]**\nStart with 30 seconds of jumping jacks to get your heart pumping!\n30 seconds of high knees - bring that energy up!\n30 seconds of squats - build that lower body strength!\n30 seconds of push-ups - modify on your knees if needed!\n30 seconds of mountain climbers - core engagement time!\n30 seconds of plank hold - breathe and stay strong!\n\n**[CTA]**\nTry this every morning for a week and watch your energy levels soar! Don't forget to like and follow for more quick workouts!\n\n**[Optional Notes]**\n- Use upbeat music\n- Show each exercise clearly\n- Include countdown timer on screen\n- Hashtags: #morningworkout #quickworkout #fitness" }}
When using Google Gemini, you may encounter provider-specific errors:
Copy
{ "success": false, "error": { "code": "AI_PROVIDER_ERROR", "message": "Google Gemini API returned an error", "details": { "provider": "google_gemini", "errorCode": "RESOURCE_EXHAUSTED", "errorMessage": "Quota exceeded for this API key" } }}
Best Practice: Always handle AI errors gracefully in your application and provide fallback content or retry mechanisms.
AI-generated content should be reviewed and verified before publishing. We are not responsible for AI-generated content accuracy, compliance, or copyright issues.