Available APIs
Lua CLI provides a comprehensive set of APIs for building AI agents:Core Classes
LuaAgent, LuaSkill, LuaTool - Agent configuration and building blocks
Automation
LuaJob, LuaWebhook - Scheduled tasks and HTTP endpoints
Message Processing
PreProcessor, PostProcessor - Filter and format messages
External Tools
LuaMCPServer - Connect MCP servers for external tool integrations
Platform APIs
AI, Agents, User, Data, CDN, Products, Baskets, Orders, Jobs, Templates, Channels - Built-in services
Environment
env() - Secure configuration management
LuaAgent, LuaJob, LuaWebhook, PreProcessor, PostProcessor, and Jobs API for comprehensive agent development.
Installation
zod is a peer dependency required for schema validationQuick Start
Import APIs
Create an Agent
Core Classes
Agent Configuration
LuaAgent
Unified agent configuration
Building Blocks
LuaSkill
Collection of related tools
LuaTool
Individual function the AI can call
Automation
LuaWebhook
HTTP endpoints for external events
LuaJob
Scheduled tasks
Message Processing
PreProcessor
Filter messages before agent
PostProcessor
Format responses after agent
Platform APIs
AI API
New! Generate AI responses with custom context in your tools:- Product descriptions
- Image analysis
- Content summarization
- Translation
- Recommendations
- Document Q&A
Full Documentation
Agents API
New! Invoke another agent from within your tool, webhook, job, or processor:- Route requests to specialist agents
- Build multi-agent pipelines
- Delegate from webhooks/jobs to conversational agents
Full Documentation
User API
Access user information:- Get current user in tools
- Get specific user in webhooks (payment notifications)
- Send messages to specific users in jobs
- Update user profiles
Full Documentation
Data API
Custom data storage with vector search:Full Documentation
CDN API
Upload and retrieve files from the CDN:- Store user uploads
- Image storage for AI analysis
- Document management
- Asset management
Full Documentation
Products API
E-commerce product catalog:Full Documentation
Baskets API
Shopping cart management:Full Documentation
Orders API
Order processing and tracking:Full Documentation
Jobs API
Dynamically create scheduled tasks from tools:Full Documentation
Templates API
Send template messages across different channels:Templates.whatsapp- WhatsApp Business templates
Full Documentation
Channels API
Send outbound messages on any connected channel — from tools, jobs, webhooks, and triggers:- Proactive notifications and reminders (with Jobs)
- Confirmations from webhooks
- Agent-initiated follow-ups
Full Documentation
Environment Variables
Secure configuration management:Full Documentation
Type Definitions
All APIs are fully typed for TypeScript:Common Patterns
External API Integration
Using Platform APIs
Custom Data with Search
API Reference Pages
Core Classes
LuaAgent
Agent configuration
LuaSkill
Skill class API
LuaTool
Tool interface
LuaWebhook
HTTP webhooks
LuaJob
Scheduled tasks
LuaMCPServer
MCP external tools
PreProcessor
Message filtering
PostProcessor
Response formatting
defineDevice
Server-side device + trigger definitions
LuaVoice
Voice agent definition
Runtime APIs
Lua
Request context API
AI
AI generation API
Agents
Agent invocation API
User
User data API
Data
Custom data API
CDN
File storage API
Products
Products API
Baskets
Baskets API
Orders
Orders API
Jobs
Jobs API
Templates
Template messaging
Channels
Outbound messaging
Voice
LuaVoice
Define voices in code — STT, TTS, LLM, plus plugin & realtime engines
Utilities
Environment
Environment utilities
Best Practices
Use TypeScript
Use TypeScript
All APIs are fully typed. Use TypeScript for:
- Autocomplete
- Type checking
- Better IDE support
Validate Inputs
Validate Inputs
Always use Zod schemas for input validation:
Handle Errors
Handle Errors
Implement proper error handling:
Use Environment Variables
Use Environment Variables
Never hardcode secrets:
Next Steps
3
See Examples
Check out Tool Examples for working code
4
Build Something
Follow the First Skill tutorial

