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

Open in Claude
Open in ChatGPT

Export Agent

client.agents.exportFile(stringagentID, AgentExportFileParams { max_steps, use_legacy_format } query?, RequestOptionsoptions?): AgentExportFileResponse
get/v1/agents/{agent_id}/export

Export the serialized JSON representation of an agent, formatted with indentation.

ParametersExpand Collapse
agentID: string
query: AgentExportFileParams { max_steps, use_legacy_format }
Deprecatedmax_steps?: number
Deprecateduse_legacy_format?: boolean

If True, exports using the legacy single-agent 'v1' format with inline tools/blocks. If False, exports using the new multi-entity 'v2' format, with separate agents, tools, blocks, files, etc.

ReturnsExpand Collapse
AgentExportFileResponse = string
Export Agent
import Letta from '@letta-ai/letta-client';

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

const response = await client.agents.exportFile('agent_id');

console.log(response);
"string"
Returns Examples
"string"