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

Open in Claude
Open in ChatGPT

Open File For Agent

client.agents.files.open(stringfileID, FileOpenParams { agent_id } params, RequestOptionsoptions?): FileOpenResponse
patch/v1/agents/{agent_id}/files/{file_id}/open

Opens a specific file for a given agent.

This endpoint marks a specific file as open in the agent's file state. The file will be included in the agent's working memory view. Returns a list of file names that were closed due to LRU eviction.

ParametersExpand Collapse
fileID: string

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

minLength41
maxLength41
params: FileOpenParams { agent_id }
agent_id: string

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

minLength42
maxLength42
ReturnsExpand Collapse
FileOpenResponse = Array<string>
Open File For Agent
import Letta from '@letta-ai/letta-client';

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

const response = await client.agents.files.open('file-123e4567-e89b-42d3-8456-426614174000', {
  agent_id: 'agent-123e4567-e89b-42d3-8456-426614174000',
});

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