Documentation

AspectBase Documentation

Everything you need to build production-ready AI features

Quick Start

Get started with AspectBase in minutes.

Step 1
Installation
npm install aspectbase
# or
yarn add aspectbase
# or
pnpm add aspectbase
Step 2
Initialize Client
import AspectBase from 'aspectbase';

const ab = new AspectBase({
  apiKey: process.env.ASPECTBASE_API_KEY,
  environment: 'production'
});
Step 3
Define a Capability
const chatCapability = ab.capability('customerSupport', {
  models: ['gpt-4o', 'claude-3-5-sonnet'],
  prompts: {
    system: "You are a helpful customer support agent.",
    version: "v1.2"
  },
  routing: {
    strategy: 'best-of-n',
    fallback: true
  }
});
Step 4
Use the Capability
const response = await chatCapability.run({
  messages: [
    { role: 'user', content: 'How do I reset my password?' }
  ]
});

console.log(response.content);