> ## Documentation Index
> Fetch the complete documentation index at: https://developer.box.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Box AI

export const SignupCTA = ({children}) => {
  return <div className="flex flex-wrap items-center gap-4 p-5 rounded-lg border border-gray-200 dark:border-gray-700 my-6" style={{
    background: "linear-gradient(135deg, rgba(0, 97, 213, 0.06), rgba(0, 97, 213, 0.02))"
  }}>
      <div className="flex-1 text-sm leading-relaxed text-gray-700 dark:text-gray-300" style={{
    minWidth: "280px"
  }}>
        {children}
      </div>
      <div className="flex flex-col items-center gap-2">
        <a href="https://account.box.com/signup/developer#ty9l3" className="signup-cta-button inline-flex items-center whitespace-nowrap px-5 py-2 text-sm font-semibold text-white no-underline">
          Get started for free
        </a>
        <a href="https://account.box.com/developers/console" className="signup-cta-login text-xs text-gray-500 dark:text-gray-400 no-underline whitespace-nowrap">
          Already have an account? Log in
        </a>
      </div>
    </div>;
};

export const MultiRelatedLinks = ({sections = []}) => {
  if (!sections || sections.length === 0) {
    return null;
  }
  return <div className="space-y-8">
      {sections.map((section, index) => <RelatedLinks key={index} title={section.title} items={section.items} />)}
    </div>;
};

export const RelatedLinks = ({title, items = []}) => {
  const getBadgeClass = badge => {
    if (!badge) return "badge-default";
    const badgeType = badge.toLowerCase().replace(/\s+/g, "-");
    return `badge-${badge === "ガイド" ? "guide" : badgeType}`;
  };
  if (!items || items.length === 0) {
    return null;
  }
  return <div className="my-8">
      {}
      <h3 className="text-sm font-bold uppercase tracking-wider mb-4">{title}</h3>

      {}
      <div className="flex flex-col gap-3">
        {items.map((item, index) => <a key={index} href={item.href} className="py-2 px-3 rounded related_link hover:bg-[#f2f2f2] dark:hover:bg-[#111827] flex items-center gap-3 group no-underline hover:no-underline border-b-0">
            {}
            <span className={`px-2 py-1 rounded-full text-xs font-semibold uppercase tracking-wide flex-shrink-0 ${getBadgeClass(item.badge)}`}>
              {item.badge}
            </span>

            {}
            <span className="text-base">{item.label}</span>
          </a>)}
      </div>
    </div>;
};

export const Link = ({href, children, className, ...props}) => {
  const localizedHref = href;
  return <a href={localizedHref} className={className} {...props}>
      {children}
    </a>;
};

Box AI API allows you to use Box AI
functionality
in your platform applications. For example, you can
implement Box AI question and answer
functionality in your third party application,
or generate content right in
your product’s content editor.

## Box AI API capabilities

Box AI API provides a number of capabilities
designed to help you leverage Large Language Models (LLMs)
in your application workflows.

You can ask Box AI to answer
user questions, summarize the document content,
or generate text you can use in your documents.
You can also use Box AI to extract metadata from the
provided input, such as a schema or metadata template.

The <Link href="/guides/embed/ui-elements/preview#box-ai-ui-element">Box AI for UI Elements</Link> functionality
allows embedding Box AI in your apps.

### Ask questions to Box AI

You can use Box AI API to ask questions about
the content, for example, while working
on documents you store in Box.

Box AI can answer your questions about the
content or generate a summary based on the
file you supply.

<Frame>
  <img src="https://mintcdn.com/box/KBEcg4yicgc_HMRY/images/guides/box-ai/box-ai-in-doc.png?fit=max&auto=format&n=KBEcg4yicgc_HMRY&q=85&s=92f515d9132bb3636ea4ac129fee038a" alt="box ai in documents" width="2260" height="324" data-path="images/guides/box-ai/box-ai-in-doc.png" />
</Frame>

Have a look at [Box AI for Documents][boxaidocs]
to see an example of how users can interact
with Box AI while
working with their documents.

### Generate text with Box AI

You can use Box AI API to generate text
from scratch, from existing text within a Box Note, or
based on a given document in Preview.
For example, you can ask Box AI to create a template
or meeting agenda based on an article you are viewing in
Preview.

Another example is Box Notes that uses Box AI
to generate text
and refine the already existing note content.
For details, see [Box AI for Notes][boxainotes].

