AI Coach

Send message to AI coach (requires OpenAI)

Changed on
post/api/ai/respond

Request

  • Base URL
    https://api.rewritelifestyle.ai (the document declares no server; this is the origin it was published from)
  • URL
    https://api.rewritelifestyle.ai/api/ai/respond
  • Auth
    HTTP bearer

Headers

x-timezonestring required

Request body

messagestring required
sessionIdstring
session_idstring

Snake-case alias for sessionId

timezonestring
capabilitiesstring[]

Chat cards this client can render beyond the original set. Older builds send nothing and get today's behaviour. Known: "recipe_set" (up to three recipes in one card).

Example request

{
  "message": "How much protein should I eat today?",
  "sessionId": "session-abc-123",
  "session_id": "session-abc-123",
  "timezone": "America/New_York",
  "capabilities": [
    "recipe_set"
  ]
}

Response

unknown required

Example response

{
  "success": true,
  "response": "Great question! Based on your progress, I recommend increasing your protein intake to 130g daily.",
  "sessionId": "6b1f2c7e-3d4a-4f8b-9c21-0a5e7d8f1b32",
  "routerDecision": {
    "intent_mode": "chat",
    "tone_profile": "warm_direct",
    "anchor_type": "protein",
    "is_crisis": false
  },
  "recipeIntent": {
    "detected": false,
    "confidence": 0
  },
  "extra": {
    "card": {
      "type": "recipe",
      "v": 1,
      "status": "done",
      "payload": {
        "title": "Garlic Chicken with Broccoli",
        "macros": {
          "calories": 340,
          "protein": 42
        }
      }
    }
  }
}

Changes