CAIRO is a powerful AI agent platform and developer SDK designed to help teams build, orchestrate, and deploy intelligent automation workflows safely and at scale. It enables developers to connect LLMs, APIs, tools, and data sources into production-ready agent systems with built-in billing, usage tracking, and multi-tenant organization management.
- Tool-calling agents with full reasoning pipelines
- Multi-step task orchestration
- Memory support and state persistence
- Streaming and async agent responses
A TypeScript/Python SDK that provides:
- Task building and execution APIs
- Agent orchestration utilities
- Authentication helpers
- Token management and usage tracking
Example:
import { Cairo } from "cairo-sdk";
const cairo = new Cairo({ apiKey: process.env.CAIRO_API_KEY });
const result = await cairo.runTask({
prompt: "Draft a product launch announcement",
});CAIRO connects AI agents with real-world tools:
- Stripe β payments, wallet top-ups, metered billing
- GitHub β issues, PR creation, code automation
- APIs & Webhooks for custom integrations
Planned integrations:
- Slack
- Notion
- Google Workspace
- Jira
- Each organization has a wallet balance.
- Users can top-up their wallet using Stripe Checkout.
- Agents consume credits based on model usage and token costs.
- Balance updates occur in real-time via webhook confirmation.
User selects amount and clicks Add Balance.
Frontend route:
POST /payment/create-checkout-session
Backend creates a Stripe checkout session with metadata:
org_iduser_idpayment_type = wallet_topup
User completes payment securely on Stripe-hosted UI.
Event:
checkout.session.completed
Webhook handler actions:
- Verify webhook signature
- Retrieve organization + amount
- Update wallet balance
- Create ledger credit entry
UPDATE organizations
SET wallet_balance = wallet_balance + <amount>
WHERE id = <org_id>;INSERT INTO credit_transactions (
org_id,
transaction_type,
amount,
source,
stripe_session_id
)
VALUES (...);CAIRO backend is powered by FastAPI and split into service layers:
api/
ββ auth/
ββ integrations/
ββ payments/
ββ agents/
ββ usage/
| Component | Description |
|---|---|
| Auth Service | JWT authentication & org verification |
| Wallet Service | Balance calculation & validation |
| Stripe Service | Checkout + webhook handler |
| Agent Service | Task execution engine |
| Usage Service | Token usage tracking & metering |
organizations (
id UUID PRIMARY KEY,
name TEXT,
wallet_balance DECIMAL,
created_at TIMESTAMP
);credit_transactions (
id UUID PRIMARY KEY,
org_id UUID FOREIGN KEY,
transaction_type TEXT,
amount DECIMAL,
source TEXT,
stripe_session_id TEXT,
created_at TIMESTAMP
);api_keys (
id UUID PRIMARY KEY,
org_id UUID,
key_hash TEXT,
is_active BOOLEAN,
created_at TIMESTAMP
);CAIRO uses JWT-based authentication.
- Each user logs in and receives a JWT token
- JWT includes:
user_idorg_id- expiration timestamp
- API keys are tied to organizations
Requests validate:
- JWT token
- Organization membership
- Wallet balance before task execution
1οΈβ£ User submits task via dashboard or SDK
2οΈβ£ Wallet balance checked
3οΈβ£ Agent pipeline processes prompt
4οΈβ£ Tools + APIs invoked as required
5οΈβ£ LLM request executed
6οΈβ£ Token usage measured
7οΈβ£ Credits deducted from wallet
8οΈβ£ Results streamed back to user
Each task records:
{
"task_id": "uuid",
"org_id": "uuid",
"model": "gpt-4",
"prompt_tokens": 230,
"completion_tokens": 470,
"credits_used": 3.93
}Credits deducted automatically:
UPDATE organizations
SET wallet_balance = wallet_balance - <credits_used>
WHERE id = <org_id>;Dashboard Features:
- Wallet balance view
- Stripe checkout top-ups
- Task execution panels
- Usage reports
- API key management
Built using:
- React + Next.js
- Tailwind CSS
- Secure JWT auth flow
User Dashboard
|
v
Frontend (Next.js)
|
v
FastAPI Gateway
|
+--> Auth Service
|
+--> Agent Engine
|
+--> Stripe Service ----> Stripe
|
+--> Usage & Billing
|
v
PostgreSQL Database
- Encrypted secrets via environment variables
- Stripe webhook signature verification
- JWT token validation per request
- API key hashing
- Rate limiting on task creation
β
Developer SDK stable release
β
Stripe billing + wallet system
β
GitHub integration foundation
π§ In Progress:
- Team collaboration agents
- Usage alerting dashboard
- Multi-agent workflows UI
π Planned:
- Slack & Notion integrations
- Marketplace for custom agents
- AI workflow templates
We welcome contributions!
-
Fork the repository
-
Create a feature branch:
git checkout -b feature/my-feature
-
Commit your changes
-
Open a pull request
For platform access or partnership inquiries:
π§ support@cairo.ai
π Website: https://cairo.ai (launching soon)
Install SDK:
npm install cairo-sdkInitialize:
const cairo = new Cairo({ apiKey: "YOUR_API_KEY" });Run your first task:
await cairo.runTask({
prompt: "Summarize today's market news",
});Build smarter with CAIRO β where AI agents go to production.