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

# Goat integration

> Integrate with the Goat tool using LangChain JavaScript.

[GOAT](https://github.com/goat-sdk/goat) is the finance toolkit for AI agents.

<Warning>
  **This tool exists outside of the main LangChain [repository](https://github.com/goat-sdk/goat/).**

  Please use caution when linking wallets to external providers and make sure they are trusted.
</Warning>

## Overview

Create agents that can:

* Send and receive payments
* Purchase physical and digital goods and services
* Engage in various investment strategies:
  * Earn yield
  * Bet on prediction markets
* Purchase crypto assets
* Tokenize any asset
* Get financial insights

### How it works

GOAT leverages blockchains, cryptocurrencies (such as stablecoins), and wallets as the infrastructure to enable agents to become economic actors:

1. Give your agent a [wallet](https://github.com/goat-sdk/goat/tree/main#chains-and-wallets)
2. Allow it to transact [anywhere](https://github.com/goat-sdk/goat/tree/main#chains-and-wallets)
3. Use more than [+200 tools](https://github.com/goat-sdk/goat/tree/main#tools)

See [what GOAT supports](https://github.com/goat-sdk/goat/tree/main#chains-and-wallets).

**Lightweight and extendable**
Different from other toolkits, GOAT is designed to be lightweight and extendable by keeping its core minimal and allowing you to install only the tools you need.

If you don't find what you need on our more than 200 integrations you can easily:

* Create your own plugin
* Integrate a new chain
* Integrate a new wallet
* Integrate a new agent framework

See [how to contribute](https://github.com/goat-sdk/goat/tree/main#-contributing).

## Setup

1. Install the core package and langchain adapter:

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
npm i @goat-sdk/core @goat-sdk/adapter-langchain
```

2. Install the type of wallet you want to use (e.g solana):

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
npm i @goat-sdk/wallet-evm @goat-sdk/wallet-viem
```

3. Install the plugins you want to use in that chain:

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
npm i @goat-sdk/plugin-erc20
```

## Instantiation

Now we can instantiate our toolkit:

```typescript theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
import { http } from "viem";
import { createWalletClient } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { baseSepolia } from "viem/chains";

import { getOnChainTools } from "@goat-sdk/adapter-langchain";
import { PEPE, USDC, erc20 } from "@goat-sdk/plugin-erc20";

import { sendETH } from "@goat-sdk/wallet-evm";
import { viem } from "@goat-sdk/wallet-viem";

import { ChatOpenAI } from "@langchain/openai";
import { createAgent } from "@langchain/classic";

// 1. Create a wallet client
const account = privateKeyToAccount(
  process.env.WALLET_PRIVATE_KEY as `0x${string}`
);

const walletClient = createWalletClient({
  account: account,
  transport: http(process.env.RPC_PROVIDER_URL),
  chain: baseSepolia,
});

// 2. Set up the tools
const tools = await getOnChainTools({
  wallet: viem(walletClient),
  plugins: [sendETH(), erc20({ tokens: [USDC, PEPE] })],
});

// 3. Create the agent
const model = new ChatOpenAI({
  model: "gpt-5.4-mini",
});

const agent = createAgent({ llm: model, tools: tools });
```

## Related

* Tool [conceptual guide](/oss/javascript/concepts/#tools)
* Tool [how-to guides](/oss/javascript/langchain/tools)

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/javascript/integrations/tools/goat.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
