Skip to main content
Box AI API is available to all customers Business and above.
Box AI API allows you to ask a question about a supplied file or a set of files, and get a response based on the content. For example, while viewing a document in Box, you can ask Box AI to summarize the content. You can also ask questions against a . When you pass a hub as the item, Box AI searches the hub’s indexed content and returns answers grounded in the curated documents the querying user has access to. See below.

Before you start

Make sure you followed the steps listed in to create a platform app and authenticate.

Send a request

To send a request containing your question, use the POST /2.0/ai/ask endpoint and provide the mandatory parameters.

Parameters

To make a call, you need to pass the following parameters. Mandatory parameters are in bold.

Use cases

Ask questions about an item

This example shows how to ask a question about one or more items using the POST ask/ai API. When using this endpoint, remember to specify the mode parameter depending on the number of items you want to supply.
The response will be as follows:

Ask questions about a hub

Instead of supplying individual files, you can point Box AI at an entire and ask questions across all of its curated content. This is useful for knowledge bases such as RFP answer banks, policy libraries, and product documentation portals, where you want natural language answers grounded in an approved set of materials without managing file IDs yourself. To query a hub, set items.type to hubs and items.id to the hub ID. A hub must be supplied as the only item in the request. The example below uses single_item_qa mode, which is the pattern shown in the .
Box AI searches the hub’s indexed content and returns an answer grounded in your approved materials. Because hubs inherit Box permissions, Box AI only references documents the querying user has access to. The hub must have AI features enabled (see ). For an end-to-end walkthrough that provisions a hub, populates it with content, and queries it with Box AI, see the tutorial.

Ask questions with content parameter

If you use the content parameter as the source of input for Box AI, it will use it as the primary source.
The response to this request is based on the content parameter instead of the file’s content:

Ask questions with citations parameter

Setting the citations parameter to true causes the response to include excerpts from source file or files Box AI used to compile the answer.
The resulting answer includes the source file and direct content citations.
Last modified on July 13, 2026