Universal AI API Client

One interface for OpenAI, Claude, and Gemini.
Built with pure JavaScript. No dependencies.

const ai = new AIKit({
    provider: 'openai',
    apiKey: 'your-key'
});

const response = await ai.chat('Hello, AI!');
console.log(response.text);

🎯 This project is part of Luka's developer portfolio β€” an open-source Universal AI API Client built to demonstrate JavaScript SDK design, npm publishing, and multi-framework integration. Read the blog series β†’

Features

πŸ”„

Auto Fallback

Automatically switch to backup providers when API fails

πŸ’Ύ

Smart Caching

LocalStorage-based caching prevents duplicate requests

πŸ’°

Cost Tracking

Real-time monitoring of API usage costs

βœ…

Response Validation

QA-focused validation for length, format, and content

🌍

Universal

Works with any language or framework

πŸš€

Zero Dependencies

Pure JavaScript, no external libraries needed

Interactive Demo

Try AIKit right in your browser

Note: You'll need your own API key to test. Get one from OpenAI, Anthropic, or Google AI Studio

Documentation

Quick Install

CDN

<script src="https://cdn.jsdelivr.net/gh/lukaPlayground/aikit@latest/dist/aikit.min.js"></script>

NPM

npm install @lukaplayground/aikit

GitHub

git clone https://github.com/lukaPlayground/aikit.git