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

# Installation

> Install and verify the Flint AI TypeScript SDK

Install the Flint AI TypeScript SDK to route your LLM traffic through the guardrails proxy. The SDK wraps your existing LLM client with a single function call — no code changes needed beyond the initial setup.

<Card title="Flint AI on GitHub" icon="github" href="https://github.com/sandbox-quantum/flintai-cli">
  Source code, example agents, and issue tracking
</Card>

## Requirements

* **Node.js 18 or later**
* **npm**, **pnpm**, or **yarn**

## Install the SDK

```bash theme={null}
npm install @sandboxaq/flintai-sdk-ts
```

The base package has no runtime dependencies. Each provider library is an optional peer dependency, loaded only when you route through that provider — install the ones you use:

```bash theme={null}
npm install @sandboxaq/flintai-sdk-ts openai              # OpenAI
npm install @sandboxaq/flintai-sdk-ts @anthropic-ai/sdk   # Anthropic
npm install @sandboxaq/flintai-sdk-ts @google/genai       # Google GenAI
npm install @sandboxaq/flintai-sdk-ts @google/adk         # Google ADK (includes Google GenAI)
```

For LangChain chat models, install the matching LangChain package (`@langchain/openai`, `@langchain/anthropic`, or `@langchain/google-genai`).

<Accordion title="Peer dependencies and version ranges">
  | Peer package              | Supported range | Used for                                                |
  | ------------------------- | --------------- | ------------------------------------------------------- |
  | `openai`                  | `^6.41.0`       | OpenAI SDK and LangChain `ChatOpenAI`                   |
  | `@anthropic-ai/sdk`       | `^0.100.1`      | Anthropic SDK and LangChain `ChatAnthropic`             |
  | `@google/genai`           | `^2.8.0`        | Google GenAI SDK and LangChain `ChatGoogleGenerativeAI` |
  | `@langchain/openai`       | `^1.4.7`        | LangChain `ChatOpenAI`                                  |
  | `@langchain/anthropic`    | `^1.4.0`        | LangChain `ChatAnthropic`                               |
  | `@langchain/google-genai` | `^2.1.31`       | LangChain `ChatGoogleGenerativeAI`                      |
  | `@google/adk`             | `^1.2.0`        | Google ADK plugin                                       |
  | `dotenv`                  | `^17.4.2`       | `.env` file loading (optional)                          |

  Every peer is optional and loaded dynamically, so a missing one surfaces only when you route through that provider — with a clear "install X" error — not at install time. For the three LLM SDKs, `wrap()` also enforces the range at runtime and throws if the installed version is below the minimum or above the maximum supported major.
</Accordion>

## Verify your installation

```typescript theme={null}
import { VERSION } from "@sandboxaq/flintai-sdk-ts";

console.log(VERSION);
```

You should see the installed version number (such as `0.3.1`).

## Module formats

The SDK ships both ES module and CommonJS builds with TypeScript types, so it works in either module system:

```typescript theme={null}
// ES modules
import { wrap } from "@sandboxaq/flintai-sdk-ts";
```

```javascript theme={null}
// CommonJS
const { wrap } = require("@sandboxaq/flintai-sdk-ts");
```

The Google ADK plugin is a subpath export:

```typescript theme={null}
import { ADKGuardrailsPlugin } from "@sandboxaq/flintai-sdk-ts/plugins/adk";
```

<Accordion title="Troubleshooting">
  **`Cannot find module '@sandboxaq/flintai-sdk-ts'`**

  Confirm the install completed in the same project where you import it, and that your `package.json` lists it under `dependencies`.

  **`Cannot find module 'openai'` (or another provider) at runtime**

  Peers are loaded dynamically, so a provider you route through must be installed. Add the peer for that provider — see the table above.

  **Provider version warning or error from `wrap()`**

  `wrap()` reads the installed provider version and rejects one outside the supported range. Install a version within the range shown above:

  ```bash theme={null}
  npm install openai@^6.41.0
  ```

  **Provider auto-detection fails when multiple provider keys are set**

  If more than one provider API key is present in your environment (`OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GOOGLE_API_KEY`), the SDK cannot tell which provider you mean, so auto-detection fails. This is common in local development. Call `init()` with an explicit `provider` before wrapping:

  ```typescript theme={null}
  import { init, wrap } from "@sandboxaq/flintai-sdk-ts";

  init({ provider: "openai" }); // "openai", "anthropic", or "google"
  wrap(client);
  ```
</Accordion>

## Next steps

<CardGroup cols={2}>
  <Card title="Configuration" icon="sliders" href="/flintai/platform/sdk/typescript/configuration">
    Set up gateway URL, API keys, and environment variables
  </Card>

  <Card title="Monitor agents at runtime" icon="shield-halved" href="/flintai/platform/getting-started/runtime">
    Get your first traces in less than 10 minutes
  </Card>
</CardGroup>
