Embeddable Chat Component

Example: Rhea DEX Agent

The first AI driven DEX on the Largest DEX on NEAR

See on Rhea DEX

Bitte AI Chat

Introduction

The Bitte AI Chat component is a React component that enables AI-powered chat interactions in your application. It supports both NEAR Protocol and EVM blockchain interactions through wallet integrations, allowing users to interact with smart contracts and perform transactions directly through the chat interface.

🔑 Before you begin, make sure you have:

  • A Bitte API Key - Get your beta BITTE_API_KEY here


Quick Start (<10min)

  1. Install package

  2. Add the Chat Component

  3. Setup API Route

  4. Wallet Connection

1. Install Package

2. Add the Chat Component

Import and use BitteAiChat in your react app and select the agent that you would like to use, browse the available agents and their respective ids on the registry The apiUrl corresponds to a proxy to not expose your api key on the client from @bitte-ai/[email protected] onwards we have now markdown rendering, you can keep rendering plaintext, or if you wanna markdown support just add format="markdown" to BitteAiChat Component

3. Setup API Route

Create an API route in your Next.js application to proxy requests to the Bitte API to not expose your key. Nextjs app router implementation:

Nextjs page router implementation:

At this point the chat should already work but to be able to send transactions you will need to add a wallet connection

4. Add wallet connection

EVM Integration

EVM integration uses WalletConnect with wagmi hooks:

SUI Integration

SUI integration uses WalletConnect with wagmi hooks:

NEAR Integration

You can integrate with NEAR using either the NEAR Wallet Selector or a direct account connection. If you want to be able to send near transacitons through the chat you will need to define at least one of these

Using Wallet Selector

Component Props

Custom Components

The BitteAiChat component provides several UI elements that can be customized via the customComponents under options prop. This enables full control over the appearance and behavior of key parts of the chat interface by passing in your own React components.

Available Custom Components

You can override the following built-in UI components:

Component Types

Below are the expected prop types for each customizable component:

MessageGroupComponentProps

ChatContainerComponentProps

InputContainerProps

SendButtonComponentProps

LoadingIndicatorComponentProps


Example Usage

Here's how you might configure the BitteAiChat component, including some optional props and custom components:

✅ Tip: All custom components are optional. If not provided, the default components will be used.

Custom Tool Components

The BitteAiChat component supports embedding interactive, data-driven tools directly into the chat UI through the customToolComponents prop. These tools allow users to interact with structured data returned by your agent’s API, such as portfolios, token swaps, or custom workflows.

How Tool Rendering Works

When your AI agent responds with a message that includes a data field , and that data matches a known type (like PortfolioResponse, TransferFTData, etc.), the chat interface can automatically render the corresponding tool component — as long as a tool is registered in customToolComponents with a matching name.

The name must match:

  • The operation name in your agent’s OpenAPI spec

  • The name field in the tool component configuration

There is no need to wrap the response in a tool object — the chat package dynamically maps the data to the corresponding component based on the configured name and type. Pre-Configured Tools

The @bitte-ai/chat package comes with built-in support for the following tools:

  • get-portfolio

  • swap

  • transfer-ft

As long as:

  • The agent's API response includes a data field that matches the correct type (PortfolioResponse, SwapFTData, or TransferFTData — all from @bitte-ai/types)

  • The OpenAPI spec defines the route using one of the above names (i.e. get-portfolio, swap, or transfer-ft as operation IDs or paths)

...then the matching tool UI will automatically be rendered — no manual configuration required.

These tools are auto-wired and will display a default UI out-of-the-box. You only need to use customToolComponents if you want to override these default UIs or add custom tools.

Example: Registering Tool Components

Then pass them into BitteAiChat:

Type Safety & Tool Interfaces

All tool types and data interfaces are available from @bitte-ai/types

Available Agents

Agent Name

Description

Category

Agent ID

CoWSwap Assistant

An assistant that generates transaction data for CoW Protocol Interactions

DeFi

near-cow-agent.vercel.app

Meme.cooking

Generates a transaction payload for creating a new memecoin on the meme.cooking platform

Memes

meme-cooking-bitte-agent.vercel.app

CoinGecko Agent

Provides real-time cryptocurrency data, including prices, market information, and charts

Investing

coingecko-ai.vercel.app

Ref Finance Agent

Provides token metadata and swaps tokens through Ref Finance

DeFi

ref-finance-agent.vercel.app

NEAR Roast Agent

Roasts a NEAR account based on their on-chain activity

Other

near-roast-agent.vercel.app

NEAR Staking

Stake, unstake, and see staking information

Other

staking-agent.intear.tech

Crypto Technical Analyst

Provides in-depth market analysis and sophisticated trading insights based on technical analysis

Investing

technical-analysis-agent.vercel.app

DAO Agent

Interacts with Sputnik DAO Contracts, query DAOs, create proposals, and vote on proposals

DAO

dao-agent.vercel.app

Safe Account Assistant

Manages Near{Safe} Account Structure

Wallet Management

near-safe-agent.vercel.app

Uniswap Assistant

Generates transaction data for Uniswap V3 Interactions

Other

near-uniswap-agent.vercel.app

GrowthMate Discovery

Discovers the ecosystem through relevant activities, news, and offers

Ecosystem

bitte-agent.vercel.app

Python Code Runner

A helpful assistant for running Python code snippets

Computational

bitte-wasmer-agent.fly.dev

PotLock Assistant

Helps users search projects and donations on PotLock platform and create projects

Other

potlockaiagent-hqd5dzcjajhpc3fa.eastus-01.azurewebsites.net

Delta Trade DCA Helper

Helps set up DCA plans to buy NEAR and other tokens

Investing

dcaagent.deltatrade.ai

SUI Defi Agent

check balances, swap, stake and more on SUI

Defi

bitte-sui-agent.vercel.app

Sui Explorer

Retrieve any blockchain data from SUI

Ecosystem

sui-explorer.vercel.app

Benqi Agent

Defi Agent for Benqi Protocol on Avalanche

Defi

benqi-agent.vercel.app

Bitte WETH Wraptor

Wrap and unwrap ETH.

Other

wraptor-agent.vercel.app

Bitte Distribute Tokens

Distribute tokens on EVM chains using csv files and more

Other

safe-airdrop-agent.vercel.app

Creating Custom Agents

Check out our docs for creating your own agent from an API

Example Projects

Styling

The component can be customized using the colors prop:

Browser Redirects (Optional)

if you're having issues with your app or wallet containing redirects you can optionally use a history api to maintain context

Create an API route in your Next.js application that will allow your app if you want to save chat context when signing a transaction after getting redirected to the wallet.

Last updated