Skip to main content

Quickstart: Email

Give your AI agent a real email address and send its first message.

Prerequisites

  • Your org’s master key (mk_...) from console.useanima.sh — creating agents is a master-key operation
  • Your organization ID (org_...), shown in the console
  • Python 3.10+ or Node.js 18+

Python

pip install anima-labs
from anima import Anima

anima = Anima(api_key="mk_...")  # master key — agent creation is admin-gated

# Create an agent with an email inbox
agent = anima.agents.create(
    org_id="org_...",  # your organization ID, from the console
    name="My First Agent",
    slug="my-first-agent",
)
print(f"Agent: {agent.id}")

# Send an email
anima.messages.send_email(
    agent_id=agent.id,
    to=["recipient@example.com"],
    subject="Hello from my AI agent",
    body="This email was sent by an AI agent powered by Anima.",
)
print("Email sent!")

Node.js / TypeScript

npm install @anima-labs/sdk
import { Anima } from "@anima-labs/sdk";

const anima = new Anima({ apiKey: "mk_..." }); // master key — agent creation is admin-gated

// Create an agent with an email inbox
const agent = await anima.agents.create({
  orgId: "org_...", // your organization ID, from the console
  name: "My First Agent",
  slug: "my-first-agent",
});
console.log(`Agent: ${agent.id}`);

// Send an email
await anima.messages.sendEmail({
  agentId: agent.id,
  to: ["recipient@example.com"],
  subject: "Hello from my AI agent",
  body: "This email was sent by an AI agent powered by Anima.",
});
console.log("Email sent!");

What’s Next