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

Open in Claude
Open in ChatGPT

Export Agent

agents.export_file(stragent_id, AgentExportFileParams**kwargs) -> AgentExportFileResponse
get/v1/agents/{agent_id}/export

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

ParametersExpand Collapse
agent_id: str
Deprecatedmax_steps: Optional[int]
Deprecateduse_legacy_format: Optional[bool]

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 = str
Export Agent
from letta_client import Letta

client = Letta(
    api_key="My API Key",
)
response = client.agents.export_file(
    agent_id="agent_id",
)
print(response)
"string"
Returns Examples
"string"