Anbu AI Documentation
Anbu AI is an open-source platform for building AI applications. Access powerful language models and image generation APIs with simple REST endpoints.
Quick Start
Get started with a simple API call. No authentication required.
curl -X POST /api/chat \
-H "Content-Type: application/json" \
-H "X-Session-Id: my-session" \
-d '{
"message": "Hello, how are you?",
"model": "gpt-4o"
}'{
"text": "Hello! I'm doing well, thank you for asking. How can I assist you today?",
"model": "gpt-4o",
"citations": []
}Chat Completions
/api/chatGenerate text completions using various AI models. Supports conversation history via session management.
Request Headers
| Header | Required | Description |
|---|---|---|
| Content-Type | Yes | application/json |
| X-Session-Id | No | Unique session identifier for conversation history |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| message | string | Yes | The user message to send |
| model | string | No | Model to use: gpt-4o, gpt-3.5 (default: gpt-4o) |
| systemPrompt | string | No | Custom system instructions for the model |
const response = await fetch('/api/chat', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Session-Id': 'user-123'
},
body: JSON.stringify({
message: 'Explain quantum computing in simple terms',
model: 'gpt-4o',
systemPrompt: 'You are a helpful science tutor'
})
});
const data = await response.json();
console.log(data.text);Image Generation
/api/imageGenerate images using AI models with various styles and sizes.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | Description of the image to generate |
| style | string | No | Style: default, ghibli, cyberpunk, anime, portrait, 3d |
| size | string | No | Aspect ratio: 1:1, 3:2, 2:3 (default: 1:1) |
const response = await fetch('/api/image', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
prompt: 'A futuristic city at sunset with flying cars',
style: 'cyberpunk',
size: '1:1'
})
});
const data = await response.json();
console.log(data.imageUrl);{
"success": true,
"model": "deepimg",
"imageUrl": "https://example.com/generated-image.png",
"prompt": "A futuristic city at sunset with flying cars"
}Session Management
/api/resetReset conversation history for a specific session.
curl -X POST /api/reset \
-H "X-Session-Id: my-session"{
"status": "ok",
"message": "Conversation reset",
"sessionId": "my-session",
"hadHistory": true
}Status
/api/statusCheck the API status and available models.
{
"status": "ok",
"version": "1.0.0",
"models": ["gpt-4o", "gpt-3.5", "deepimg"]
}GPT-4o Model
GPT-4o is the most capable model available, offering advanced reasoning, longer context, and vision capabilities.
Parameters
| Parameter | Default | Description |
|---|---|---|
| temperature | 0.9 | Controls randomness (0-1) |
| max_tokens | 2048 | Maximum response length |
| top_p | 0.7 | Nucleus sampling parameter |
GPT-3.5 Model
GPT-3.5 is a fast and efficient model ideal for simpler tasks and quick responses.
DeepImg Model
DeepImg is a high-quality image generation model supporting multiple artistic styles.
Available Styles
defaultghiblicyberpunkanimeportrait3d