Skip to main content

Agents API

The Agents API lets you list, create, deploy, and invoke agents. Access via client.agents:

Methods

list()

List all agents for the authenticated user.
Returns: Promise<Agent[]> Example:

get(slug)

Get a specific agent by slug.
Parameters: Returns: Promise<Agent> Example:
Errors:
  • 404 — Agent not found

create(options)

Create a new agent.
Parameters: Returns: Promise<Agent> Example:

delete(slug)

Delete an agent.
Parameters: Returns: Promise<void> Example:
This permanently deletes the agent, its secrets, and all invocation history.

deploy(slug)

Deploy an agent.
Parameters: 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.
Parameters: Returns: Promise<Agent> Example:

invoke(slug, options)

Invoke an agent with a prompt.
Parameters: Returns: Promise<InvocationResponse> Example:
With session (multi-turn conversation):
Response:

uploadCode(slug, file, filename, options?)

Upload code directly to an agent and deploy.
Parameters: Returns: Promise<UploadResponse> Example:

listSecrets(slug)

List secret keys for an agent (values are never returned).
Parameters: Returns: Promise<Secret[]> Example:

setSecret(slug, key, value)

Set a secret for an agent.
Parameters: Returns: Promise<void> Example:

deleteSecret(slug, key)

Delete a secret from an agent.
Parameters: Returns: Promise<void> Example:

Full Example

See Also