Skip to main content

Request template

As per these examples to call OpenAI the following template was used:
curl -X POST "https://api.openai.com/v1/responses" \
  -H "Authorization: Bearer <OPEN_AI_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "o4-mini",
    "instructions": "<PREFERENCES>",
    "input": "<REQUEST_PROMPT>",
    "tools": [
      {
        "type": "mcp",
        "server_label": "spike-health-data",
        "server_url": "https://app-api.spikeapi.com/v3/mcp",
        "headers": {
          "Authorization": "Bearer <SPIKE_ACCESS_TOKEN>"
        },
        "server_description": "Health and fitness data analysis server providing daily and hourly statistics from connected wearables and health devices.",
        "allowed_tools": ["query_statistics_daily"],
        "require_approval": "never"
      }
    ]
  }'
Filling in variables will give you very specific, tailored responses. Available tools should be autodetected by your client and usually you won’t need to restrict it’s usage (set to wildcard or ‘all’), but if you have a use case for such restriction, allowed values include query_sleep, query_statistics_daily, query_statistics_hourly, get_user_info, get_user_properties. Possibilities are limitless, but let’s look at the few concrete examples below.

Walking statistics

Given the prompt show my total steps and calories burned each day over the last week with a set of instructions similar to “display the output as a lean sentence, listing the data in a readable way. Add averages at the end. Compare my walking trend to other female in their forties living in Paris”, produced response would look something like: From Aug 14 to 20 you took 6 613 steps (2 349 kcal), 3 437 steps (1 893 kcal), 2 976 steps (1 917 kcal), 2 538 steps (1 680 kcal), 6 364 steps (2 001 kcal), 6 202 steps (2 223 kcal) and 6 526 steps (2 170 kcal) respectively, averaging 4 951 steps and 2 033 kcal, with a mid-week dip before recovering to near your week’s start, below the ~7 000-step daily average for Parisian women in their forties. Given the prompt between 10 Aug and 15 Aug 2025, what were the trends of my sleep quality, including duration and score with a set of instructions similar to “present data in a concise readable sentence, include single recommendation how to improve sleep quality, given my age from user profile”, produced response would look something like below. Notice that specific age was not given as input, but through combination of multiple requests, all data from APIs is gathered to serve the best possible response. Between 10 and 15 August 2025, your nightly sleep duration ranged from 7 h 10 m to 8 h 49 m - speaking on the 11th, dipping mid-period, rising to its highest on the 14th before falling on the 15th - and your sleep score climbed steadily from 87 to 94 by the 14th then eased to 88; Given your age of 30, try a consistent wind-down routine - such as limiting screen time 30 minutes before bed - to boost your deep-sleep proportion.

Symptom diary analysis

Given the prompt analyze my migraine frequency from my symptom diary alongside my stress levels and heart rate variability data from the past month with user-provided symptom diary data and instructions “correlate symptom occurrences with biometric data, identify potential triggers, and suggest patterns for monitoring”, the AI would produce a comprehensive analysis like: Your migraine diary shows 8 episodes in the past month, with higher frequency during weeks of elevated stress scores (avg 7.2/10 vs baseline 4.8/10) and significantly lower HRV values (42ms vs your typical 58ms) on migraine days. Stress spikes preceded 6 of 8 migraines by 24-48 hours, while your resting heart rate increased by 8-12 bpm during these periods. Consider tracking caffeine intake and sleep debt as additional data points, as your migraines clustered around days with < 6.5h sleep and stress scores above 6.

Mood and energy correlation

Given the prompt how does my daily mood rating correlate with my activity levels and recovery metrics over the past 6 weeks with user-provided mood journal entries rated 1-10, the analysis might reveal: Your mood ratings (avg 6.8/10) show strong positive correlation (r=0.73) with your recovery scores and moderate correlation (r=0.52) with daily step count. Days with mood ratings below 5 consistently aligned with recovery scores under 60% and step counts below 4,000. Your highest mood days (8-10) occurred when recovery exceeded 75% and you maintained 7,000+ steps, suggesting activity level and adequate recovery significantly impact your emotional well-being.

Medication timing optimization

Given the prompt analyze the effectiveness of my medication timing based on my symptom tracking and heart rate patterns with medication log and symptom severity ratings, a response could be: Your medication timing data reveals optimal efficacy when taken 2 hours before typical symptom onset (11 AM vs 2 PM dosing). Heart rate variability improved by 15% and symptom severity decreased from average 6.2/10 to 3.8/10 with morning dosing. Days with missed doses showed 24% higher stress scores and elevated resting heart rate (+9 bpm), indicating consistent timing enhances both subjective symptoms and objective cardiovascular metrics.

Nutrition and performance tracking

Given the prompt correlate my food diary entries with my workout performance and recovery data over the past month with detailed nutrition logs including macronutrient breakdown, a comprehensive analysis might show: Your workout intensity scores correlate strongly (r=0.68) with carbohydrate intake 2-4 hours pre-exercise, with optimal performance when consuming 45-60g carbs beforehand. Recovery scores improved significantly (avg 78% vs 61%) on days with protein intake exceeding 1.2g/kg body weight. Your energy crashes (recorded in your diary) consistently occurred after high-sugar meals (>40g simple carbs), coinciding with heart rate spikes and reduced HRV for 3-4 hours post-meal.

Work stress and biometric patterns

Given the prompt analyze how my work stress levels from my daily journal correlate with my cardiovascular metrics and sleep patterns with work stress ratings (1-10) and meeting/deadline tracking, the analysis could reveal: High work stress days (7-10/10) consistently showed 18% higher resting heart rate, 25% lower HRV, and delayed sleep onset by an average of 47 minutes. Your stress scores peaked during weeks with >25 hours of meetings, correlating with elevated cortisol indicators (reduced deep sleep % and morning HRV suppression). Recovery scores dropped below 50% during consecutive high-stress days, suggesting cumulative cardiovascular impact that requires 2-3 low-stress days to normalize.

Environmental factors and health metrics

Given the prompt how do weather patterns and air quality from my location tracking affect my breathing exercises effectiveness and overall wellness scores with environmental data and mindfulness practice logs: Your breathing exercise effectiveness (measured by HRV improvement post-session) decreased by 31% on days with AQI >100, while high humidity days (>80%) reduced your typical 12% HRV boost to just 4%. Optimal conditions for your practice were cool, dry days (15-20°C, < 60% humidity) with minimal air pollution, where sessions consistently improved your stress scores by 2-3 points and maintained elevated HRV for 4-6 hours afterward.