Ariha AI API Documentation


Get API KEY
Back to Dashboard

Ariha AI API Documentation

Overview

The Ariha AI API provides access to advanced language model capabilities through a simple REST API endpoint. The API supports multiple roles and languages, allowing for customized AI interactions.

Base URL

https://ariha-api.ariha.ai

Endpoints

POST /api

Generate AI responses based on user queries with role and language preferences.

Authentication

Request Format

Request Parameters

Parameter Type Required Description
api_key string Yes Authentication key in format "email:api_key"
query string Yes The text query to process (1-200 characters)
role string No AI assistant role (default: "Assistant")
language string No Response language (default: "English")

Supported Roles

Supported Languages

Example Request Bodies

Example 1

{
    "api_key": "email@example.com:your_api_key_here",
    "query": "Tell me about artificial intelligence",
    "role": "Tutor",
    "language": "English"
}

Example 2

{
    "api_key": "email@example.com:your_api_key_here",
    "query": "Tell me about artificial intelligence"
}

Response Formats

Success Response

{
    "status": "success",
    "message": "Response generated successfully",
    "response": "AI-generated response text here"
}

Error Response

{
    "status": "error",
    "message": "Error description here"
}

Rate Limits

Code Examples

cURL

curl -X POST https://ariha-api.ariha.ai/api \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "email@example.com:your_api_key_here",
    "query": "Tell me about artificial intelligence",
    "role": "Tutor",
    "language": "English"
  }'

Python

import requests

url = "https://ariha-api.ariha.ai/api"
payload = {
    "api_key": "email@example.com:your_api_key_here",
    "query": "Tell me about artificial intelligence",
    "role": "Tutor",
    "language": "English"
}

response = requests.post(url, json=payload)
result = response.json()

if result["status"] == "success":
    print(result["response"])
else:
    print(f"Error: {result['message']}")

JavaScript (Fetch)

const url = 'https://ariha-api.ariha.ai/api';
const data = {
    api_key: 'email@example.com:your_api_key_here',
    query: 'Tell me about artificial intelligence',
    role: 'Tutor',
    language: 'English'
};

fetch(url, {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
    },
    body: JSON.stringify(data)
})
.then(response => response.json())
.then(result => {
    if (result.status === 'success') {
        console.log(result.response);
    } else {
        console.error('Error:', result.message);
    }
})
.catch(error => console.error('Error:', error));

Node.js (Axios)

const axios = require('axios');

const url = 'https://ariha-api.ariha.ai/api';
const data = {
    api_key: 'email@example.com:your_api_key_here',
    query: 'Tell me about artificial intelligence',
    role: 'Tutor',
    language: 'English'
};

axios.post(url, data)
    .then(response => {
        if (response.data.status === 'success') {
            console.log(response.data.response);
        } else {
            console.error('Error:', response.data.message);
        }
    })
    .catch(error => console.error('Error:', error));