Skip to content
Letta Platform Letta Platform Letta Docs
Sign up

Import Agent

POST/v1/agents/import

Import a serialized agent file and recreate the agent(s) in the system. Returns the IDs of all imported agents.

Header ParametersExpand Collapse
"x-override-embedding-model": optional string
Body ParametersForm DataExpand Collapse
file: file
Deprecatedappend_copy_suffix: optional boolean

If set to True, appends “_copy” to the end of the agent name.

embedding: optional string

Embedding handle to override with.

Deprecatedenv_vars_json: optional string

Environment variables as a JSON string to pass to the agent for tool execution. Use ‘secrets’ instead.

model: optional string

Model handle to override the agent’s default model. This allows the imported agent to use a different model while keeping other defaults (e.g., context size) from the original configuration.

name: optional string

If provided, overrides the agent name with this value.

Deprecatedoverride_embedding_handle: optional string

Override import with specific embedding handle. Use ‘embedding’ instead.

override_existing_tools: optional boolean

If set to True, existing tools can get their source code overwritten by the uploaded tool definitions. Note that Letta core tools can never be updated externally.

Deprecatedoverride_model_handle: optional string

Model handle to override the agent’s default model. Use ‘model’ instead.

Deprecatedoverride_name: optional string

If provided, overrides the agent name with this value. Use ‘name’ instead.

Deprecatedproject_id: optional string

The project ID to associate the uploaded agent with. This is now passed via headers.

secrets: optional string

Secrets as a JSON string to pass to the agent for tool execution.

strip_messages: optional boolean

If set to True, strips all messages from the agent before importing.

ReturnsExpand Collapse
agent_ids: array of string

List of IDs of the imported agents

Import Agent

curl https://api.letta.com/v1/agents/import \
    -H 'Content-Type: multipart/form-data' \
    -H "Authorization: Bearer $LETTA_API_KEY" \
    -F 'file=@/path/to/file'
{
  "agent_ids": [
    "string"
  ]
}
Returns Examples
{
  "agent_ids": [
    "string"
  ]
}