> ## 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

> Technical reference for Box AI request handling, input limits, model behavior, and the agent override system.

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 = localizeLink(href);
  return <a href={localizedHref} className={className} {...props}>
      {children}
    </a>;
};

This section contains developer guides for working with Box AI. For a summary of API capabilities, quick starts, and reference links, see the [Box AI API](/ai/box-ai-api) page.

The below guides cover what you need to know before you start writing code: how Box AI processes requests, what limits apply to different endpoints, how to control model behavior through agent overrides, and where to find the specific tutorial for your use case.

<SignupCTA>
  A free developer account gives you access to the Box AI API, Developer Console, and everything you need to start building.
</SignupCTA>

## How requests are processed

When you send a request to a Box AI endpoint, Box handles the model infrastructure for you. Your request flows through the following stages:

* **File retrieval**: Box reads the file content from the `items` array you provide. If you include the optional `content` parameter, that text is used as the primary input instead of the file's stored content. For `POST /ai/ask`, an `items` entry can also be a [Box Hub](/guides/hubs-api/index) (`"type": "hubs"`), in which case Box searches the hub's indexed content instead of a single file. See [Ask questions about a hub](/guides/box-ai/ai-tutorials/ask-questions#ask-questions-about-a-hub).
* **Representation generation**: For text-based files, Box converts the document into a text representation. For images, Box applies OCR automatically on supported endpoints.
* **Model routing**: Box routes the request to the default model for that endpoint and mode. You can override this with the `ai_agent` parameter.
* **Response generation**: The LLM processes your prompt against the file content and returns a result. Box handles token windowing for long documents (splitting content into chunks with embeddings for `long_text` configurations).

<Note>
  Box AI does not support multi-modal requests. If you send both images and text in the same request, only the text is processed.
</Note>

## Input limits

The limits below apply across Box AI endpoints. Exceeding these limits does not produce an error in most cases; Box truncates to the limit and processes what it can.

### Text and prompt limits

| Constraint                                         | Limit                                           |
| -------------------------------------------------- | ----------------------------------------------- |
| Prompt length                                      | 10,000 characters                               |
| Single file text representation (`single_item_qa`) | 2 MB of text. Content beyond 2 MB is truncated. |
| Multiple files (`multiple_item_qa`)                | Up to 25 files                                  |
| Items array for `text_gen`                         | Exactly 1 file                                  |
| Items array for `extract` and `extract_structured` | Exactly 1 file                                  |

### Image limits

| Constraint                          | Limit                                                    |
| ----------------------------------- | -------------------------------------------------------- |
| Resolution                          | 1024 x 1024 pixels                                       |
| Maximum images or pages per request | 5. If more are provided, only the first 5 are processed. |

### OCR and file format support

OCR is **not** available on all endpoints.

| Endpoint                      | OCR             | Supported file formats |
| ----------------------------- | --------------- | ---------------------- |
| `POST /ai/text_gen`           | No              | Text-based files       |
| `POST /ai/extract`            | No              | Text-based files       |
| `POST /ai/extract_structured` | Yes (automatic) | PDF, TIFF, PNG, JPEG   |

### Language support

Box AI works in English, Japanese, French, Spanish, and many other languages. However, the underlying models are primarily trained on English, so prompts in other languages may return lower quality results.

The `extract_structured` endpoint has explicit multilingual support for:

* English, Japanese, Chinese, Korean
* Cyrillic-based languages (Russian, Ukrainian, Bulgarian, Serbian)

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

## The `ai_agent` override system

The following Box AI endpoints accept an optional `ai_agent` parameter that lets you override the default model configuration: `POST /ai/ask`, `POST /ai/text_gen`, `POST /ai/extract`, and `POST /ai/extract_structured`. This is how you control which LLM runs, how it behaves, and what instructions it receives.

### When to use overrides

* **Pinning a model version**: Box updates default models regularly. If your downstream process depends on consistent output, pin to a specific model to avoid unexpected changes.
* **Switching models**: Different models produce different results. You can switch to any model in the <Link href="/guides/box-ai/ai-models/index">supported models list</Link> to optimize for your use case.
* **Customizing prompts**: The `prompt_template` and `system_message` parameters let you steer the LLM's behavior without changing your application code.
* **Tuning creativity**: Adjust `temperature` and other `llm_endpoint_params` to control how deterministic or creative the output is.

### How it works

<Steps>
  <Step title="Get the default configuration">
    Call <Link href="/reference/get-ai-agent-default">`GET /2.0/ai_agent_default`</Link> with the `mode` you want (`ask`, `text_gen`, `extract`, or `extract_structured`) to retrieve the current defaults.
  </Step>

  <Step title="Modify the configuration">
    Change the fields you need: `model`, `prompt_template`, `system_message`, `llm_endpoint_params`, or `num_tokens_for_completion`. Leave other fields unchanged.
  </Step>

  <Step title="Pass it back in your request">
    Include the modified configuration as the `ai_agent` parameter in your `POST` request. Box uses your overrides for that request only.
  </Step>
</Steps>

### Configuration structure by endpoint

The `ai_agent` object structure varies by endpoint because each handles content differently:

| Endpoint                      | Agent type                    | Configuration keys                                               |
| ----------------------------- | ----------------------------- | ---------------------------------------------------------------- |
| `POST /ai/ask`                | `ai_agent_ask`                | `basic_text`, `basic_text_multi`, `long_text`, `long_text_multi` |
| `POST /ai/text_gen`           | `ai_agent_text_gen`           | `basic_gen`                                                      |
| `POST /ai/extract`            | `ai_agent_extract`            | `basic_text`, `long_text`                                        |
| `POST /ai/extract_structured` | `ai_agent_extract_structured` | `basic_text`, `long_text`                                        |

The `ask` endpoint has four configuration keys because it handles both single-item and multi-item modes, and both short and long documents. When using `multiple_item_qa` mode, the `_multi` variants apply.

For `long_text` configurations, Box splits the content into chunks using an embeddings model. You can configure the embeddings model and chunking strategy as part of the override.

### LLM parameter differences by provider

The `llm_endpoint_params` options depend on the model provider:

| Provider                                                                      | Param type      | Key difference                                                    |
| ----------------------------------------------------------------------------- | --------------- | ----------------------------------------------------------------- |
| <Link href="/reference/resources/ai-llm-endpoint-params-openai">OpenAI</Link> | `openai_params` | Use `temperature` **or** `top_p`, not both                        |
| <Link href="/reference/resources/ai-llm-endpoint-params-google">Google</Link> | `google_params` | `temperature` works with `top_p` and `top_k` together             |
| <Link href="/reference/resources/ai-llm-endpoint-params-aws">AWS</Link>       | `aws_params`    | Same as Google: `temperature` works alongside `top_p` and `top_k` |

For detailed override examples, see the <Link href="/guides/box-ai/ai-agents/ai-agent-overrides">AI model overrides</Link> guide and the <Link href="/guides/box-ai/ai-tutorials/default-agent-overrides">override tutorial</Link>.

### Model versioning

Box guarantees each AI agent configuration snapshot for at least 12 months, with a 6-month transition window when a new version is released. Default model changes are posted in the <Link href="/changelog">developer changelog</Link>. To avoid disruption, pin your agent configuration to a specific model version using overrides.

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

## Box AI for UI Elements

The <Link href="/guides/embed/ui-elements/preview#box-ai-ui-element">Box AI for UI Elements</Link> integration embeds question-answering directly into Content Preview within your application. This lets end users interact with Box AI without leaving your UI.

## User Activity Reports

[User Activity Reports][uar] track Box AI interactions. Box admins can filter for the following action types:

| Action type         | Description                                            |
| ------------------- | ------------------------------------------------------ |
| **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 |

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

## Guides in this section

<CardGroup cols={2}>
  <Card title="Tutorials" icon="graduation-cap" href={localizeLink("/guides/box-ai/ai-tutorials/index")}>
    Step-by-step guides for each endpoint: ask, text generation, extraction,
    and model overrides.
  </Card>

  <Card title="Model overrides" icon="sliders" href={localizeLink("/guides/box-ai/ai-agents/index")}>
    Override default models, prompts, and LLM parameters. Includes the
    default configuration reference and versioning policy.
  </Card>

  <Card title="Supported models" icon="microchip" href={localizeLink("/guides/box-ai/ai-models/index")}>
    Full list of core and customer-enabled models with capability tiers,
    compliance badges, and API names.
  </Card>

  <Card title="Quick starts" icon="rocket" href={localizeLink("/ai/box-ai-api#quick-starts")}>
    Get up and running in minutes with Python SDK walkthroughs for
    summarization and extraction.
  </Card>
</CardGroup>

## See Box AI in action

These end-to-end tutorials show how to combine Box AI with other platform capabilities to build production-ready automations.

<CardGroup cols={2}>
  <Card title="Invoice intake automation" icon="file-invoice" href={localizeLink("/tutorials/invoice-intake")} arrow="true">
    Use Box AI Extract and metadata to automate accounts payable - extract vendors, totals, and dates from every invoice.
  </Card>

  <Card title="Sales RFP answer bank" icon="magnifying-glass" href={localizeLink("/tutorials/sales-rfp-answer-bank")} arrow="true">
    Build an AI-powered knowledge base with Box Hubs and let sales reps query approved proposals in natural language.
  </Card>
</CardGroup>
