Skip to content
  • Auto
  • Light
  • Dark
DiscordForumGitHubSign up
View as Markdown
Copy Markdown

Open in Claude
Open in ChatGPT

Cancel Message

client.agents.messages.cancel(stringagentID, MessageCancelParams { run_ids } body?, RequestOptionsoptions?): MessageCancelResponse
post/v1/agents/{agent_id}/messages/cancel

Cancel runs associated with an agent. If run_ids are passed in, cancel those in particular.

Note to cancel active runs associated with an agent, redis is required.

ParametersExpand Collapse
agentID: string

The ID of the agent in the format 'agent-'

minLength42
maxLength42
body: MessageCancelParams { run_ids }
run_ids?: Array<string> | null

Optional list of run IDs to cancel

ReturnsExpand Collapse
MessageCancelResponse = Record<string, unknown>
Cancel Message
import Letta from '@letta-ai/letta-client';

const client = new Letta({
  apiKey: 'My API Key',
});

const response = await client.agents.messages.cancel('agent-123e4567-e89b-42d3-8456-426614174000');

console.log(response);
{
  "foo": "bar"
}
Returns Examples
{
  "foo": "bar"
}