Getting Started

The AmaniBOT API is built on REST principles and returns JSON responses. All requests require authentication via API key.

Base URL

https://api.amanibot.com/v1

Authentication

Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Chat Completion

Send a message to AmaniBOT and receive a culturally appropriate response in the specified language.

Endpoint

POST /chat/completions

Request Body

{ "message": "Hello, how are you?", "language": "hi", "context": { "cultural_region": "north_india", "formality": "casual" }, "user_id": "user_123" }

Response

{ "id": "chat_abc123", "response": "नमस्ते! मैं बहुत अच्छा हूँ, धन्यवाद। आप कैसे हैं?", "language": "hi", "confidence": 0.95, "cultural_context": "casual_greeting_north_india", "timestamp": "2025-01-27T10:30:00Z" }

Language Detection

Automatically detect the language of input text with cultural context.

Endpoint

POST /language/detect

Request Body

{ "text": "مرحبا، كيف حالك؟" }

Response

{ "language": "ar", "confidence": 0.98, "dialect": "modern_standard_arabic", "cultural_markers": ["formal_greeting"] }

Supported Languages

AmaniBOT supports the following language codes:

  • en - English
  • ar - Arabic (العربية)
  • hi - Hindi (हिन्दी)
  • ml - Malayalam (മലയാളം)
  • te - Telugu (తెలుగు)
  • kn - Kannada (ಕನ್ನಡ)
  • ta - Tamil (தமிழ்)

Error Handling

The API uses standard HTTP status codes and returns detailed error messages.

Error Response Format

{ "error": { "code": "invalid_language", "message": "The specified language is not supported", "details": "Language 'xyz' is not in our supported language list" } }

Common Status Codes

  • 200 - Success
  • 400 - Bad Request
  • 401 - Unauthorized
  • 429 - Rate Limit Exceeded
  • 500 - Internal Server Error

Rate Limits

API rate limits vary by plan:

  • Starter - 100 requests per minute
  • Professional - 1,000 requests per minute
  • Enterprise - Custom limits

Rate Limit Headers

X-RateLimit-Limit: 1000 X-RateLimit-Remaining: 999 X-RateLimit-Reset: 1643723400

SDKs and Libraries

We provide official SDKs for popular programming languages:

  • JavaScript/Node.js - npm install amanibot-js
  • Python - pip install amanibot-python
  • Java - Maven/Gradle available
  • PHP - Composer package
  • Go - Go module

JavaScript Example

import AmaniBOT from 'amanibot-js'; const client = new AmaniBOT('your-api-key'); const response = await client.chat({ message: 'Hello, how are you?', language: 'hi', context: { cultural_region: 'north_india', formality: 'casual' } }); console.log(response.message);