Agents API
The Agents API lets you list, create, deploy, and invoke agents. Access viaclient.agents:
Methods
list()
List all agents for the authenticated user.Promise<Agent[]>
Example:
get(slug)
Get a specific agent by slug.
Returns:
Promise<Agent>
Example:
404— Agent not found
create(options)
Create a new agent.
Returns:
Promise<Agent>
Example:
delete(slug)
Delete an agent.
Returns:
Promise<void>
Example:
deploy(slug)
Deploy an agent.
Returns:
Promise<Agent>
Example:
Deployment is asynchronous. The returned agent will have status
deploying. Poll get() to check when it becomes active.stop(slug)
Stop a running agent.
Returns:
Promise<Agent>
Example:
invoke(slug, options)
Invoke an agent with a prompt.
Returns:
Promise<InvocationResponse>
Example:
uploadCode(slug, file, filename, options?)
Upload code directly to an agent and deploy.
Returns:
Promise<UploadResponse>
Example:
listSecrets(slug)
List secret keys for an agent (values are never returned).
Returns:
Promise<Secret[]>
Example:
setSecret(slug, key, value)
Set a secret for an agent.
Returns:
Promise<void>
Example:
deleteSecret(slug, key)
Delete a secret from an agent.
Returns:
Promise<void>
Example:
Full Example
See Also
- Secrets API — Manage secrets
- Types — TypeScript interfaces
- cast invoke — CLI equivalent