baseUrl option points the plugin at another REST base, such as a proxy (https; plain http only for localhost). Things to know before you write:
- Agents keep state. An agent has core memory blocks (always in its context), archival passages (searched when needed), attached tools, folders and files.
agents.blocks.*,agents.passages.*,blocks.*andarchives.*read and edit that memory directly. - Messages run the model.
agents.messages.createandconversations.messages.createcall the agent’s model and may run its tools, so they spend tokens and aredestructive.agents.messages.createAsyncruns in the background (pollruns.get); the streaming routes return the server-sent events as text. - Tools.
tools.*manage custom tools,mcpServers.*connect MCP servers, andagents.tools.attachgives a tool to an agent.agents.tools.runandmcpServers.tools.runexecute a tool directly. - Templates and identities (
templates.*,agents.identities.*) are Letta Cloud features. - Routes Letta Cloud didn’t serve (11-27). On a free account, Letta Cloud had no route for
archives.*,folders.*,templates.*,passages.searchandagents.importFile(404, “Cannot GET”), though the reference lists them. They are kept as documented; expect a 404 until Letta serves them for your plan. Letta now steers new work to its Agent SDK and App Server; the REST API still answers. - Undocumented returns. Letta’s reference gives no return type for some routes (deletes, attach and detach, file open and close, tags, traces); those return the JSON Letta sends, unchecked, or
{ success: true }for an empty body.
- 129 typed API operations
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
Store the Letta API key before the first call: More: API Key
pnpm corsair setup --plugin=letta --tenant=acme api_key=<your-key> (leave out --tenant without multiTenancy), or pass it as key in the plugin options. With Hub, each tenant enters their own key on the connect page. See API key auth.4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
List agentsWhat’s next
API reference
Every
letta.api.* operation with input and output types.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.