> For the complete documentation index, see [llms.txt](https://ai.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ai.ortusbooks.com/getting-started/installation.md). Agents can also search and read this documentation through its [MCP server](https://ai.ortusbooks.com/~gitbook/mcp).

# installation

Install the BoxLang AI module and make your first call.

## 📦 Install

**Requirements**: BoxLang 1.8+, and either an API key for a cloud provider or [Ollama](https://ai.ortusbooks.com/getting-started/installation/provider-setup.md) for free local AI.

Install the module globally with the BoxLang module installer:

```bash
install-bx-module bx-ai
```

Or locally for one application or runtime:

```bash
install-bx-module bx-ai --local
```

Using CommandBox:

```bash
box install bx-ai
```

## 🔑 Set your first provider

Put your key in an environment variable and name the provider in `boxlang.json`:

```bash
export OPENAI_API_KEY="sk-..."
```

```json
{
  "modules": {
    "bxai": {
      "settings": {
        "provider": "openai"
      }
    }
  }
}
```

The module reads `<PROVIDER>_API_KEY` for you, so `OPENAI_API_KEY` is picked up without an `apiKey` setting. Never commit a key to git.

## ✅ Verify

```javascript
// test-ai.bxs
println( aiChat( "Say hello!" ) )
```

```bash
boxlang test-ai.bxs
```

You should see a reply from your provider. If you get an error, check that the key is set in the same shell and see the troubleshooting section of [Provider Setup](https://ai.ortusbooks.com/getting-started/installation/provider-setup.md).

## 🚀 Next steps

1. [**Configuration**](https://ai.ortusbooks.com/getting-started/configuration.md): the settings you will use, on one page
2. [**Provider Setup**](https://ai.ortusbooks.com/getting-started/installation/provider-setup.md): details for every provider
3. [**Quick Start**](https://ai.ortusbooks.com/getting-started/quickstart.md): your first conversation


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://ai.ortusbooks.com/getting-started/installation.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
