/** * January AI - Nutrition Intelligence APIs * Build food and metabolic intelligence into your product — one API for understanding what people eat and how food may affect them. **Clinical-grade precision, consumer-grade experiences.** January builds the infrastructure underneath the product: turning messy health and nutrition data into reliable intelligence, so your team spends its time on the experience instead of the foundation. **Security & compliance** — **SOC 2 Type II** · **HIPAA-aligned practices** · **BAA** and **Zero Data Retention (ZDR)** available **What you can build** - **Scan food** — photo and text food recognition: detect foods and nutrition, then correct results conversationally - **Search the food database** — by name or barcode — and get healthier alternatives for any food - **Log food, water and weight** — per-user diaries with day-range queries - **Predict glucose response** to any meal — no sensor required **Getting started** 1. Create an API key in the [Developer Dashboard](https://dashboard.january.ai) — the full key is shown once, at creation. 2. Send it as `Authorization: Bearer sk-…` — click **Authorize** here to make every example below a live request. 3. On the endpoints that read or write an end user\'s logs, say whose with the `January-End-User-ID` header — each one documents it. No other endpoint takes it: everything else either asks the shared food database a question or works on the body you send, and neither depends on who the food is for. **Calling from a mobile app** — your `sk-` key must never ship inside an app. Instead, exchange it on your backend for a *client token*: a credential that lasts up to two hours, acts as exactly one of your end users, and carries only the scopes you grant it (see the **authentication** section). Your app then calls these endpoints directly, with no proxy of your own in the request path. Both credentials travel in the same `Authorization: Bearer` header, and every endpoint below opens by saying which it accepts — **API key or client token**, or **API key only**. **Support** — [support@january.ai](mailto:support@january.ai) · [Discord community](https://discord.gg/cYQeh3UnC) · [docs.january.ai](https://docs.january.ai) * * The version of the OpenAPI document: 1.2 * Contact: support@january.ai * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import * as runtime from '../runtime.js'; import { type CreateWaterLogBody } from '../models/CreateWaterLogBody.js'; import { type ListWaterLogsResponse } from '../models/ListWaterLogsResponse.js'; import { type WaterLog } from '../models/WaterLog.js'; export interface CreateWaterLogRequest { createWaterLogBody: CreateWaterLogBody; januaryEndUserID?: string; } export interface DeleteWaterLogRequest { logId: string; januaryEndUserID?: string; } export interface ListWaterLogsRequest { startDate: Date; endDate: Date; timezone: string; unit: string; januaryEndUserID?: string; } /** * */ export declare class WaterLogsApi extends runtime.BaseAPI { /** * Creates request options for createWaterLog without sending the request */ createWaterLogRequestOpts(requestParameters: CreateWaterLogRequest): Promise; /** * **API key or client token.** Records one amount of water, in `fl_oz`, `ml` or `cup` (1–811.5 fl_oz, 30–24000 ml, 0.1–101.4 cup). An end user\'s total is capped at 24 L (about 811 fl oz) per day: a log that would take the day of its `created_at` past it is refused with `daily_water_limit_exceeded`. Save the returned `id` to delete the log. Not idempotent: verify with the list endpoint before retrying a timed-out create, since a retry records the water twice and counts twice toward the cap. Callable with a client token carrying the `water_logs:write` scope. * Log water for a user */ createWaterLogRaw(requestParameters: CreateWaterLogRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * **API key or client token.** Records one amount of water, in `fl_oz`, `ml` or `cup` (1–811.5 fl_oz, 30–24000 ml, 0.1–101.4 cup). An end user\'s total is capped at 24 L (about 811 fl oz) per day: a log that would take the day of its `created_at` past it is refused with `daily_water_limit_exceeded`. Save the returned `id` to delete the log. Not idempotent: verify with the list endpoint before retrying a timed-out create, since a retry records the water twice and counts twice toward the cap. Callable with a client token carrying the `water_logs:write` scope. * Log water for a user */ createWaterLog(requestParameters: CreateWaterLogRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Creates request options for deleteWaterLog without sending the request */ deleteWaterLogRequestOpts(requestParameters: DeleteWaterLogRequest): Promise; /** * **API key or client token.** Idempotent: deleting an unknown or already-deleted log answers the same 204, so it is safe to retry. The amount no longer counts toward its day\'s cap. Callable with a client token carrying the `water_logs:write` scope. * Delete a water log */ deleteWaterLogRaw(requestParameters: DeleteWaterLogRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * **API key or client token.** Idempotent: deleting an unknown or already-deleted log answers the same 204, so it is safe to retry. The amount no longer counts toward its day\'s cap. Callable with a client token carrying the `water_logs:write` scope. * Delete a water log */ deleteWaterLog(requestParameters: DeleteWaterLogRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Creates request options for listWaterLogs without sending the request */ listWaterLogsRequestOpts(requestParameters: ListWaterLogsRequest): Promise; /** * **API key or client token.** Returns one total per local calendar day between `start_date` and `end_date` (both inclusive, in `timezone`), oldest first, in the `unit` you ask for, rounded to one decimal place. Days with nothing logged are absent. At most 100 days are returned — when more match, the most recent 100. `start_date` may reach back at most 5 years from today in `timezone`. An empty list is a valid result. Callable with a client token carrying the `water_logs:read` scope. * List a user\'s daily water totals in a date range */ listWaterLogsRaw(requestParameters: ListWaterLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * **API key or client token.** Returns one total per local calendar day between `start_date` and `end_date` (both inclusive, in `timezone`), oldest first, in the `unit` you ask for, rounded to one decimal place. Days with nothing logged are absent. At most 100 days are returned — when more match, the most recent 100. `start_date` may reach back at most 5 years from today in `timezone`. An empty list is a valid result. Callable with a client token carrying the `water_logs:read` scope. * List a user\'s daily water totals in a date range */ listWaterLogs(requestParameters: ListWaterLogsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; } //# sourceMappingURL=WaterLogsApi.d.ts.map