Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
The documentation for using the nutrition advisor ai, and other related tools
The documentation for the advisor API guide is linked below.
*Note that you can ignore the authorization section of the linked documentation. Your token from Nutrition Hub Authorization will work.
Nutrition Hub allows access to all nutrition-related services on a credit-usage basis
Nutrition Hub is a comprehensive platform providing access to a wide range of nutritional data and services. With our industry-leading food recognition and nutrition tracking SDK, your team can effortlessly integrate real-time, on-device food recognition and hands-free food tracking functionality into mobile applications.
Below is a quick overview of the key capabilities enabled by our Nutrition-AI technology.
With a single API key, you gain access to multiple powerful APIs, including:
Food Database API: Detailed nutritional information for thousands of food items.
Nutrition Advisor API: AI-driven personalized nutrition advice.
Vision AI API: Image recognition for analyzing food items and extracting nutritional data.
Text AI API: text-based ai suggestions, meal log assist tools, recipe builder, similar item suggestions etc, tailored to a users profile
Credit-Based Usage
Nutrition Hub uses a credit-based system, where each API call consumes a specific number of tokens. Your subscription includes a certain number of tokens, allowing you to use the services as needed.
Explore the documentation to learn more about how to integrate and make the most out of Nutrition Hub's features.
Links to the documentation for using the nutrition ai sdk
Included in your Nutrition Hub products is the mobile application SDK. Simply follow the setup guide for the target operating system, and use your Nutrition Hub api key as its configuration.
How tokens are used in API calls, and how to track their usage
The API operates on a credit usage basis. Your subscription includes X million tokens. Each API call consumes tokens.
API Request:
Vision AI Request:
Text AI Request:
Chat Message Request:
X-Budget-Cap
: 12,000,000 (total tokens available in the current period)
X-Period-Usage
: 494,188 (tokens used in the current period)
X-Request-Usage
: 634 (tokens used by the current request)
Monitor these headers to track your API usage and avoid exceeding your token limit.
You can also see your total usage in your accounts portal dashboard for this product. This will display usage, % used and free, etc.
The dashboard also contains a section to show your usage in a few different breakdowns. It allows you to see number (total)
and token usage (total)
for requests of certain types (ai chat, api call, vision ai tools, etc) or by the API path that made the request (grouped after a certain level of path-specificity).
Food search, nutrient details, voice or image meal logging, etc.
The documentation for the API guide is linked below.
*Note that you can ignore the authorization section of the linked documentation. Your token from Nutrition Hub Authorization will work.
How to obtain your access token to authenticate your api calls
To use the Nutrition Hub APIs, you need to obtain a Bearer Token using your API key. Follow the steps below to authorize your API requests.
Obtain Bearer Token
Endpoint: POST
Path Parameters:
key
: Your API or license key provided in your product dashboard.
Response Schema:
access_token
(string): The Bearer Token you will use to authorize your API requests.
expires_in
(number): Token expiration time in seconds.
scope
(string): The scope of the token.
token_type
(string): The type of the token, typically "Bearer".
Example Request:
Example Response:
Using the Bearer Token
Include the access_token
in the Authorization header for all your API requests. The only required header is the Authorization
header with the Bearer token.
Example Authorization Header: