Add conversational banking, spending analysis, and real-time financial intelligence to any app — powered by the Investec API.
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.
One SDK. Every feature. Production-ready out of the box.
Natural language interface to accounts, balances, and transactions. GPT-4o powered with full tool use.
AI-categorised spend breakdowns, trend detection, and predictions for the next 30 days.
Real-time balances and transactions streamed directly from the Investec API.
One function call wires up tools, system prompts, and streaming. Bring your own model.
Browser mic → Whisper transcription → AI response. Hands-free finance.
Upload a photo — GPT-4o Vision extracts merchant, amount, line items, and matches transactions.
Risk-score individual transactions with AI reasoning. Flag anomalies before they become problems.
Agentic workflows that autonomously track progress and send alerts when you're off target.
No Investec API knowledge required. The SDK handles auth, rate limiting, and AI orchestration.
npm install investec-aiconst 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!,
});// 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);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.`,
});The live demo runs against real Investec sandbox data. Ask the AI anything about your finances.