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

Open in Claude
Open in ChatGPT

Create agents from a template (Cloud-only)

client.templates.agents.create(stringtemplateVersion, AgentCreateParams { agent_name, identity_ids, initial_message_sequence, 3 more } body?, RequestOptionsoptions?): void
post/v1/templates/{template_version}/agents

Creates an Agent or multiple Agents from a template

ParametersExpand Collapse
templateVersion: string
body: AgentCreateParams { agent_name, identity_ids, initial_message_sequence, 3 more }
agent_name?: string

The name of the agent, optional otherwise a random one will be assigned

identity_ids?: Array<string>

The identity ids to assign to the agent

initial_message_sequence?: Array<InitialMessageSequence>

Set an initial sequence of messages, if not provided, the agent will start with the default message sequence, if an empty array is provided, the agent will start with no messages

content: string
role: "user" | "system" | "assistant"
Accepts one of the following:
"user"
"system"
"assistant"
batch_item_id?: string | null
group_id?: string | null
name?: string | null
otid?: string | null
sender_id?: string | null
memory_variables?: Record<string, string>

The memory variables to assign to the agent

tags?: Array<string>

The tags to assign to the agent

tool_variables?: Record<string, string>

The tool variables to assign to the agent

Create agents from a template (Cloud-only)
import Letta from '@letta-ai/letta-client';

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

await client.templates.agents.create('template_version');
Returns Examples