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.