API Documentation

Generis AI API

Complete reference for integrating Generis AI into your applications.

πŸš€ Getting Started

All API requests require a JWT token in the Authorization header. Obtain a token by logging in.

POST /generis/api/auth/login

Authenticate and receive a JWT token.

Request
{ "email": "user@example.com", "password": "yourpassword" }
Response
{ "token": "eyJhbGci...", "user": { "id": "u_123", "email": "user@example.com" } }
Usage (curl)
curl -H "Authorization: Bearer <token>" \ https://generistech.com/api/agents

Base URL: https://generistech.com/api

πŸ€– Agents API

GET/agents

List all agents for the authenticated user.

Response
[{ "id": "agent_abc", "name": "Support Bot", "type": "customer_support", "model": "claude-sonnet", "status": "active" }]
POST/agents

Create a new agent.

Request
{ "name": "My Agent", "type": "customer_support", "system_prompt": "You are a helpful assistant...", "model": "claude-sonnet", "temperature": 0.7 }
GET/agents/:id

Get a specific agent by ID.

PUT/agents/:id

Update agent settings. Same body as POST.

DELETE/agents/:id

Permanently delete an agent and all its data.

πŸ’¬ Chat API

POST/agents/:id/chat

Send a message to an agent and receive a response.

Request
{ "message": "Hello, how can you help me?", "conversation_id": "conv_xyz" // optional }
Response
{ "response": "I can help you with...", "conversation_id": "conv_xyz", "tokens_used": 142 }

πŸ—¨οΈ Conversations API

GET/agents/:id/conversations

List all conversations for an agent.

Response
[{ "id": "conv_xyz", "visitor_name": "John Doe", "message_count": 12, "created_at": "2025-01-15T10:30:00Z" }]

πŸ“š Knowledge Base API

GET/knowledge-bases

List all knowledge bases (filter by agent_id in query params).

POST/knowledge-bases

Create a new knowledge base.

Request
{ "name": "Product FAQ", "agent_id": "agent_abc" }
GET/knowledge-bases/:id/documents

List documents in a knowledge base.

Response
[{ "id": "doc_1", "title": "Return Policy", "content": "Our return policy..." }]
POST/knowledge-bases/:id/documents

Add a document to a knowledge base.

Request
{ "title": "Return Policy", "content": "Full document text here..." }
DELETE/knowledge-bases/:id/documents/:docId

Delete a specific document.

πŸ”§ Tools API

GET/agents/:id/tools

Get tools configuration for an agent.

Response
{ "tools": [ {"name": "web_search", "enabled": true}, {"name": "calculator", "enabled": false} ] }
PUT/agents/:id/tools

Update enabled tools for an agent.

Request
{ "tools": ["web_search", "calculator", "current_datetime"] }

Available tools: web_search, calculator, current_datetime, http_request, memory_save, memory_recall, knowledge_base_search, send_email, format_response, set_variable

Anthropic server-side tools (Claude agents only): anthropic_web_search (web search with cited sources, $10 per 1,000 searches; replaces the built-in web_search on Claude when both are enabled), anthropic_web_fetch (fetches a page or PDF whose URL appeared in the conversation; token cost only). Optional limits live in the agent config: web_search.max_uses, web_search.allowed_domains or blocked_domains, web_search.user_location, web_fetch.max_uses, web_fetch.max_content_tokens, web_fetch.allowed_domains.

PUT/agents/:id/advisor

Give the agent an advisor: a stronger Claude model it consults mid-reply for a plan or course correction (Anthropic advisor tool). Off by default. Consultations are billed at the advisor model's rates and appear in the conversation tool log as advisor.

Request
{ "enabled": true, "model": "claude-opus-5-5", // must be at least as capable as the agent model "max_uses": 2, // per reply, 1-5 "max_tokens": 2048 // advisor output cap per consultation, 1024-8192 }

Valid pairs: Sonnet 5.5 or Haiku 5.5 agents can use Opus 5.5, Fable 5.1 or Sonnet 5.5; Opus 5.5 agents can use Fable 5.1 or Opus 5.5; Fable 5.1 agents only Fable 5.1. An invalid model is replaced by the default for the agent model. Also applies to agents running on Claude Managed Agents.

πŸ“… Schedules API

GET/agents/:id/schedules

List all schedules for an agent.

Response
[{ "id": "sch_1", "label": "Morning Report", "cron_expr": "0 9 * * *", "prompt": "Generate today's summary", "active": true, "last_run_at": "2025-01-15T09:00:00Z", "last_run_status": "success" }]
POST/agents/:id/schedules

Create a new schedule.

Request
{ "label": "Morning Report", "cron_expr": "0 9 * * *", "prompt": "Generate today's summary" }
PATCH/schedules/:id

Update schedule (e.g. toggle active).

Request
{ "active": false }
DELETE/schedules/:id

Delete a schedule permanently.

POST/schedules/:id/run

Manually trigger a schedule immediately.

πŸͺŸ Widget Embed

Embed a chat widget on any website with a single script tag.

Basic Embed
<script> window.GenerisConfig = { agentId: 'your-agent-id', position: 'bottom-right', theme: 'dark', primaryColor: '#6c5ce7' }; </script> <script src="https://generistech.com/widget/widget.js"></script>
Config Options
{ "agentId": "string (required)", "position": "'bottom-right' | 'bottom-left'", "theme": "'dark' | 'light'", "primaryColor": "'#6c5ce7' (hex)", "welcomeMessage": "string", "hideOnMobile": false }

⌨️ CLI

The generis-cli manages agents from the terminal. Source: Documents/GenerisAI/generis-cli. Install locally with npm link. npm publish is pending.

Installation
cd ~/Documents/GenerisAI/generis-cli && npm link
Planned commands
generis login # authenticate generis agents list # list all agents generis agents create --name "Bot" # create agent generis chat <agentId> # interactive chat generis agents delete <agentId> # delete agent generis config set api-url <url> # set custom API generis --help # show all commands