SDKs
Anima provides official SDKs for TypeScript/Node.js, Python, and Go. All three give you access to the full platform: agents, email, cards, vault, phone, webhooks, and more.
TypeScript / Node.js
Python
Go
Installation
npm install @anima-labs/sdk
The TypeScript SDK is fully typed and works with Node.js, Bun, and Deno.Initialization
import { Anima } from "@anima-labs/sdk";
const anima = new Anima({ apiKey: "ak_..." });
Key examples
Create an agent
const agent = await anima.agents.create({ name: "Procurement Bot" });
console.log(agent.id); // ag_abc123
Send an email
await anima.messages.sendEmail({
agentId: agent.id,
to: "vendor@example.com",
subject: "Purchase Order #1042",
body: "Please find the attached purchase order.",
});
Issue a virtual card
const card = await anima.cards.create({
agentId: agent.id,
label: "Vendor Payments",
currency: "usd",
spendLimitDaily: 50000, // amount in cents
});
Installation
The Python SDK is fully typed and supports both synchronous and asynchronous usage.Initialization
from anima import Anima
anima = Anima(api_key="ak_...")
Key examples
Create an agent
agent = anima.agents.create(name="Procurement Bot")
print(agent.id) # ag_abc123
Send an email
anima.messages.send_email(
agent_id=agent.id,
to="vendor@example.com",
subject="Purchase Order #1042",
body="Please find the attached purchase order.",
)
Issue a virtual card
card = anima.cards.create(
agent_id=agent.id,
label="Vendor Payments",
currency="usd",
spend_limit_daily=50000, # amount in cents
)
Async usage
Use AsyncAnima when running inside an async framework like FastAPI or asyncio:from anima import AsyncAnima
anima = AsyncAnima(api_key="ak_...")
agent = await anima.agents.create(name="Async Procurement Bot")
Installation
go get github.com/anima-labs/anima-go
Requires Go 1.21 or later.Initialization
import "github.com/anima-labs/anima-go"
client := anima.NewClient("ak_...")
You can pass additional options at construction time:client := anima.NewClient("ak_...",
anima.WithBaseURL("https://api.useanima.sh"),
anima.WithTimeout(30 * time.Second),
anima.WithRetries(3),
)
Key example
package main
import (
"context"
"fmt"
"log"
"github.com/anima-labs/anima-go"
)
func main() {
ctx := context.Background()
client := anima.NewClient("ak_...")
agent, err := client.Agents.Create(ctx, &anima.CreateAgentParams{
Name: "Procurement Bot",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Agent created: %s\n", agent.ID)
_, err = client.Messages.SendEmail(ctx, &anima.SendEmailParams{
AgentID: agent.ID,
To: "vendor@example.com",
Subject: "Purchase Order #1042",
Body: "Please find the attached purchase order.",
})
if err != nil {
log.Fatal(err)
}
fmt.Println("Email sent!")
}
Error handling
The Go SDK uses typed errors so you can inspect failures precisely:agent, err := client.Agents.Get(ctx, "ag_nonexistent")
if err != nil {
var apiErr *anima.APIError
if errors.As(err, &apiErr) {
fmt.Printf("API error %d: %s\n", apiErr.StatusCode, apiErr.Message)
}
log.Fatal(err)
}
Available resources
All three SDKs expose the same set of resources:
| Resource | Description |
|---|
agents | Create and manage AI agents |
messages | Send and receive email messages |
inboxes | Manage email inboxes |
cards | Issue and manage virtual cards |
vault | Store and retrieve encrypted credentials |
phone | Manage phone numbers |
webhooks | Subscribe to real-time events |
domains | Configure custom email domains |
security | Manage security policies |
api_keys | Create and rotate API keys |
All monetary amounts (spend limits, balances, transaction values) are expressed in the smallest currency unit — cents for USD.