AI banking in three lines

Add conversational banking, spending analysis, and real-time financial intelligence to any app — powered by the Investec API.

app/api/chat/route.ts
import { InvestecAI, createChatHandler } from 'investec-ai';

const sdk = new InvestecAI({
  clientId: process.env.INVESTEC_CLIENT_ID!,
  clientSecret: process.env.INVESTEC_CLIENT_SECRET!,
  apiKey: process.env.INVESTEC_API_KEY!,
  openaiApiKey: process.env.OPENAI_API_KEY!,
});

export const POST = createChatHandler(sdk);

That's it. Your app now has a fully functional AI banking assistant.

Everything your banking app needs

One SDK. Every feature. Production-ready out of the box.

Conversational banking

Natural language interface to accounts, balances, and transactions. GPT-4o powered with full tool use.

Spending analysis

AI-categorised spend breakdowns, trend detection, and predictions for the next 30 days.

Live account data

Real-time balances and transactions streamed directly from the Investec API.

Zero boilerplate

One function call wires up tools, system prompts, and streaming. Bring your own model.

Voice banking

Browser mic → Whisper transcription → AI response. Hands-free finance.

Receipt scanning

Upload a photo — GPT-4o Vision extracts merchant, amount, line items, and matches transactions.

Fraud detection

Risk-score individual transactions with AI reasoning. Flag anomalies before they become problems.

Savings goals

Agentic workflows that autonomously track progress and send alerts when you're off target.

Up and running in minutes

No Investec API knowledge required. The SDK handles auth, rate limiting, and AI orchestration.

01

Install the SDK

npm install investec-ai
02

Initialise the client

const sdk = new InvestecAI({
  clientId:     process.env.INVESTEC_CLIENT_ID!,
  clientSecret: process.env.INVESTEC_CLIENT_SECRET!,
  apiKey:       process.env.INVESTEC_API_KEY!,
  openaiApiKey: process.env.OPENAI_API_KEY!,
});
03

Start building

// Fetch accounts
const accounts = await sdk.getAccounts();

// Analyse spending
const analysis = await sdk.analyzeSpending(
  accountId, { period: '30d' }
);

// Add AI chat to any route
export const POST = createChatHandler(sdk);

A clean API for every use case

Fully typed. Tree-shakeable. Works in Node, edge runtimes, and the browser.

Accounts & balances

const sdk = new InvestecAI({
  clientId:     process.env.INVESTEC_CLIENT_ID!,
  clientSecret: process.env.INVESTEC_CLIENT_SECRET!,
  apiKey:       process.env.INVESTEC_API_KEY!,
  openaiApiKey: process.env.OPENAI_API_KEY!,
});

// List all accounts
const accounts = await sdk.getAccounts();

// Get live balance
const { currentBalance, availableBalance } =
  await sdk.getBalance(accountId);

Transactions

// Fetch recent transactions
const txns = await sdk.getTransactions(accountId, {
  limit: 50,
  from: '2025-01-01',
  to:   '2025-01-31',
});

AI spending analysis

const analysis = await sdk.analyzeSpending(accountId, {
  period: '30d',   // or '90d'
});

// Returns: categories, insights[], predictions
console.log(analysis.insights);
console.log(analysis.predictions.next30Days);

AI chat (plug & play)

// Next.js App Router — app/api/chat/route.ts
import { createChatHandler } from 'investec-ai';

export const POST = createChatHandler(sdk, {
  model: anthropic('claude-opus-4-5'), // any model
  maxSteps: 10,
  system: (d) => `${d}\nReply in Zulu.`,
});

See it working right now

The live demo runs against real Investec sandbox data. Ask the AI anything about your finances.