For the complete documentation index, see llms.txt. This page is also available as Markdown.

Glucose prediction

Predict the glucose response to a meal without requiring a sensor. Optional CGM history can personalize the same operation.

Predict the glucose response to a meal

post

API key or client token.

Predicts the glucose curve a meal will produce for the given profile and body.timezone (required — the IANA timezone the end user is in; the prediction depends on the meal's local time of day). Optionally personalize by sending cgm_data with the consumed_foods eaten during it (both together; the upstream needs at least five complete days of paired history). Nothing is stored, so there is no end-user identity to send: the request acts as the partner itself.

Callable with a client token carrying the glucose:read scope.

Authorizations
AuthorizationstringRequired

Your credential, sent as Authorization: Bearer <credential>. Two kinds reach this API, and the prefix tells them apart.

API key (sk-…) — created in the Developer Dashboard, it authenticates your whole account. Use it only where you control the machine — never inside a mobile app or a browser. Every endpoint accepts it.

Client token (ct-…) — a short-lived credential bound to one of your end users, minted from your API key by POST /v1.2/auth/client-tokens on your backend and relayed to the device. Safe to hold on a phone: it expires within 2 hours and acts only as the user it was minted for. Endpoints that open with API key or client token accept one and name the scope it must carry; endpoints that open with API key only refuse it.

Body
timezonestringRequired

The IANA timezone the end user is in. The prediction depends on the meal's local time of day.

Example: America/New_York
start_timestring · date-timeRequired

When the meal is (or will be) eaten. Must carry a timezone designator.

Example: 2024-09-13T11:34:56Z
Responses
200

points, the predicted glucose curve at 15-minute intervals, plus the meal's overall impact score and suggested chart bounds for rendering it.

application/json
impact_scorestring · enum · nullableRequired

The meal's overall glucose impact. Null when the model returned no grade, or one outside this list.

Example: lowPossible values:
post/v1.2/glucose/predictions
POST /v1.2/glucose/predictions HTTP/1.1
Host: partners.january.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 323

{
  "user_profile": {
    "age": 42,
    "sex": "female",
    "height": {
      "value": 66,
      "unit": "in"
    },
    "weight": {
      "value": 150,
      "unit": "lb"
    },
    "activity_level": "moderately_active",
    "health_conditions": [
      "prediabetes"
    ]
  },
  "foods": [
    {
      "food_id": "101963552",
      "serving_id": "68051535",
      "quantity": 1.4
    }
  ],
  "start_time": "2024-09-13T11:34:56Z",
  "timezone": "America/New_York"
}
{
  "points": [
    {
      "minutes": 30,
      "value": 140
    }
  ],
  "impact_score": "low",
  "chart": {
    "min": 70,
    "max": 140
  }
}

Last updated

Was this helpful?