/** * 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. */ /** * * @export * @interface ClientToken */ export interface ClientToken { /** * The credential itself. Shown exactly once — it is stored only as a hash and can never be retrieved again. * @type {string} * @memberof ClientToken */ token: string; /** * Seconds until the token expires, counted from the moment this response was produced. Compute expiry from this rather than from `expires_at` — a device clock that is wrong makes an absolute timestamp wrong with it. * @type {number} * @memberof ClientToken */ expiresIn: number; /** * The same expiry as an absolute UTC instant, for logs and humans. * @type {Date} * @memberof ClientToken */ expiresAt: Date; /** * The end user this token is bound to, echoed back so a caller can assert it minted what it meant to. * @type {string} * @memberof ClientToken */ endUserId: string; /** * What this token may do — the exact scopes it was granted, echoed back so a caller can assert it minted what it meant to. * @type {Array} * @memberof ClientToken */ scopes: Array; } /** * @export */ export declare const ClientTokenScopesEnum: { readonly foodsRead: 'foods:read'; readonly foodAnalysisWrite: 'food_analysis:write'; readonly foodLogsRead: 'food_logs:read'; readonly foodLogsWrite: 'food_logs:write'; readonly glucoseRead: 'glucose:read'; readonly restaurantsRead: 'restaurants:read'; readonly waterLogsRead: 'water_logs:read'; readonly waterLogsWrite: 'water_logs:write'; readonly weightLogsRead: 'weight_logs:read'; readonly weightLogsWrite: 'weight_logs:write'; readonly unknownDefaultOpenApi: '11184809'; }; export type ClientTokenScopesEnum = typeof ClientTokenScopesEnum[keyof typeof ClientTokenScopesEnum]; /** * Check if a given object implements the ClientToken interface. */ export declare function instanceOfClientToken(value: object): value is ClientToken; export declare function ClientTokenFromJSON(json: any): ClientToken; export declare function ClientTokenFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClientToken; export declare function ClientTokenToJSON(json: any): ClientToken; export declare function ClientTokenToJSONTyped(value?: ClientToken | null, ignoreDiscriminator?: boolean): any; //# sourceMappingURL=ClientToken.d.ts.map