1) Create an organization
POST /api/orgs
{ "name": "Acme Labs" }
Build research‑grade mini‑agents and mini‑apps. This guide covers API/SDK usage, CMS blocks, webhooks, security, and real‑world patterns across bio/chem, professional services, media, finance, energy, healthcare, and education.
POST /api/orgs
{ "name": "Acme Labs" }
POST /api/agents
{
"orgId": "org_123",
"name": "Lead Intake",
"config": {
"model": "gpt-4o",
"tools": ["calendar.create", "sheets.append"],
"system": "Qualify leads and book meetings on the owner's calendar."
}
}
POST /api/apps/app_123/routes
{
"path": "/landing",
"content": [
{ "type": "hero", "props": { "title": "Welcome", "subtitle": "mini‑agents in days" } },
{ "type": "feature-list", "props": { "items": ["agents", "cms", "deploy"] } }
]
}
Authorization: Bearer <api_key>
# Create key (owner only)
POST /api/apps/app_123/keys
{ "name": "server" } → { "key": "sk_live_***" } // shown once
# List
GET /api/agents?orgId=org_123
# Chat with an agent
POST /api/agents/agent_123/chat
{
"messages": [
{ "role": "user", "content": "Summarize this PDF and add action items." }
],
"attachments": [
{ "type": "file", "url": "https://..." }
]
}
PATCH /api/apps/app_123/routes/route_456
{
"content": [
{ "type": "hero", "props": { "title": "complext", "subtitle": "research‑grade agents" } },
{ "type": "code", "props": { "language": "ts", "body": "console.log('hello');" } }
]
}
pnpm add @complext/sdk
import { complext } from "@complext/sdk";
const client = complext({ apiKey: process.env.COMPLEXT_API_KEY! });
const agent = await client.agents.create({
orgId: "org_123",
name: "Research Assistant",
config: {
model: "gpt-4o",
tools: ["web.search", "sheets.append"]
}
});
const reply = await client.agents.chat(agent.id, {
messages: [{ role: "user", content: "Draft a one-page summary of CRISPR" }]
});
console.log(reply.text);
import type { Block } from "@complext/sdk";
function renderBlock(b: Block) {
if (b.type === "hero") {
return /*html*/`
${b.props.title}
${b.props.subtitle}
`;
}
return "";
}
POST https://yourapp.com/webhooks/complext
X-Complext-Signature: t=..., v1=...
{
"type": "agent.job.completed",
"data": { "jobId": "job_123", "status": "succeeded", "output": {...} }
}
import crypto from "node:crypto";
export function verify(sigHeader, rawBody, secret) {
const [tPart, v1Part] = sigHeader.split(","); // t=... , v1=...
const t = tPart.split("=")[1];
const v1 = v1Part.split("=")[1];
const hmac = crypto.createHmac("sha256", secret);
hmac.update(`${t}.${rawBody}`);
const digest = hmac.digest("hex");
return crypto.timingSafeEqual(Buffer.from(v1), Buffer.from(digest));
}
Composable JSON blocks for routing, content, and simple app UIs.
{
"type": "hero" | "feature-list" | "code" | "form",
"props": { "...": "..." }
}
{
"type": "hero",
"props": {
"title": "Welcome to complext",
"subtitle": "mini‑agents & mini‑apps in days",
"cta": { "label": "Contact", "href": "/contact.html" }
}
}
{
"type": "feature-list",
"props": {
"items": ["agents", "cms pages", "deploy"]
}
}
{
"type": "code",
"props": { "language": "ts", "body": "console.log('hello');" }
}
Agents run with explicit tool permissions and typed I/O so you can trust outcomes and reproduce runs.
POST /api/tools/register
{
"name": "calendar.create",
"input": { "title": "string", "when": "datetime", "attendees": "string[]" },
"output": { "eventId": "string", "link": "string" },
"policy": { "orgOnly": true, "rateLimit": "10/m" }
}
POST /api/agents/agent_123/chat
{
"messages": [{ "role": "user", "content": "Book a 30m call with Alex Fri 10am" }],
"allow": ["calendar.create"]
}
Sensitive workloads can run on your own machines. For research tasks, we use containerized processors with least‑privilege policies and signed artifacts for traceability.
Clear org/app boundaries. Secrets stay in tools (not prompts). Tools receive scoped tokens; prompts receive references.
Every job has a timeline (inputs, tool calls, outputs) so audits and repros are simple. Redaction and PII scrubbing are available per field.
A non‑exhaustive starting library to explore AI in different domains. Use these to guide validation, safety, and feasibility checks.
Tip: pair literature with small proof‑of‑concept agents. Validate utility, failure modes, and review loops before scaling.
Define a clear task, success metric, and human approval step. Ship in days, not months.
Use schemas for tool inputs/outputs. Reject/repair invalid structures and log failures.
Pass only the fields an agent needs. Avoid dumping full records into prompts.
Retain traces for audit; add redaction where needed. Make repro easy.
Yes. You can run selected agents and processors on your own hardware with the same abstractions.
Secrets stay in the tool layer, not prompts. Tools receive scoped tokens; prompts receive references.
We provide data boundaries, audit trails, and optional PII scrubbing. Add your industry policies on top.