Get started with AgentLens Cloud in under 5 minutes. No server to deploy, no infrastructure to manage.
- Go to https://app.agentlens.ai
- Click Sign Up — authenticate with GitHub, Google, or email
- You'll land on the Organization Dashboard with a default org created for you
- Navigate to Settings → API Keys
- Click Create API Key
- Give it a name (e.g.,
dev-local) and select a role (adminormember) - Copy the key (
als_cloud_...) — it's shown only once
Or use the CLI:
npx @agentlensai/cli cloud login
npx @agentlensai/cli cloud keys create --name dev-localpip install agentlensai[all-providers] # all 9 LLM providers
# or pick specific ones:
pip install agentlensai[openai] # just OpenAI
pip install agentlensai[anthropic] # just Anthropicnpm install @agentlensai/sdkimport agentlensai
agentlensai.init(
cloud=True,
api_key="als_cloud_your_key_here",
agent_id="my-agent",
)
import anthropic
client = anthropic.Anthropic()
message = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello!"}],
)
# ^ Automatically captured: model, tokens, cost, latency, full prompt/completion
agentlensai.shutdown()import agentlensai
agentlensai.init(
cloud=True,
api_key="als_cloud_your_key_here",
agent_id="my-agent",
)
import openai
client = openai.OpenAI()
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello!"}],
)
agentlensai.shutdown()import agentlensai
agentlensai.init(
cloud=True,
api_key="als_cloud_your_key_here",
agent_id="my-agent",
)
import litellm
response = litellm.completion(
model="gpt-4o-mini",
messages=[{"role": "user", "content": "Hello!"}],
)
agentlensai.shutdown()import { AgentLensClient } from '@agentlensai/sdk';
const client = new AgentLensClient({
cloud: true,
apiKey: 'als_cloud_your_key_here',
});
const sessions = await client.getSessions();
console.log(sessions);Instead of passing parameters directly, you can use environment variables:
export AGENTLENS_CLOUD=true
export AGENTLENS_API_KEY=als_cloud_your_key_here
export AGENTLENS_AGENT_ID=my-agentimport agentlensai
agentlensai.init(cloud=True) # picks up API key from envAfter running your instrumented code, verify data is flowing:
Dashboard: Open https://app.agentlens.ai → Sessions — you should see your session appear within seconds.
CLI:
npx @agentlensai/cli cloud sessions --limit 5SDK:
from agentlensai import AgentLensClient
client = AgentLensClient(cloud=True, api_key="als_cloud_your_key_here")
sessions = client.get_sessions(limit=5)
for s in sessions:
print(f"{s.id} — {s.agent_id} — {s.status}")
client.close()The landing page shows live metrics: total sessions, events, errors, and active agents. The 24-hour timeline chart updates in real time.
Browse all agent sessions with sortable columns: agent name, status, start time, duration, event count, error count, and cost. Click any session to see its full timeline.
View aggregate LLM metrics: total calls, cost, latency, and token usage. Break down by provider and model. Filter by agent or time range.
Monitor agent reliability with 5-dimension health scoring (error rate, cost efficiency, tool success, latency, completion rate). Track trends over time.
Manage your API keys: create, revoke, and see last-used timestamps. Each key is scoped to your organization.
Invite team members, assign roles (owner, admin, member), and manage organization settings.
View current usage (events ingested, storage), plan limits, and billing history. Upgrade or manage your subscription.
- Check your API key — ensure it starts with
als_cloud_and hasn't been revoked - Check the environment — run
echo $AGENTLENS_API_KEYto confirm it's set - Key might be expired — create a new one in the dashboard
- Call
agentlensai.shutdown()— the SDK batches events and flushes on shutdown. Without it, the last batch may not be sent. - Check network — ensure your machine can reach
https://api.agentlens.ai - Check agent_id — filter by the correct agent in the dashboard
- Sync mode for debugging — use
agentlensai.init(cloud=True, api_key="...", sync_mode=True)to send events synchronously and see errors immediately
You've hit the rate limit for your plan. Options:
- Wait and retry (the SDK has built-in retry with exponential backoff)
- Upgrade your plan for higher limits
- Reduce event volume by filtering what you instrument
- Ensure your Python/Node.js has up-to-date CA certificates
- If behind a corporate proxy, configure
HTTPS_PROXYenvironment variable
- Verify you're using
cloud=True(not pointing atlocalhost) - Check firewall rules — outbound HTTPS (port 443) to
api.agentlens.aimust be allowed
Cloud mode requires agentlensai >= 0.11.0. Upgrade:
pip install --upgrade agentlensai
# or
npm install @agentlensai/sdk@latest- SDK Migration Guide — migrating from self-hosted to cloud
- API Reference — full REST API documentation
- Agent Memory Guide — memory, recall, and lessons