managed-agents-api
Use Anthropic's Managed Agents API (/v1/agents, /v1/sessions) — server-side agent runtime that handles the tool loop, compaction, memory, and scaling for you. Covers when to pick Managed over SDK, request shape, and cost model. Use this skill when building production agents at scale, deciding between SDK vs Managed, or migrating from self-hosted agent loops. Activate when: Managed Agents API, /v1/agents, /v1/sessions, server-side agent, Anthropic agent runtime.
What this skill does
# Managed Agents API
**The Managed Agents API lets Anthropic run the agent loop server-side. You POST a user message; they run the tool loop, manage context, and stream results. You lose control but gain simplicity and durability.**
## When to Use
- Production agents where you don't want to operate infrastructure
- Long-running agents that span hours/days — server-side compaction handles it
- Multi-client agents (web + mobile + CLI) sharing sessions
- Scaling without worrying about loop-runner uptime
## When NOT to Use
- Agents with heavy client-side context (local files, IDE state) — SDK fits better
- You need custom tool-execution environments not exposed by Managed
- Debug-heavy development — self-hosted gives you more visibility
## Core Objects
1. **Agent** (`/v1/agents`) — a template: name, system prompt, tools, model
2. **Session** (`/v1/sessions`) — a live conversation bound to an agent
3. **Message** — added to a session; triggers agent run
## Create an Agent
```ts
const agent = await client.beta.agents.create({
name: "support-bot",
description: "Customer support for ACME",
model: "claude-sonnet-4-6",
system_prompt: "You are ACME's support agent. Be concise and accurate.",
tools: [
{ type: "search_tickets", name: "search_tickets", /* schema */ },
{ type: "create_escalation", name: "create_escalation" },
],
mcp_servers: [
{ type: "url", url: "https://mcp.acme.com/sse", name: "acme" },
],
});
// Returns: { id: "agt_...", name: "support-bot", ... }
```
Agents are versionable — update without breaking live sessions.
## Start a Session
```ts
const session = await client.beta.sessions.create({
agent_id: agent.id,
metadata: { user_id: "u-42", ticket_id: "T-1001" },
});
// Returns: { id: "ses_...", agent_id: "agt_...", status: "idle", ... }
```
Metadata is yours to use for filtering, auditing, linking to your domain.
## Send a Message
```ts
const stream = client.beta.sessions.messages.stream({
session_id: session.id,
content: "My order #12345 is stuck — can you help?",
});
for await (const event of stream) {
if (event.type === "text") console.log(event.delta);
if (event.type === "tool_use") console.log("TOOL:", event.name);
if (event.type === "done") break;
}
```
Managed runs the tool loop server-side. You see streamed text, tool calls, and final response. You don't execute tools — Managed does (either built-in tools or via MCP).
## Resuming Sessions
Sessions are durable. A day later:
```ts
const next = await client.beta.sessions.messages.create({
session_id: session.id,
content: "Any update on my issue?",
});
```
Server-side compaction keeps context in budget. You don't manage history — it's stored and pruned automatically.
## Listing & Filtering Sessions
```ts
const sessions = await client.beta.sessions.list({
agent_id: agent.id,
metadata: { user_id: "u-42" },
limit: 50,
});
```
Use metadata filters to scope sessions by user, tenant, or workflow instance.
## Tool Execution
Tools are declared on the Agent. Managed executes them by:
- **Built-in tools** (code_execution, web_search, computer, memory) — Anthropic runs
- **MCP servers** — Managed connects to your server and calls tools there
- **Custom tools (URL endpoints)** — Managed POSTs to your URL with tool input
```ts
tools: [
{
type: "url",
name: "ship_order",
description: "Ship an order",
input_schema: { /* ... */ },
url: "https://api.acme.com/tools/ship",
auth: { type: "bearer", token: "${ACME_TOKEN}" },
},
]
```
Your endpoint must return the tool result JSON. Managed handles retries and the loop.
## Cost Model
- Token cost: same as direct API
- Infrastructure cost: included (loop runner, storage, compaction)
- MCP/URL tool calls: you pay your own server costs
- Sessions storage: retained per your retention setting
Typically 5-15% more expensive than self-hosted agents in exchange for zero ops.
## Observability
```ts
const events = await client.beta.sessions.events.list({ session_id, limit: 100 });
// Returns loop events: tool_use, tool_result, thinking, compaction, etc.
```
Every step is logged. You can audit, replay, and debug without running infrastructure.
## Migration from SDK
Incremental:
1. Create a matching Agent with your current tools declared
2. For new users, route to Managed
3. For existing SDK sessions, finish them out
4. Drop SDK once all traffic is on Managed
Or parallel for critical flows — run both and A/B test.
## Limitations
- Agent tools must be declarable (MCP or URL) — you can't run arbitrary Node.js tools in Managed
- Client-side context (open editor, local files) can't be in Managed — use SDK
- Fine-grained loop control unavailable — Managed decides when to compact, when to retry
## Best Practices
1. Use Managed for customer-facing agents where you care about uptime more than control
2. Use SDK for dev tools, IDE integrations, local automation
3. Put tools behind MCP or URL endpoints — keeps them reusable across agents
4. Use session metadata for tenant isolation and auditability
5. Set retention policies explicitly (default may be longer than you want)
6. Monitor session event streams for anomalies — long loops, repeated tool failures
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.