Embedded Agents
Ship Levain agents inside your own product, one workspace per customer.
Your product serves its own customers. Embedded agents let you put working AI agents in front of them without building an agent platform yourself: you own the experience, the pricing, and the relationship; Levain runs the machinery underneath. Your customers never need a Levain account — no separate login, no Levain UI, no emails from us.
The model
Three levels, each with a clear job:
| Level | What it is |
|---|---|
| Org | Your company. Holds your API keys, your agent registry, your webhooks, and your pooled credit. |
| Workspace | One per end-customer. Their agents, credentials, runs, and usage stay behind their own boundary. |
| Agent | Authored once at the org level, versioned centrally, adopted into every customer workspace. |
The workspace your team signs in to is the org's primary workspace. It works like any other Levain workspace — build and test agents there, manage billing, invite teammates. The workspaces you provision for customers are headless: nobody signs in to them, and your backend acts on them entirely through the API.
How access works
One org API key reaches every workspace in the org. Pick the workspace per
request with the X-Workspace-Id header:
curl https://api.levainlabs.com/api/v1/runs/ \
-H "Authorization: Bearer $LEVAIN_ORG_KEY" \
-H "X-Workspace-Id: $CUSTOMER_WORKSPACE_ID"Every workspace-scoped endpoint — agents, runs, sessions, analytics — works this way, so anything you can do in one workspace you can script across the fleet. Keys handed out for a single workspace stay confined to it: a workspace key can't see siblings or manage the org.
The integration loop
- Create an org API key in the dashboard under Organization settings →
API Keys, or via
POST /api/v1/org/api-keys. - Provision a workspace when a customer signs up for your agent-powered feature.
- Hand off credentials your product already holds for that customer, so their agents can reach their data.
- Publish your agent to the org registry and adopt it into the customer's workspace.
- Trigger runs with
X-Workspace-Id, and receive webhooks when they finish. - Meter usage per customer, so you know what the feature costs to run for each of them.
- Suspend the workspace when the customer offboards — data kept, runs refused.
Embedded agents are available on the Enterprise plan; see Plans & Billing. The full API surface is documented under API Reference → Organization.