Skip to main content

Endpoint

POST /api/chat

Overview

Interact with the AI health assistant by sending messages and receiving intelligent responses based on the user’s health data.
The chat API supports multiple LLM providers including OpenAI, Google Gemini, Anthropic Claude, and OpenRouter.

Request

message
string
required
The user’s message or question
user_id
string
required
Unique identifier for the user
session_id
string
Optional session ID to maintain conversation context
provider
string
LLM provider to use: openai, google, anthropic, or openrouter. Defaults to configured provider.
curl -X POST http://localhost:18080/api/chat \
  -H "Content-Type: application/json" \
  -d '{
    "message": "How many steps did I take yesterday?",
    "user_id": "user_123",
    "session_id": "session_abc"
  }'

Response

{
  "response": "Based on your Garmin data, you took 10,543 steps yesterday. That's about 200 steps more than your daily average!",
  "session_id": "session_abc",
  "timestamp": "2024-01-15T10:30:00Z",
  "provider": "openai",
  "model": "gpt-4"
}
The AI assistant has access to the user’s connected health data and can answer questions about activity, sleep, heart rate, and other metrics.