Developer Portal

Integrate Eyenak AI's powerful capabilities into your applications with our comprehensive API

JWT Authentication
RESTful API
Real-time Streaming
Third-Party Integration

Quick Start

Get started with Eyenak AI API in minutes

1. Authentication

Obtain your JWT token by logging in:

POST /accounts/api/login/
Content-Type: application/json

{
  "username": "your_username",
  "password": "your_password"
}

2. Make API Calls

Include the token in your requests:

Authorization: Bearer <your-jwt-token>
Content-Type: application/json

3. Third-Party Integration

For integrating Eyenak AI into your website:

// Generate company-specific JWT token
POST /accounts/api/third-party/login/

// Use token in iframe or API calls
<iframe src="/chatbot/?token=YOUR_TOKEN"></iframe>

Integration Examples

Python Example

import requests

# Login and get token
response = requests.post('/accounts/api/login/', json={
  'username': 'your_username',
  'password': 'your_password'
})
token = response.json()['token']

# Make authenticated request
headers = {'Authorization': f'Bearer {token}'}
response = requests.post('/chatbot/api/',
  json={'message': 'Hello AI', 'model': 'gpt-4'},
  headers=headers)

JavaScript Example

// Login and get token
const loginResponse = await fetch('/accounts/api/login/', {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({username: 'your_username', password: 'your_password'})
});
const {token} = await loginResponse.json();

// Make authenticated request
const response = await fetch('/chatbot/api/', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({message: 'Hello AI', model: 'gpt-4'})
});