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

Overview

Beta

Add food search, food analysis, restaurant search, voice capture, food, water, and weight logging, and glucose prediction to a native Android app, with Kotlin coroutines and typed models.

Start here

  1. Add a token endpoint to your backend, or run the token relay while you build.

  2. Implement JanuaryTokenProvider in the app (Authentication).

Security model

The app gets a short-lived client token (ct-…) from your backend and sends it directly to January. Your API key (sk-…) stays on your backend. Never put it in an APK, whether in Gradle properties, BuildConfig, resources, or remote configuration.

Android app ── POST with the app session ──▶ Your backend
                                                  │
                                                  │ POST /v1.2/auth/client-tokens
                                                  │ with your API key
                                                  ▼
                                             January API
                                                  │
Android app ◀── { token, expires_in } ────────────┘
     │
     └── Authorization: Bearer ct-… ──▶ January API

The SDK always calls the production January API. It has no base-URL setting, and it never sees your token endpoint's URL; only your token provider does. How authentication works walks through the flow.

Never log tokens, API keys, meal images, nutrition data, or health profiles, and keep them out of analytics.

Requirements

Android API 24 or later, compile SDK 36, Java 17, and core library desugaring in every app that uses the SDK. Compatibility and permissions lists the verified toolchain and the permissions the SDK adds.

The example app uses every resource and the native food scanner.

Last updated

Was this helpful?