<Frame>
  <img src="https://mintcdn.com/box/KBEcg4yicgc_HMRY/images/guides/box-ai/box-ai-in-notes.png?fit=max&auto=format&n=KBEcg4yicgc_HMRY&q=85&s=7f4da41ebd3b2d87e5cc73b48618c76e" alt="box ai in notes" width="1392" height="382" data-path="images/guides/box-ai/box-ai-in-notes.png" />
</Frame>

### Metadata extraction

The <Link href="/reference/post-ai-extract">`POST /2.0/ai/extract`</Link> and <Link href="/reference/post-ai-extract-structured">`POST /2.0/ai/extract_structured`</Link> endpoints allow you to extract data from the provided input and return them in a form of key-value pairs.

* Use the `extract_structured` endpoint to extract data according to a pre-defined structure obtained from the metadata template, or a set of fields. Use it for shorter documents
* Use the Enhanced Extract Agent for long, complex documents
* Use the `extract` endpoint to extract data from a file using a prompt that can include a stringified version of formats such as JSON or XML, or even plain text.

#### Enhanced Extract Agent

The Enhanced Extract Agent is designed to extract key-value pairs from complex documents. It converts the unstructured content into metadata for easier discovery and search.

You can <Link href="/guides/box-ai/ai-tutorials/extract-metadata-structured#">use the agent</Link> through the Box AI API and turn unstructured data into structured output to use in production databases, third party systems, or analytics.

The Enhanced Extract Agent uses Gemini 2.5 Pro to provide a chain-of-thought reasoning and returns both the extracted values and a reasoning behind
its answer.

### Configuration overrides

You can use the `ai_agent` parameter available in the Box AI API requests to override the default agent configuration and introduce your own custom settings.

For details, see <Link href="/guides/box-ai/ai-agents/get-agent-default-config">AI agent default configuration</Link>.

<SignupCTA>
  A free developer account gives you access to the Box AI API. Try document summarization, question answering, and metadata extraction through the API.
</SignupCTA>

### Box AI for UI Elements

Box AI for UI Elements is available in Content Preview
allows asking questions about documents directly
within platform applications.
Check out how to use the <Link href="/guides/embed/ui-elements/preview#box-ai-ui-element">Box AI for UI Elements</Link>
to embed Box AI functionality in your projects.

## Supported languages

Box AI works in a number of languages including
English, Japanese, French, Spanish, and many more.
However, the underlying models are primarily
trained on English language documents. This means
that prompts in other languages may return answers
of lower quality than in English. Tests have shown
satisfactory results for summarizing, checking grammar
and spelling, and answering questions, but bear in mind
that the results may be different than in English.

<Tip>
  Switch the language to Japanese to get
  better results for this language.
</Tip>

## Box AI API in User Activity Report (UAR)

[User Activity Reports][uar] provide an overview of the actions the users are taking in Box. Box Admins use this report to view the actions taken by their users within a given time period, and this includes interactions with Box AI. The report contains the following action types that Box admins can select to get details for Box AI:

* **AI query**: The user queried Box AI and received a response.
* **Failed AI query**: The user queried Box AI but did not receive a response.

[boxainotes]: https://support.box.com/hc/en-us/articles/22198577315347-Box-AI-for-Notes

[boxaidocs]: https://support.box.com/hc/en-us/articles/22158484213267-Box-AI-for-Documents

[uar]: https://support.box.com/hc/en-us/articles/4415012490387-User-Activity-Report

<RelatedLinks
  title="RELATED APIS"
  items={[
{ label: translate("Generate text"), href: "/reference/post-ai-text-gen", badge: "POST" },
{ label: translate("Ask question"), href: "/reference/post-ai-ask", badge: "POST" }
]}
/>

<RelatedLinks
  title="RELATED GUIDES"
  items={[
{ label: translate("Get started with Box AI"), href: "/guides/box-ai/ai-tutorials/prerequisites", badge: "GUIDE" },
{ label: translate("Ask questions to Box AI"), href: "/guides/box-ai/ai-tutorials/ask-questions", badge: "GUIDE" },
{ label: translate("Generate text with Box AI"), href: "/guides/box-ai/ai-tutorials/generate-text", badge: "GUIDE" },
{ label: translate("Extract metadata from file (structured)"), href: "/guides/box-ai/ai-tutorials/extract-metadata-structured", badge: "GUIDE" },
{ label: translate("Extract metadata from file (freeform)"), href: "/guides/box-ai/ai-tutorials/extract-metadata", badge: "GUIDE" }
]}
/>
