/** * 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 CorrectPhotoScanBody } from '../models/CorrectPhotoScanBody.js'; import { type FoodScan } from '../models/FoodScan.js'; import { type ScanFoodPhotoBody } from '../models/ScanFoodPhotoBody.js'; import { type SearchFoodsByNaturalLanguageBody } from '../models/SearchFoodsByNaturalLanguageBody.js'; export interface CorrectPhotoScanRequest { correctPhotoScanBody: CorrectPhotoScanBody; } export interface ScanFoodPhotoRequest { scanFoodPhotoBody: ScanFoodPhotoBody; } export interface SearchFoodsByNaturalLanguageRequest { searchFoodsByNaturalLanguageBody: SearchFoodsByNaturalLanguageBody; } /** * */ export declare class PhotoScanningApi extends runtime.BaseAPI { /** * Creates request options for correctPhotoScan without sending the request */ correctPhotoScanRequestOpts(requestParameters: CorrectPhotoScanRequest): Promise; /** * **API key or client token.** Revises an analysis result. Send back the `analysis` object exactly as `POST /v1.2/food-analysis/image` or `/text` returned it, plus `instruction` describing the correction; the response is a corrected result with recalculated totals. Adjust portions through `instruction` (\"it was about half of that\") rather than editing serving quantities by hand. Nutrient keys a detection omits are filled in as zero automatically, and each detection must carry its selected catalog serving and consumed serving count. Callable with a client token carrying the `food_analysis:write` scope. * Correct an analysis in plain English */ correctPhotoScanRaw(requestParameters: CorrectPhotoScanRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * **API key or client token.** Revises an analysis result. Send back the `analysis` object exactly as `POST /v1.2/food-analysis/image` or `/text` returned it, plus `instruction` describing the correction; the response is a corrected result with recalculated totals. Adjust portions through `instruction` (\"it was about half of that\") rather than editing serving quantities by hand. Nutrient keys a detection omits are filled in as zero automatically, and each detection must carry its selected catalog serving and consumed serving count. Callable with a client token carrying the `food_analysis:write` scope. * Correct an analysis in plain English */ correctPhotoScan(requestParameters: CorrectPhotoScanRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Creates request options for scanFoodPhoto without sending the request */ scanFoodPhotoRequestOpts(requestParameters: ScanFoodPhotoRequest): Promise; /** * **API key or client token.** Analyzes a food photo and returns the detected foods with their nutrition and an aggregated total. The photo can show the food itself or a packaged product — the front of the pack, the ingredient list, or the Nutrition Facts panel all work, and a packaged product comes back as a single detection in the usual result shape. `image` accepts either an http(s) URL or a base64 data URI. Analysis can take tens of seconds for complex meals. Omit `reasoning` or set `reasoning.effort` to `xhigh` to use the reasoning-based analyzer; set its effort to `none` to use the standard analyzer. Both modes return the same response shape and use the same rate-limit bucket and credit cost. **Beta:** label reading is in testing — returned nutrition can be incomplete or differ from the printed values, so validate results before relying on them. A photo of nothing but a barcode is rejected; use `GET /v1.2/foods/barcode/{barcode}` for those. Best results come from sharp, well-lit photos with the food or the complete panel large in the frame; ~1,024 px on the shorter side is plenty, and downsizing huge images lowers latency. Callable with a client token carrying the `food_analysis:write` scope. * Analyze a food or label photo */ scanFoodPhotoRaw(requestParameters: ScanFoodPhotoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * **API key or client token.** Analyzes a food photo and returns the detected foods with their nutrition and an aggregated total. The photo can show the food itself or a packaged product — the front of the pack, the ingredient list, or the Nutrition Facts panel all work, and a packaged product comes back as a single detection in the usual result shape. `image` accepts either an http(s) URL or a base64 data URI. Analysis can take tens of seconds for complex meals. Omit `reasoning` or set `reasoning.effort` to `xhigh` to use the reasoning-based analyzer; set its effort to `none` to use the standard analyzer. Both modes return the same response shape and use the same rate-limit bucket and credit cost. **Beta:** label reading is in testing — returned nutrition can be incomplete or differ from the printed values, so validate results before relying on them. A photo of nothing but a barcode is rejected; use `GET /v1.2/foods/barcode/{barcode}` for those. Best results come from sharp, well-lit photos with the food or the complete panel large in the frame; ~1,024 px on the shorter side is plenty, and downsizing huge images lowers latency. Callable with a client token carrying the `food_analysis:write` scope. * Analyze a food or label photo */ scanFoodPhoto(requestParameters: ScanFoodPhotoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; /** * Creates request options for searchFoodsByNaturalLanguage without sending the request */ searchFoodsByNaturalLanguageRequestOpts(requestParameters: SearchFoodsByNaturalLanguageRequest): Promise; /** * **API key or client token.** Parses free text like \"a bowl of oatmeal with honey\" into detected foods with quantities and nutrition — the text counterpart of `POST /v1.2/food-analysis/image`. Text analyses return `meal_name: null` (the caller already has the words) and grade nothing, so every detection carries `confidence: null`. For keyword search over the food database, use `GET /v1.2/foods`. Callable with a client token carrying the `food_analysis:write` scope. * Analyze a meal description */ searchFoodsByNaturalLanguageRaw(requestParameters: SearchFoodsByNaturalLanguageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * **API key or client token.** Parses free text like \"a bowl of oatmeal with honey\" into detected foods with quantities and nutrition — the text counterpart of `POST /v1.2/food-analysis/image`. Text analyses return `meal_name: null` (the caller already has the words) and grade nothing, so every detection carries `confidence: null`. For keyword search over the food database, use `GET /v1.2/foods`. Callable with a client token carrying the `food_analysis:write` scope. * Analyze a meal description */ searchFoodsByNaturalLanguage(requestParameters: SearchFoodsByNaturalLanguageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; } //# sourceMappingURL=PhotoScanningApi.d.ts.map