Documentation

API Reference

Complete reference for the AI Search & Chat Widget API. Integrate intelligent search and AI-powered chat into any website.

Base URL: https://api.dinev.pro/api/v1 Version: 0.1.0
# Authentication

The API uses two types of keys. Public keys are safe for browser use; API keys are for server-side operations only.

Public Key Browser-safe

Used by the widget in the browser. Restricted to widget endpoints only. Passed via header or query parameter.

X-Public-Key: pk_xxxx...xxxx

API Key Server only

Full access to management endpoints. Never expose in client-side code. Passed via header.

X-API-Key: xxxx...xxxx
# Widget

Endpoints used by the embedded chat widget. Authenticated with Public Key.

GET /widget/config Get widget configuration

Returns client-specific widget settings including bot name, brand color, greeting message, and position.

ParameterDescription
key queryrequiredPublic key
200 Response
JSON
{ "widget_settings": { "botName": "AI Assistant", "brandColor": "#3B82F6", "greeting": "How can I help?", "position": "bottom-right" }, "client_name": "example.com" }
GET /widget/widget.js Get widget JavaScript bundle

Returns the compiled widget JavaScript file. Embed in your site with a single script tag.

ParameterDescription
key queryrequiredPublic key
Integration
<!-- Add before </body> --> <script src="https://demo.dinev.pro/api/v1/widget/widget.js?key=YOUR_KEY"></script>
POST /widget/search Widget search & chat

Main search/chat endpoint used by the widget. Supports pure search mode and AI chat mode with LLM-generated answers.

Request Body
{ "query": "How does AI help customer service?", "mode": "chat", // "search" | "chat" "top_k": 5 }

200 Response
JSON
{ "answer": "AI helps customer service by...", "follow_up_question": "What are the benefits of chatbots?", "results": [ { "item_id": "uuid", "title": "Customer Service with AI", "snippet": "AI systems provide 24/7 support...", "url": "https://example.com/article", "type": "post", "score": 0.85 } ] }
# Items

Manage content items in your knowledge base. Requires API Key.

GET /items List all items
POST /items Create item
GET /items/{id} Get item by ID
POST /items/reindex Reindex all items
# Clients

Multi-tenant client management. Requires API Key.

POST /clients Create client
GET /clients/{id} Get client details