> For the complete documentation index, see [llms.txt](https://black-sheep-finance.gitbook.io/black-sheep-finance-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://black-sheep-finance.gitbook.io/black-sheep-finance-docs/getting-started/installation.md).

# Installation

The SDK is published as `@blacksheep/sdk` and supports Node 18+, Bun, Deno, and most edge runtimes (Cloudflare Workers, Vercel Edge).

## Package managers

```bash
npm  i  @blacksheep/sdk
pnpm add @blacksheep/sdk
yarn add @blacksheep/sdk
bun  add @blacksheep/sdk
```

## Optional peer dependencies

| Use case         | Install                                |
| ---------------- | -------------------------------------- |
| LangChain agents | `npm i langchain @langchain/core zod`  |
| Webhook server   | `npm i hono` *(or any http framework)* |

## Environment variables

| Variable      | Required | Description                                  |
| ------------- | -------- | -------------------------------------------- |
| `BS_API_KEY`  | yes      | API key from **Dashboard → Developers**      |
| `BS_BASE_URL` | no       | Override the API base URL (defaults to prod) |

```bash
# .env
BS_API_KEY=bs_live_...
```

## Verify the install

```ts
import { BlackSheep } from "@blacksheep/sdk";
const bs = new BlackSheep({ apiKey: process.env.BS_API_KEY! });
console.log(await bs.agents.list());
```

If you see an empty array (`[]`), you're good. If you see a `BlackSheepError` with status `401`, recheck the API key.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://black-sheep-finance.gitbook.io/black-sheep-finance-docs/getting-started/installation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
