Getting Started¶
Get up and running with Jodit AI Adapter in minutes.
Installation¶
Basic Usage¶
import { start } from 'jodit-ai-adapter';
const { app, cleanup } = await start({
port: 8082,
providers: {
openai: {
type: 'openai',
apiKey: process.env.OPENAI_API_KEY,
defaultModel: 'gpt-5.2'
}
}
});
// To gracefully shut down:
// await cleanup();
The server is now running at http://localhost:8082.
The cleanup() function stops the server and releases all resources (e.g. Redis connections).
Embed Into Existing Express App¶
If you already have an Express server, mount the adapter as middleware:
import express from 'express';
import { start } from 'jodit-ai-adapter';
const app = express();
// ... your existing routes and middleware
const { cleanup } = await start({
existingApp: app,
config: {
providers: {
openai: {
type: 'openai',
apiKey: process.env.OPENAI_API_KEY,
defaultModel: 'gpt-5.2'
}
}
}
});
app.listen(3000);
// To gracefully shut down:
// await cleanup();
All AI routes will be available under /ai/* (e.g. /ai/health, /ai/request).
Docker¶
Docker Compose¶
services:
jodit-ai-adapter:
image: xdsoft/jodit-ai-adapter
ports:
- "8082:8082"
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
- OPENAI_DEFAULT_MODEL=gpt-5.2
restart: unless-stopped
With Redis rate limiting:
services:
jodit-ai-adapter:
image: xdsoft/jodit-ai-adapter
ports:
- "8082:8082"
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
- OPENAI_DEFAULT_MODEL=gpt-5.2
- RATE_LIMIT_ENABLED=true
- RATE_LIMIT_TYPE=redis
- REDIS_URL=redis://redis:6379
depends_on:
- redis
restart: unless-stopped
redis:
image: redis:7-alpine
restart: unless-stopped
Verify It Works¶
Next Steps¶
- Configuration - Environment variables, config file, rate limiting
- API Reference - All available endpoints
- Client Integration - Connect Jodit Editor to the adapter