vNext Preview

Lecca Documentation

Welcome! These docs cover setup, API usage, and best practices for building with Lecca’s Agents & Workflows.

Introduction

Lecca helps you create friendly, buildable AI agents and drag‑and‑drop workflows. It’s model‑agnostic and integrates with tools like Gmail, Google Sheets, HubSpot and Slack.

ConceptDescription
AgentAn autonomous configuration that uses tools and memory to perform tasks.
WorkflowVisual sequence of triggers and actions orchestrating apps and agents.
ProviderAn AI model provider (OpenAI, Anthropic, Gemini, DeepSeek, etc.).

Getting Started

  1. Sign up and verify your email.
  2. Create an API key in Dashboard → API Keys.
  3. Choose your default AI provider.
// Fetch agents (JavaScript)
const resp = await fetch("https://api.lecca.io/v1/agents", {
  headers: { Authorization: `Bearer ${process.env.LECCA_API_KEY}` }
});
const data = await resp.json();
console.log(data);

Installation

Install the CLI and SDK to speed up development:

# npm
npm i -g @lecca/cli
npm i @lecca/sdk

# or yarn
yarn global add @lecca/cli
yarn add @lecca/sdk

Authentication

Authenticate using a Bearer token. Keep your keys secret and rotate regularly.

curl -X GET \
  -H "Authorization: Bearer $LECCA_API_KEY" \
  https://api.lecca.io/v1/agents

AI Providers

Lecca is model‑agnostic. Select a provider globally, per agent, or per workflow step.

ProviderModelsNotes
OpenAIGPT‑4o mini, o3‑miniGreat for reasoning + tools
AnthropicClaude 3.5Helpful and safe
GoogleGemini 2.0Strong on multimodal
DeepSeekR1Fast and cost‑efficient

Agents

Define role, tools, and memory. You can chat with agents or run them inside workflows.

{
  "name": "Support Agent",
  "role": "Helps with common support queries",
  "tools": ["email.send", "calendar.create"],
  "memory": true,
  "provider": "openai:gpt-4o-mini"
}

Workflows

Create triggers and actions that call tools or agents. Add human‑in‑the‑loop approvals.

trigger("email.received")
 .filter(msg => msg.to.includes("support@acme.com"))
 .action(agent("Support Agent"))
 .approve("Escalate to human if score < 0.6");

Webhooks

Subscribe to events to sync with your systems.

curl -X POST https://api.lecca.io/v1/webhooks \
  -H "Authorization: Bearer $LECCA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "event": "workflow.completed",
    "target_url": "https://example.com/hooks/lecca"
  }'

Examples

Minimal Node.js example combining Agents + Workflows:

import { Lecca } from "@lecca/sdk";
const lecca = new Lecca(process.env.LECCA_API_KEY);

const agent = await lecca.agents.create({
  name: "Prospector", tools: ["web.search","email.send"], memory: true
});

await lecca.workflows.create({
  name: "Weekly outbound",
  steps: [
    { use: "web.search", with: { query: "fresh leads in fintech" } },
    { use: "agent.run", with: { agentId: agent.id, prompt: "Draft outreach" } },
    { use: "email.send", with: { from: "sales@acme.com" } }
  ]
});

FAQ

Can I switch providers? Yes — set at account, agent, or step level.

Is there a free tier? Start free, then upgrade as usage grows.