
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@creative-tim/agents
Advanced tools
Official Creative Tim Agents SDK — programmatically create and control OpenClaw AI agents and other agent models
Official SDK for Creative Tim OpenClaw — programmatically create and control AI agents from your code.
import { OpenClaw } from '@creative-tim/agents'
const client = new OpenClaw({ apiKey: 'sk-ct-...' })
const agent = await client.agents.create({
name: 'My Agent',
anthropicApiKey: process.env.ANTHROPIC_API_KEY!,
})
const { text } = await agent.chat('Hello! What can you do?')
console.log(text)
npm install @creative-tim/agents
# or
pnpm add @creative-tim/agents
# or
bun add @creative-tim/agents
sk-ct-... key (shown once)import { OpenClaw } from '@creative-tim/agents'
const client = new OpenClaw({
apiKey: process.env.OPENCLAW_API_KEY!, // sk-ct-...
})
agents.create() provisions a new persistent agent. Call it once per user or use-case, store the returned agent.id, and reconnect to the same agent on every subsequent request using agents.get().
const agent = await client.agents.create({
name: 'Research Bot',
anthropicApiKey: process.env.ANTHROPIC_API_KEY!,
model: 'claude-sonnet-4-6', // optional, default: claude-sonnet-4-6
})
// Persist the ID — you will need it to reconnect later
await db.save({ agentId: agent.id })
Cold start: A new agent takes ~60–80 seconds to provision. If a pre-warmed instance is available it takes ~15–20 seconds instead. Poll
agent.status()untilstatus === 'active'before chatting.
Every agent moves through these states:
status | lifecycleState | Meaning |
|---|---|---|
provisioning | initializing | Agent record created, machine starting |
provisioning | container_starting | Machine is up, services initialising (~60–80s) |
active | active | Ready to chat |
error | error_recoverable | Transient error — call agent.restart() to recover |
Poll agent.status() after create() until status === 'active':
let agentStatus
do {
await new Promise(r => setTimeout(r, 5000))
agentStatus = await agent.status()
} while (agentStatus.status === 'provisioning')
if (agentStatus.status === 'error') {
// Recover by restarting — no data is lost
await agent.restart()
}
// agent is now active — safe to chat
agents.get() returns a handle to an already-running agent without any API call. Use this on every page load instead of calling create() again.
// Retrieve the stored ID from your database
const agentId = await db.get(userId).agentId
// Instant — no provisioning, no cold start
const agent = client.agents.get(agentId)
const { text } = await agent.chat('Hello!')
| Scenario | Time |
|---|---|
create() with pre-warmed instance | ~15–20 s |
create() cold (no pre-warm available) | ~60–80 s |
get(id).chat() on a running agent | ~1–2 s (LLM only) |
The first chat() call after a cold start transparently retries until the agent is fully warmed up — you don't need to add any retry logic yourself.
const { text, sessionKey } = await agent.chat('Summarise this paper: ...')
// Continue the same conversation thread
const followUp = await agent.chat('Can you expand on point 3?', { sessionId: sessionKey })
for await (const chunk of agent.stream('Write me a poem about the ocean')) {
process.stdout.write(chunk)
}
const agents = await client.agents.list()
// [{ id, name, status, lifecycleState, createdAt, ... }]
Restarts the agent process without touching any data — skills, conversation history, and configuration are all preserved. Use this to recover from an error state or after a transient failure.
await agent.restart()
// Agent moves back to provisioning → active automatically
// The next chat() call will wait for the agent to be ready
Restart only restarts the running process. It does not affect stored skills, conversation history, or any other agent data.
Skills extend an agent with custom capabilities defined in markdown.
// Install a skill
await agent.skills.install('web-search', `
# Web Search Skill
You can search the web using the provided search API.
When asked to find something online, call this skill.
`)
// List installed skills
const skills = await agent.skills.list()
// Remove a skill
await agent.skills.remove('web-search')
await agent.delete()
new OpenClaw(config)| Option | Type | Required | Description |
|---|---|---|---|
apiKey | string | Yes | Your sk-ct-... API key |
baseUrl | string | No | Override API base URL (defaults to https://www.creative-tim.com/ui) |
client.agents| Method | Returns | Description |
|---|---|---|
create(options) | Promise<AgentHandle> | Provision a new agent |
list() | Promise<Agent[]> | List all agents for this API key |
get(agentId) | AgentHandle | Get a handle to an existing agent (no API call) |
AgentHandle| Method | Returns | Description |
|---|---|---|
status() | Promise<Agent> | Get current agent status and lifecycle state |
chat(message, options?) | Promise<ChatResponse> | Send a message, get a response |
stream(message, options?) | AsyncGenerator<string> | Stream response tokens |
restart() | Promise<void> | Restart the agent process — no data loss |
skills.list() | Promise<Skill[]> | List installed skills |
skills.install(name, content) | Promise<void> | Install a skill |
skills.remove(name) | Promise<void> | Remove a skill |
delete() | Promise<void> | Permanently delete the agent |
CreateAgentOptionsinterface CreateAgentOptions {
name: string
anthropicApiKey: string
model?: string // default: claude-sonnet-4-6
systemPrompt?: string // optional system prompt
}
Agentinterface Agent {
id: string
name: string
status: 'provisioning' | 'active' | 'error'
lifecycleState: string
model?: string
createdAt: string
updatedAt: string
}
ChatResponseinterface ChatResponse {
text: string // the agent's reply
sessionKey: string // pass as sessionId to continue the conversation thread
raw: unknown // full response object
}
The package ships with full TypeScript declarations. All types are exported from the root:
import type { Agent, AgentHandle, CreateAgentOptions, ChatResponse, Skill } from '@creative-tim/agents'
Apache-2.0 — Creative Tim
OpenClaw is an independent open-source project and is not affiliated with or endorsed by Creative Tim. OpenClaw is licensed under the MIT License. For more information visit openclaw.ai or the OpenClaw GitHub repository.
FAQs
Official Creative Tim Agents SDK — programmatically create and control OpenClaw AI agents and other agent models
We found that @creative-tim/agents demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.