Agent frameworks
Layrcake ships tool packages for the agent frameworks people build with, plus the MCP server for everything else. Each package wraps the official SDK, so the tools, prices and rules are the same everywhere. You need an API key in LAYRCAKE_API_KEY: create one at layrcake.dev/connect. New workspaces start with 300 free credits.
What every package enforces
- One budget per run. You set it in credits. Every paid call is capped at what is left, and calls are refused once it is spent.
- Dry run. Turn it on and every call returns what it would cost, charging nothing.
- No double charges. Each call carries an idempotency key, so a retry never pays twice.
- Verified addresses only. A campaign accepts only emails that passed verify_email in the same run.
- Stop at approval. launch_campaign returns a preview and an approval link. The tools never take a confirmation token, and every paid call after the link is refused. A signed-in person approves in the console.
The tools are find_leads, enrich, verify_email, check_companies, research_company, create_campaign, launch_campaign and get_me. Prices are on the pricing page.
Python: LangChain, LlamaIndex, CrewAI
LangChain
pip install -U langchain-layrcake
from langchain.agents import create_agent
from langchain_layrcake import LayrcakeToolkit
toolkit = LayrcakeToolkit(budget_credits=50) # reads LAYRCAKE_API_KEY
agent = create_agent(model="anthropic:claude-sonnet-5-5", tools=toolkit.get_tools())
result = agent.invoke({"messages": [{"role": "user", "content":
"Find 5 heads of sales at UK software companies, verify their work emails, "
"draft a two-step campaign and ask for approval."}]})
print(result["messages"][-1].content)Also needs a model provider, for example pip install -U "langchain[anthropic]". Source: Layrcake-dev/langchain-layrcake.
LlamaIndex
pip install llama-index-tools-layrcake
import asyncio
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.anthropic import Anthropic
from llama_index.tools.layrcake import LayrcakeToolSpec
tools = LayrcakeToolSpec(budget_credits=50).to_tool_list() # reads LAYRCAKE_API_KEY
agent = FunctionAgent(tools=tools, llm=Anthropic(model="claude-sonnet-5-5"))
print(asyncio.run(agent.run(
"Find 5 heads of sales at UK software companies, verify their work emails, draft a campaign, ask for approval.")))Also needs a model integration, for example pip install llama-index-llms-anthropic. Source: Layrcake-dev/llama-index-tools-layrcake.
CrewAI
pip install crewai-layrcake
from crewai import Agent, Crew, Task
from crewai_layrcake import layrcake_tools
sdr = Agent(role="SDR", goal="Book meetings with UK sales leaders", backstory="Careful with credits.",
tools=layrcake_tools(budget_credits=50), llm="anthropic/claude-sonnet-5-5")
task = Task(description="Find 5 heads of sales at UK software companies, verify their work emails, "
"draft a two-step campaign and ask for approval.", expected_output="The approval link.", agent=sdr)
print(Crew(agents=[sdr], tasks=[task]).kickoff())Anthropic models need pip install "crewai[anthropic]". Source: Layrcake-dev/crewai-layrcake.
Building your own adapter? The same rules are in the SDK as layrcake.agent_tools (pip install "layrcake[agents]"), with sync and async sessions.
TypeScript: Vercel AI SDK, Mastra
Vercel AI SDK
npm install @layrcake/ai-sdk ai
import { anthropic } from "@ai-sdk/anthropic";
import { generateText, hasToolCall, isStepCount } from "ai";
import { createLayrcakeTools } from "@layrcake/ai-sdk";
const { tools, summary } = createLayrcakeTools({ budget: 100 }); // reads LAYRCAKE_API_KEY
await generateText({
model: anthropic("claude-sonnet-5-5"),
prompt: "Find 10 heads of sales at software companies in London with 20 to 200 staff and draft a short campaign about cutting time spent on lead research.",
tools,
toolCallConcurrency: 1,
stopWhen: [hasToolCall("launch_campaign"), isStepCount(40)],
});
const run = summary();
console.log(`Kept ${run.kept} verified emails. Spent ${run.spent} credits.`);
if (run.approvalUrl) console.log(`A person approves here: ${run.approvalUrl}`);The loop ends on the launch_campaign call, so read the result from summary(). No zod needed. Source: Layrcake-dev/layrcake-ai-sdk.
Mastra
npm install @layrcake/mastra @mastra/core
import { Agent } from "@mastra/core/agent";
import { createLayrcakeTools } from "@layrcake/mastra";
const { tools, stopWhen, summary } = createLayrcakeTools({ budget: 100 });
const prospector = new Agent({
id: "prospector",
name: "Prospector",
instructions: "Find people with find_leads, get work emails with enrich, keep only addresses verify_email marks valid or catch_all_valid, draft a campaign, then call launch_campaign once and stop.",
model: "anthropic/claude-sonnet-5-5",
tools,
});
await prospector.generate("Find 10 heads of sales at software companies in London with 20 to 200 staff and draft a short campaign about cutting time spent on lead research.", { stopWhen, maxSteps: 40 });
const run = summary();
if (run.approvalUrl) console.log(`A person approves here: ${run.approvalUrl}`);Needs Mastra 1.50.1 or later. Source: Layrcake-dev/layrcake-mastra.
Building your own adapter? The same rules are in the SDK at layrcake/agent-tools (npm install layrcake).
Claude Agent SDK, OpenAI Agents SDK and MCP clients
Frameworks that speak MCP can use the hosted server directly: https://mcp.layrcake.dev/mcp with Authorization: Bearer YOUR_LAYRCAKE_API_KEY, or OAuth where the client supports it. Setup for each client is on Add to your agent. The starter kits below show the Claude Agent SDK on MCP and the OpenAI Agents SDK on the Python SDK.
Starter kits
Each kit is a working agent that finds people, verifies their emails, drafts a campaign and stops at the approval link. Each has a dry-run mode, one run command, CI, and a note on running through OpenRouter.
- starter-claude-agent-sdk · TypeScript, MCP
- starter-openai-agents · Python
- starter-vercel-ai-sdk · TypeScript
- starter-langgraph · Python
- starter-mastra · TypeScript
- starter-n8n · an importable n8n workflow