> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Letta API reference

> API reference for the Letta plugin in Corsair: every `letta.api.*` operation with its input and output types, taken from the plugin's Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Access Tokens

### create

`accessTokens.create`

Create token (Cloud-only). Create a new client side access token with the specified configuration. Mints a client-side access token (it expires after 5 minutes unless expires\_at says otherwise).

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.accessTokens.create({
	hostname: 'example',
	policy: [{
		id: 'doc_8f2k1x9q',
		access: ['read_messages'],
		type: 'agent',
	}],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `hostname` | `string` | Yes | The hostname of the client side application. Please specify the full URL including the protocol (http or https). |
| `policy` | `object[]` | Yes | — |
| `expires_at` | `string` | No | The expiration date of the token. If not provided, the token will expire in 5 minutes |

> [accordion] policy full type
>
> ```ts theme={null}
> {
>   id: string,
>   access: (read_messages | write_messages | read_agent | write_agent)[],
>   type: agent
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `token` | `string \| null` | No | — |
| `expiresAt` | `string \| null` | No | — |
| `hostname` | `string \| null` | No | — |
| `policy` | `object \| null` | No | — |

> [accordion] policy full type
>
> ```ts theme={null}
> {
>   data?: {
>     id?: string | null,
>     access?: string[] | null,
>     type?: string | null
>   }[] | null,
>   version?: string | null
> } | null
> ```

***

### delete

`accessTokens.delete`

Delete token (Cloud-only). Delete a client side access token. Letta Cloud refused every delete on 11-27 (400, its own body check fails even with no body); tokens expire on their own. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.accessTokens.delete({ token: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `token` | `string` | Yes | — |
| `body` | `any` | No | — |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### list

`accessTokens.list`

List tokens (Cloud-only). List all client side access tokens for the current account. This is only available for cloud users.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.accessTokens.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agentId` | `string` | No | The agent ID to filter tokens by. If provided, only tokens for this agent will be returned. |
| `limit` | `number` | No | The number of tokens to return per page. Defaults to 10. |
| `offset` | `number` | No | The offset for pagination. Defaults to 0. |

**Output:** `object[] \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   hasNextPage?: boolean | null,
>   tokens?: {
>     token?: string | null,
>     expiresAt?: string | null,
>     hostname?: string | null,
>     policy?: {
>       data?: {
>         id?: string | null,
>         access?: string[] | null,
>         type?: string | null
>       }[] | null,
>       version?: string | null
>     } | null
>   }[] | null
> }[] | {
>   hasNextPage?: boolean | null,
>   tokens?: {
>     token?: string | null,
>     expiresAt?: string | null,
>     hostname?: string | null,
>     policy?: {
>       data?: {
>         id?: string | null,
>         access?: string[] | null,
>         type?: string | null
>       }[] | null,
>       version?: string | null
>     } | null
>   }[] | null
> }
> ```

***

## Agents

### archives.attach

`agents.archives.attach`

Attach Archive To Agent. Attach an archive to an agent. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.agents.archives.attach({ agent_id: 'example', archive_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `archive_id` | `string` | Yes | — |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### archives.detach

`agents.archives.detach`

Detach Archive From Agent. Detach an archive from an agent. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.agents.archives.detach({ agent_id: 'example', archive_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `archive_id` | `string` | Yes | — |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### blocks.attach

`agents.blocks.attach`

Attach Block To Agent. Attach a core memory block to an agent.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.agents.blocks.attach({ agent_id: 'example', block_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `block_id` | `string` | Yes | The ID of the block in the format 'block-\<uuid4>' |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The id of the agent. Assigned by the database. |
| `agent_type` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | Enum to represent the type of agent. |
| `blocks` | `object[] \| null` | No | The memory blocks used by the agent. |
| `llm_config` | `object \| null` | No | Configuration for Language Model (LLM) connection and generation parameters. .. deprecated:: LLMConfig is deprecated and should not be used as an input or return type in API calls. Use the schemas in letta.schemas.model (ModelSettings, OpenAIModelSettings, etc.) instead. For conversion, use the \_to\_model() method or Model.\_from\_llm\_config() method. |
| `memory` | `object \| null` | No | Deprecated: Use `blocks` field instead. The in-context memory of the agent. |
| `name` | `string \| null` | No | The name of the agent. |
| `sources` | `object[] \| null` | No | Deprecated: Use `folders` field instead. The sources used by the agent. |
| `system` | `string \| null` | No | The system prompt used by the agent. |
| `tags` | `string[] \| null` | No | The tags associated with the agent. |
| `tools` | `object[] \| null` | No | The tools used by the agent. |
| `base_template_id` | `string \| null` | No | The base template id of the agent. |
| `compaction_settings` | `object \| null` | No | Configuration for conversation compaction / summarization. Per-model settings (temperature, max tokens, etc.) are derived from the default configuration for that handle. |
| `created_at` | `string \| null` | No | The timestamp when the object was created. |
| `created_by_id` | `string \| null` | No | The id of the user that made this object. |
| `deployment_id` | `string \| null` | No | The id of the deployment. |
| `description` | `string \| null` | No | The description of the agent. |
| `embedding` | `string \| null` | No | The embedding model handle used by the agent (format: provider/model-name). |
| `embedding_config` | `object \| null` | No | Configuration for embedding model connection and processing parameters. |
| `enable_sleeptime` | `boolean \| null` | No | If set to True, memory management will move to a background agent thread. |
| `entity_id` | `string \| null` | No | The id of the entity within the template. |
| `hidden` | `boolean \| null` | No | If set to True, the agent will be hidden. |
| `identities` | `object[] \| null` | No | The identities associated with this agent. |
| `identity_ids` | `string[] \| null` | No | Deprecated: Use `identities` field instead. The ids of the identities associated with this agent. |
| `last_run_completion` | `string \| null` | No | The timestamp when the agent last completed a run. |
| `last_run_duration_ms` | `number \| null` | No | The duration in milliseconds of the agent's last run. |
| `last_stop_reason` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | — |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this object. |
| `managed_group` | `object \| null` | No | The multi-agent group that this agent manages |
| `max_files_open` | `number \| null` | No | Maximum number of files that can be open at once for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `message_buffer_autoclear` | `boolean \| null` | No | If set to True, the agent will not remember previous messages (though the agent will still retain state via core memory blocks and archival/recall memory). Not recommended unless you have an advanced use case. |
| `message_ids` | `string[] \| null` | No | The ids of the messages in the agent's in-context memory. |
| `metadata` | `object \| null` | No | The metadata of the agent. |
| `model` | `string \| null` | No | The model handle used by the agent (format: provider/model-name). |
| `model_settings` | `object \| null` | No | The model settings used by the agent. |
| `multi_agent_group` | `object \| null` | No | Deprecated: Use `managed_group` field instead. The multi-agent group that this agent manages. |
| `pending_approval` | `object \| null` | No | A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution). Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional\[str]): The name of the sender of the message tool\_call (ToolCall): The tool call |
| `per_file_view_window_char_limit` | `number \| null` | No | The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `project_id` | `string \| null` | No | The id of the project the agent belongs to. |
| `response_format` | `object \| null` | No | The response format used by the agent |
| `secrets` | `object[] \| null` | No | The environment variables for tool execution specific to this agent. |
| `template_id` | `string \| null` | No | The id of the template the agent belongs to. |
| `timezone` | `string \| null` | No | The timezone of the agent (IANA format). |
| `tool_exec_environment_variables` | `object[] \| null` | No | Deprecated: use `secrets` field instead. |
| `tool_rules` | `object[] \| null` | No | The list of tool rules. |
| `updated_at` | `string \| null` | No | The timestamp when the object was last updated. |

> [accordion] blocks full type
>
> ```ts theme={null}
> {
>   value?: string | null,
>   id?: string | null,
>   base_template_id?: string | null,
>   created_by_id?: string | null,
>   deployment_id?: string | null,
>   description?: string | null,
>   entity_id?: string | null,
>   hidden?: boolean | null,
>   is_template?: boolean | null,
>   label?: string | null,
>   last_updated_by_id?: string | null,
>   limit?: number | null,
>   metadata?: {
>   } | null,
>   preserve_on_migration?: boolean | null,
>   project_id?: string | null,
>   read_only?: boolean | null,
>   tags?: string[] | null,
>   template_id?: string | null,
>   template_name?: string | null
> }[] | null
> ```

> [accordion] llm\_config full type
>
> ```ts theme={null}
> {
>   context_window?: number | null,
>   model?: string | null,
>   model_endpoint_type?: string | null,
>   compatibility_type?: string | null,
>   display_name?: string | null,
>   effort?: string | null,
>   enable_reasoner?: boolean | null,
>   frequency_penalty?: number | null,
>   handle?: string | null,
>   max_reasoning_tokens?: number | null,
>   max_tokens?: number | null,
>   model_endpoint?: string | null,
>   model_wrapper?: string | null,
>   parallel_tool_calls?: boolean | null,
>   provider_category?: string | string | null,
>   provider_name?: string | null,
>   put_inner_thoughts_in_kwargs?: boolean | null,
>   reasoning_effort?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   return_logprobs?: boolean | null,
>   return_token_ids?: boolean | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   tier?: string | null,
>   tool_call_parser?: string | null,
>   top_logprobs?: number | null,
>   verbosity?: string | null
> } | null
> ```

> [accordion] memory full type
>
> ```ts theme={null}
> {
>   blocks?: {
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   agent_type?: string | string | string | string | string | string | string | string | string | string | null,
>   file_blocks?: {
>     file_id?: string | null,
>     is_open?: boolean | null,
>     source_id?: string | null,
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_accessed_at?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   git_enabled?: boolean | null,
>   prompt_template?: string | null
> } | null
> ```

> [accordion] sources full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   name?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   instructions?: string | null,
>   last_updated_by_id?: string | null,
>   metadata?: {
>   } | null,
>   updated_at?: string | null,
>   vector_db_provider?: string | string | string | null
> }[] | null
> ```

> [accordion] tools full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   args_json_schema?: {
>   } | null,
>   created_by_id?: string | null,
>   default_requires_approval?: boolean | null,
>   description?: string | null,
>   enable_parallel_execution?: boolean | null,
>   json_schema?: {
>   } | null,
>   last_updated_by_id?: string | null,
>   metadata_?: {
>   } | null,
>   name?: string | null,
>   npm_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   pip_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   project_id?: string | null,
>   return_char_limit?: number | null,
>   source_code?: string | null,
>   source_type?: string | null,
>   tags?: string[] | null,
>   tool_type?: string | string | string | string | string | string | string | string | string | string | string | null
> }[] | null
> ```

> [accordion] compaction\_settings full type
>
> ```ts theme={null}
> {
>   clip_chars?: number | null,
>   mode?: string | null,
>   model?: string | null,
>   model_settings?: {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking?: {
>       clear_thinking?: boolean | null,
>       type?: string | null
>     } | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     temperature?: number | null
>   } | null,
>   prompt?: string | null,
>   prompt_acknowledgement?: boolean | null,
>   sliding_window_percentage?: number | null
> } | null
> ```

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim?: number | null,
>   embedding_endpoint_type?: string | null,
>   embedding_model?: string | null,
>   azure_deployment?: string | null,
>   azure_endpoint?: string | null,
>   azure_version?: string | null,
>   batch_size?: number | null,
>   embedding_chunk_size?: number | null,
>   embedding_endpoint?: string | null,
>   handle?: string | null
> } | null
> ```

> [accordion] identities full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   block_ids?: string[] | null,
>   identifier_key?: string | null,
>   identity_type?: string | null,
>   name?: string | null,
>   project_id?: string | null,
>   properties?: {
>     key?: string | null,
>     type?: string | null,
>     value?: string | number | boolean | {
>     } | null
>   }[] | null
> }[] | null
> ```

> [accordion] managed\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] model\_settings full type
>
> ```ts theme={null}
> {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking?: {
>     clear_thinking?: boolean | null,
>     type?: string | null
>   } | null
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   temperature?: number | null
> } | null
> ```

> [accordion] multi\_agent\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] pending\_approval full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   date?: string | null,
>   tool_call?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null,
>   is_err?: boolean | null,
>   message_type?: string | null,
>   name?: string | null,
>   otid?: string | null,
>   run_id?: string | null,
>   sender_id?: string | null,
>   seq_id?: number | null,
>   step_id?: string | null,
>   tool_calls?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   }[] | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null
> } | null
> ```

> [accordion] response\_format full type
>
> ```ts theme={null}
> {
>   type?: string | null
> } | {
>   json_schema?: {
>   } | null,
>   type?: string | null
> } | {
>   type?: string | null
> } | null
> ```

> [accordion] secrets full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_exec\_environment\_variables full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_rules full type
>
> ```ts theme={null}
> (
>   {
>     children?: string[] | null,
>     tool_name?: string | null,
>     child_arg_nodes?: {
>       name?: string | null,
>       args?: {
>       } | null
>     }[] | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     args?: {
>     } | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     child_output_mapping?: Record<string, string> | null,
>     tool_name?: string | null,
>     default_child?: string | null,
>     prompt_template?: string | null,
>     require_output_mapping?: boolean | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     max_count_limit?: number | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     children?: string[] | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   }
> )[] | null
> ```

***

### blocks.detach

`agents.blocks.detach`

Detach Block From Agent. Detach a core memory block from an agent.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.agents.blocks.detach({ agent_id: 'example', block_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `block_id` | `string` | Yes | The ID of the block in the format 'block-\<uuid4>' |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The id of the agent. Assigned by the database. |
| `agent_type` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | Enum to represent the type of agent. |
| `blocks` | `object[] \| null` | No | The memory blocks used by the agent. |
| `llm_config` | `object \| null` | No | Configuration for Language Model (LLM) connection and generation parameters. .. deprecated:: LLMConfig is deprecated and should not be used as an input or return type in API calls. Use the schemas in letta.schemas.model (ModelSettings, OpenAIModelSettings, etc.) instead. For conversion, use the \_to\_model() method or Model.\_from\_llm\_config() method. |
| `memory` | `object \| null` | No | Deprecated: Use `blocks` field instead. The in-context memory of the agent. |
| `name` | `string \| null` | No | The name of the agent. |
| `sources` | `object[] \| null` | No | Deprecated: Use `folders` field instead. The sources used by the agent. |
| `system` | `string \| null` | No | The system prompt used by the agent. |
| `tags` | `string[] \| null` | No | The tags associated with the agent. |
| `tools` | `object[] \| null` | No | The tools used by the agent. |
| `base_template_id` | `string \| null` | No | The base template id of the agent. |
| `compaction_settings` | `object \| null` | No | Configuration for conversation compaction / summarization. Per-model settings (temperature, max tokens, etc.) are derived from the default configuration for that handle. |
| `created_at` | `string \| null` | No | The timestamp when the object was created. |
| `created_by_id` | `string \| null` | No | The id of the user that made this object. |
| `deployment_id` | `string \| null` | No | The id of the deployment. |
| `description` | `string \| null` | No | The description of the agent. |
| `embedding` | `string \| null` | No | The embedding model handle used by the agent (format: provider/model-name). |
| `embedding_config` | `object \| null` | No | Configuration for embedding model connection and processing parameters. |
| `enable_sleeptime` | `boolean \| null` | No | If set to True, memory management will move to a background agent thread. |
| `entity_id` | `string \| null` | No | The id of the entity within the template. |
| `hidden` | `boolean \| null` | No | If set to True, the agent will be hidden. |
| `identities` | `object[] \| null` | No | The identities associated with this agent. |
| `identity_ids` | `string[] \| null` | No | Deprecated: Use `identities` field instead. The ids of the identities associated with this agent. |
| `last_run_completion` | `string \| null` | No | The timestamp when the agent last completed a run. |
| `last_run_duration_ms` | `number \| null` | No | The duration in milliseconds of the agent's last run. |
| `last_stop_reason` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | — |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this object. |
| `managed_group` | `object \| null` | No | The multi-agent group that this agent manages |
| `max_files_open` | `number \| null` | No | Maximum number of files that can be open at once for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `message_buffer_autoclear` | `boolean \| null` | No | If set to True, the agent will not remember previous messages (though the agent will still retain state via core memory blocks and archival/recall memory). Not recommended unless you have an advanced use case. |
| `message_ids` | `string[] \| null` | No | The ids of the messages in the agent's in-context memory. |
| `metadata` | `object \| null` | No | The metadata of the agent. |
| `model` | `string \| null` | No | The model handle used by the agent (format: provider/model-name). |
| `model_settings` | `object \| null` | No | The model settings used by the agent. |
| `multi_agent_group` | `object \| null` | No | Deprecated: Use `managed_group` field instead. The multi-agent group that this agent manages. |
| `pending_approval` | `object \| null` | No | A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution). Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional\[str]): The name of the sender of the message tool\_call (ToolCall): The tool call |
| `per_file_view_window_char_limit` | `number \| null` | No | The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `project_id` | `string \| null` | No | The id of the project the agent belongs to. |
| `response_format` | `object \| null` | No | The response format used by the agent |
| `secrets` | `object[] \| null` | No | The environment variables for tool execution specific to this agent. |
| `template_id` | `string \| null` | No | The id of the template the agent belongs to. |
| `timezone` | `string \| null` | No | The timezone of the agent (IANA format). |
| `tool_exec_environment_variables` | `object[] \| null` | No | Deprecated: use `secrets` field instead. |
| `tool_rules` | `object[] \| null` | No | The list of tool rules. |
| `updated_at` | `string \| null` | No | The timestamp when the object was last updated. |

> [accordion] blocks full type
>
> ```ts theme={null}
> {
>   value?: string | null,
>   id?: string | null,
>   base_template_id?: string | null,
>   created_by_id?: string | null,
>   deployment_id?: string | null,
>   description?: string | null,
>   entity_id?: string | null,
>   hidden?: boolean | null,
>   is_template?: boolean | null,
>   label?: string | null,
>   last_updated_by_id?: string | null,
>   limit?: number | null,
>   metadata?: {
>   } | null,
>   preserve_on_migration?: boolean | null,
>   project_id?: string | null,
>   read_only?: boolean | null,
>   tags?: string[] | null,
>   template_id?: string | null,
>   template_name?: string | null
> }[] | null
> ```

> [accordion] llm\_config full type
>
> ```ts theme={null}
> {
>   context_window?: number | null,
>   model?: string | null,
>   model_endpoint_type?: string | null,
>   compatibility_type?: string | null,
>   display_name?: string | null,
>   effort?: string | null,
>   enable_reasoner?: boolean | null,
>   frequency_penalty?: number | null,
>   handle?: string | null,
>   max_reasoning_tokens?: number | null,
>   max_tokens?: number | null,
>   model_endpoint?: string | null,
>   model_wrapper?: string | null,
>   parallel_tool_calls?: boolean | null,
>   provider_category?: string | string | null,
>   provider_name?: string | null,
>   put_inner_thoughts_in_kwargs?: boolean | null,
>   reasoning_effort?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   return_logprobs?: boolean | null,
>   return_token_ids?: boolean | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   tier?: string | null,
>   tool_call_parser?: string | null,
>   top_logprobs?: number | null,
>   verbosity?: string | null
> } | null
> ```

> [accordion] memory full type
>
> ```ts theme={null}
> {
>   blocks?: {
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   agent_type?: string | string | string | string | string | string | string | string | string | string | null,
>   file_blocks?: {
>     file_id?: string | null,
>     is_open?: boolean | null,
>     source_id?: string | null,
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_accessed_at?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   git_enabled?: boolean | null,
>   prompt_template?: string | null
> } | null
> ```

> [accordion] sources full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   name?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   instructions?: string | null,
>   last_updated_by_id?: string | null,
>   metadata?: {
>   } | null,
>   updated_at?: string | null,
>   vector_db_provider?: string | string | string | null
> }[] | null
> ```

> [accordion] tools full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   args_json_schema?: {
>   } | null,
>   created_by_id?: string | null,
>   default_requires_approval?: boolean | null,
>   description?: string | null,
>   enable_parallel_execution?: boolean | null,
>   json_schema?: {
>   } | null,
>   last_updated_by_id?: string | null,
>   metadata_?: {
>   } | null,
>   name?: string | null,
>   npm_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   pip_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   project_id?: string | null,
>   return_char_limit?: number | null,
>   source_code?: string | null,
>   source_type?: string | null,
>   tags?: string[] | null,
>   tool_type?: string | string | string | string | string | string | string | string | string | string | string | null
> }[] | null
> ```

> [accordion] compaction\_settings full type
>
> ```ts theme={null}
> {
>   clip_chars?: number | null,
>   mode?: string | null,
>   model?: string | null,
>   model_settings?: {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking?: {
>       clear_thinking?: boolean | null,
>       type?: string | null
>     } | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     temperature?: number | null
>   } | null,
>   prompt?: string | null,
>   prompt_acknowledgement?: boolean | null,
>   sliding_window_percentage?: number | null
> } | null
> ```

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim?: number | null,
>   embedding_endpoint_type?: string | null,
>   embedding_model?: string | null,
>   azure_deployment?: string | null,
>   azure_endpoint?: string | null,
>   azure_version?: string | null,
>   batch_size?: number | null,
>   embedding_chunk_size?: number | null,
>   embedding_endpoint?: string | null,
>   handle?: string | null
> } | null
> ```

> [accordion] identities full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   block_ids?: string[] | null,
>   identifier_key?: string | null,
>   identity_type?: string | null,
>   name?: string | null,
>   project_id?: string | null,
>   properties?: {
>     key?: string | null,
>     type?: string | null,
>     value?: string | number | boolean | {
>     } | null
>   }[] | null
> }[] | null
> ```

> [accordion] managed\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] model\_settings full type
>
> ```ts theme={null}
> {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking?: {
>     clear_thinking?: boolean | null,
>     type?: string | null
>   } | null
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   temperature?: number | null
> } | null
> ```

> [accordion] multi\_agent\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] pending\_approval full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   date?: string | null,
>   tool_call?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null,
>   is_err?: boolean | null,
>   message_type?: string | null,
>   name?: string | null,
>   otid?: string | null,
>   run_id?: string | null,
>   sender_id?: string | null,
>   seq_id?: number | null,
>   step_id?: string | null,
>   tool_calls?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   }[] | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null
> } | null
> ```

> [accordion] response\_format full type
>
> ```ts theme={null}
> {
>   type?: string | null
> } | {
>   json_schema?: {
>   } | null,
>   type?: string | null
> } | {
>   type?: string | null
> } | null
> ```

> [accordion] secrets full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_exec\_environment\_variables full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_rules full type
>
> ```ts theme={null}
> (
>   {
>     children?: string[] | null,
>     tool_name?: string | null,
>     child_arg_nodes?: {
>       name?: string | null,
>       args?: {
>       } | null
>     }[] | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     args?: {
>     } | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     child_output_mapping?: Record<string, string> | null,
>     tool_name?: string | null,
>     default_child?: string | null,
>     prompt_template?: string | null,
>     require_output_mapping?: boolean | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     max_count_limit?: number | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     children?: string[] | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   }
> )[] | null
> ```

***

### blocks.get

`agents.blocks.get`

Retrieve Block For Agent. Retrieve a core memory block from an agent.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.agents.blocks.get({ agent_id: 'example', block_label: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `block_label` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The id of the block. |
| `value` | `string \| null` | No | Value of the block. |
| `base_template_id` | `string \| null` | No | (Deprecated) The base template id of the block. |
| `created_by_id` | `string \| null` | No | The id of the user that made this Block. |
| `deployment_id` | `string \| null` | No | (Deprecated) The id of the deployment. |
| `description` | `string \| null` | No | Description of the block. |
| `entity_id` | `string \| null` | No | (Deprecated) The id of the entity within the template. |
| `hidden` | `boolean \| null` | No | (Deprecated) If set to True, the block will be hidden. |
| `is_template` | `boolean \| null` | No | Whether the block is a template (e.g. saved human/persona options). |
| `label` | `string \| null` | No | Label of the block (e.g. 'human', 'persona') in the context window. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that last updated this Block. |
| `limit` | `number \| null` | No | Character limit of the block. |
| `metadata` | `object \| null` | No | Metadata of the block. |
| `preserve_on_migration` | `boolean \| null` | No | (Deprecated) Preserve the block on template migration. |
| `project_id` | `string \| null` | No | The associated project id. |
| `read_only` | `boolean \| null` | No | (Deprecated) Whether the agent has read-only access to the block. |
| `tags` | `string[] \| null` | No | The tags associated with the block. |
| `template_id` | `string \| null` | No | (Deprecated) The id of the template. |
| `template_name` | `string \| null` | No | (Deprecated) The name of the block template (if it is a template). |

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### blocks.list

`agents.blocks.list`

List Blocks For Agent. Retrieve the core memory blocks of a specific agent.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.agents.blocks.list({ agent_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `after` | `string` | No | Cursor for pagination (block ID). Returns results relative to this ID in the specified sort order. Expected format: 'block-\<uuid4>' |
| `before` | `string` | No | Cursor for pagination (block ID). Returns results relative to this ID in the specified sort order. Expected format: 'block-\<uuid4>' |
| `limit` | `number` | No | Maximum number of blocks to return |
| `order` | `asc \| desc` | No | Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for newest first |
| `order_by` | `created_at` | No | Field to sort by |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   value?: string | null,
>   base_template_id?: string | null,
>   created_by_id?: string | null,
>   deployment_id?: string | null,
>   description?: string | null,
>   entity_id?: string | null,
>   hidden?: boolean | null,
>   is_template?: boolean | null,
>   label?: string | null,
>   last_updated_by_id?: string | null,
>   limit?: number | null,
>   metadata?: {
>   } | null,
>   preserve_on_migration?: boolean | null,
>   project_id?: string | null,
>   read_only?: boolean | null,
>   tags?: string[] | null,
>   template_id?: string | null,
>   template_name?: string | null
> }[]
> ```

***

### blocks.update

`agents.blocks.update`

Update Block For Agent. Updates a core memory block of an agent.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.agents.blocks.update({ agent_id: 'example', block_label: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `block_label` | `string` | Yes | — |
| `base_template_id` | `string` | No | The base template id of the block. |
| `deployment_id` | `string` | No | The id of the deployment. |
| `description` | `string` | No | Description of the block. |
| `entity_id` | `string` | No | The id of the entity within the template. |
| `hidden` | `boolean` | No | If set to True, the block will be hidden. |
| `is_template` | `boolean` | No | Whether the block is a template (e.g. saved human/persona options). |
| `label` | `string` | No | Label of the block (e.g. 'human', 'persona') in the context window. |
| `limit` | `number` | No | Character limit of the block. |
| `metadata` | `object` | No | Metadata of the block. |
| `preserve_on_migration` | `boolean` | No | Preserve the block on template migration. |
| `project_id` | `string` | No | The associated project id. |
| `read_only` | `boolean` | No | Whether the agent has read-only access to the block. |
| `tags` | `string[]` | No | The tags to associate with the block. |
| `template_id` | `string` | No | The id of the template. |
| `template_name` | `string` | No | Name of the block if it is a template. |
| `value` | `string` | No | Value of the block. |

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The id of the block. |
| `value` | `string \| null` | No | Value of the block. |
| `base_template_id` | `string \| null` | No | (Deprecated) The base template id of the block. |
| `created_by_id` | `string \| null` | No | The id of the user that made this Block. |
| `deployment_id` | `string \| null` | No | (Deprecated) The id of the deployment. |
| `description` | `string \| null` | No | Description of the block. |
| `entity_id` | `string \| null` | No | (Deprecated) The id of the entity within the template. |
| `hidden` | `boolean \| null` | No | (Deprecated) If set to True, the block will be hidden. |
| `is_template` | `boolean \| null` | No | Whether the block is a template (e.g. saved human/persona options). |
| `label` | `string \| null` | No | Label of the block (e.g. 'human', 'persona') in the context window. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that last updated this Block. |
| `limit` | `number \| null` | No | Character limit of the block. |
| `metadata` | `object \| null` | No | Metadata of the block. |
| `preserve_on_migration` | `boolean \| null` | No | (Deprecated) Preserve the block on template migration. |
| `project_id` | `string \| null` | No | The associated project id. |
| `read_only` | `boolean \| null` | No | (Deprecated) Whether the agent has read-only access to the block. |
| `tags` | `string[] \| null` | No | The tags associated with the block. |
| `template_id` | `string \| null` | No | (Deprecated) The id of the template. |
| `template_name` | `string \| null` | No | (Deprecated) The name of the block template (if it is a template). |

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### create

`agents.create`

Create Agent. Create an agent. (POST /v1/agents/)

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.agents.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_type` | `memgpt_agent \| memgpt_v2_agent \| letta_v1_agent \| react_agent \| workflow_agent \| split_thread_agent \| sleeptime_agent \| voice_convo_agent \| voice_sleeptime_agent` | No | Enum to represent the type of agent. |
| `base_template_id` | `string` | No | Deprecated: No longer used. The base template id of the agent. |
| `block_ids` | `string[]` | No | The ids of the blocks used by the agent. |
| `compaction_settings` | `object` | No | Configuration for conversation compaction / summarization. Per-model settings (temperature, max tokens, etc.) are derived from the default configuration for that handle. |
| `context_window_limit` | `number` | No | The context window limit used by the agent. |
| `description` | `string` | No | The description of the agent. |
| `embedding` | `string` | No | The embedding model handle used by the agent (format: provider/model-name). |
| `embedding_chunk_size` | `number` | No | Deprecated: No longer used. The embedding chunk size used by the agent. |
| `embedding_config` | `object` | No | Configuration for embedding model connection and processing parameters. |
| `enable_reasoner` | `boolean` | No | Deprecated: Use `model` field to configure reasoning instead. Whether to enable internal extended thinking step for a reasoner model. |
| `enable_sleeptime` | `boolean` | No | If set to True, memory management will move to a background agent thread. |
| `folder_ids` | `string[]` | No | The ids of the folders used by the agent. |
| `from_template` | `string` | No | Deprecated: please use the 'create agents from a template' endpoint instead. |
| `hidden` | `boolean` | No | Deprecated: No longer used. If set to True, the agent will be hidden. |
| `identity_ids` | `string[]` | No | The ids of the identities associated with this agent. |
| `include_base_tool_rules` | `boolean` | No | If true, attaches the Letta base tool rules (e.g. deny all tools not explicitly allowed). |
| `include_base_tools` | `boolean` | No | If true, attaches the Letta core tools (e.g. core\_memory related functions). |
| `include_default_source` | `boolean` | No | If true, automatically creates and attaches a default data source for this agent. |
| `initial_message_sequence` | `object[]` | No | The initial set of messages to put in the agent's in-context memory. |
| `llm_config` | `object` | No | Configuration for Language Model (LLM) connection and generation parameters. .. deprecated:: LLMConfig is deprecated and should not be used as an input or return type in API calls. Use the schemas in letta.schemas.model (ModelSettings, OpenAIModelSettings, etc.) instead. For conversion, use the \_to\_model() method or Model.\_from\_llm\_config() method. |
| `max_files_open` | `number` | No | Maximum number of files that can be open at once for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `max_reasoning_tokens` | `number` | No | Deprecated: Use `model` field to configure reasoning tokens instead. The maximum number of tokens to generate for reasoning step. |
| `max_tokens` | `number` | No | Deprecated: Use `model` field to configure max output tokens instead. The maximum number of tokens to generate, including reasoning step. |
| `memory_blocks` | `object[]` | No | The blocks to create in the agent's in-context memory. |
| `memory_variables` | `Record<string, string>` | No | Deprecated: Only relevant for creating agents from a template. Use the 'create agents from a template' endpoint instead. |
| `message_buffer_autoclear` | `boolean` | No | If set to True, the agent will not remember previous messages (though the agent will still retain state via core memory blocks and archival/recall memory). Not recommended unless you have an advanced use case. |
| `metadata` | `object` | No | The metadata of the agent. |
| `model` | `string` | No | The model handle for the agent to use (format: provider/model-name). |
| `model_settings` | `object` | No | The model settings for the agent. |
| `name` | `string` | No | The name of the agent. |
| `parallel_tool_calls` | `boolean` | No | Deprecated: Use `model_settings` to configure parallel tool calls instead. If set to True, enables parallel tool calling. |
| `per_file_view_window_char_limit` | `number` | No | The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `project` | `string` | No | Deprecated: Project should now be passed via the X-Project header instead of in the request body. If using the SDK, this can be done via the x\_project parameter. |
| `project_id` | `string` | No | Deprecated: No longer used. The id of the project the agent belongs to. |
| `reasoning` | `boolean` | No | Deprecated: Use `model` field to configure reasoning instead. Whether to enable reasoning for this agent. |
| `response_format` | `object` | No | Deprecated: Use `model_settings` field to configure response format instead. The response format for the agent. |
| `secrets` | `Record<string, string>` | No | The environment variables for tool execution specific to this agent. |
| `source_ids` | `string[]` | No | Deprecated: Use `folder_ids` field instead. The ids of the sources used by the agent. |
| `system` | `string` | No | The system prompt used by the agent. |
| `tags` | `string[]` | No | The tags associated with the agent. |
| `template` | `boolean` | No | Deprecated: No longer used. |
| `template_id` | `string` | No | Deprecated: No longer used. The id of the template the agent belongs to. |
| `timezone` | `string` | No | The timezone of the agent (IANA format). |
| `tool_exec_environment_variables` | `Record<string, string>` | No | Deprecated: Use `secrets` field instead. Environment variables for tool execution. |
| `tool_ids` | `string[]` | No | The ids of the tools used by the agent. |
| `tool_rules` | `object[]` | No | The tool rules governing the agent. |
| `tools` | `string[]` | No | The tools used by the agent. |

> [accordion] compaction\_settings full type
>
> ```ts theme={null}
> {
>   clip_chars?: number,
>   mode?: all | sliding_window | self_compact_all | self_compact_sliding_window,
>   model?: string,
>   model_settings?: {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: openai,
>     reasoning?: {
>       reasoning_effort?: none | minimal | low | medium | high | xhigh
>     },
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: openai,
>     reasoning?: {
>       reasoning_effort?: none | minimal | low | medium | high | xhigh
>     },
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number
>   } | {
>     effort?: low | medium | high | xhigh | max,
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: anthropic,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number,
>     thinking?: {
>       budget_tokens?: number,
>       type?: enabled | disabled
>     },
>     verbosity?: low | medium | high
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: google_ai,
>     response_schema?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number,
>     thinking_config?: {
>       include_thoughts?: boolean,
>       thinking_budget?: number
>     }
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: google_vertex,
>     response_schema?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number,
>     thinking_config?: {
>       include_thoughts?: boolean,
>       thinking_budget?: number
>     }
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: azure,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: xai,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: moonshot,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: zai,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number,
>     thinking?: {
>       clear_thinking?: boolean,
>       type?: enabled | disabled
>     }
>   } | {
>     effort?: low | medium | high | xhigh | max,
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: moonshot_coding,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number,
>     thinking?: {
>       budget_tokens?: number,
>       type?: enabled | disabled
>     },
>     verbosity?: low | medium | high
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: groq,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: deepseek,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: together,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: bedrock,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: baseten,
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: openrouter,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: chatgpt_oauth,
>     reasoning?: {
>       reasoning_effort?: none | low | medium | high | xhigh
>     },
>     temperature?: number
>   },
>   prompt?: string,
>   prompt_acknowledgement?: boolean,
>   sliding_window_percentage?: number
> }
> ```

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim: number,
>   embedding_endpoint_type: openai | anthropic | bedrock | google_ai | google_vertex | azure | groq | ollama | webui | webui-legacy | lmstudio | lmstudio-legacy | llamacpp | koboldcpp | vllm | hugging-face | mistral | together | pinecone,
>   embedding_model: string,
>   azure_deployment?: string,
>   azure_endpoint?: string,
>   azure_version?: string,
>   batch_size?: number,
>   embedding_chunk_size?: number,
>   embedding_endpoint?: string,
>   handle?: string
> }
> ```

> [accordion] initial\_message\_sequence full type
>
> ```ts theme={null}
> {
>   content: (
>     {
>       text: string,
>       signature?: string,
>       type?: text
>     } | {
>       source: {
>         url: string,
>         type?: url
>       } | {
>         data: string,
>         media_type: string,
>         detail?: string,
>         type?: base64
>       } | {
>         file_id: string,
>         data?: string,
>         detail?: string,
>         media_type?: string,
>         type?: letta
>       },
>       type?: image
>     } | {
>       id: string,
>       input: {
>       },
>       name: string,
>       signature?: string,
>       type?: tool_call
>     } | {
>       content: string,
>       is_error: boolean,
>       tool_call_id: string,
>       type?: tool_return
>     } | {
>       is_native: boolean,
>       reasoning: string,
>       signature?: string,
>       type?: reasoning
>     } | {
>       data: string,
>       type?: redacted_reasoning
>     } | {
>       signature?: string,
>       type?: omitted_reasoning
>     }
>   )[] | string,
>   role: user | system | assistant,
>   batch_item_id?: string,
>   group_id?: string,
>   name?: string,
>   otid?: string,
>   sender_id?: string,
>   type?: message
> }[]
> ```

> [accordion] llm\_config full type
>
> ```ts theme={null}
> {
>   context_window: number,
>   model: string,
>   model_endpoint_type: openai | anthropic | google_ai | google_vertex | azure | groq | ollama | webui | webui-legacy | lmstudio | lmstudio-legacy | lmstudio-chatcompletions | llamacpp | koboldcpp | vllm | hugging-face | minimax | moonshot | moonshot_coding | mistral | together | bedrock | deepseek | xai | zai | zai_coding | baseten | fireworks | openrouter | chatgpt_oauth,
>   compatibility_type?: gguf | mlx,
>   display_name?: string,
>   effort?: low | medium | high | xhigh | max,
>   enable_reasoner?: boolean,
>   frequency_penalty?: number,
>   handle?: string,
>   max_reasoning_tokens?: number,
>   max_tokens?: number,
>   model_endpoint?: string,
>   model_wrapper?: string,
>   parallel_tool_calls?: boolean,
>   provider_category?: base | byok,
>   provider_name?: string,
>   put_inner_thoughts_in_kwargs?: boolean,
>   reasoning_effort?: none | minimal | low | medium | high | xhigh,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   return_logprobs?: boolean,
>   return_token_ids?: boolean,
>   strict?: boolean,
>   temperature?: number,
>   tier?: string,
>   tool_call_parser?: string,
>   top_logprobs?: number,
>   verbosity?: low | medium | high
> }
> ```

> [accordion] memory\_blocks full type
>
> ```ts theme={null}
> {
>   label: string,
>   value: string,
>   base_template_id?: string,
>   deployment_id?: string,
>   description?: string,
>   entity_id?: string,
>   hidden?: boolean,
>   is_template?: boolean,
>   limit?: number,
>   metadata?: {
>   },
>   preserve_on_migration?: boolean,
>   project_id?: string,
>   read_only?: boolean,
>   tags?: string[],
>   template_id?: string,
>   template_name?: string
> }[]
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] model\_settings full type
>
> ```ts theme={null}
> {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: openai,
>   reasoning?: {
>     reasoning_effort?: none | minimal | low | medium | high | xhigh
>   },
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   strict?: boolean,
>   temperature?: number
> } | {
> } | {
>   effort?: low | medium | high | xhigh | max,
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: anthropic,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   strict?: boolean,
>   temperature?: number,
>   thinking?: {
>     budget_tokens?: number,
>     type?: enabled | disabled
>   },
>   verbosity?: low | medium | high
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: google_ai,
>   response_schema?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number,
>   thinking_config?: {
>     include_thoughts?: boolean,
>     thinking_budget?: number
>   }
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: google_vertex,
>   response_schema?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number,
>   thinking_config?: {
>     include_thoughts?: boolean,
>     thinking_budget?: number
>   }
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: azure,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: xai,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: moonshot,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   strict?: boolean,
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: zai,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number,
>   thinking?: {
>     clear_thinking?: boolean,
>     type?: enabled | disabled
>   }
> } | {
>   effort?: low | medium | high | xhigh | max,
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: moonshot_coding,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   strict?: boolean,
>   temperature?: number,
>   thinking?: {
>     budget_tokens?: number,
>     type?: enabled | disabled
>   },
>   verbosity?: low | medium | high
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: groq,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: deepseek,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: together,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: bedrock,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: baseten,
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: openrouter,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: chatgpt_oauth,
>   reasoning?: {
>     reasoning_effort?: none | low | medium | high | xhigh
>   },
>   temperature?: number
> }
> ```

> [accordion] response\_format full type
>
> ```ts theme={null}
> {
>   type?: text
> } | {
>   json_schema: {
>   },
>   type?: json_schema
> } | {
>   type?: json_object
> }
> ```

> [accordion] tool\_rules full type
>
> ```ts theme={null}
> (
>   {
>     children: string[],
>     tool_name: string,
>     child_arg_nodes?: {
>       name: string,
>       args?: {
>       }
>     }[],
>     prompt_template?: string,
>     type?: constrain_child_tools
>   } | {
>     tool_name: string,
>     args?: {
>     },
>     prompt_template?: string,
>     type?: run_first
>   } | {
>     tool_name: string,
>     prompt_template?: string,
>     type?: exit_loop
>   } | {
>     child_output_mapping: Record<string, string>,
>     tool_name: string,
>     default_child?: string,
>     prompt_template?: string,
>     require_output_mapping?: boolean,
>     type?: conditional
>   } | {
>     tool_name: string,
>     prompt_template?: string,
>     type?: continue_loop
>   } | {
>     tool_name: string,
>     prompt_template?: string,
>     type?: required_before_exit
>   } | {
>     max_count_limit: number,
>     tool_name: string,
>     prompt_template?: string,
>     type?: max_count_per_step
>   } | {
>     children: string[],
>     tool_name: string,
>     prompt_template?: string,
>     type?: parent_last_tool
>   } | {
>     tool_name: string,
>     prompt_template?: string,
>     type?: requires_approval
>   }
> )[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The id of the agent. Assigned by the database. |
| `agent_type` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | Enum to represent the type of agent. |
| `blocks` | `object[] \| null` | No | The memory blocks used by the agent. |
| `llm_config` | `object \| null` | No | Configuration for Language Model (LLM) connection and generation parameters. .. deprecated:: LLMConfig is deprecated and should not be used as an input or return type in API calls. Use the schemas in letta.schemas.model (ModelSettings, OpenAIModelSettings, etc.) instead. For conversion, use the \_to\_model() method or Model.\_from\_llm\_config() method. |
| `memory` | `object \| null` | No | Deprecated: Use `blocks` field instead. The in-context memory of the agent. |
| `name` | `string \| null` | No | The name of the agent. |
| `sources` | `object[] \| null` | No | Deprecated: Use `folders` field instead. The sources used by the agent. |
| `system` | `string \| null` | No | The system prompt used by the agent. |
| `tags` | `string[] \| null` | No | The tags associated with the agent. |
| `tools` | `object[] \| null` | No | The tools used by the agent. |
| `base_template_id` | `string \| null` | No | The base template id of the agent. |
| `compaction_settings` | `object \| null` | No | Configuration for conversation compaction / summarization. Per-model settings (temperature, max tokens, etc.) are derived from the default configuration for that handle. |
| `created_at` | `string \| null` | No | The timestamp when the object was created. |
| `created_by_id` | `string \| null` | No | The id of the user that made this object. |
| `deployment_id` | `string \| null` | No | The id of the deployment. |
| `description` | `string \| null` | No | The description of the agent. |
| `embedding` | `string \| null` | No | The embedding model handle used by the agent (format: provider/model-name). |
| `embedding_config` | `object \| null` | No | Configuration for embedding model connection and processing parameters. |
| `enable_sleeptime` | `boolean \| null` | No | If set to True, memory management will move to a background agent thread. |
| `entity_id` | `string \| null` | No | The id of the entity within the template. |
| `hidden` | `boolean \| null` | No | If set to True, the agent will be hidden. |
| `identities` | `object[] \| null` | No | The identities associated with this agent. |
| `identity_ids` | `string[] \| null` | No | Deprecated: Use `identities` field instead. The ids of the identities associated with this agent. |
| `last_run_completion` | `string \| null` | No | The timestamp when the agent last completed a run. |
| `last_run_duration_ms` | `number \| null` | No | The duration in milliseconds of the agent's last run. |
| `last_stop_reason` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | — |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this object. |
| `managed_group` | `object \| null` | No | The multi-agent group that this agent manages |
| `max_files_open` | `number \| null` | No | Maximum number of files that can be open at once for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `message_buffer_autoclear` | `boolean \| null` | No | If set to True, the agent will not remember previous messages (though the agent will still retain state via core memory blocks and archival/recall memory). Not recommended unless you have an advanced use case. |
| `message_ids` | `string[] \| null` | No | The ids of the messages in the agent's in-context memory. |
| `metadata` | `object \| null` | No | The metadata of the agent. |
| `model` | `string \| null` | No | The model handle used by the agent (format: provider/model-name). |
| `model_settings` | `object \| null` | No | The model settings used by the agent. |
| `multi_agent_group` | `object \| null` | No | Deprecated: Use `managed_group` field instead. The multi-agent group that this agent manages. |
| `pending_approval` | `object \| null` | No | A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution). Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional\[str]): The name of the sender of the message tool\_call (ToolCall): The tool call |
| `per_file_view_window_char_limit` | `number \| null` | No | The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `project_id` | `string \| null` | No | The id of the project the agent belongs to. |
| `response_format` | `object \| null` | No | The response format used by the agent |
| `secrets` | `object[] \| null` | No | The environment variables for tool execution specific to this agent. |
| `template_id` | `string \| null` | No | The id of the template the agent belongs to. |
| `timezone` | `string \| null` | No | The timezone of the agent (IANA format). |
| `tool_exec_environment_variables` | `object[] \| null` | No | Deprecated: use `secrets` field instead. |
| `tool_rules` | `object[] \| null` | No | The list of tool rules. |
| `updated_at` | `string \| null` | No | The timestamp when the object was last updated. |

> [accordion] blocks full type
>
> ```ts theme={null}
> {
>   value?: string | null,
>   id?: string | null,
>   base_template_id?: string | null,
>   created_by_id?: string | null,
>   deployment_id?: string | null,
>   description?: string | null,
>   entity_id?: string | null,
>   hidden?: boolean | null,
>   is_template?: boolean | null,
>   label?: string | null,
>   last_updated_by_id?: string | null,
>   limit?: number | null,
>   metadata?: {
>   } | null,
>   preserve_on_migration?: boolean | null,
>   project_id?: string | null,
>   read_only?: boolean | null,
>   tags?: string[] | null,
>   template_id?: string | null,
>   template_name?: string | null
> }[] | null
> ```

> [accordion] llm\_config full type
>
> ```ts theme={null}
> {
>   context_window?: number | null,
>   model?: string | null,
>   model_endpoint_type?: string | null,
>   compatibility_type?: string | null,
>   display_name?: string | null,
>   effort?: string | null,
>   enable_reasoner?: boolean | null,
>   frequency_penalty?: number | null,
>   handle?: string | null,
>   max_reasoning_tokens?: number | null,
>   max_tokens?: number | null,
>   model_endpoint?: string | null,
>   model_wrapper?: string | null,
>   parallel_tool_calls?: boolean | null,
>   provider_category?: string | string | null,
>   provider_name?: string | null,
>   put_inner_thoughts_in_kwargs?: boolean | null,
>   reasoning_effort?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   return_logprobs?: boolean | null,
>   return_token_ids?: boolean | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   tier?: string | null,
>   tool_call_parser?: string | null,
>   top_logprobs?: number | null,
>   verbosity?: string | null
> } | null
> ```

> [accordion] memory full type
>
> ```ts theme={null}
> {
>   blocks?: {
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   agent_type?: string | string | string | string | string | string | string | string | string | string | null,
>   file_blocks?: {
>     file_id?: string | null,
>     is_open?: boolean | null,
>     source_id?: string | null,
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_accessed_at?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   git_enabled?: boolean | null,
>   prompt_template?: string | null
> } | null
> ```

> [accordion] sources full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   name?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   instructions?: string | null,
>   last_updated_by_id?: string | null,
>   metadata?: {
>   } | null,
>   updated_at?: string | null,
>   vector_db_provider?: string | string | string | null
> }[] | null
> ```

> [accordion] tools full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   args_json_schema?: {
>   } | null,
>   created_by_id?: string | null,
>   default_requires_approval?: boolean | null,
>   description?: string | null,
>   enable_parallel_execution?: boolean | null,
>   json_schema?: {
>   } | null,
>   last_updated_by_id?: string | null,
>   metadata_?: {
>   } | null,
>   name?: string | null,
>   npm_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   pip_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   project_id?: string | null,
>   return_char_limit?: number | null,
>   source_code?: string | null,
>   source_type?: string | null,
>   tags?: string[] | null,
>   tool_type?: string | string | string | string | string | string | string | string | string | string | string | null
> }[] | null
> ```

> [accordion] compaction\_settings full type
>
> ```ts theme={null}
> {
>   clip_chars?: number | null,
>   mode?: string | null,
>   model?: string | null,
>   model_settings?: {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking?: {
>       clear_thinking?: boolean | null,
>       type?: string | null
>     } | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     temperature?: number | null
>   } | null,
>   prompt?: string | null,
>   prompt_acknowledgement?: boolean | null,
>   sliding_window_percentage?: number | null
> } | null
> ```

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim?: number | null,
>   embedding_endpoint_type?: string | null,
>   embedding_model?: string | null,
>   azure_deployment?: string | null,
>   azure_endpoint?: string | null,
>   azure_version?: string | null,
>   batch_size?: number | null,
>   embedding_chunk_size?: number | null,
>   embedding_endpoint?: string | null,
>   handle?: string | null
> } | null
> ```

> [accordion] identities full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   block_ids?: string[] | null,
>   identifier_key?: string | null,
>   identity_type?: string | null,
>   name?: string | null,
>   project_id?: string | null,
>   properties?: {
>     key?: string | null,
>     type?: string | null,
>     value?: string | number | boolean | {
>     } | null
>   }[] | null
> }[] | null
> ```

> [accordion] managed\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] model\_settings full type
>
> ```ts theme={null}
> {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking?: {
>     clear_thinking?: boolean | null,
>     type?: string | null
>   } | null
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   temperature?: number | null
> } | null
> ```

> [accordion] multi\_agent\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] pending\_approval full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   date?: string | null,
>   tool_call?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null,
>   is_err?: boolean | null,
>   message_type?: string | null,
>   name?: string | null,
>   otid?: string | null,
>   run_id?: string | null,
>   sender_id?: string | null,
>   seq_id?: number | null,
>   step_id?: string | null,
>   tool_calls?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   }[] | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null
> } | null
> ```

> [accordion] response\_format full type
>
> ```ts theme={null}
> {
>   type?: string | null
> } | {
>   json_schema?: {
>   } | null,
>   type?: string | null
> } | {
>   type?: string | null
> } | null
> ```

> [accordion] secrets full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_exec\_environment\_variables full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_rules full type
>
> ```ts theme={null}
> (
>   {
>     children?: string[] | null,
>     tool_name?: string | null,
>     child_arg_nodes?: {
>       name?: string | null,
>       args?: {
>       } | null
>     }[] | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     args?: {
>     } | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     child_output_mapping?: Record<string, string> | null,
>     tool_name?: string | null,
>     default_child?: string | null,
>     prompt_template?: string | null,
>     require_output_mapping?: boolean | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     max_count_limit?: number | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     children?: string[] | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   }
> )[] | null
> ```

***

### delete

`agents.delete`

Delete Agent. Delete an agent. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.agents.delete({ agent_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### exportFile

`agents.exportFile`

Export Agent. Export the serialized JSON representation of an agent, formatted with indentation. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.agents.exportFile({ agent_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | — |
| `conversation_id` | `string` | No | Conversation ID to export. If provided, uses messages from this conversation instead of the agent's global message history. |
| `max_steps` | `number` | No | — |
| `scrub_messages` | `boolean` | No | If True, excludes all messages from the export. Useful for sharing agent configs without conversation history. |
| `use_legacy_format` | `boolean` | No | 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. |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### files.close

`agents.files.close`

Close File For Agent. Closes a specific file for a given agent. This endpoint marks a specific file as closed in the agent's file state. The file will be removed from the agent's working memory view. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.agents.files.close({ agent_id: 'example', file_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `file_id` | `string` | Yes | The ID of the file in the format 'file-\<uuid4>' |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### files.closeAll

`agents.files.closeAll`

Close All Files For Agent. Closes all currently open files for a given agent. This endpoint updates the file state for the agent so that no files are marked as open. Typically used to reset the working memory view for the agent. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.agents.files.closeAll({ agent_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### files.list

`agents.files.list`

List Files For Agent. Get the files attached to an agent with their open/closed status. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.agents.files.list({ agent_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `after` | `string` | No | Cursor for pagination (file ID). Returns results relative to this ID in the specified sort order. Expected format: 'file-\<uuid4>' |
| `before` | `string` | No | Cursor for pagination (file ID). Returns results relative to this ID in the specified sort order. Expected format: 'file-\<uuid4>' |
| `cursor` | `string` | No | Pagination cursor from previous response (deprecated, use before/after) |
| `is_open` | `boolean` | No | Filter by open status (true for open files, false for closed files) |
| `limit` | `number` | No | Maximum number of files to return |
| `order` | `asc \| desc` | No | Sort order for files by creation time. 'asc' for oldest first, 'desc' for newest first |
| `order_by` | `created_at` | No | Field to sort by |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `files` | `object[] \| null` | No | — |
| `next_cursor` | `string \| null` | No | — |
| `has_more` | `boolean \| null` | No | — |

> [accordion] files full type
>
> ```ts theme={null}
> {
>   files?: {
>     id?: string | null,
>     file_id?: string | null,
>     file_name?: string | null,
>     folder_id?: string | null,
>     folder_name?: string | null,
>     is_open?: boolean | null,
>     end_line?: number | null,
>     last_accessed_at?: string | null,
>     start_line?: number | null,
>     visible_content?: string | null
>   }[] | null,
>   has_more?: boolean | null,
>   next_cursor?: string | null
> }[] | null
> ```

***

### files.open

`agents.files.open`

Open File For Agent. 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. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.agents.files.open({ agent_id: 'example', file_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `file_id` | `string` | Yes | The ID of the file in the format 'file-\<uuid4>' |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### folders.attach

`agents.folders.attach`

Attach Folder To Agent. Attach a folder to an agent. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.agents.folders.attach({ agent_id: 'example', folder_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `folder_id` | `string` | Yes | The ID of the source in the format 'source-\<uuid4>' |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The id of the agent. Assigned by the database. |
| `agent_type` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | Enum to represent the type of agent. |
| `blocks` | `object[] \| null` | No | The memory blocks used by the agent. |
| `llm_config` | `object \| null` | No | Configuration for Language Model (LLM) connection and generation parameters. .. deprecated:: LLMConfig is deprecated and should not be used as an input or return type in API calls. Use the schemas in letta.schemas.model (ModelSettings, OpenAIModelSettings, etc.) instead. For conversion, use the \_to\_model() method or Model.\_from\_llm\_config() method. |
| `memory` | `object \| null` | No | Deprecated: Use `blocks` field instead. The in-context memory of the agent. |
| `name` | `string \| null` | No | The name of the agent. |
| `sources` | `object[] \| null` | No | Deprecated: Use `folders` field instead. The sources used by the agent. |
| `system` | `string \| null` | No | The system prompt used by the agent. |
| `tags` | `string[] \| null` | No | The tags associated with the agent. |
| `tools` | `object[] \| null` | No | The tools used by the agent. |
| `base_template_id` | `string \| null` | No | The base template id of the agent. |
| `compaction_settings` | `object \| null` | No | Configuration for conversation compaction / summarization. Per-model settings (temperature, max tokens, etc.) are derived from the default configuration for that handle. |
| `created_at` | `string \| null` | No | The timestamp when the object was created. |
| `created_by_id` | `string \| null` | No | The id of the user that made this object. |
| `deployment_id` | `string \| null` | No | The id of the deployment. |
| `description` | `string \| null` | No | The description of the agent. |
| `embedding` | `string \| null` | No | The embedding model handle used by the agent (format: provider/model-name). |
| `embedding_config` | `object \| null` | No | Configuration for embedding model connection and processing parameters. |
| `enable_sleeptime` | `boolean \| null` | No | If set to True, memory management will move to a background agent thread. |
| `entity_id` | `string \| null` | No | The id of the entity within the template. |
| `hidden` | `boolean \| null` | No | If set to True, the agent will be hidden. |
| `identities` | `object[] \| null` | No | The identities associated with this agent. |
| `identity_ids` | `string[] \| null` | No | Deprecated: Use `identities` field instead. The ids of the identities associated with this agent. |
| `last_run_completion` | `string \| null` | No | The timestamp when the agent last completed a run. |
| `last_run_duration_ms` | `number \| null` | No | The duration in milliseconds of the agent's last run. |
| `last_stop_reason` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | — |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this object. |
| `managed_group` | `object \| null` | No | The multi-agent group that this agent manages |
| `max_files_open` | `number \| null` | No | Maximum number of files that can be open at once for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `message_buffer_autoclear` | `boolean \| null` | No | If set to True, the agent will not remember previous messages (though the agent will still retain state via core memory blocks and archival/recall memory). Not recommended unless you have an advanced use case. |
| `message_ids` | `string[] \| null` | No | The ids of the messages in the agent's in-context memory. |
| `metadata` | `object \| null` | No | The metadata of the agent. |
| `model` | `string \| null` | No | The model handle used by the agent (format: provider/model-name). |
| `model_settings` | `object \| null` | No | The model settings used by the agent. |
| `multi_agent_group` | `object \| null` | No | Deprecated: Use `managed_group` field instead. The multi-agent group that this agent manages. |
| `pending_approval` | `object \| null` | No | A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution). Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional\[str]): The name of the sender of the message tool\_call (ToolCall): The tool call |
| `per_file_view_window_char_limit` | `number \| null` | No | The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `project_id` | `string \| null` | No | The id of the project the agent belongs to. |
| `response_format` | `object \| null` | No | The response format used by the agent |
| `secrets` | `object[] \| null` | No | The environment variables for tool execution specific to this agent. |
| `template_id` | `string \| null` | No | The id of the template the agent belongs to. |
| `timezone` | `string \| null` | No | The timezone of the agent (IANA format). |
| `tool_exec_environment_variables` | `object[] \| null` | No | Deprecated: use `secrets` field instead. |
| `tool_rules` | `object[] \| null` | No | The list of tool rules. |
| `updated_at` | `string \| null` | No | The timestamp when the object was last updated. |

> [accordion] blocks full type
>
> ```ts theme={null}
> {
>   value?: string | null,
>   id?: string | null,
>   base_template_id?: string | null,
>   created_by_id?: string | null,
>   deployment_id?: string | null,
>   description?: string | null,
>   entity_id?: string | null,
>   hidden?: boolean | null,
>   is_template?: boolean | null,
>   label?: string | null,
>   last_updated_by_id?: string | null,
>   limit?: number | null,
>   metadata?: {
>   } | null,
>   preserve_on_migration?: boolean | null,
>   project_id?: string | null,
>   read_only?: boolean | null,
>   tags?: string[] | null,
>   template_id?: string | null,
>   template_name?: string | null
> }[] | null
> ```

> [accordion] llm\_config full type
>
> ```ts theme={null}
> {
>   context_window?: number | null,
>   model?: string | null,
>   model_endpoint_type?: string | null,
>   compatibility_type?: string | null,
>   display_name?: string | null,
>   effort?: string | null,
>   enable_reasoner?: boolean | null,
>   frequency_penalty?: number | null,
>   handle?: string | null,
>   max_reasoning_tokens?: number | null,
>   max_tokens?: number | null,
>   model_endpoint?: string | null,
>   model_wrapper?: string | null,
>   parallel_tool_calls?: boolean | null,
>   provider_category?: string | string | null,
>   provider_name?: string | null,
>   put_inner_thoughts_in_kwargs?: boolean | null,
>   reasoning_effort?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   return_logprobs?: boolean | null,
>   return_token_ids?: boolean | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   tier?: string | null,
>   tool_call_parser?: string | null,
>   top_logprobs?: number | null,
>   verbosity?: string | null
> } | null
> ```

> [accordion] memory full type
>
> ```ts theme={null}
> {
>   blocks?: {
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   agent_type?: string | string | string | string | string | string | string | string | string | string | null,
>   file_blocks?: {
>     file_id?: string | null,
>     is_open?: boolean | null,
>     source_id?: string | null,
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_accessed_at?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   git_enabled?: boolean | null,
>   prompt_template?: string | null
> } | null
> ```

> [accordion] sources full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   name?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   instructions?: string | null,
>   last_updated_by_id?: string | null,
>   metadata?: {
>   } | null,
>   updated_at?: string | null,
>   vector_db_provider?: string | string | string | null
> }[] | null
> ```

> [accordion] tools full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   args_json_schema?: {
>   } | null,
>   created_by_id?: string | null,
>   default_requires_approval?: boolean | null,
>   description?: string | null,
>   enable_parallel_execution?: boolean | null,
>   json_schema?: {
>   } | null,
>   last_updated_by_id?: string | null,
>   metadata_?: {
>   } | null,
>   name?: string | null,
>   npm_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   pip_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   project_id?: string | null,
>   return_char_limit?: number | null,
>   source_code?: string | null,
>   source_type?: string | null,
>   tags?: string[] | null,
>   tool_type?: string | string | string | string | string | string | string | string | string | string | string | null
> }[] | null
> ```

> [accordion] compaction\_settings full type
>
> ```ts theme={null}
> {
>   clip_chars?: number | null,
>   mode?: string | null,
>   model?: string | null,
>   model_settings?: {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking?: {
>       clear_thinking?: boolean | null,
>       type?: string | null
>     } | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     temperature?: number | null
>   } | null,
>   prompt?: string | null,
>   prompt_acknowledgement?: boolean | null,
>   sliding_window_percentage?: number | null
> } | null
> ```

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim?: number | null,
>   embedding_endpoint_type?: string | null,
>   embedding_model?: string | null,
>   azure_deployment?: string | null,
>   azure_endpoint?: string | null,
>   azure_version?: string | null,
>   batch_size?: number | null,
>   embedding_chunk_size?: number | null,
>   embedding_endpoint?: string | null,
>   handle?: string | null
> } | null
> ```

> [accordion] identities full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   block_ids?: string[] | null,
>   identifier_key?: string | null,
>   identity_type?: string | null,
>   name?: string | null,
>   project_id?: string | null,
>   properties?: {
>     key?: string | null,
>     type?: string | null,
>     value?: string | number | boolean | {
>     } | null
>   }[] | null
> }[] | null
> ```

> [accordion] managed\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] model\_settings full type
>
> ```ts theme={null}
> {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking?: {
>     clear_thinking?: boolean | null,
>     type?: string | null
>   } | null
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   temperature?: number | null
> } | null
> ```

> [accordion] multi\_agent\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] pending\_approval full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   date?: string | null,
>   tool_call?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null,
>   is_err?: boolean | null,
>   message_type?: string | null,
>   name?: string | null,
>   otid?: string | null,
>   run_id?: string | null,
>   sender_id?: string | null,
>   seq_id?: number | null,
>   step_id?: string | null,
>   tool_calls?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   }[] | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null
> } | null
> ```

> [accordion] response\_format full type
>
> ```ts theme={null}
> {
>   type?: string | null
> } | {
>   json_schema?: {
>   } | null,
>   type?: string | null
> } | {
>   type?: string | null
> } | null
> ```

> [accordion] secrets full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_exec\_environment\_variables full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_rules full type
>
> ```ts theme={null}
> (
>   {
>     children?: string[] | null,
>     tool_name?: string | null,
>     child_arg_nodes?: {
>       name?: string | null,
>       args?: {
>       } | null
>     }[] | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     args?: {
>     } | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     child_output_mapping?: Record<string, string> | null,
>     tool_name?: string | null,
>     default_child?: string | null,
>     prompt_template?: string | null,
>     require_output_mapping?: boolean | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     max_count_limit?: number | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     children?: string[] | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   }
> )[] | null
> ```

***

### folders.detach

`agents.folders.detach`

Detach Folder From Agent. Detach a folder from an agent. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.agents.folders.detach({ agent_id: 'example', folder_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `folder_id` | `string` | Yes | The ID of the source in the format 'source-\<uuid4>' |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The id of the agent. Assigned by the database. |
| `agent_type` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | Enum to represent the type of agent. |
| `blocks` | `object[] \| null` | No | The memory blocks used by the agent. |
| `llm_config` | `object \| null` | No | Configuration for Language Model (LLM) connection and generation parameters. .. deprecated:: LLMConfig is deprecated and should not be used as an input or return type in API calls. Use the schemas in letta.schemas.model (ModelSettings, OpenAIModelSettings, etc.) instead. For conversion, use the \_to\_model() method or Model.\_from\_llm\_config() method. |
| `memory` | `object \| null` | No | Deprecated: Use `blocks` field instead. The in-context memory of the agent. |
| `name` | `string \| null` | No | The name of the agent. |
| `sources` | `object[] \| null` | No | Deprecated: Use `folders` field instead. The sources used by the agent. |
| `system` | `string \| null` | No | The system prompt used by the agent. |
| `tags` | `string[] \| null` | No | The tags associated with the agent. |
| `tools` | `object[] \| null` | No | The tools used by the agent. |
| `base_template_id` | `string \| null` | No | The base template id of the agent. |
| `compaction_settings` | `object \| null` | No | Configuration for conversation compaction / summarization. Per-model settings (temperature, max tokens, etc.) are derived from the default configuration for that handle. |
| `created_at` | `string \| null` | No | The timestamp when the object was created. |
| `created_by_id` | `string \| null` | No | The id of the user that made this object. |
| `deployment_id` | `string \| null` | No | The id of the deployment. |
| `description` | `string \| null` | No | The description of the agent. |
| `embedding` | `string \| null` | No | The embedding model handle used by the agent (format: provider/model-name). |
| `embedding_config` | `object \| null` | No | Configuration for embedding model connection and processing parameters. |
| `enable_sleeptime` | `boolean \| null` | No | If set to True, memory management will move to a background agent thread. |
| `entity_id` | `string \| null` | No | The id of the entity within the template. |
| `hidden` | `boolean \| null` | No | If set to True, the agent will be hidden. |
| `identities` | `object[] \| null` | No | The identities associated with this agent. |
| `identity_ids` | `string[] \| null` | No | Deprecated: Use `identities` field instead. The ids of the identities associated with this agent. |
| `last_run_completion` | `string \| null` | No | The timestamp when the agent last completed a run. |
| `last_run_duration_ms` | `number \| null` | No | The duration in milliseconds of the agent's last run. |
| `last_stop_reason` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | — |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this object. |
| `managed_group` | `object \| null` | No | The multi-agent group that this agent manages |
| `max_files_open` | `number \| null` | No | Maximum number of files that can be open at once for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `message_buffer_autoclear` | `boolean \| null` | No | If set to True, the agent will not remember previous messages (though the agent will still retain state via core memory blocks and archival/recall memory). Not recommended unless you have an advanced use case. |
| `message_ids` | `string[] \| null` | No | The ids of the messages in the agent's in-context memory. |
| `metadata` | `object \| null` | No | The metadata of the agent. |
| `model` | `string \| null` | No | The model handle used by the agent (format: provider/model-name). |
| `model_settings` | `object \| null` | No | The model settings used by the agent. |
| `multi_agent_group` | `object \| null` | No | Deprecated: Use `managed_group` field instead. The multi-agent group that this agent manages. |
| `pending_approval` | `object \| null` | No | A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution). Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional\[str]): The name of the sender of the message tool\_call (ToolCall): The tool call |
| `per_file_view_window_char_limit` | `number \| null` | No | The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `project_id` | `string \| null` | No | The id of the project the agent belongs to. |
| `response_format` | `object \| null` | No | The response format used by the agent |
| `secrets` | `object[] \| null` | No | The environment variables for tool execution specific to this agent. |
| `template_id` | `string \| null` | No | The id of the template the agent belongs to. |
| `timezone` | `string \| null` | No | The timezone of the agent (IANA format). |
| `tool_exec_environment_variables` | `object[] \| null` | No | Deprecated: use `secrets` field instead. |
| `tool_rules` | `object[] \| null` | No | The list of tool rules. |
| `updated_at` | `string \| null` | No | The timestamp when the object was last updated. |

> [accordion] blocks full type
>
> ```ts theme={null}
> {
>   value?: string | null,
>   id?: string | null,
>   base_template_id?: string | null,
>   created_by_id?: string | null,
>   deployment_id?: string | null,
>   description?: string | null,
>   entity_id?: string | null,
>   hidden?: boolean | null,
>   is_template?: boolean | null,
>   label?: string | null,
>   last_updated_by_id?: string | null,
>   limit?: number | null,
>   metadata?: {
>   } | null,
>   preserve_on_migration?: boolean | null,
>   project_id?: string | null,
>   read_only?: boolean | null,
>   tags?: string[] | null,
>   template_id?: string | null,
>   template_name?: string | null
> }[] | null
> ```

> [accordion] llm\_config full type
>
> ```ts theme={null}
> {
>   context_window?: number | null,
>   model?: string | null,
>   model_endpoint_type?: string | null,
>   compatibility_type?: string | null,
>   display_name?: string | null,
>   effort?: string | null,
>   enable_reasoner?: boolean | null,
>   frequency_penalty?: number | null,
>   handle?: string | null,
>   max_reasoning_tokens?: number | null,
>   max_tokens?: number | null,
>   model_endpoint?: string | null,
>   model_wrapper?: string | null,
>   parallel_tool_calls?: boolean | null,
>   provider_category?: string | string | null,
>   provider_name?: string | null,
>   put_inner_thoughts_in_kwargs?: boolean | null,
>   reasoning_effort?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   return_logprobs?: boolean | null,
>   return_token_ids?: boolean | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   tier?: string | null,
>   tool_call_parser?: string | null,
>   top_logprobs?: number | null,
>   verbosity?: string | null
> } | null
> ```

> [accordion] memory full type
>
> ```ts theme={null}
> {
>   blocks?: {
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   agent_type?: string | string | string | string | string | string | string | string | string | string | null,
>   file_blocks?: {
>     file_id?: string | null,
>     is_open?: boolean | null,
>     source_id?: string | null,
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_accessed_at?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   git_enabled?: boolean | null,
>   prompt_template?: string | null
> } | null
> ```

> [accordion] sources full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   name?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   instructions?: string | null,
>   last_updated_by_id?: string | null,
>   metadata?: {
>   } | null,
>   updated_at?: string | null,
>   vector_db_provider?: string | string | string | null
> }[] | null
> ```

> [accordion] tools full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   args_json_schema?: {
>   } | null,
>   created_by_id?: string | null,
>   default_requires_approval?: boolean | null,
>   description?: string | null,
>   enable_parallel_execution?: boolean | null,
>   json_schema?: {
>   } | null,
>   last_updated_by_id?: string | null,
>   metadata_?: {
>   } | null,
>   name?: string | null,
>   npm_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   pip_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   project_id?: string | null,
>   return_char_limit?: number | null,
>   source_code?: string | null,
>   source_type?: string | null,
>   tags?: string[] | null,
>   tool_type?: string | string | string | string | string | string | string | string | string | string | string | null
> }[] | null
> ```

> [accordion] compaction\_settings full type
>
> ```ts theme={null}
> {
>   clip_chars?: number | null,
>   mode?: string | null,
>   model?: string | null,
>   model_settings?: {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking?: {
>       clear_thinking?: boolean | null,
>       type?: string | null
>     } | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     temperature?: number | null
>   } | null,
>   prompt?: string | null,
>   prompt_acknowledgement?: boolean | null,
>   sliding_window_percentage?: number | null
> } | null
> ```

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim?: number | null,
>   embedding_endpoint_type?: string | null,
>   embedding_model?: string | null,
>   azure_deployment?: string | null,
>   azure_endpoint?: string | null,
>   azure_version?: string | null,
>   batch_size?: number | null,
>   embedding_chunk_size?: number | null,
>   embedding_endpoint?: string | null,
>   handle?: string | null
> } | null
> ```

> [accordion] identities full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   block_ids?: string[] | null,
>   identifier_key?: string | null,
>   identity_type?: string | null,
>   name?: string | null,
>   project_id?: string | null,
>   properties?: {
>     key?: string | null,
>     type?: string | null,
>     value?: string | number | boolean | {
>     } | null
>   }[] | null
> }[] | null
> ```

> [accordion] managed\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] model\_settings full type
>
> ```ts theme={null}
> {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking?: {
>     clear_thinking?: boolean | null,
>     type?: string | null
>   } | null
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   temperature?: number | null
> } | null
> ```

> [accordion] multi\_agent\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] pending\_approval full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   date?: string | null,
>   tool_call?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null,
>   is_err?: boolean | null,
>   message_type?: string | null,
>   name?: string | null,
>   otid?: string | null,
>   run_id?: string | null,
>   sender_id?: string | null,
>   seq_id?: number | null,
>   step_id?: string | null,
>   tool_calls?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   }[] | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null
> } | null
> ```

> [accordion] response\_format full type
>
> ```ts theme={null}
> {
>   type?: string | null
> } | {
>   json_schema?: {
>   } | null,
>   type?: string | null
> } | {
>   type?: string | null
> } | null
> ```

> [accordion] secrets full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_exec\_environment\_variables full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_rules full type
>
> ```ts theme={null}
> (
>   {
>     children?: string[] | null,
>     tool_name?: string | null,
>     child_arg_nodes?: {
>       name?: string | null,
>       args?: {
>       } | null
>     }[] | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     args?: {
>     } | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     child_output_mapping?: Record<string, string> | null,
>     tool_name?: string | null,
>     default_child?: string | null,
>     prompt_template?: string | null,
>     require_output_mapping?: boolean | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     max_count_limit?: number | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     children?: string[] | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   }
> )[] | null
> ```

***

### folders.list

`agents.folders.list`

List Folders For Agent. Get the folders associated with an agent. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.agents.folders.list({ agent_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `after` | `string` | No | Cursor for pagination (source ID). Returns results relative to this ID in the specified sort order. Expected format: 'source-\<uuid4>' |
| `before` | `string` | No | Cursor for pagination (source ID). Returns results relative to this ID in the specified sort order. Expected format: 'source-\<uuid4>' |
| `limit` | `number` | No | Maximum number of sources to return |
| `order` | `asc \| desc` | No | Sort order for sources by creation time. 'asc' for oldest first, 'desc' for newest first |
| `order_by` | `created_at` | No | Field to sort by |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   name?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   instructions?: string | null,
>   last_updated_by_id?: string | null,
>   metadata?: {
>   } | null,
>   updated_at?: string | null,
>   vector_db_provider?: string | string | string | null
> }[]
> ```

***

### get

`agents.get`

Retrieve Agent. Get the state of the agent.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.agents.get({ agent_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `include` | `(agent.blocks \| agent.identities \| agent.managed_group \| agent.pending_approval \| agent.secrets \| agent.sources \| agent.tags \| agent.tools)[]` | No | Specify which relational fields to include in the response. No relationships are included by default. |
| `include_relationships` | `string[]` | No | Specify which relational fields (e.g., 'tools', 'sources', 'memory') to include in the response. If not provided, all relationships are loaded by default. Using this can optimize performance by reducing unnecessary joins.This is a legacy parameter, and no longer supported after 1.0.0 SDK versions. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The id of the agent. Assigned by the database. |
| `agent_type` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | Enum to represent the type of agent. |
| `blocks` | `object[] \| null` | No | The memory blocks used by the agent. |
| `llm_config` | `object \| null` | No | Configuration for Language Model (LLM) connection and generation parameters. .. deprecated:: LLMConfig is deprecated and should not be used as an input or return type in API calls. Use the schemas in letta.schemas.model (ModelSettings, OpenAIModelSettings, etc.) instead. For conversion, use the \_to\_model() method or Model.\_from\_llm\_config() method. |
| `memory` | `object \| null` | No | Deprecated: Use `blocks` field instead. The in-context memory of the agent. |
| `name` | `string \| null` | No | The name of the agent. |
| `sources` | `object[] \| null` | No | Deprecated: Use `folders` field instead. The sources used by the agent. |
| `system` | `string \| null` | No | The system prompt used by the agent. |
| `tags` | `string[] \| null` | No | The tags associated with the agent. |
| `tools` | `object[] \| null` | No | The tools used by the agent. |
| `base_template_id` | `string \| null` | No | The base template id of the agent. |
| `compaction_settings` | `object \| null` | No | Configuration for conversation compaction / summarization. Per-model settings (temperature, max tokens, etc.) are derived from the default configuration for that handle. |
| `created_at` | `string \| null` | No | The timestamp when the object was created. |
| `created_by_id` | `string \| null` | No | The id of the user that made this object. |
| `deployment_id` | `string \| null` | No | The id of the deployment. |
| `description` | `string \| null` | No | The description of the agent. |
| `embedding` | `string \| null` | No | The embedding model handle used by the agent (format: provider/model-name). |
| `embedding_config` | `object \| null` | No | Configuration for embedding model connection and processing parameters. |
| `enable_sleeptime` | `boolean \| null` | No | If set to True, memory management will move to a background agent thread. |
| `entity_id` | `string \| null` | No | The id of the entity within the template. |
| `hidden` | `boolean \| null` | No | If set to True, the agent will be hidden. |
| `identities` | `object[] \| null` | No | The identities associated with this agent. |
| `identity_ids` | `string[] \| null` | No | Deprecated: Use `identities` field instead. The ids of the identities associated with this agent. |
| `last_run_completion` | `string \| null` | No | The timestamp when the agent last completed a run. |
| `last_run_duration_ms` | `number \| null` | No | The duration in milliseconds of the agent's last run. |
| `last_stop_reason` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | — |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this object. |
| `managed_group` | `object \| null` | No | The multi-agent group that this agent manages |
| `max_files_open` | `number \| null` | No | Maximum number of files that can be open at once for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `message_buffer_autoclear` | `boolean \| null` | No | If set to True, the agent will not remember previous messages (though the agent will still retain state via core memory blocks and archival/recall memory). Not recommended unless you have an advanced use case. |
| `message_ids` | `string[] \| null` | No | The ids of the messages in the agent's in-context memory. |
| `metadata` | `object \| null` | No | The metadata of the agent. |
| `model` | `string \| null` | No | The model handle used by the agent (format: provider/model-name). |
| `model_settings` | `object \| null` | No | The model settings used by the agent. |
| `multi_agent_group` | `object \| null` | No | Deprecated: Use `managed_group` field instead. The multi-agent group that this agent manages. |
| `pending_approval` | `object \| null` | No | A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution). Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional\[str]): The name of the sender of the message tool\_call (ToolCall): The tool call |
| `per_file_view_window_char_limit` | `number \| null` | No | The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `project_id` | `string \| null` | No | The id of the project the agent belongs to. |
| `response_format` | `object \| null` | No | The response format used by the agent |
| `secrets` | `object[] \| null` | No | The environment variables for tool execution specific to this agent. |
| `template_id` | `string \| null` | No | The id of the template the agent belongs to. |
| `timezone` | `string \| null` | No | The timezone of the agent (IANA format). |
| `tool_exec_environment_variables` | `object[] \| null` | No | Deprecated: use `secrets` field instead. |
| `tool_rules` | `object[] \| null` | No | The list of tool rules. |
| `updated_at` | `string \| null` | No | The timestamp when the object was last updated. |

> [accordion] blocks full type
>
> ```ts theme={null}
> {
>   value?: string | null,
>   id?: string | null,
>   base_template_id?: string | null,
>   created_by_id?: string | null,
>   deployment_id?: string | null,
>   description?: string | null,
>   entity_id?: string | null,
>   hidden?: boolean | null,
>   is_template?: boolean | null,
>   label?: string | null,
>   last_updated_by_id?: string | null,
>   limit?: number | null,
>   metadata?: {
>   } | null,
>   preserve_on_migration?: boolean | null,
>   project_id?: string | null,
>   read_only?: boolean | null,
>   tags?: string[] | null,
>   template_id?: string | null,
>   template_name?: string | null
> }[] | null
> ```

> [accordion] llm\_config full type
>
> ```ts theme={null}
> {
>   context_window?: number | null,
>   model?: string | null,
>   model_endpoint_type?: string | null,
>   compatibility_type?: string | null,
>   display_name?: string | null,
>   effort?: string | null,
>   enable_reasoner?: boolean | null,
>   frequency_penalty?: number | null,
>   handle?: string | null,
>   max_reasoning_tokens?: number | null,
>   max_tokens?: number | null,
>   model_endpoint?: string | null,
>   model_wrapper?: string | null,
>   parallel_tool_calls?: boolean | null,
>   provider_category?: string | string | null,
>   provider_name?: string | null,
>   put_inner_thoughts_in_kwargs?: boolean | null,
>   reasoning_effort?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   return_logprobs?: boolean | null,
>   return_token_ids?: boolean | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   tier?: string | null,
>   tool_call_parser?: string | null,
>   top_logprobs?: number | null,
>   verbosity?: string | null
> } | null
> ```

> [accordion] memory full type
>
> ```ts theme={null}
> {
>   blocks?: {
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   agent_type?: string | string | string | string | string | string | string | string | string | string | null,
>   file_blocks?: {
>     file_id?: string | null,
>     is_open?: boolean | null,
>     source_id?: string | null,
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_accessed_at?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   git_enabled?: boolean | null,
>   prompt_template?: string | null
> } | null
> ```

> [accordion] sources full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   name?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   instructions?: string | null,
>   last_updated_by_id?: string | null,
>   metadata?: {
>   } | null,
>   updated_at?: string | null,
>   vector_db_provider?: string | string | string | null
> }[] | null
> ```

> [accordion] tools full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   args_json_schema?: {
>   } | null,
>   created_by_id?: string | null,
>   default_requires_approval?: boolean | null,
>   description?: string | null,
>   enable_parallel_execution?: boolean | null,
>   json_schema?: {
>   } | null,
>   last_updated_by_id?: string | null,
>   metadata_?: {
>   } | null,
>   name?: string | null,
>   npm_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   pip_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   project_id?: string | null,
>   return_char_limit?: number | null,
>   source_code?: string | null,
>   source_type?: string | null,
>   tags?: string[] | null,
>   tool_type?: string | string | string | string | string | string | string | string | string | string | string | null
> }[] | null
> ```

> [accordion] compaction\_settings full type
>
> ```ts theme={null}
> {
>   clip_chars?: number | null,
>   mode?: string | null,
>   model?: string | null,
>   model_settings?: {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking?: {
>       clear_thinking?: boolean | null,
>       type?: string | null
>     } | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     temperature?: number | null
>   } | null,
>   prompt?: string | null,
>   prompt_acknowledgement?: boolean | null,
>   sliding_window_percentage?: number | null
> } | null
> ```

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim?: number | null,
>   embedding_endpoint_type?: string | null,
>   embedding_model?: string | null,
>   azure_deployment?: string | null,
>   azure_endpoint?: string | null,
>   azure_version?: string | null,
>   batch_size?: number | null,
>   embedding_chunk_size?: number | null,
>   embedding_endpoint?: string | null,
>   handle?: string | null
> } | null
> ```

> [accordion] identities full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   block_ids?: string[] | null,
>   identifier_key?: string | null,
>   identity_type?: string | null,
>   name?: string | null,
>   project_id?: string | null,
>   properties?: {
>     key?: string | null,
>     type?: string | null,
>     value?: string | number | boolean | {
>     } | null
>   }[] | null
> }[] | null
> ```

> [accordion] managed\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] model\_settings full type
>
> ```ts theme={null}
> {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking?: {
>     clear_thinking?: boolean | null,
>     type?: string | null
>   } | null
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   temperature?: number | null
> } | null
> ```

> [accordion] multi\_agent\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] pending\_approval full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   date?: string | null,
>   tool_call?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null,
>   is_err?: boolean | null,
>   message_type?: string | null,
>   name?: string | null,
>   otid?: string | null,
>   run_id?: string | null,
>   sender_id?: string | null,
>   seq_id?: number | null,
>   step_id?: string | null,
>   tool_calls?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   }[] | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null
> } | null
> ```

> [accordion] response\_format full type
>
> ```ts theme={null}
> {
>   type?: string | null
> } | {
>   json_schema?: {
>   } | null,
>   type?: string | null
> } | {
>   type?: string | null
> } | null
> ```

> [accordion] secrets full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_exec\_environment\_variables full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_rules full type
>
> ```ts theme={null}
> (
>   {
>     children?: string[] | null,
>     tool_name?: string | null,
>     child_arg_nodes?: {
>       name?: string | null,
>       args?: {
>       } | null
>     }[] | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     args?: {
>     } | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     child_output_mapping?: Record<string, string> | null,
>     tool_name?: string | null,
>     default_child?: string | null,
>     prompt_template?: string | null,
>     require_output_mapping?: boolean | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     max_count_limit?: number | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     children?: string[] | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   }
> )[] | null
> ```

***

### identities.attach

`agents.identities.attach`

Attach Identity To Agent. Attach an identity to an agent. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.agents.identities.attach({ agent_id: 'example', identity_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `identity_id` | `string` | Yes | — |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### identities.detach

`agents.identities.detach`

Detach Identity From Agent. Detach an identity from an agent. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.agents.identities.detach({ agent_id: 'example', identity_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `identity_id` | `string` | Yes | — |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### importFile

`agents.importFile`

Import Agent. Import a serialized agent file and recreate the agent(s) in the system. Returns the IDs of all imported agents. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.agents.importFile({
	file: { base64: 'SGVsbG8gZnJvbSBDb3JzYWly', filename: 'notes.txt', contentType: 'text/plain' },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `override_embedding_model` | `string` | No | — |
| `file` | `string \| object \| custom` | Yes | The .af agent file to import. |
| `model` | `string` | No | Model handle to use instead of the file's default model. |
| `embedding` | `string` | No | Embedding handle to use instead of the file’s default. |
| `override_existing_tools` | `boolean` | No | Replace tools that already exist with the same name. |
| `project_id` | `string` | No | The project to import the agent into. |
| `strip_messages` | `boolean` | No | Import the agent without its message history. |
| `secrets` | `string` | No | Secrets as a JSON string, used by tools when they run. |
| `name` | `string` | No | A name for the imported agent. |

> [accordion] file full type
>
> ```ts theme={null}
> string | {
>   url: string,
>   filename?: string,
>   contentType?: string
> } | {
>   base64: string,
>   filename?: string,
>   contentType?: string
> } | custom
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_ids` | `string[] \| null` | No | List of IDs of the imported agents |

***

### list

`agents.list`

List Agents. Get a list of all agents. (GET /v1/agents/)

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.agents.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | Cursor for pagination |
| `ascending` | `boolean` | No | Whether to sort agents oldest to newest (True) or newest to oldest (False, default) |
| `base_template_id` | `string` | No | Search agents by base template ID |
| `before` | `string` | No | Cursor for pagination |
| `created_by_id` | `string` | No | Filter agents by the user who created them. |
| `identifier_keys` | `string[]` | No | Search agents by identifier keys |
| `identity_id` | `string` | No | Search agents by identity ID |
| `include` | `(agent.blocks \| agent.identities \| agent.managed_group \| agent.pending_approval \| agent.secrets \| agent.sources \| agent.tags \| agent.tools)[]` | No | Specify which relational fields to include in the response. No relationships are included by default. |
| `include_relationships` | `string[]` | No | Specify which relational fields (e.g., 'tools', 'sources', 'memory') to include in the response. If not provided, all relationships are loaded by default. Using this can optimize performance by reducing unnecessary joins.This is a legacy parameter, and no longer supported after 1.0.0 SDK versions. |
| `last_stop_reason` | `end_turn \| error \| llm_api_error \| invalid_llm_response \| invalid_tool_call \| max_steps \| max_tokens_exceeded \| no_tool_call \| tool_rule \| cancelled \| insufficient_credits \| requires_approval \| context_window_overflow_in_system_prompt` | No | — |
| `limit` | `number` | No | Limit for pagination |
| `match_all_tags` | `boolean` | No | If True, only returns agents that match ALL given tags. Otherwise, return agents that have ANY of the passed-in tags. |
| `name` | `string` | No | Name of the agent |
| `order` | `asc \| desc` | No | Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first |
| `order_by` | `created_at \| updated_at \| last_run_completion` | No | Field to sort by |
| `project_id` | `string` | No | Search agents by project ID - this will default to your default project on cloud |
| `query_text` | `string` | No | Search agents by name |
| `sort_by` | `string` | No | Field to sort by. Options: 'created\_at' (default), 'last\_run\_completion' |
| `tags` | `string[]` | No | List of tags to filter agents by |
| `template_id` | `string` | No | Search agents by template ID |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_type?: string | string | string | string | string | string | string | string | string | null,
>   blocks?: {
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   llm_config?: {
>     context_window?: number | null,
>     model?: string | null,
>     model_endpoint_type?: string | null,
>     compatibility_type?: string | null,
>     display_name?: string | null,
>     effort?: string | null,
>     enable_reasoner?: boolean | null,
>     frequency_penalty?: number | null,
>     handle?: string | null,
>     max_reasoning_tokens?: number | null,
>     max_tokens?: number | null,
>     model_endpoint?: string | null,
>     model_wrapper?: string | null,
>     parallel_tool_calls?: boolean | null,
>     provider_category?: string | string | null,
>     provider_name?: string | null,
>     put_inner_thoughts_in_kwargs?: boolean | null,
>     reasoning_effort?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     return_logprobs?: boolean | null,
>     return_token_ids?: boolean | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     tier?: string | null,
>     tool_call_parser?: string | null,
>     top_logprobs?: number | null,
>     verbosity?: string | null
>   } | null,
>   memory?: {
>     blocks?: {
>       value?: string | null,
>       id?: string | null,
>       base_template_id?: string | null,
>       created_by_id?: string | null,
>       deployment_id?: string | null,
>       description?: string | null,
>       entity_id?: string | null,
>       hidden?: boolean | null,
>       is_template?: boolean | null,
>       label?: string | null,
>       last_updated_by_id?: string | null,
>       limit?: number | null,
>       metadata?: {
>       } | null,
>       preserve_on_migration?: boolean | null,
>       project_id?: string | null,
>       read_only?: boolean | null,
>       tags?: string[] | null,
>       template_id?: string | null,
>       template_name?: string | null
>     }[] | null,
>     agent_type?: string | string | string | string | string | string | string | string | string | string | null,
>     file_blocks?: {
>       file_id?: string | null,
>       is_open?: boolean | null,
>       source_id?: string | null,
>       value?: string | null,
>       id?: string | null,
>       base_template_id?: string | null,
>       created_by_id?: string | null,
>       deployment_id?: string | null,
>       description?: string | null,
>       entity_id?: string | null,
>       hidden?: boolean | null,
>       is_template?: boolean | null,
>       label?: string | null,
>       last_accessed_at?: string | null,
>       last_updated_by_id?: string | null,
>       limit?: number | null,
>       metadata?: {
>       } | null,
>       preserve_on_migration?: boolean | null,
>       project_id?: string | null,
>       read_only?: boolean | null,
>       tags?: string[] | null,
>       template_id?: string | null,
>       template_name?: string | null
>     }[] | null,
>     git_enabled?: boolean | null,
>     prompt_template?: string | null
>   } | null,
>   name?: string | null,
>   sources?: {
>     id?: string | null,
>     embedding_config?: {
>       embedding_dim?: number | null,
>       embedding_endpoint_type?: string | null,
>       embedding_model?: string | null,
>       azure_deployment?: string | null,
>       azure_endpoint?: string | null,
>       azure_version?: string | null,
>       batch_size?: number | null,
>       embedding_chunk_size?: number | null,
>       embedding_endpoint?: string | null,
>       handle?: string | null
>     } | null,
>     name?: string | null,
>     created_at?: string | null,
>     created_by_id?: string | null,
>     description?: string | null,
>     instructions?: string | null,
>     last_updated_by_id?: string | null,
>     metadata?: {
>     } | null,
>     updated_at?: string | null,
>     vector_db_provider?: string | string | string | null
>   }[] | null,
>   system?: string | null,
>   tags?: string[] | null,
>   tools?: {
>     id?: string | null,
>     args_json_schema?: {
>     } | null,
>     created_by_id?: string | null,
>     default_requires_approval?: boolean | null,
>     description?: string | null,
>     enable_parallel_execution?: boolean | null,
>     json_schema?: {
>     } | null,
>     last_updated_by_id?: string | null,
>     metadata_?: {
>     } | null,
>     name?: string | null,
>     npm_requirements?: {
>       name?: string | null,
>       version?: string | null
>     }[] | null,
>     pip_requirements?: {
>       name?: string | null,
>       version?: string | null
>     }[] | null,
>     project_id?: string | null,
>     return_char_limit?: number | null,
>     source_code?: string | null,
>     source_type?: string | null,
>     tags?: string[] | null,
>     tool_type?: string | string | string | string | string | string | string | string | string | string | string | null
>   }[] | null,
>   base_template_id?: string | null,
>   compaction_settings?: {
>     clip_chars?: number | null,
>     mode?: string | null,
>     model?: string | null,
>     model_settings?: {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       reasoning?: {
>         reasoning_effort?: string | null
>       } | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       strict?: boolean | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       reasoning?: {
>         reasoning_effort?: string | null
>       } | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       strict?: boolean | null,
>       temperature?: number | null
>     } | {
>       effort?: string | null,
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       strict?: boolean | null,
>       temperature?: number | null,
>       thinking?: {
>         budget_tokens?: number | null,
>         type?: string | null
>       } | null,
>       verbosity?: string | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_schema?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null,
>       thinking_config?: {
>         include_thoughts?: boolean | null,
>         thinking_budget?: number | null
>       } | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_schema?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null,
>       thinking_config?: {
>         include_thoughts?: boolean | null,
>         thinking_budget?: number | null
>       } | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       strict?: boolean | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null,
>       thinking?: {
>         clear_thinking?: boolean | null,
>         type?: string | null
>       } | null
>     } | {
>       effort?: string | null,
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       strict?: boolean | null,
>       temperature?: number | null,
>       thinking?: {
>         budget_tokens?: number | null,
>         type?: string | null
>       } | null,
>       verbosity?: string | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       reasoning?: {
>         reasoning_effort?: string | null
>       } | null,
>       temperature?: number | null
>     } | null,
>     prompt?: string | null,
>     prompt_acknowledgement?: boolean | null,
>     sliding_window_percentage?: number | null
>   } | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   deployment_id?: string | null,
>   description?: string | null,
>   embedding?: string | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   enable_sleeptime?: boolean | null,
>   entity_id?: string | null,
>   hidden?: boolean | null,
>   identities?: {
>     id?: string | null,
>     agent_ids?: string[] | null,
>     block_ids?: string[] | null,
>     identifier_key?: string | null,
>     identity_type?: string | null,
>     name?: string | null,
>     project_id?: string | null,
>     properties?: {
>       key?: string | null,
>       type?: string | null,
>       value?: string | number | boolean | {
>       } | null
>     }[] | null
>   }[] | null,
>   identity_ids?: string[] | null,
>   last_run_completion?: string | null,
>   last_run_duration_ms?: number | null,
>   last_stop_reason?: string | string | string | string | string | string | string | string | string | string | string | string | string | null,
>   last_updated_by_id?: string | null,
>   managed_group?: {
>     id?: string | null,
>     agent_ids?: string[] | null,
>     description?: string | null,
>     manager_type?: string | null,
>     base_template_id?: string | null,
>     deployment_id?: string | null,
>     hidden?: boolean | null,
>     last_processed_message_id?: string | null,
>     manager_agent_id?: string | null,
>     max_message_buffer_length?: number | null,
>     max_turns?: number | null,
>     min_message_buffer_length?: number | null,
>     project_id?: string | null,
>     shared_block_ids?: string[] | null,
>     sleeptime_agent_frequency?: number | null,
>     template_id?: string | null,
>     termination_token?: string | null,
>     turns_counter?: number | null
>   } | null,
>   max_files_open?: number | null,
>   message_buffer_autoclear?: boolean | null,
>   message_ids?: string[] | null,
>   metadata?: {
>   } | null,
>   model?: string | null,
>   model_settings?: {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking?: {
>       clear_thinking?: boolean | null,
>       type?: string | null
>     } | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     temperature?: number | null
>   } | null,
>   multi_agent_group?: {
>     id?: string | null,
>     agent_ids?: string[] | null,
>     description?: string | null,
>     manager_type?: string | null,
>     base_template_id?: string | null,
>     deployment_id?: string | null,
>     hidden?: boolean | null,
>     last_processed_message_id?: string | null,
>     manager_agent_id?: string | null,
>     max_message_buffer_length?: number | null,
>     max_turns?: number | null,
>     min_message_buffer_length?: number | null,
>     project_id?: string | null,
>     shared_block_ids?: string[] | null,
>     sleeptime_agent_frequency?: number | null,
>     template_id?: string | null,
>     termination_token?: string | null,
>     turns_counter?: number | null
>   } | null,
>   pending_approval?: {
>     id?: string | null,
>     date?: string | null,
>     tool_call?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null,
>     tool_calls?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     }[] | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null
>   } | null,
>   per_file_view_window_char_limit?: number | null,
>   project_id?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   secrets?: {
>     agent_id?: string | null,
>     key?: string | null,
>     value?: string | null,
>     id?: string | null,
>     created_at?: string | null,
>     created_by_id?: string | null,
>     description?: string | null,
>     last_updated_by_id?: string | null,
>     updated_at?: string | null,
>     value_enc?: string | null
>   }[] | null,
>   template_id?: string | null,
>   timezone?: string | null,
>   tool_exec_environment_variables?: {
>     agent_id?: string | null,
>     key?: string | null,
>     value?: string | null,
>     id?: string | null,
>     created_at?: string | null,
>     created_by_id?: string | null,
>     description?: string | null,
>     last_updated_by_id?: string | null,
>     updated_at?: string | null,
>     value_enc?: string | null
>   }[] | null,
>   tool_rules?: (
>     {
>       children?: string[] | null,
>       tool_name?: string | null,
>       child_arg_nodes?: {
>         name?: string | null,
>         args?: {
>         } | null
>       }[] | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       tool_name?: string | null,
>       args?: {
>       } | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       child_output_mapping?: Record<string, string> | null,
>       tool_name?: string | null,
>       default_child?: string | null,
>       prompt_template?: string | null,
>       require_output_mapping?: boolean | null,
>       type?: string | null
>     } | {
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       max_count_limit?: number | null,
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       children?: string[] | null,
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     }
>   )[] | null,
>   updated_at?: string | null
> }[]
> ```

***

### messages.cancel

`agents.messages.cancel`

Cancel Message. Cancel runs associated with an agent. If run\_ids are passed in, cancel those in particular. Note to cancel active runs associated with an agent, redis is required.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.agents.messages.cancel({ agent_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `run_ids` | `string[]` | No | Optional list of run IDs to cancel |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### messages.compact

`agents.messages.compact`

Summarize Messages. Summarize an agent's conversation history.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.agents.messages.compact({ agent_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `compaction_settings` | `object` | No | Configuration for conversation compaction / summarization. Per-model settings (temperature, max tokens, etc.) are derived from the default configuration for that handle. |

> [accordion] compaction\_settings full type
>
> ```ts theme={null}
> {
>   clip_chars?: number,
>   mode?: all | sliding_window | self_compact_all | self_compact_sliding_window,
>   model?: string,
>   model_settings?: {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: openai,
>     reasoning?: {
>       reasoning_effort?: none | minimal | low | medium | high | xhigh
>     },
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: openai,
>     reasoning?: {
>       reasoning_effort?: none | minimal | low | medium | high | xhigh
>     },
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number
>   } | {
>     effort?: low | medium | high | xhigh | max,
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: anthropic,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number,
>     thinking?: {
>       budget_tokens?: number,
>       type?: enabled | disabled
>     },
>     verbosity?: low | medium | high
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: google_ai,
>     response_schema?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number,
>     thinking_config?: {
>       include_thoughts?: boolean,
>       thinking_budget?: number
>     }
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: google_vertex,
>     response_schema?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number,
>     thinking_config?: {
>       include_thoughts?: boolean,
>       thinking_budget?: number
>     }
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: azure,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: xai,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: moonshot,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: zai,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number,
>     thinking?: {
>       clear_thinking?: boolean,
>       type?: enabled | disabled
>     }
>   } | {
>     effort?: low | medium | high | xhigh | max,
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: moonshot_coding,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number,
>     thinking?: {
>       budget_tokens?: number,
>       type?: enabled | disabled
>     },
>     verbosity?: low | medium | high
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: groq,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: deepseek,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: together,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: bedrock,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: baseten,
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: openrouter,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: chatgpt_oauth,
>     reasoning?: {
>       reasoning_effort?: none | low | medium | high | xhigh
>     },
>     temperature?: number
>   },
>   prompt?: string,
>   prompt_acknowledgement?: boolean,
>   sliding_window_percentage?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `num_messages_after` | `number \| null` | No | — |
| `num_messages_before` | `number \| null` | No | — |
| `summary` | `string \| null` | No | — |

***

### messages.create

`agents.messages.create`

Create Message. Process a user message and return the agent's response. This endpoint accepts a message from a user and processes it through the agent. Note: Sending multiple concurrent requests to the same agent can lead to undefined behavior. Runs the agent: it calls its model (spending tokens) and may run tools.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.agents.messages.create({ agent_id: 'agent-3f0e6a2c-8b1d-4c7e-9a52-1d2e3f4a5b6c', input: 'What do you remember about me?' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `assistant_message_tool_kwarg` | `string` | No | The name of the message argument in the designated message tool. Still supported for legacy agent types, but deprecated for letta\_v1\_agent onward. |
| `assistant_message_tool_name` | `string` | No | The name of the designated message tool. Still supported for legacy agent types, but deprecated for letta\_v1\_agent onward. |
| `background` | `boolean` | No | Whether to process the request in the background (only used when streaming=true). |
| `client_skills` | `object[]` | No | Client-side skills available in the environment. These are rendered in the system prompt's available skills section alongside agent-scoped skills from MemFS. |
| `client_tools` | `object[]` | No | Client-side tools that the agent can call. When the agent calls a client-side tool, execution pauses and returns control to the client to execute the tool and provide the result via a ToolReturn. |
| `enable_thinking` | `string` | No | If set to True, enables reasoning before responses or tool calls from the agent. |
| `include_compaction_messages` | `boolean` | No | If True, compaction events emit structured `SummaryMessage` and `EventMessage` types. If False (default), compaction messages are not included in the response. |
| `include_pings` | `boolean` | No | Whether to include periodic keepalive ping messages in the stream to prevent connection timeouts (only used when streaming=true). |
| `include_return_message_types` | `(system_message \| user_message \| assistant_message \| reasoning_message \| hidden_reasoning_message \| tool_call_message \| tool_return_message \| approval_request_message \| approval_response_message \| summary_message \| event_message)[]` | No | Only return specified message types in the response. If `None` (default) returns all messages. |
| `input` | `string \| object[] \| object` | No | Syntactic sugar for a single user message. Equivalent to messages=\[\{'role': 'user', 'content': input}]. |
| `max_steps` | `number` | No | Maximum number of steps the agent should take to process the request. |
| `messages` | `object[]` | No | The messages to be sent to the agent. |
| `override_model` | `string` | No | Model handle to use for this request instead of the agent's default model. This allows sending a message to a different model without changing the agent's configuration. |
| `override_system` | `string` | No | Optional per-request system prompt override. When set, this is passed directly to the underlying LLM request and bypasses the persisted/compiled system message for that request. |
| `return_logprobs` | `boolean` | No | If True, returns log probabilities of the output tokens in the response. Useful for RL training. Only supported for OpenAI-compatible providers (including SGLang). |
| `return_token_ids` | `boolean` | No | If True, returns token IDs and logprobs for ALL LLM generations in the agent step, not just the last one. Uses SGLang native /generate endpoint. Returns 'turns' field with TurnTokenData for each assistant/tool turn. Required for proper multi-turn RL training with loss masking. |
| `stream_tokens` | `boolean` | No | Flag to determine if individual tokens should be streamed, rather than streaming per step (only used when streaming=true). |
| `streaming` | `boolean` | No | If True, returns a streaming response (Server-Sent Events). If False (default), returns a complete response. |
| `top_logprobs` | `number` | No | Number of most likely tokens to return at each position (0-20). Requires return\_logprobs=True. |
| `use_assistant_message` | `boolean` | No | Whether the server should parse specific tool call arguments (default `send_message`) as `AssistantMessage` objects. Still supported for legacy agent types, but deprecated for letta\_v1\_agent onward. |

> [accordion] client\_skills full type
>
> ```ts theme={null}
> {
>   description: string,
>   location: string,
>   name: string
> }[]
> ```

> [accordion] client\_tools full type
>
> ```ts theme={null}
> {
>   name: string,
>   description?: string,
>   parameters?: {
>   }
> }[]
> ```

> [accordion] input full type
>
> ```ts theme={null}
> string | (
>   {
>     text: string,
>     signature?: string,
>     type?: text
>   } | {
>     source: {
>       url: string,
>       type?: url
>     } | {
>       data: string,
>       media_type: string,
>       detail?: string,
>       type?: base64
>     } | {
>       file_id: string,
>       data?: string,
>       detail?: string,
>       media_type?: string,
>       type?: letta
>     },
>     type?: image
>   } | {
>     id: string,
>     input: {
>     },
>     name: string,
>     signature?: string,
>     type?: tool_call
>   } | {
>     content: string,
>     is_error: boolean,
>     tool_call_id: string,
>     type?: tool_return
>   } | {
>     is_native: boolean,
>     reasoning: string,
>     signature?: string,
>     type?: reasoning
>   } | {
>     data: string,
>     type?: redacted_reasoning
>   } | {
>     signature?: string,
>     type?: omitted_reasoning
>   } | {
>     id: string,
>     summary: {
>       index: number,
>       text: string
>     }[],
>     encrypted_content?: string,
>     type?: summarized_reasoning
>   }
> )[] | {
>   source: {
>     url: string,
>     type?: url
>   } | {
>     data: string,
>     media_type: string,
>     detail?: string,
>     type?: base64
>   } | {
>     file_id: string,
>     data?: string,
>     detail?: string,
>     media_type?: string,
>     type?: letta
>   },
>   type?: image
> } | {
>   id: string,
>   input: {
>   },
>   name: string,
>   signature?: string,
>   type?: tool_call
> }
> ```

> [accordion] messages full type
>
> ```ts theme={null}
> (
>   {
>     content: (
>       {
>         text: string,
>         signature?: string,
>         type?: text
>       } | {
>         source: {
>           url: string,
>           type?: url
>         } | {
>           data: string,
>           media_type: string,
>           detail?: string,
>           type?: base64
>         } | {
>           file_id: string,
>           data?: string,
>           detail?: string,
>           media_type?: string,
>           type?: letta
>         },
>         type?: image
>       } | {
>         id: string,
>         input: {
>         },
>         name: string,
>         signature?: string,
>         type?: tool_call
>       } | {
>         content: string,
>         is_error: boolean,
>         tool_call_id: string,
>         type?: tool_return
>       } | {
>         is_native: boolean,
>         reasoning: string,
>         signature?: string,
>         type?: reasoning
>       } | {
>         data: string,
>         type?: redacted_reasoning
>       } | {
>         signature?: string,
>         type?: omitted_reasoning
>       }
>     )[] | string,
>     role: user | system | assistant,
>     batch_item_id?: string,
>     group_id?: string,
>     name?: string,
>     otid?: string,
>     sender_id?: string,
>     type?: message
>   } | {
>     approval_request_id?: string,
>     approvals?: (
>       {
>         approve: boolean,
>         tool_call_id: string,
>         reason?: string,
>         type?: approval
>       } | {
>         status: success | error,
>         tool_call_id: string,
>         tool_return: (
>           {
>             text: string,
>             signature?: string,
>             type?: text
>           } | {
>             source: {
>               url: string,
>               type?: url
>             } | {
>               data: string,
>               media_type: string,
>               detail?: string,
>               type?: base64
>             } | {
>               file_id: string,
>               data?: string,
>               detail?: string,
>               media_type?: string,
>               type?: letta
>             },
>             type?: image
>           }
>         )[] | string,
>         stderr?: string[],
>         stdout?: string[],
>         type?: tool
>       }
>     )[],
>     approve?: boolean,
>     group_id?: string,
>     otid?: string,
>     reason?: string,
>     type?: approval
>   } | {
>     content: (
>       {
>         text: string,
>         signature?: string,
>         type?: text
>       } | {
>         source: {
>           url: string,
>           type?: url
>         } | {
>           data: string,
>           media_type: string,
>           detail?: string,
>           type?: base64
>         } | {
>           file_id: string,
>           data?: string,
>           detail?: string,
>           media_type?: string,
>           type?: letta
>         },
>         type?: image
>       } | {
>         id: string,
>         input: {
>         },
>         name: string,
>         signature?: string,
>         type?: tool_call
>       } | {
>         content: string,
>         is_error: boolean,
>         tool_call_id: string,
>         type?: tool_return
>       } | {
>         is_native: boolean,
>         reasoning: string,
>         signature?: string,
>         type?: reasoning
>       } | {
>         data: string,
>         type?: redacted_reasoning
>       } | {
>         signature?: string,
>         type?: omitted_reasoning
>       }
>     )[] | string,
>     role: user | system | assistant,
>     batch_item_id?: string,
>     group_id?: string,
>     name?: string,
>     otid?: string,
>     sender_id?: string,
>     type?: message
>   }
> )[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `messages` | `object[] \| null` | No | The messages returned by the agent. |
| `stop_reason` | `object \| null` | No | The stop reason from Letta indicating why agent loop stopped execution. |
| `usage` | `object \| null` | No | The usage statistics of the agent. |
| `logprobs` | `object \| null` | No | Log probabilities of the output tokens from the last LLM call. Only present if return\_logprobs was enabled. |
| `turns` | `object[] \| null` | No | Token data for all LLM generations in multi-turn agent interaction. Includes token IDs and logprobs for each assistant turn, plus tool result content. Only present if return\_token\_ids was enabled. Used for RL training with loss masking. |

> [accordion] messages full type
>
> ```ts theme={null}
> (
>   {
>     id?: string | null,
>     content?: string | null,
>     date?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     content?: (
>       {
>         text?: string | null,
>         signature?: string | null,
>         type?: string | null
>       } | {
>         source?: {
>           url?: string | null,
>           type?: string | null
>         } | {
>           data?: string | null,
>           media_type?: string | null,
>           detail?: string | null,
>           type?: string | null
>         } | {
>           file_id?: string | null,
>           data?: string | null,
>           detail?: string | null,
>           media_type?: string | null,
>           type?: string | null
>         } | null,
>         type?: string | null
>       }
>     )[] | string | null,
>     date?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     reasoning?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     signature?: string | null,
>     source?: string | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     state?: string | null,
>     hidden_reasoning?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     tool_call?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null,
>     tool_calls?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     }[] | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     status?: string | null,
>     tool_call_id?: string | null,
>     tool_return?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     stderr?: string[] | null,
>     stdout?: string[] | null,
>     step_id?: string | null,
>     tool_returns?: {
>       status?: string | null,
>       tool_call_id?: string | null,
>       tool_return?: (
>         {
>           text?: string | null,
>           signature?: string | null,
>           type?: string | null
>         } | {
>           source?: {
>             url?: string | null,
>             type?: string | null
>           } | {
>             data?: string | null,
>             media_type?: string | null,
>             detail?: string | null,
>             type?: string | null
>           } | {
>             file_id?: string | null,
>             data?: string | null,
>             detail?: string | null,
>             media_type?: string | null,
>             type?: string | null
>           } | null,
>           type?: string | null
>         }
>       )[] | string | null,
>       stderr?: string[] | null,
>       stdout?: string[] | null,
>       type?: string | null
>     }[] | null
>   } | {
>     id?: string | null,
>     content?: {
>       text?: string | null,
>       signature?: string | null,
>       type?: string | null
>     }[] | string | null,
>     date?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     tool_call?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null,
>     tool_calls?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     }[] | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     approval_request_id?: string | null,
>     approvals?: (
>       {
>         approve?: boolean | null,
>         tool_call_id?: string | null,
>         reason?: string | null,
>         type?: string | null
>       } | {
>         status?: string | null,
>         tool_call_id?: string | null,
>         tool_return?: (
>           {
>             text?: string | null,
>             signature?: string | null,
>             type?: string | null
>           } | {
>             source?: {
>               url?: string | null,
>               type?: string | null
>             } | {
>               data?: string | null,
>               media_type?: string | null,
>               detail?: string | null,
>               type?: string | null
>             } | {
>               file_id?: string | null,
>               data?: string | null,
>               detail?: string | null,
>               media_type?: string | null,
>               type?: string | null
>             } | null,
>             type?: string | null
>           }
>         )[] | string | null,
>         stderr?: string[] | null,
>         stdout?: string[] | null,
>         type?: string | null
>       }
>     )[] | null,
>     approve?: boolean | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     reason?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     summary?: string | null,
>     compaction_stats?: {
>       context_window?: number | null,
>       messages_count_after?: number | null,
>       messages_count_before?: number | null,
>       trigger?: string | null,
>       context_tokens_after?: number | null,
>       context_tokens_before?: number | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     event_data?: {
>     } | null,
>     event_type?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   }
> )[] | null
> ```

> [accordion] stop\_reason full type
>
> ```ts theme={null}
> {
>   stop_reason?: string | string | string | string | string | string | string | string | string | string | string | string | string | null,
>   message_type?: string | null
> } | null
> ```

> [accordion] usage full type
>
> ```ts theme={null}
> {
>   cache_write_tokens?: number | null,
>   cached_input_tokens?: number | null,
>   completion_tokens?: number | null,
>   context_tokens?: number | null,
>   message_type?: string | null,
>   prompt_tokens?: number | null,
>   reasoning_tokens?: number | null,
>   run_ids?: string[] | null,
>   step_count?: number | null,
>   total_tokens?: number | null
> } | null
> ```

> [accordion] logprobs full type
>
> ```ts theme={null}
> {
>   content?: {
>     token?: string | null,
>     logprob?: number | null,
>     top_logprobs?: {
>       token?: string | null,
>       logprob?: number | null,
>       bytes?: number[] | null
>     }[] | null,
>     bytes?: number[] | null
>   }[] | null,
>   refusal?: {
>     token?: string | null,
>     logprob?: number | null,
>     top_logprobs?: {
>       token?: string | null,
>       logprob?: number | null,
>       bytes?: number[] | null
>     }[] | null,
>     bytes?: number[] | null
>   }[] | null
> } | null
> ```

> [accordion] turns full type
>
> ```ts theme={null}
> {
>   role?: string | null,
>   content?: string | null,
>   output_ids?: number[] | null,
>   output_token_logprobs?: any[][] | null,
>   tool_name?: string | null
> }[] | null
> ```

***

### messages.createAsync

`agents.messages.createAsync`

Create Message Async. Asynchronously process a user message and return a run object. The actual processing happens in the background, and the status can be checked using the run ID. This is "asynchronous" in the sense that it's a background run and explicitly must be fetched by the run ID. Runs the agent in the background and returns a run to poll with runs.get. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.agents.messages.createAsync({ agent_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `assistant_message_tool_kwarg` | `string` | No | The name of the message argument in the designated message tool. Still supported for legacy agent types, but deprecated for letta\_v1\_agent onward. |
| `assistant_message_tool_name` | `string` | No | The name of the designated message tool. Still supported for legacy agent types, but deprecated for letta\_v1\_agent onward. |
| `callback_url` | `string` | No | Optional callback URL to POST to when the job completes |
| `client_skills` | `object[]` | No | Client-side skills available in the environment. These are rendered in the system prompt's available skills section alongside agent-scoped skills from MemFS. |
| `client_tools` | `object[]` | No | Client-side tools that the agent can call. When the agent calls a client-side tool, execution pauses and returns control to the client to execute the tool and provide the result via a ToolReturn. |
| `enable_thinking` | `string` | No | If set to True, enables reasoning before responses or tool calls from the agent. |
| `include_compaction_messages` | `boolean` | No | If True, compaction events emit structured `SummaryMessage` and `EventMessage` types. If False (default), compaction messages are not included in the response. |
| `include_return_message_types` | `(system_message \| user_message \| assistant_message \| reasoning_message \| hidden_reasoning_message \| tool_call_message \| tool_return_message \| approval_request_message \| approval_response_message \| summary_message \| event_message)[]` | No | Only return specified message types in the response. If `None` (default) returns all messages. |
| `input` | `string \| object[] \| object` | No | Syntactic sugar for a single user message. Equivalent to messages=\[\{'role': 'user', 'content': input}]. |
| `max_steps` | `number` | No | Maximum number of steps the agent should take to process the request. |
| `messages` | `object[]` | No | The messages to be sent to the agent. |
| `override_model` | `string` | No | Model handle to use for this request instead of the agent's default model. This allows sending a message to a different model without changing the agent's configuration. |
| `override_system` | `string` | No | Optional per-request system prompt override. When set, this is passed directly to the underlying LLM request and bypasses the persisted/compiled system message for that request. |
| `return_logprobs` | `boolean` | No | If True, returns log probabilities of the output tokens in the response. Useful for RL training. Only supported for OpenAI-compatible providers (including SGLang). |
| `return_token_ids` | `boolean` | No | If True, returns token IDs and logprobs for ALL LLM generations in the agent step, not just the last one. Uses SGLang native /generate endpoint. Returns 'turns' field with TurnTokenData for each assistant/tool turn. Required for proper multi-turn RL training with loss masking. |
| `top_logprobs` | `number` | No | Number of most likely tokens to return at each position (0-20). Requires return\_logprobs=True. |
| `use_assistant_message` | `boolean` | No | Whether the server should parse specific tool call arguments (default `send_message`) as `AssistantMessage` objects. Still supported for legacy agent types, but deprecated for letta\_v1\_agent onward. |

> [accordion] client\_skills full type
>
> ```ts theme={null}
> {
>   description: string,
>   location: string,
>   name: string
> }[]
> ```

> [accordion] client\_tools full type
>
> ```ts theme={null}
> {
>   name: string,
>   description?: string,
>   parameters?: {
>   }
> }[]
> ```

> [accordion] input full type
>
> ```ts theme={null}
> string | (
>   {
>     text: string,
>     signature?: string,
>     type?: text
>   } | {
>     source: {
>       url: string,
>       type?: url
>     } | {
>       data: string,
>       media_type: string,
>       detail?: string,
>       type?: base64
>     } | {
>       file_id: string,
>       data?: string,
>       detail?: string,
>       media_type?: string,
>       type?: letta
>     },
>     type?: image
>   } | {
>     id: string,
>     input: {
>     },
>     name: string,
>     signature?: string,
>     type?: tool_call
>   } | {
>     content: string,
>     is_error: boolean,
>     tool_call_id: string,
>     type?: tool_return
>   } | {
>     is_native: boolean,
>     reasoning: string,
>     signature?: string,
>     type?: reasoning
>   } | {
>     data: string,
>     type?: redacted_reasoning
>   } | {
>     signature?: string,
>     type?: omitted_reasoning
>   } | {
>     id: string,
>     summary: {
>       index: number,
>       text: string
>     }[],
>     encrypted_content?: string,
>     type?: summarized_reasoning
>   }
> )[] | {
>   source: {
>     url: string,
>     type?: url
>   } | {
>     data: string,
>     media_type: string,
>     detail?: string,
>     type?: base64
>   } | {
>     file_id: string,
>     data?: string,
>     detail?: string,
>     media_type?: string,
>     type?: letta
>   },
>   type?: image
> } | {
>   id: string,
>   input: {
>   },
>   name: string,
>   signature?: string,
>   type?: tool_call
> }
> ```

> [accordion] messages full type
>
> ```ts theme={null}
> (
>   {
>     content: (
>       {
>         text: string,
>         signature?: string,
>         type?: text
>       } | {
>         source: {
>           url: string,
>           type?: url
>         } | {
>           data: string,
>           media_type: string,
>           detail?: string,
>           type?: base64
>         } | {
>           file_id: string,
>           data?: string,
>           detail?: string,
>           media_type?: string,
>           type?: letta
>         },
>         type?: image
>       } | {
>         id: string,
>         input: {
>         },
>         name: string,
>         signature?: string,
>         type?: tool_call
>       } | {
>         content: string,
>         is_error: boolean,
>         tool_call_id: string,
>         type?: tool_return
>       } | {
>         is_native: boolean,
>         reasoning: string,
>         signature?: string,
>         type?: reasoning
>       } | {
>         data: string,
>         type?: redacted_reasoning
>       } | {
>         signature?: string,
>         type?: omitted_reasoning
>       }
>     )[] | string,
>     role: user | system | assistant,
>     batch_item_id?: string,
>     group_id?: string,
>     name?: string,
>     otid?: string,
>     sender_id?: string,
>     type?: message
>   } | {
>     approval_request_id?: string,
>     approvals?: (
>       {
>         approve: boolean,
>         tool_call_id: string,
>         reason?: string,
>         type?: approval
>       } | {
>         status: success | error,
>         tool_call_id: string,
>         tool_return: (
>           {
>             text: string,
>             signature?: string,
>             type?: text
>           } | {
>             source: {
>               url: string,
>               type?: url
>             } | {
>               data: string,
>               media_type: string,
>               detail?: string,
>               type?: base64
>             } | {
>               file_id: string,
>               data?: string,
>               detail?: string,
>               media_type?: string,
>               type?: letta
>             },
>             type?: image
>           }
>         )[] | string,
>         stderr?: string[],
>         stdout?: string[],
>         type?: tool
>       }
>     )[],
>     approve?: boolean,
>     group_id?: string,
>     otid?: string,
>     reason?: string,
>     type?: approval
>   } | {
>     content: (
>       {
>         text: string,
>         signature?: string,
>         type?: text
>       } | {
>         source: {
>           url: string,
>           type?: url
>         } | {
>           data: string,
>           media_type: string,
>           detail?: string,
>           type?: base64
>         } | {
>           file_id: string,
>           data?: string,
>           detail?: string,
>           media_type?: string,
>           type?: letta
>         },
>         type?: image
>       } | {
>         id: string,
>         input: {
>         },
>         name: string,
>         signature?: string,
>         type?: tool_call
>       } | {
>         content: string,
>         is_error: boolean,
>         tool_call_id: string,
>         type?: tool_return
>       } | {
>         is_native: boolean,
>         reasoning: string,
>         signature?: string,
>         type?: reasoning
>       } | {
>         data: string,
>         type?: redacted_reasoning
>       } | {
>         signature?: string,
>         type?: omitted_reasoning
>       }
>     )[] | string,
>     role: user | system | assistant,
>     batch_item_id?: string,
>     group_id?: string,
>     name?: string,
>     otid?: string,
>     sender_id?: string,
>     type?: message
>   }
> )[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The human-friendly ID of the Run |
| `agent_id` | `string \| null` | No | The unique identifier of the agent associated with the run. |
| `background` | `boolean \| null` | No | Whether the run was created in background mode. |
| `base_template_id` | `string \| null` | No | The base template ID that the run belongs to. |
| `callback_error` | `string \| null` | No | Optional error message from attempting to POST the callback endpoint. |
| `callback_sent_at` | `string \| null` | No | Timestamp when the callback was last attempted. |
| `callback_status_code` | `number \| null` | No | HTTP status code returned by the callback endpoint. |
| `callback_url` | `string \| null` | No | If set, POST to this URL when the run completes. |
| `completed_at` | `string \| null` | No | The timestamp when the run was completed. |
| `conversation_id` | `string \| null` | No | The unique identifier of the conversation associated with the run. |
| `created_at` | `string \| null` | No | The timestamp when the run was created. |
| `metadata` | `object \| null` | No | Additional metadata for the run. |
| `request_config` | `object \| null` | No | The request configuration for the run. |
| `status` | `string \| null` | No | The current status of the run. |
| `stop_reason` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | — |
| `total_duration_ns` | `number \| null` | No | Total run duration in nanoseconds |
| `ttft_ns` | `number \| null` | No | Time to first token for a run in nanoseconds |

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] request\_config full type
>
> ```ts theme={null}
> {
>   assistant_message_tool_kwarg?: string | null,
>   assistant_message_tool_name?: string | null,
>   include_return_message_types?: (string | string | string | string | string | string | string | string | string | string | string)[] | null,
>   use_assistant_message?: boolean | null
> } | null
> ```

***

### messages.list

`agents.messages.list`

List Messages. Retrieve message history for an agent.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.agents.messages.list({ agent_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `after` | `string` | No | Cursor for pagination (message ID). Returns results relative to this ID in the specified sort order. Expected format: 'message-\<uuid4>' |
| `assistant_message_tool_kwarg` | `string` | No | The name of the message argument. |
| `assistant_message_tool_name` | `string` | No | The name of the designated message tool. |
| `before` | `string` | No | Cursor for pagination (message ID). Returns results relative to this ID in the specified sort order. Expected format: 'message-\<uuid4>' |
| `conversation_id` | `string` | No | Conversation ID to filter messages by. |
| `group_id` | `string` | No | Group ID to filter messages by. |
| `include_err` | `boolean` | No | Whether to include error messages and error statuses. For debugging purposes only. |
| `include_return_message_types` | `(system_message \| user_message \| assistant_message \| reasoning_message \| hidden_reasoning_message \| tool_call_message \| tool_return_message \| approval_request_message \| approval_response_message \| summary_message \| event_message)[]` | No | Message types to include in response. When null, all message types are returned. |
| `limit` | `number` | No | Maximum number of messages to return |
| `order` | `asc \| desc` | No | Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first |
| `order_by` | `created_at` | No | Field to sort by |
| `use_assistant_message` | `boolean` | No | Whether to use assistant messages |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> (
>   {
>     id?: string | null,
>     content?: string | null,
>     date?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     content?: (
>       {
>         text?: string | null,
>         signature?: string | null,
>         type?: string | null
>       } | {
>         source?: {
>           url?: string | null,
>           type?: string | null
>         } | {
>           data?: string | null,
>           media_type?: string | null,
>           detail?: string | null,
>           type?: string | null
>         } | {
>           file_id?: string | null,
>           data?: string | null,
>           detail?: string | null,
>           media_type?: string | null,
>           type?: string | null
>         } | null,
>         type?: string | null
>       }
>     )[] | string | null,
>     date?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     reasoning?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     signature?: string | null,
>     source?: string | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     state?: string | null,
>     hidden_reasoning?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     tool_call?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null,
>     tool_calls?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     }[] | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     status?: string | null,
>     tool_call_id?: string | null,
>     tool_return?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     stderr?: string[] | null,
>     stdout?: string[] | null,
>     step_id?: string | null,
>     tool_returns?: {
>       status?: string | null,
>       tool_call_id?: string | null,
>       tool_return?: (
>         {
>           text?: string | null,
>           signature?: string | null,
>           type?: string | null
>         } | {
>           source?: {
>             url?: string | null,
>             type?: string | null
>           } | {
>             data?: string | null,
>             media_type?: string | null,
>             detail?: string | null,
>             type?: string | null
>           } | {
>             file_id?: string | null,
>             data?: string | null,
>             detail?: string | null,
>             media_type?: string | null,
>             type?: string | null
>           } | null,
>           type?: string | null
>         }
>       )[] | string | null,
>       stderr?: string[] | null,
>       stdout?: string[] | null,
>       type?: string | null
>     }[] | null
>   } | {
>     id?: string | null,
>     content?: {
>       text?: string | null,
>       signature?: string | null,
>       type?: string | null
>     }[] | string | null,
>     date?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     tool_call?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null,
>     tool_calls?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     }[] | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     approval_request_id?: string | null,
>     approvals?: (
>       {
>         approve?: boolean | null,
>         tool_call_id?: string | null,
>         reason?: string | null,
>         type?: string | null
>       } | {
>         status?: string | null,
>         tool_call_id?: string | null,
>         tool_return?: (
>           {
>             text?: string | null,
>             signature?: string | null,
>             type?: string | null
>           } | {
>             source?: {
>               url?: string | null,
>               type?: string | null
>             } | {
>               data?: string | null,
>               media_type?: string | null,
>               detail?: string | null,
>               type?: string | null
>             } | {
>               file_id?: string | null,
>               data?: string | null,
>               detail?: string | null,
>               media_type?: string | null,
>               type?: string | null
>             } | null,
>             type?: string | null
>           }
>         )[] | string | null,
>         stderr?: string[] | null,
>         stdout?: string[] | null,
>         type?: string | null
>       }
>     )[] | null,
>     approve?: boolean | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     reason?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     summary?: string | null,
>     compaction_stats?: {
>       context_window?: number | null,
>       messages_count_after?: number | null,
>       messages_count_before?: number | null,
>       trigger?: string | null,
>       context_tokens_after?: number | null,
>       context_tokens_before?: number | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     event_data?: {
>     } | null,
>     event_type?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   }
> )[]
> ```

***

### messages.reset

`agents.messages.reset`

Reset Messages. Resets the messages for an agent. Clears the agent's message history.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.agents.messages.reset({ agent_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `add_default_initial_messages` | `boolean` | No | If true, adds the default initial messages after resetting. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The id of the agent. Assigned by the database. |
| `agent_type` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | Enum to represent the type of agent. |
| `blocks` | `object[] \| null` | No | The memory blocks used by the agent. |
| `llm_config` | `object \| null` | No | Configuration for Language Model (LLM) connection and generation parameters. .. deprecated:: LLMConfig is deprecated and should not be used as an input or return type in API calls. Use the schemas in letta.schemas.model (ModelSettings, OpenAIModelSettings, etc.) instead. For conversion, use the \_to\_model() method or Model.\_from\_llm\_config() method. |
| `memory` | `object \| null` | No | Deprecated: Use `blocks` field instead. The in-context memory of the agent. |
| `name` | `string \| null` | No | The name of the agent. |
| `sources` | `object[] \| null` | No | Deprecated: Use `folders` field instead. The sources used by the agent. |
| `system` | `string \| null` | No | The system prompt used by the agent. |
| `tags` | `string[] \| null` | No | The tags associated with the agent. |
| `tools` | `object[] \| null` | No | The tools used by the agent. |
| `base_template_id` | `string \| null` | No | The base template id of the agent. |
| `compaction_settings` | `object \| null` | No | Configuration for conversation compaction / summarization. Per-model settings (temperature, max tokens, etc.) are derived from the default configuration for that handle. |
| `created_at` | `string \| null` | No | The timestamp when the object was created. |
| `created_by_id` | `string \| null` | No | The id of the user that made this object. |
| `deployment_id` | `string \| null` | No | The id of the deployment. |
| `description` | `string \| null` | No | The description of the agent. |
| `embedding` | `string \| null` | No | The embedding model handle used by the agent (format: provider/model-name). |
| `embedding_config` | `object \| null` | No | Configuration for embedding model connection and processing parameters. |
| `enable_sleeptime` | `boolean \| null` | No | If set to True, memory management will move to a background agent thread. |
| `entity_id` | `string \| null` | No | The id of the entity within the template. |
| `hidden` | `boolean \| null` | No | If set to True, the agent will be hidden. |
| `identities` | `object[] \| null` | No | The identities associated with this agent. |
| `identity_ids` | `string[] \| null` | No | Deprecated: Use `identities` field instead. The ids of the identities associated with this agent. |
| `last_run_completion` | `string \| null` | No | The timestamp when the agent last completed a run. |
| `last_run_duration_ms` | `number \| null` | No | The duration in milliseconds of the agent's last run. |
| `last_stop_reason` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | — |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this object. |
| `managed_group` | `object \| null` | No | The multi-agent group that this agent manages |
| `max_files_open` | `number \| null` | No | Maximum number of files that can be open at once for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `message_buffer_autoclear` | `boolean \| null` | No | If set to True, the agent will not remember previous messages (though the agent will still retain state via core memory blocks and archival/recall memory). Not recommended unless you have an advanced use case. |
| `message_ids` | `string[] \| null` | No | The ids of the messages in the agent's in-context memory. |
| `metadata` | `object \| null` | No | The metadata of the agent. |
| `model` | `string \| null` | No | The model handle used by the agent (format: provider/model-name). |
| `model_settings` | `object \| null` | No | The model settings used by the agent. |
| `multi_agent_group` | `object \| null` | No | Deprecated: Use `managed_group` field instead. The multi-agent group that this agent manages. |
| `pending_approval` | `object \| null` | No | A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution). Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional\[str]): The name of the sender of the message tool\_call (ToolCall): The tool call |
| `per_file_view_window_char_limit` | `number \| null` | No | The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `project_id` | `string \| null` | No | The id of the project the agent belongs to. |
| `response_format` | `object \| null` | No | The response format used by the agent |
| `secrets` | `object[] \| null` | No | The environment variables for tool execution specific to this agent. |
| `template_id` | `string \| null` | No | The id of the template the agent belongs to. |
| `timezone` | `string \| null` | No | The timezone of the agent (IANA format). |
| `tool_exec_environment_variables` | `object[] \| null` | No | Deprecated: use `secrets` field instead. |
| `tool_rules` | `object[] \| null` | No | The list of tool rules. |
| `updated_at` | `string \| null` | No | The timestamp when the object was last updated. |

> [accordion] blocks full type
>
> ```ts theme={null}
> {
>   value?: string | null,
>   id?: string | null,
>   base_template_id?: string | null,
>   created_by_id?: string | null,
>   deployment_id?: string | null,
>   description?: string | null,
>   entity_id?: string | null,
>   hidden?: boolean | null,
>   is_template?: boolean | null,
>   label?: string | null,
>   last_updated_by_id?: string | null,
>   limit?: number | null,
>   metadata?: {
>   } | null,
>   preserve_on_migration?: boolean | null,
>   project_id?: string | null,
>   read_only?: boolean | null,
>   tags?: string[] | null,
>   template_id?: string | null,
>   template_name?: string | null
> }[] | null
> ```

> [accordion] llm\_config full type
>
> ```ts theme={null}
> {
>   context_window?: number | null,
>   model?: string | null,
>   model_endpoint_type?: string | null,
>   compatibility_type?: string | null,
>   display_name?: string | null,
>   effort?: string | null,
>   enable_reasoner?: boolean | null,
>   frequency_penalty?: number | null,
>   handle?: string | null,
>   max_reasoning_tokens?: number | null,
>   max_tokens?: number | null,
>   model_endpoint?: string | null,
>   model_wrapper?: string | null,
>   parallel_tool_calls?: boolean | null,
>   provider_category?: string | string | null,
>   provider_name?: string | null,
>   put_inner_thoughts_in_kwargs?: boolean | null,
>   reasoning_effort?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   return_logprobs?: boolean | null,
>   return_token_ids?: boolean | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   tier?: string | null,
>   tool_call_parser?: string | null,
>   top_logprobs?: number | null,
>   verbosity?: string | null
> } | null
> ```

> [accordion] memory full type
>
> ```ts theme={null}
> {
>   blocks?: {
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   agent_type?: string | string | string | string | string | string | string | string | string | string | null,
>   file_blocks?: {
>     file_id?: string | null,
>     is_open?: boolean | null,
>     source_id?: string | null,
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_accessed_at?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   git_enabled?: boolean | null,
>   prompt_template?: string | null
> } | null
> ```

> [accordion] sources full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   name?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   instructions?: string | null,
>   last_updated_by_id?: string | null,
>   metadata?: {
>   } | null,
>   updated_at?: string | null,
>   vector_db_provider?: string | string | string | null
> }[] | null
> ```

> [accordion] tools full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   args_json_schema?: {
>   } | null,
>   created_by_id?: string | null,
>   default_requires_approval?: boolean | null,
>   description?: string | null,
>   enable_parallel_execution?: boolean | null,
>   json_schema?: {
>   } | null,
>   last_updated_by_id?: string | null,
>   metadata_?: {
>   } | null,
>   name?: string | null,
>   npm_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   pip_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   project_id?: string | null,
>   return_char_limit?: number | null,
>   source_code?: string | null,
>   source_type?: string | null,
>   tags?: string[] | null,
>   tool_type?: string | string | string | string | string | string | string | string | string | string | string | null
> }[] | null
> ```

> [accordion] compaction\_settings full type
>
> ```ts theme={null}
> {
>   clip_chars?: number | null,
>   mode?: string | null,
>   model?: string | null,
>   model_settings?: {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking?: {
>       clear_thinking?: boolean | null,
>       type?: string | null
>     } | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     temperature?: number | null
>   } | null,
>   prompt?: string | null,
>   prompt_acknowledgement?: boolean | null,
>   sliding_window_percentage?: number | null
> } | null
> ```

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim?: number | null,
>   embedding_endpoint_type?: string | null,
>   embedding_model?: string | null,
>   azure_deployment?: string | null,
>   azure_endpoint?: string | null,
>   azure_version?: string | null,
>   batch_size?: number | null,
>   embedding_chunk_size?: number | null,
>   embedding_endpoint?: string | null,
>   handle?: string | null
> } | null
> ```

> [accordion] identities full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   block_ids?: string[] | null,
>   identifier_key?: string | null,
>   identity_type?: string | null,
>   name?: string | null,
>   project_id?: string | null,
>   properties?: {
>     key?: string | null,
>     type?: string | null,
>     value?: string | number | boolean | {
>     } | null
>   }[] | null
> }[] | null
> ```

> [accordion] managed\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] model\_settings full type
>
> ```ts theme={null}
> {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking?: {
>     clear_thinking?: boolean | null,
>     type?: string | null
>   } | null
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   temperature?: number | null
> } | null
> ```

> [accordion] multi\_agent\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] pending\_approval full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   date?: string | null,
>   tool_call?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null,
>   is_err?: boolean | null,
>   message_type?: string | null,
>   name?: string | null,
>   otid?: string | null,
>   run_id?: string | null,
>   sender_id?: string | null,
>   seq_id?: number | null,
>   step_id?: string | null,
>   tool_calls?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   }[] | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null
> } | null
> ```

> [accordion] response\_format full type
>
> ```ts theme={null}
> {
>   type?: string | null
> } | {
>   json_schema?: {
>   } | null,
>   type?: string | null
> } | {
>   type?: string | null
> } | null
> ```

> [accordion] secrets full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_exec\_environment\_variables full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_rules full type
>
> ```ts theme={null}
> (
>   {
>     children?: string[] | null,
>     tool_name?: string | null,
>     child_arg_nodes?: {
>       name?: string | null,
>       args?: {
>       } | null
>     }[] | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     args?: {
>     } | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     child_output_mapping?: Record<string, string> | null,
>     tool_name?: string | null,
>     default_child?: string | null,
>     prompt_template?: string | null,
>     require_output_mapping?: boolean | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     max_count_limit?: number | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     children?: string[] | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   }
> )[] | null
> ```

***

### messages.stream

`agents.messages.stream`

Create Message Streaming. Process a user message and return the agent's response. Deprecated: Use the POST /\{agent\_id}/messages endpoint with streaming=true in the request body instead. Note: Sending multiple concurrent requests to the same agent can lead to undefined behavior. Runs the agent like agents.messages.create and returns the server-sent events as text.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.agents.messages.stream({ agent_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `assistant_message_tool_kwarg` | `string` | No | The name of the message argument in the designated message tool. Still supported for legacy agent types, but deprecated for letta\_v1\_agent onward. |
| `assistant_message_tool_name` | `string` | No | The name of the designated message tool. Still supported for legacy agent types, but deprecated for letta\_v1\_agent onward. |
| `background` | `boolean` | No | Whether to process the request in the background (only used when streaming=true). |
| `client_skills` | `object[]` | No | Client-side skills available in the environment. These are rendered in the system prompt's available skills section alongside agent-scoped skills from MemFS. |
| `client_tools` | `object[]` | No | Client-side tools that the agent can call. When the agent calls a client-side tool, execution pauses and returns control to the client to execute the tool and provide the result via a ToolReturn. |
| `enable_thinking` | `string` | No | If set to True, enables reasoning before responses or tool calls from the agent. |
| `include_compaction_messages` | `boolean` | No | If True, compaction events emit structured `SummaryMessage` and `EventMessage` types. If False (default), compaction messages are not included in the response. |
| `include_pings` | `boolean` | No | Whether to include periodic keepalive ping messages in the stream to prevent connection timeouts (only used when streaming=true). |
| `include_return_message_types` | `(system_message \| user_message \| assistant_message \| reasoning_message \| hidden_reasoning_message \| tool_call_message \| tool_return_message \| approval_request_message \| approval_response_message \| summary_message \| event_message)[]` | No | Only return specified message types in the response. If `None` (default) returns all messages. |
| `input` | `string \| object[] \| object` | No | Syntactic sugar for a single user message. Equivalent to messages=\[\{'role': 'user', 'content': input}]. |
| `max_steps` | `number` | No | Maximum number of steps the agent should take to process the request. |
| `messages` | `object[]` | No | The messages to be sent to the agent. |
| `override_model` | `string` | No | Model handle to use for this request instead of the agent's default model. This allows sending a message to a different model without changing the agent's configuration. |
| `override_system` | `string` | No | Optional per-request system prompt override. When set, this is passed directly to the underlying LLM request and bypasses the persisted/compiled system message for that request. |
| `return_logprobs` | `boolean` | No | If True, returns log probabilities of the output tokens in the response. Useful for RL training. Only supported for OpenAI-compatible providers (including SGLang). |
| `return_token_ids` | `boolean` | No | If True, returns token IDs and logprobs for ALL LLM generations in the agent step, not just the last one. Uses SGLang native /generate endpoint. Returns 'turns' field with TurnTokenData for each assistant/tool turn. Required for proper multi-turn RL training with loss masking. |
| `stream_tokens` | `boolean` | No | Flag to determine if individual tokens should be streamed, rather than streaming per step (only used when streaming=true). |
| `streaming` | `boolean` | No | If True, returns a streaming response (Server-Sent Events). If False (default), returns a complete response. |
| `top_logprobs` | `number` | No | Number of most likely tokens to return at each position (0-20). Requires return\_logprobs=True. |
| `use_assistant_message` | `boolean` | No | Whether the server should parse specific tool call arguments (default `send_message`) as `AssistantMessage` objects. Still supported for legacy agent types, but deprecated for letta\_v1\_agent onward. |

> [accordion] client\_skills full type
>
> ```ts theme={null}
> {
>   description: string,
>   location: string,
>   name: string
> }[]
> ```

> [accordion] client\_tools full type
>
> ```ts theme={null}
> {
>   name: string,
>   description?: string,
>   parameters?: {
>   }
> }[]
> ```

> [accordion] input full type
>
> ```ts theme={null}
> string | (
>   {
>     text: string,
>     signature?: string,
>     type?: text
>   } | {
>     source: {
>       url: string,
>       type?: url
>     } | {
>       data: string,
>       media_type: string,
>       detail?: string,
>       type?: base64
>     } | {
>       file_id: string,
>       data?: string,
>       detail?: string,
>       media_type?: string,
>       type?: letta
>     },
>     type?: image
>   } | {
>     id: string,
>     input: {
>     },
>     name: string,
>     signature?: string,
>     type?: tool_call
>   } | {
>     content: string,
>     is_error: boolean,
>     tool_call_id: string,
>     type?: tool_return
>   } | {
>     is_native: boolean,
>     reasoning: string,
>     signature?: string,
>     type?: reasoning
>   } | {
>     data: string,
>     type?: redacted_reasoning
>   } | {
>     signature?: string,
>     type?: omitted_reasoning
>   } | {
>     id: string,
>     summary: {
>       index: number,
>       text: string
>     }[],
>     encrypted_content?: string,
>     type?: summarized_reasoning
>   }
> )[] | {
>   source: {
>     url: string,
>     type?: url
>   } | {
>     data: string,
>     media_type: string,
>     detail?: string,
>     type?: base64
>   } | {
>     file_id: string,
>     data?: string,
>     detail?: string,
>     media_type?: string,
>     type?: letta
>   },
>   type?: image
> } | {
>   id: string,
>   input: {
>   },
>   name: string,
>   signature?: string,
>   type?: tool_call
> }
> ```

> [accordion] messages full type
>
> ```ts theme={null}
> (
>   {
>     content: (
>       {
>         text: string,
>         signature?: string,
>         type?: text
>       } | {
>         source: {
>           url: string,
>           type?: url
>         } | {
>           data: string,
>           media_type: string,
>           detail?: string,
>           type?: base64
>         } | {
>           file_id: string,
>           data?: string,
>           detail?: string,
>           media_type?: string,
>           type?: letta
>         },
>         type?: image
>       } | {
>         id: string,
>         input: {
>         },
>         name: string,
>         signature?: string,
>         type?: tool_call
>       } | {
>         content: string,
>         is_error: boolean,
>         tool_call_id: string,
>         type?: tool_return
>       } | {
>         is_native: boolean,
>         reasoning: string,
>         signature?: string,
>         type?: reasoning
>       } | {
>         data: string,
>         type?: redacted_reasoning
>       } | {
>         signature?: string,
>         type?: omitted_reasoning
>       }
>     )[] | string,
>     role: user | system | assistant,
>     batch_item_id?: string,
>     group_id?: string,
>     name?: string,
>     otid?: string,
>     sender_id?: string,
>     type?: message
>   } | {
>     approval_request_id?: string,
>     approvals?: (
>       {
>         approve: boolean,
>         tool_call_id: string,
>         reason?: string,
>         type?: approval
>       } | {
>         status: success | error,
>         tool_call_id: string,
>         tool_return: (
>           {
>             text: string,
>             signature?: string,
>             type?: text
>           } | {
>             source: {
>               url: string,
>               type?: url
>             } | {
>               data: string,
>               media_type: string,
>               detail?: string,
>               type?: base64
>             } | {
>               file_id: string,
>               data?: string,
>               detail?: string,
>               media_type?: string,
>               type?: letta
>             },
>             type?: image
>           }
>         )[] | string,
>         stderr?: string[],
>         stdout?: string[],
>         type?: tool
>       }
>     )[],
>     approve?: boolean,
>     group_id?: string,
>     otid?: string,
>     reason?: string,
>     type?: approval
>   } | {
>     content: (
>       {
>         text: string,
>         signature?: string,
>         type?: text
>       } | {
>         source: {
>           url: string,
>           type?: url
>         } | {
>           data: string,
>           media_type: string,
>           detail?: string,
>           type?: base64
>         } | {
>           file_id: string,
>           data?: string,
>           detail?: string,
>           media_type?: string,
>           type?: letta
>         },
>         type?: image
>       } | {
>         id: string,
>         input: {
>         },
>         name: string,
>         signature?: string,
>         type?: tool_call
>       } | {
>         content: string,
>         is_error: boolean,
>         tool_call_id: string,
>         type?: tool_return
>       } | {
>         is_native: boolean,
>         reasoning: string,
>         signature?: string,
>         type?: reasoning
>       } | {
>         data: string,
>         type?: redacted_reasoning
>       } | {
>         signature?: string,
>         type?: omitted_reasoning
>       }
>     )[] | string,
>     role: user | system | assistant,
>     batch_item_id?: string,
>     group_id?: string,
>     name?: string,
>     otid?: string,
>     sender_id?: string,
>     type?: message
>   }
> )[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `text` | `string` | Yes | The response body as text. |
| `contentType` | `string \| null` | Yes | The content type Letta answered with. |

***

### passages.create

`agents.passages.create`

Create Passage. Insert a memory into an agent's archival memory store.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.agents.passages.create({ agent_id: 'example', text: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `text` | `string` | Yes | Text to write to archival memory. |
| `created_at` | `string` | No | Optional timestamp for the memory (defaults to current UTC time). |
| `tags` | `string[]` | No | Optional list of tags to attach to the memory. |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   embedding?: number[] | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   text?: string | null,
>   id?: string | null,
>   archive_id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   file_id?: string | null,
>   file_name?: string | null,
>   is_deleted?: boolean | null,
>   last_updated_by_id?: string | null,
>   metadata?: {
>   } | null,
>   source_id?: string | null,
>   tags?: string[] | null,
>   updated_at?: string | null
> }[]
> ```

***

### passages.delete

`agents.passages.delete`

Delete Passage. Delete a memory from an agent's archival memory store. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.agents.passages.delete({ agent_id: 'example', memory_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `memory_id` | `string` | Yes | — |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### passages.list

`agents.passages.list`

List Passages. Retrieve the memories in an agent's archival memory store (paginated query).

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.agents.passages.list({ agent_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `after` | `string` | No | Unique ID of the memory to start the query range at. |
| `ascending` | `boolean` | No | Whether to sort passages oldest to newest (True, default) or newest to oldest (False) |
| `before` | `string` | No | Unique ID of the memory to end the query range at. |
| `limit` | `number` | No | How many results to include in the response. |
| `search` | `string` | No | Search passages by text |

**Output:** `object[] \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   embedding?: number[] | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   text?: string | null,
>   id?: string | null,
>   archive_id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   file_id?: string | null,
>   file_name?: string | null,
>   is_deleted?: boolean | null,
>   last_updated_by_id?: string | null,
>   metadata?: {
>   } | null,
>   source_id?: string | null,
>   tags?: string[] | null,
>   updated_at?: string | null
> }[] | {
>   embedding?: number[] | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   text?: string | null,
>   id?: string | null,
>   archive_id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   file_id?: string | null,
>   file_name?: string | null,
>   is_deleted?: boolean | null,
>   last_updated_by_id?: string | null,
>   metadata?: {
>   } | null,
>   source_id?: string | null,
>   tags?: string[] | null,
>   updated_at?: string | null
> }
> ```

***

### passages.search

`agents.passages.search`

Search Archival Memory. Search archival memory using semantic (embedding-based) search with optional temporal filtering. This endpoint allows manual triggering of archival memory searches, enabling users to query an agent's archival memory store directly via the API.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.agents.passages.search({ agent_id: 'example', query: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `query` | `string` | Yes | String to search for using semantic similarity |
| `end_datetime` | `string` | No | Filter results to passages created before this datetime |
| `start_datetime` | `string` | No | Filter results to passages created after this datetime |
| `tag_match_mode` | `any \| all` | No | How to match tags - 'any' to match passages with any of the tags, 'all' to match only passages with all tags |
| `tags` | `string[]` | No | Optional list of tags to filter search results |
| `top_k` | `number` | No | Maximum number of results to return. Uses system default if not specified |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `count` | `number \| null` | No | Total number of results returned |
| `results` | `object[] \| null` | No | List of search results matching the query |

> [accordion] results full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   content?: string | null,
>   timestamp?: string | null,
>   tags?: string[] | null
> }[] | null
> ```

***

### recompile

`agents.recompile`

Recompile Agent. Manually trigger system prompt recompilation for an agent.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.agents.recompile({ agent_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `dry_run` | `boolean` | No | If True, do not persist changes; still returns the compiled system prompt. |
| `update_timestamp` | `boolean` | No | If True, update the in-context memory last edit timestamp embedded in the system prompt. |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### schedule.create

`agents.schedule.create`

Schedule Agent Message. Schedule a message to be sent by the agent at a specified time or on a recurring basis.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.agents.schedule.create({
	agent_id: 'example',
	messages: [{ content: 'example', role: 'user' }],
	schedule: { scheduled_at: 1 },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | — |
| `messages` | `object[]` | Yes | — |
| `schedule` | `object` | Yes | — |
| `callback_url` | `string` | No | — |
| `include_return_message_types` | `(system_message \| user_message \| assistant_message \| reasoning_message \| hidden_reasoning_message \| tool_call_message \| tool_return_message \| approval_request_message \| approval_response_message)[]` | No | — |
| `max_steps` | `number` | No | — |

> [accordion] messages full type
>
> ```ts theme={null}
> {
>   content: ((
>     {
>       text: string,
>       signature?: string,
>       type?: text
>     } | {
>       source: {
>         data: string,
>         media_type: string,
>         detail?: string,
>         type?: base64
>       },
>       type: image
>     }
>   )[] | string)[] | string,
>   role: user | assistant | system,
>   name?: string,
>   otid?: string,
>   sender_id?: string,
>   type?: message
> }[]
> ```

> [accordion] schedule full type
>
> ```ts theme={null}
> {
>   scheduled_at: number,
>   type?: one-time
> } | {
>   cron_expression: string,
>   type: recurring
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `next_scheduled_at` | `string \| null` | No | — |

***

### schedule.delete

`agents.schedule.delete`

Delete Scheduled Agent Message. Delete a scheduled message by its ID for a specific agent. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.agents.schedule.delete({ agent_id: 'example', scheduled_message_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | — |
| `scheduled_message_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |

***

### schedule.get

`agents.schedule.get`

Retrieve Scheduled Agent Message. Retrieve a scheduled message by its ID for a specific agent.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.agents.schedule.get({ agent_id: 'example', scheduled_message_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | — |
| `scheduled_message_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `agent_id` | `string \| null` | No | — |
| `message` | `object \| null` | No | — |
| `next_scheduled_time` | `string \| null` | No | — |
| `schedule` | `object \| null` | No | — |

> [accordion] message full type
>
> ```ts theme={null}
> {
>   messages?: {
>     content?: ((
>       {
>         text?: string | null,
>         signature?: string | null,
>         type?: string | null
>       } | {
>         source?: {
>           data?: string | null,
>           media_type?: string | null,
>           detail?: string | null,
>           type?: string | null
>         } | null,
>         type?: string | null
>       }
>     )[] | string)[] | string | null,
>     role?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     sender_id?: string | null,
>     type?: string | null
>   }[] | null,
>   callback_url?: string | null,
>   include_return_message_types?: string[] | null,
>   max_steps?: number | null
> } | null
> ```

> [accordion] schedule full type
>
> ```ts theme={null}
> {
>   scheduled_at?: number | null,
>   type?: string | null
> } | {
>   cron_expression?: string | null,
>   type?: string | null
> } | null
> ```

***

### schedule.list

`agents.schedule.list`

List Scheduled Agent Messages. List all scheduled messages for a specific agent.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.agents.schedule.list({ agent_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | — |
| `after` | `string` | No | — |
| `limit` | `string` | No | — |

**Output:** `object[] \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   has_next_page?: boolean | null,
>   scheduled_messages?: {
>     id?: string | null,
>     agent_id?: string | null,
>     message?: {
>       messages?: {
>         content?: ((
>           {
>             text?: string | null,
>             signature?: string | null,
>             type?: string | null
>           } | {
>             source?: {
>               data?: string | null,
>               media_type?: string | null,
>               detail?: string | null,
>               type?: string | null
>             } | null,
>             type?: string | null
>           }
>         )[] | string)[] | string | null,
>         role?: string | null,
>         name?: string | null,
>         otid?: string | null,
>         sender_id?: string | null,
>         type?: string | null
>       }[] | null,
>       callback_url?: string | null,
>       include_return_message_types?: string[] | null,
>       max_steps?: number | null
>     } | null,
>     next_scheduled_time?: string | null,
>     schedule?: {
>       scheduled_at?: number | null,
>       type?: string | null
>     } | {
>       cron_expression?: string | null,
>       type?: string | null
>     } | null
>   }[] | null
> }[] | {
>   has_next_page?: boolean | null,
>   scheduled_messages?: {
>     id?: string | null,
>     agent_id?: string | null,
>     message?: {
>       messages?: {
>         content?: ((
>           {
>             text?: string | null,
>             signature?: string | null,
>             type?: string | null
>           } | {
>             source?: {
>               data?: string | null,
>               media_type?: string | null,
>               detail?: string | null,
>               type?: string | null
>             } | null,
>             type?: string | null
>           }
>         )[] | string)[] | string | null,
>         role?: string | null,
>         name?: string | null,
>         otid?: string | null,
>         sender_id?: string | null,
>         type?: string | null
>       }[] | null,
>       callback_url?: string | null,
>       include_return_message_types?: string[] | null,
>       max_steps?: number | null
>     } | null,
>     next_scheduled_time?: string | null,
>     schedule?: {
>       scheduled_at?: number | null,
>       type?: string | null
>     } | {
>       cron_expression?: string | null,
>       type?: string | null
>     } | null
>   }[] | null
> }
> ```

***

### tools.attach

`agents.tools.attach`

Attach Tool To Agent. Attach a tool to an agent.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.agents.tools.attach({ agent_id: 'example', tool_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `tool_id` | `string` | Yes | The ID of the tool in the format 'tool-\<uuid4>' |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The id of the agent. Assigned by the database. |
| `agent_type` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | Enum to represent the type of agent. |
| `blocks` | `object[] \| null` | No | The memory blocks used by the agent. |
| `llm_config` | `object \| null` | No | Configuration for Language Model (LLM) connection and generation parameters. .. deprecated:: LLMConfig is deprecated and should not be used as an input or return type in API calls. Use the schemas in letta.schemas.model (ModelSettings, OpenAIModelSettings, etc.) instead. For conversion, use the \_to\_model() method or Model.\_from\_llm\_config() method. |
| `memory` | `object \| null` | No | Deprecated: Use `blocks` field instead. The in-context memory of the agent. |
| `name` | `string \| null` | No | The name of the agent. |
| `sources` | `object[] \| null` | No | Deprecated: Use `folders` field instead. The sources used by the agent. |
| `system` | `string \| null` | No | The system prompt used by the agent. |
| `tags` | `string[] \| null` | No | The tags associated with the agent. |
| `tools` | `object[] \| null` | No | The tools used by the agent. |
| `base_template_id` | `string \| null` | No | The base template id of the agent. |
| `compaction_settings` | `object \| null` | No | Configuration for conversation compaction / summarization. Per-model settings (temperature, max tokens, etc.) are derived from the default configuration for that handle. |
| `created_at` | `string \| null` | No | The timestamp when the object was created. |
| `created_by_id` | `string \| null` | No | The id of the user that made this object. |
| `deployment_id` | `string \| null` | No | The id of the deployment. |
| `description` | `string \| null` | No | The description of the agent. |
| `embedding` | `string \| null` | No | The embedding model handle used by the agent (format: provider/model-name). |
| `embedding_config` | `object \| null` | No | Configuration for embedding model connection and processing parameters. |
| `enable_sleeptime` | `boolean \| null` | No | If set to True, memory management will move to a background agent thread. |
| `entity_id` | `string \| null` | No | The id of the entity within the template. |
| `hidden` | `boolean \| null` | No | If set to True, the agent will be hidden. |
| `identities` | `object[] \| null` | No | The identities associated with this agent. |
| `identity_ids` | `string[] \| null` | No | Deprecated: Use `identities` field instead. The ids of the identities associated with this agent. |
| `last_run_completion` | `string \| null` | No | The timestamp when the agent last completed a run. |
| `last_run_duration_ms` | `number \| null` | No | The duration in milliseconds of the agent's last run. |
| `last_stop_reason` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | — |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this object. |
| `managed_group` | `object \| null` | No | The multi-agent group that this agent manages |
| `max_files_open` | `number \| null` | No | Maximum number of files that can be open at once for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `message_buffer_autoclear` | `boolean \| null` | No | If set to True, the agent will not remember previous messages (though the agent will still retain state via core memory blocks and archival/recall memory). Not recommended unless you have an advanced use case. |
| `message_ids` | `string[] \| null` | No | The ids of the messages in the agent's in-context memory. |
| `metadata` | `object \| null` | No | The metadata of the agent. |
| `model` | `string \| null` | No | The model handle used by the agent (format: provider/model-name). |
| `model_settings` | `object \| null` | No | The model settings used by the agent. |
| `multi_agent_group` | `object \| null` | No | Deprecated: Use `managed_group` field instead. The multi-agent group that this agent manages. |
| `pending_approval` | `object \| null` | No | A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution). Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional\[str]): The name of the sender of the message tool\_call (ToolCall): The tool call |
| `per_file_view_window_char_limit` | `number \| null` | No | The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `project_id` | `string \| null` | No | The id of the project the agent belongs to. |
| `response_format` | `object \| null` | No | The response format used by the agent |
| `secrets` | `object[] \| null` | No | The environment variables for tool execution specific to this agent. |
| `template_id` | `string \| null` | No | The id of the template the agent belongs to. |
| `timezone` | `string \| null` | No | The timezone of the agent (IANA format). |
| `tool_exec_environment_variables` | `object[] \| null` | No | Deprecated: use `secrets` field instead. |
| `tool_rules` | `object[] \| null` | No | The list of tool rules. |
| `updated_at` | `string \| null` | No | The timestamp when the object was last updated. |

> [accordion] blocks full type
>
> ```ts theme={null}
> {
>   value?: string | null,
>   id?: string | null,
>   base_template_id?: string | null,
>   created_by_id?: string | null,
>   deployment_id?: string | null,
>   description?: string | null,
>   entity_id?: string | null,
>   hidden?: boolean | null,
>   is_template?: boolean | null,
>   label?: string | null,
>   last_updated_by_id?: string | null,
>   limit?: number | null,
>   metadata?: {
>   } | null,
>   preserve_on_migration?: boolean | null,
>   project_id?: string | null,
>   read_only?: boolean | null,
>   tags?: string[] | null,
>   template_id?: string | null,
>   template_name?: string | null
> }[] | null
> ```

> [accordion] llm\_config full type
>
> ```ts theme={null}
> {
>   context_window?: number | null,
>   model?: string | null,
>   model_endpoint_type?: string | null,
>   compatibility_type?: string | null,
>   display_name?: string | null,
>   effort?: string | null,
>   enable_reasoner?: boolean | null,
>   frequency_penalty?: number | null,
>   handle?: string | null,
>   max_reasoning_tokens?: number | null,
>   max_tokens?: number | null,
>   model_endpoint?: string | null,
>   model_wrapper?: string | null,
>   parallel_tool_calls?: boolean | null,
>   provider_category?: string | string | null,
>   provider_name?: string | null,
>   put_inner_thoughts_in_kwargs?: boolean | null,
>   reasoning_effort?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   return_logprobs?: boolean | null,
>   return_token_ids?: boolean | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   tier?: string | null,
>   tool_call_parser?: string | null,
>   top_logprobs?: number | null,
>   verbosity?: string | null
> } | null
> ```

> [accordion] memory full type
>
> ```ts theme={null}
> {
>   blocks?: {
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   agent_type?: string | string | string | string | string | string | string | string | string | string | null,
>   file_blocks?: {
>     file_id?: string | null,
>     is_open?: boolean | null,
>     source_id?: string | null,
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_accessed_at?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   git_enabled?: boolean | null,
>   prompt_template?: string | null
> } | null
> ```

> [accordion] sources full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   name?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   instructions?: string | null,
>   last_updated_by_id?: string | null,
>   metadata?: {
>   } | null,
>   updated_at?: string | null,
>   vector_db_provider?: string | string | string | null
> }[] | null
> ```

> [accordion] tools full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   args_json_schema?: {
>   } | null,
>   created_by_id?: string | null,
>   default_requires_approval?: boolean | null,
>   description?: string | null,
>   enable_parallel_execution?: boolean | null,
>   json_schema?: {
>   } | null,
>   last_updated_by_id?: string | null,
>   metadata_?: {
>   } | null,
>   name?: string | null,
>   npm_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   pip_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   project_id?: string | null,
>   return_char_limit?: number | null,
>   source_code?: string | null,
>   source_type?: string | null,
>   tags?: string[] | null,
>   tool_type?: string | string | string | string | string | string | string | string | string | string | string | null
> }[] | null
> ```

> [accordion] compaction\_settings full type
>
> ```ts theme={null}
> {
>   clip_chars?: number | null,
>   mode?: string | null,
>   model?: string | null,
>   model_settings?: {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking?: {
>       clear_thinking?: boolean | null,
>       type?: string | null
>     } | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     temperature?: number | null
>   } | null,
>   prompt?: string | null,
>   prompt_acknowledgement?: boolean | null,
>   sliding_window_percentage?: number | null
> } | null
> ```

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim?: number | null,
>   embedding_endpoint_type?: string | null,
>   embedding_model?: string | null,
>   azure_deployment?: string | null,
>   azure_endpoint?: string | null,
>   azure_version?: string | null,
>   batch_size?: number | null,
>   embedding_chunk_size?: number | null,
>   embedding_endpoint?: string | null,
>   handle?: string | null
> } | null
> ```

> [accordion] identities full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   block_ids?: string[] | null,
>   identifier_key?: string | null,
>   identity_type?: string | null,
>   name?: string | null,
>   project_id?: string | null,
>   properties?: {
>     key?: string | null,
>     type?: string | null,
>     value?: string | number | boolean | {
>     } | null
>   }[] | null
> }[] | null
> ```

> [accordion] managed\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] model\_settings full type
>
> ```ts theme={null}
> {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking?: {
>     clear_thinking?: boolean | null,
>     type?: string | null
>   } | null
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   temperature?: number | null
> } | null
> ```

> [accordion] multi\_agent\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] pending\_approval full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   date?: string | null,
>   tool_call?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null,
>   is_err?: boolean | null,
>   message_type?: string | null,
>   name?: string | null,
>   otid?: string | null,
>   run_id?: string | null,
>   sender_id?: string | null,
>   seq_id?: number | null,
>   step_id?: string | null,
>   tool_calls?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   }[] | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null
> } | null
> ```

> [accordion] response\_format full type
>
> ```ts theme={null}
> {
>   type?: string | null
> } | {
>   json_schema?: {
>   } | null,
>   type?: string | null
> } | {
>   type?: string | null
> } | null
> ```

> [accordion] secrets full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_exec\_environment\_variables full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_rules full type
>
> ```ts theme={null}
> (
>   {
>     children?: string[] | null,
>     tool_name?: string | null,
>     child_arg_nodes?: {
>       name?: string | null,
>       args?: {
>       } | null
>     }[] | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     args?: {
>     } | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     child_output_mapping?: Record<string, string> | null,
>     tool_name?: string | null,
>     default_child?: string | null,
>     prompt_template?: string | null,
>     require_output_mapping?: boolean | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     max_count_limit?: number | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     children?: string[] | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   }
> )[] | null
> ```

***

### tools.detach

`agents.tools.detach`

Detach Tool From Agent. Detach a tool from an agent.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.agents.tools.detach({ agent_id: 'example', tool_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `tool_id` | `string` | Yes | The ID of the tool in the format 'tool-\<uuid4>' |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The id of the agent. Assigned by the database. |
| `agent_type` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | Enum to represent the type of agent. |
| `blocks` | `object[] \| null` | No | The memory blocks used by the agent. |
| `llm_config` | `object \| null` | No | Configuration for Language Model (LLM) connection and generation parameters. .. deprecated:: LLMConfig is deprecated and should not be used as an input or return type in API calls. Use the schemas in letta.schemas.model (ModelSettings, OpenAIModelSettings, etc.) instead. For conversion, use the \_to\_model() method or Model.\_from\_llm\_config() method. |
| `memory` | `object \| null` | No | Deprecated: Use `blocks` field instead. The in-context memory of the agent. |
| `name` | `string \| null` | No | The name of the agent. |
| `sources` | `object[] \| null` | No | Deprecated: Use `folders` field instead. The sources used by the agent. |
| `system` | `string \| null` | No | The system prompt used by the agent. |
| `tags` | `string[] \| null` | No | The tags associated with the agent. |
| `tools` | `object[] \| null` | No | The tools used by the agent. |
| `base_template_id` | `string \| null` | No | The base template id of the agent. |
| `compaction_settings` | `object \| null` | No | Configuration for conversation compaction / summarization. Per-model settings (temperature, max tokens, etc.) are derived from the default configuration for that handle. |
| `created_at` | `string \| null` | No | The timestamp when the object was created. |
| `created_by_id` | `string \| null` | No | The id of the user that made this object. |
| `deployment_id` | `string \| null` | No | The id of the deployment. |
| `description` | `string \| null` | No | The description of the agent. |
| `embedding` | `string \| null` | No | The embedding model handle used by the agent (format: provider/model-name). |
| `embedding_config` | `object \| null` | No | Configuration for embedding model connection and processing parameters. |
| `enable_sleeptime` | `boolean \| null` | No | If set to True, memory management will move to a background agent thread. |
| `entity_id` | `string \| null` | No | The id of the entity within the template. |
| `hidden` | `boolean \| null` | No | If set to True, the agent will be hidden. |
| `identities` | `object[] \| null` | No | The identities associated with this agent. |
| `identity_ids` | `string[] \| null` | No | Deprecated: Use `identities` field instead. The ids of the identities associated with this agent. |
| `last_run_completion` | `string \| null` | No | The timestamp when the agent last completed a run. |
| `last_run_duration_ms` | `number \| null` | No | The duration in milliseconds of the agent's last run. |
| `last_stop_reason` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | — |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this object. |
| `managed_group` | `object \| null` | No | The multi-agent group that this agent manages |
| `max_files_open` | `number \| null` | No | Maximum number of files that can be open at once for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `message_buffer_autoclear` | `boolean \| null` | No | If set to True, the agent will not remember previous messages (though the agent will still retain state via core memory blocks and archival/recall memory). Not recommended unless you have an advanced use case. |
| `message_ids` | `string[] \| null` | No | The ids of the messages in the agent's in-context memory. |
| `metadata` | `object \| null` | No | The metadata of the agent. |
| `model` | `string \| null` | No | The model handle used by the agent (format: provider/model-name). |
| `model_settings` | `object \| null` | No | The model settings used by the agent. |
| `multi_agent_group` | `object \| null` | No | Deprecated: Use `managed_group` field instead. The multi-agent group that this agent manages. |
| `pending_approval` | `object \| null` | No | A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution). Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional\[str]): The name of the sender of the message tool\_call (ToolCall): The tool call |
| `per_file_view_window_char_limit` | `number \| null` | No | The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `project_id` | `string \| null` | No | The id of the project the agent belongs to. |
| `response_format` | `object \| null` | No | The response format used by the agent |
| `secrets` | `object[] \| null` | No | The environment variables for tool execution specific to this agent. |
| `template_id` | `string \| null` | No | The id of the template the agent belongs to. |
| `timezone` | `string \| null` | No | The timezone of the agent (IANA format). |
| `tool_exec_environment_variables` | `object[] \| null` | No | Deprecated: use `secrets` field instead. |
| `tool_rules` | `object[] \| null` | No | The list of tool rules. |
| `updated_at` | `string \| null` | No | The timestamp when the object was last updated. |

> [accordion] blocks full type
>
> ```ts theme={null}
> {
>   value?: string | null,
>   id?: string | null,
>   base_template_id?: string | null,
>   created_by_id?: string | null,
>   deployment_id?: string | null,
>   description?: string | null,
>   entity_id?: string | null,
>   hidden?: boolean | null,
>   is_template?: boolean | null,
>   label?: string | null,
>   last_updated_by_id?: string | null,
>   limit?: number | null,
>   metadata?: {
>   } | null,
>   preserve_on_migration?: boolean | null,
>   project_id?: string | null,
>   read_only?: boolean | null,
>   tags?: string[] | null,
>   template_id?: string | null,
>   template_name?: string | null
> }[] | null
> ```

> [accordion] llm\_config full type
>
> ```ts theme={null}
> {
>   context_window?: number | null,
>   model?: string | null,
>   model_endpoint_type?: string | null,
>   compatibility_type?: string | null,
>   display_name?: string | null,
>   effort?: string | null,
>   enable_reasoner?: boolean | null,
>   frequency_penalty?: number | null,
>   handle?: string | null,
>   max_reasoning_tokens?: number | null,
>   max_tokens?: number | null,
>   model_endpoint?: string | null,
>   model_wrapper?: string | null,
>   parallel_tool_calls?: boolean | null,
>   provider_category?: string | string | null,
>   provider_name?: string | null,
>   put_inner_thoughts_in_kwargs?: boolean | null,
>   reasoning_effort?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   return_logprobs?: boolean | null,
>   return_token_ids?: boolean | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   tier?: string | null,
>   tool_call_parser?: string | null,
>   top_logprobs?: number | null,
>   verbosity?: string | null
> } | null
> ```

> [accordion] memory full type
>
> ```ts theme={null}
> {
>   blocks?: {
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   agent_type?: string | string | string | string | string | string | string | string | string | string | null,
>   file_blocks?: {
>     file_id?: string | null,
>     is_open?: boolean | null,
>     source_id?: string | null,
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_accessed_at?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   git_enabled?: boolean | null,
>   prompt_template?: string | null
> } | null
> ```

> [accordion] sources full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   name?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   instructions?: string | null,
>   last_updated_by_id?: string | null,
>   metadata?: {
>   } | null,
>   updated_at?: string | null,
>   vector_db_provider?: string | string | string | null
> }[] | null
> ```

> [accordion] tools full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   args_json_schema?: {
>   } | null,
>   created_by_id?: string | null,
>   default_requires_approval?: boolean | null,
>   description?: string | null,
>   enable_parallel_execution?: boolean | null,
>   json_schema?: {
>   } | null,
>   last_updated_by_id?: string | null,
>   metadata_?: {
>   } | null,
>   name?: string | null,
>   npm_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   pip_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   project_id?: string | null,
>   return_char_limit?: number | null,
>   source_code?: string | null,
>   source_type?: string | null,
>   tags?: string[] | null,
>   tool_type?: string | string | string | string | string | string | string | string | string | string | string | null
> }[] | null
> ```

> [accordion] compaction\_settings full type
>
> ```ts theme={null}
> {
>   clip_chars?: number | null,
>   mode?: string | null,
>   model?: string | null,
>   model_settings?: {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking?: {
>       clear_thinking?: boolean | null,
>       type?: string | null
>     } | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     temperature?: number | null
>   } | null,
>   prompt?: string | null,
>   prompt_acknowledgement?: boolean | null,
>   sliding_window_percentage?: number | null
> } | null
> ```

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim?: number | null,
>   embedding_endpoint_type?: string | null,
>   embedding_model?: string | null,
>   azure_deployment?: string | null,
>   azure_endpoint?: string | null,
>   azure_version?: string | null,
>   batch_size?: number | null,
>   embedding_chunk_size?: number | null,
>   embedding_endpoint?: string | null,
>   handle?: string | null
> } | null
> ```

> [accordion] identities full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   block_ids?: string[] | null,
>   identifier_key?: string | null,
>   identity_type?: string | null,
>   name?: string | null,
>   project_id?: string | null,
>   properties?: {
>     key?: string | null,
>     type?: string | null,
>     value?: string | number | boolean | {
>     } | null
>   }[] | null
> }[] | null
> ```

> [accordion] managed\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] model\_settings full type
>
> ```ts theme={null}
> {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking?: {
>     clear_thinking?: boolean | null,
>     type?: string | null
>   } | null
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   temperature?: number | null
> } | null
> ```

> [accordion] multi\_agent\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] pending\_approval full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   date?: string | null,
>   tool_call?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null,
>   is_err?: boolean | null,
>   message_type?: string | null,
>   name?: string | null,
>   otid?: string | null,
>   run_id?: string | null,
>   sender_id?: string | null,
>   seq_id?: number | null,
>   step_id?: string | null,
>   tool_calls?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   }[] | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null
> } | null
> ```

> [accordion] response\_format full type
>
> ```ts theme={null}
> {
>   type?: string | null
> } | {
>   json_schema?: {
>   } | null,
>   type?: string | null
> } | {
>   type?: string | null
> } | null
> ```

> [accordion] secrets full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_exec\_environment\_variables full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_rules full type
>
> ```ts theme={null}
> (
>   {
>     children?: string[] | null,
>     tool_name?: string | null,
>     child_arg_nodes?: {
>       name?: string | null,
>       args?: {
>       } | null
>     }[] | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     args?: {
>     } | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     child_output_mapping?: Record<string, string> | null,
>     tool_name?: string | null,
>     default_child?: string | null,
>     prompt_template?: string | null,
>     require_output_mapping?: boolean | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     max_count_limit?: number | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     children?: string[] | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   }
> )[] | null
> ```

***

### tools.list

`agents.tools.list`

List Tools For Agent. Get tools from an existing agent.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.agents.tools.list({ agent_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `after` | `string` | No | Cursor for pagination (tool ID). Returns results relative to this ID in the specified sort order. Expected format: 'tool-\<uuid4>' |
| `before` | `string` | No | Cursor for pagination (tool ID). Returns results relative to this ID in the specified sort order. Expected format: 'tool-\<uuid4>' |
| `limit` | `number` | No | Maximum number of tools to return |
| `order` | `asc \| desc` | No | Sort order for tools by creation time. 'asc' for oldest first, 'desc' for newest first |
| `order_by` | `created_at` | No | Field to sort by |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   args_json_schema?: {
>   } | null,
>   created_by_id?: string | null,
>   default_requires_approval?: boolean | null,
>   description?: string | null,
>   enable_parallel_execution?: boolean | null,
>   json_schema?: {
>   } | null,
>   last_updated_by_id?: string | null,
>   metadata_?: {
>   } | null,
>   name?: string | null,
>   npm_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   pip_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   project_id?: string | null,
>   return_char_limit?: number | null,
>   source_code?: string | null,
>   source_type?: string | null,
>   tags?: string[] | null,
>   tool_type?: string | string | string | string | string | string | string | string | string | string | string | null
> }[]
> ```

***

### tools.run

`agents.tools.run`

Run Tool For Agent. Trigger a tool by name on a specific agent, providing the necessary arguments. This endpoint executes a tool that is attached to the agent, using the agent's state and environment variables for execution context. Executes the tool with the arguments given; side effects are the tool’s own.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.agents.tools.run({ agent_id: 'example', tool_name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `tool_name` | `string` | Yes | — |
| `args` | `object` | No | Arguments to pass to the tool |

> [accordion] args full type
>
> ```ts theme={null}
> {
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | The status of the tool execution and return object |
| `agent_state` | `object \| null` | No | Representation of an agent's state. This is the state of the agent at a given time, and is persisted in the DB backend. The state has all the information needed to recreate a persisted agent. |
| `func_return` | `any \| null` | No | The function return object |
| `sandbox_config_fingerprint` | `string \| null` | No | The fingerprint of the config for the sandbox |
| `stderr` | `string[] \| null` | No | Captured stderr from the function invocation |
| `stdout` | `string[] \| null` | No | Captured stdout (prints, logs) from function invocation |

> [accordion] agent\_state full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_type?: string | string | string | string | string | string | string | string | string | null,
>   blocks?: {
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   llm_config?: {
>     context_window?: number | null,
>     model?: string | null,
>     model_endpoint_type?: string | null,
>     compatibility_type?: string | null,
>     display_name?: string | null,
>     effort?: string | null,
>     enable_reasoner?: boolean | null,
>     frequency_penalty?: number | null,
>     handle?: string | null,
>     max_reasoning_tokens?: number | null,
>     max_tokens?: number | null,
>     model_endpoint?: string | null,
>     model_wrapper?: string | null,
>     parallel_tool_calls?: boolean | null,
>     provider_category?: string | string | null,
>     provider_name?: string | null,
>     put_inner_thoughts_in_kwargs?: boolean | null,
>     reasoning_effort?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     return_logprobs?: boolean | null,
>     return_token_ids?: boolean | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     tier?: string | null,
>     tool_call_parser?: string | null,
>     top_logprobs?: number | null,
>     verbosity?: string | null
>   } | null,
>   memory?: {
>     blocks?: {
>       value?: string | null,
>       id?: string | null,
>       base_template_id?: string | null,
>       created_by_id?: string | null,
>       deployment_id?: string | null,
>       description?: string | null,
>       entity_id?: string | null,
>       hidden?: boolean | null,
>       is_template?: boolean | null,
>       label?: string | null,
>       last_updated_by_id?: string | null,
>       limit?: number | null,
>       metadata?: {
>       } | null,
>       preserve_on_migration?: boolean | null,
>       project_id?: string | null,
>       read_only?: boolean | null,
>       tags?: string[] | null,
>       template_id?: string | null,
>       template_name?: string | null
>     }[] | null,
>     agent_type?: string | string | string | string | string | string | string | string | string | string | null,
>     file_blocks?: {
>       file_id?: string | null,
>       is_open?: boolean | null,
>       source_id?: string | null,
>       value?: string | null,
>       id?: string | null,
>       base_template_id?: string | null,
>       created_by_id?: string | null,
>       deployment_id?: string | null,
>       description?: string | null,
>       entity_id?: string | null,
>       hidden?: boolean | null,
>       is_template?: boolean | null,
>       label?: string | null,
>       last_accessed_at?: string | null,
>       last_updated_by_id?: string | null,
>       limit?: number | null,
>       metadata?: {
>       } | null,
>       preserve_on_migration?: boolean | null,
>       project_id?: string | null,
>       read_only?: boolean | null,
>       tags?: string[] | null,
>       template_id?: string | null,
>       template_name?: string | null
>     }[] | null,
>     git_enabled?: boolean | null,
>     prompt_template?: string | null
>   } | null,
>   name?: string | null,
>   sources?: {
>     id?: string | null,
>     embedding_config?: {
>       embedding_dim?: number | null,
>       embedding_endpoint_type?: string | null,
>       embedding_model?: string | null,
>       azure_deployment?: string | null,
>       azure_endpoint?: string | null,
>       azure_version?: string | null,
>       batch_size?: number | null,
>       embedding_chunk_size?: number | null,
>       embedding_endpoint?: string | null,
>       handle?: string | null
>     } | null,
>     name?: string | null,
>     created_at?: string | null,
>     created_by_id?: string | null,
>     description?: string | null,
>     instructions?: string | null,
>     last_updated_by_id?: string | null,
>     metadata?: {
>     } | null,
>     updated_at?: string | null,
>     vector_db_provider?: string | string | string | null
>   }[] | null,
>   system?: string | null,
>   tags?: string[] | null,
>   tools?: {
>     id?: string | null,
>     args_json_schema?: {
>     } | null,
>     created_by_id?: string | null,
>     default_requires_approval?: boolean | null,
>     description?: string | null,
>     enable_parallel_execution?: boolean | null,
>     json_schema?: {
>     } | null,
>     last_updated_by_id?: string | null,
>     metadata_?: {
>     } | null,
>     name?: string | null,
>     npm_requirements?: {
>       name?: string | null,
>       version?: string | null
>     }[] | null,
>     pip_requirements?: {
>       name?: string | null,
>       version?: string | null
>     }[] | null,
>     project_id?: string | null,
>     return_char_limit?: number | null,
>     source_code?: string | null,
>     source_type?: string | null,
>     tags?: string[] | null,
>     tool_type?: string | string | string | string | string | string | string | string | string | string | string | null
>   }[] | null,
>   base_template_id?: string | null,
>   compaction_settings?: {
>     clip_chars?: number | null,
>     mode?: string | null,
>     model?: string | null,
>     model_settings?: {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       reasoning?: {
>         reasoning_effort?: string | null
>       } | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       strict?: boolean | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       reasoning?: {
>         reasoning_effort?: string | null
>       } | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       strict?: boolean | null,
>       temperature?: number | null
>     } | {
>       effort?: string | null,
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       strict?: boolean | null,
>       temperature?: number | null,
>       thinking?: {
>         budget_tokens?: number | null,
>         type?: string | null
>       } | null,
>       verbosity?: string | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_schema?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null,
>       thinking_config?: {
>         include_thoughts?: boolean | null,
>         thinking_budget?: number | null
>       } | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_schema?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null,
>       thinking_config?: {
>         include_thoughts?: boolean | null,
>         thinking_budget?: number | null
>       } | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       strict?: boolean | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null,
>       thinking?: {
>         clear_thinking?: boolean | null,
>         type?: string | null
>       } | null
>     } | {
>       effort?: string | null,
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       strict?: boolean | null,
>       temperature?: number | null,
>       thinking?: {
>         budget_tokens?: number | null,
>         type?: string | null
>       } | null,
>       verbosity?: string | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       reasoning?: {
>         reasoning_effort?: string | null
>       } | null,
>       temperature?: number | null
>     } | null,
>     prompt?: string | null,
>     prompt_acknowledgement?: boolean | null,
>     sliding_window_percentage?: number | null
>   } | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   deployment_id?: string | null,
>   description?: string | null,
>   embedding?: string | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   enable_sleeptime?: boolean | null,
>   entity_id?: string | null,
>   hidden?: boolean | null,
>   identities?: {
>     id?: string | null,
>     agent_ids?: string[] | null,
>     block_ids?: string[] | null,
>     identifier_key?: string | null,
>     identity_type?: string | null,
>     name?: string | null,
>     project_id?: string | null,
>     properties?: {
>       key?: string | null,
>       type?: string | null,
>       value?: string | number | boolean | {
>       } | null
>     }[] | null
>   }[] | null,
>   identity_ids?: string[] | null,
>   last_run_completion?: string | null,
>   last_run_duration_ms?: number | null,
>   last_stop_reason?: string | string | string | string | string | string | string | string | string | string | string | string | string | null,
>   last_updated_by_id?: string | null,
>   managed_group?: {
>     id?: string | null,
>     agent_ids?: string[] | null,
>     description?: string | null,
>     manager_type?: string | null,
>     base_template_id?: string | null,
>     deployment_id?: string | null,
>     hidden?: boolean | null,
>     last_processed_message_id?: string | null,
>     manager_agent_id?: string | null,
>     max_message_buffer_length?: number | null,
>     max_turns?: number | null,
>     min_message_buffer_length?: number | null,
>     project_id?: string | null,
>     shared_block_ids?: string[] | null,
>     sleeptime_agent_frequency?: number | null,
>     template_id?: string | null,
>     termination_token?: string | null,
>     turns_counter?: number | null
>   } | null,
>   max_files_open?: number | null,
>   message_buffer_autoclear?: boolean | null,
>   message_ids?: string[] | null,
>   metadata?: {
>   } | null,
>   model?: string | null,
>   model_settings?: {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking?: {
>       clear_thinking?: boolean | null,
>       type?: string | null
>     } | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     temperature?: number | null
>   } | null,
>   multi_agent_group?: {
>     id?: string | null,
>     agent_ids?: string[] | null,
>     description?: string | null,
>     manager_type?: string | null,
>     base_template_id?: string | null,
>     deployment_id?: string | null,
>     hidden?: boolean | null,
>     last_processed_message_id?: string | null,
>     manager_agent_id?: string | null,
>     max_message_buffer_length?: number | null,
>     max_turns?: number | null,
>     min_message_buffer_length?: number | null,
>     project_id?: string | null,
>     shared_block_ids?: string[] | null,
>     sleeptime_agent_frequency?: number | null,
>     template_id?: string | null,
>     termination_token?: string | null,
>     turns_counter?: number | null
>   } | null,
>   pending_approval?: {
>     id?: string | null,
>     date?: string | null,
>     tool_call?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null,
>     tool_calls?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     }[] | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null
>   } | null,
>   per_file_view_window_char_limit?: number | null,
>   project_id?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   secrets?: {
>     agent_id?: string | null,
>     key?: string | null,
>     value?: string | null,
>     id?: string | null,
>     created_at?: string | null,
>     created_by_id?: string | null,
>     description?: string | null,
>     last_updated_by_id?: string | null,
>     updated_at?: string | null,
>     value_enc?: string | null
>   }[] | null,
>   template_id?: string | null,
>   timezone?: string | null,
>   tool_exec_environment_variables?: {
>     agent_id?: string | null,
>     key?: string | null,
>     value?: string | null,
>     id?: string | null,
>     created_at?: string | null,
>     created_by_id?: string | null,
>     description?: string | null,
>     last_updated_by_id?: string | null,
>     updated_at?: string | null,
>     value_enc?: string | null
>   }[] | null,
>   tool_rules?: (
>     {
>       children?: string[] | null,
>       tool_name?: string | null,
>       child_arg_nodes?: {
>         name?: string | null,
>         args?: {
>         } | null
>       }[] | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       tool_name?: string | null,
>       args?: {
>       } | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       child_output_mapping?: Record<string, string> | null,
>       tool_name?: string | null,
>       default_child?: string | null,
>       prompt_template?: string | null,
>       require_output_mapping?: boolean | null,
>       type?: string | null
>     } | {
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       max_count_limit?: number | null,
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       children?: string[] | null,
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     }
>   )[] | null,
>   updated_at?: string | null
> } | null
> ```

***

### tools.updateApproval

`agents.tools.updateApproval`

Update Approval For Tool. Modify the approval requirement for a tool attached to an agent. Accepts requires\_approval via request body (preferred) or query parameter (deprecated). Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.agents.tools.updateApproval({ agent_id: 'example', tool_name: 'example', requires_approval: true });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `tool_name` | `string` | Yes | — |
| `requires_approval` | `boolean` | Yes | Whether the tool requires approval before execution |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The id of the agent. Assigned by the database. |
| `agent_type` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | Enum to represent the type of agent. |
| `blocks` | `object[] \| null` | No | The memory blocks used by the agent. |
| `llm_config` | `object \| null` | No | Configuration for Language Model (LLM) connection and generation parameters. .. deprecated:: LLMConfig is deprecated and should not be used as an input or return type in API calls. Use the schemas in letta.schemas.model (ModelSettings, OpenAIModelSettings, etc.) instead. For conversion, use the \_to\_model() method or Model.\_from\_llm\_config() method. |
| `memory` | `object \| null` | No | Deprecated: Use `blocks` field instead. The in-context memory of the agent. |
| `name` | `string \| null` | No | The name of the agent. |
| `sources` | `object[] \| null` | No | Deprecated: Use `folders` field instead. The sources used by the agent. |
| `system` | `string \| null` | No | The system prompt used by the agent. |
| `tags` | `string[] \| null` | No | The tags associated with the agent. |
| `tools` | `object[] \| null` | No | The tools used by the agent. |
| `base_template_id` | `string \| null` | No | The base template id of the agent. |
| `compaction_settings` | `object \| null` | No | Configuration for conversation compaction / summarization. Per-model settings (temperature, max tokens, etc.) are derived from the default configuration for that handle. |
| `created_at` | `string \| null` | No | The timestamp when the object was created. |
| `created_by_id` | `string \| null` | No | The id of the user that made this object. |
| `deployment_id` | `string \| null` | No | The id of the deployment. |
| `description` | `string \| null` | No | The description of the agent. |
| `embedding` | `string \| null` | No | The embedding model handle used by the agent (format: provider/model-name). |
| `embedding_config` | `object \| null` | No | Configuration for embedding model connection and processing parameters. |
| `enable_sleeptime` | `boolean \| null` | No | If set to True, memory management will move to a background agent thread. |
| `entity_id` | `string \| null` | No | The id of the entity within the template. |
| `hidden` | `boolean \| null` | No | If set to True, the agent will be hidden. |
| `identities` | `object[] \| null` | No | The identities associated with this agent. |
| `identity_ids` | `string[] \| null` | No | Deprecated: Use `identities` field instead. The ids of the identities associated with this agent. |
| `last_run_completion` | `string \| null` | No | The timestamp when the agent last completed a run. |
| `last_run_duration_ms` | `number \| null` | No | The duration in milliseconds of the agent's last run. |
| `last_stop_reason` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | — |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this object. |
| `managed_group` | `object \| null` | No | The multi-agent group that this agent manages |
| `max_files_open` | `number \| null` | No | Maximum number of files that can be open at once for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `message_buffer_autoclear` | `boolean \| null` | No | If set to True, the agent will not remember previous messages (though the agent will still retain state via core memory blocks and archival/recall memory). Not recommended unless you have an advanced use case. |
| `message_ids` | `string[] \| null` | No | The ids of the messages in the agent's in-context memory. |
| `metadata` | `object \| null` | No | The metadata of the agent. |
| `model` | `string \| null` | No | The model handle used by the agent (format: provider/model-name). |
| `model_settings` | `object \| null` | No | The model settings used by the agent. |
| `multi_agent_group` | `object \| null` | No | Deprecated: Use `managed_group` field instead. The multi-agent group that this agent manages. |
| `pending_approval` | `object \| null` | No | A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution). Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional\[str]): The name of the sender of the message tool\_call (ToolCall): The tool call |
| `per_file_view_window_char_limit` | `number \| null` | No | The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `project_id` | `string \| null` | No | The id of the project the agent belongs to. |
| `response_format` | `object \| null` | No | The response format used by the agent |
| `secrets` | `object[] \| null` | No | The environment variables for tool execution specific to this agent. |
| `template_id` | `string \| null` | No | The id of the template the agent belongs to. |
| `timezone` | `string \| null` | No | The timezone of the agent (IANA format). |
| `tool_exec_environment_variables` | `object[] \| null` | No | Deprecated: use `secrets` field instead. |
| `tool_rules` | `object[] \| null` | No | The list of tool rules. |
| `updated_at` | `string \| null` | No | The timestamp when the object was last updated. |

> [accordion] blocks full type
>
> ```ts theme={null}
> {
>   value?: string | null,
>   id?: string | null,
>   base_template_id?: string | null,
>   created_by_id?: string | null,
>   deployment_id?: string | null,
>   description?: string | null,
>   entity_id?: string | null,
>   hidden?: boolean | null,
>   is_template?: boolean | null,
>   label?: string | null,
>   last_updated_by_id?: string | null,
>   limit?: number | null,
>   metadata?: {
>   } | null,
>   preserve_on_migration?: boolean | null,
>   project_id?: string | null,
>   read_only?: boolean | null,
>   tags?: string[] | null,
>   template_id?: string | null,
>   template_name?: string | null
> }[] | null
> ```

> [accordion] llm\_config full type
>
> ```ts theme={null}
> {
>   context_window?: number | null,
>   model?: string | null,
>   model_endpoint_type?: string | null,
>   compatibility_type?: string | null,
>   display_name?: string | null,
>   effort?: string | null,
>   enable_reasoner?: boolean | null,
>   frequency_penalty?: number | null,
>   handle?: string | null,
>   max_reasoning_tokens?: number | null,
>   max_tokens?: number | null,
>   model_endpoint?: string | null,
>   model_wrapper?: string | null,
>   parallel_tool_calls?: boolean | null,
>   provider_category?: string | string | null,
>   provider_name?: string | null,
>   put_inner_thoughts_in_kwargs?: boolean | null,
>   reasoning_effort?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   return_logprobs?: boolean | null,
>   return_token_ids?: boolean | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   tier?: string | null,
>   tool_call_parser?: string | null,
>   top_logprobs?: number | null,
>   verbosity?: string | null
> } | null
> ```

> [accordion] memory full type
>
> ```ts theme={null}
> {
>   blocks?: {
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   agent_type?: string | string | string | string | string | string | string | string | string | string | null,
>   file_blocks?: {
>     file_id?: string | null,
>     is_open?: boolean | null,
>     source_id?: string | null,
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_accessed_at?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   git_enabled?: boolean | null,
>   prompt_template?: string | null
> } | null
> ```

> [accordion] sources full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   name?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   instructions?: string | null,
>   last_updated_by_id?: string | null,
>   metadata?: {
>   } | null,
>   updated_at?: string | null,
>   vector_db_provider?: string | string | string | null
> }[] | null
> ```

> [accordion] tools full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   args_json_schema?: {
>   } | null,
>   created_by_id?: string | null,
>   default_requires_approval?: boolean | null,
>   description?: string | null,
>   enable_parallel_execution?: boolean | null,
>   json_schema?: {
>   } | null,
>   last_updated_by_id?: string | null,
>   metadata_?: {
>   } | null,
>   name?: string | null,
>   npm_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   pip_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   project_id?: string | null,
>   return_char_limit?: number | null,
>   source_code?: string | null,
>   source_type?: string | null,
>   tags?: string[] | null,
>   tool_type?: string | string | string | string | string | string | string | string | string | string | string | null
> }[] | null
> ```

> [accordion] compaction\_settings full type
>
> ```ts theme={null}
> {
>   clip_chars?: number | null,
>   mode?: string | null,
>   model?: string | null,
>   model_settings?: {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking?: {
>       clear_thinking?: boolean | null,
>       type?: string | null
>     } | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     temperature?: number | null
>   } | null,
>   prompt?: string | null,
>   prompt_acknowledgement?: boolean | null,
>   sliding_window_percentage?: number | null
> } | null
> ```

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim?: number | null,
>   embedding_endpoint_type?: string | null,
>   embedding_model?: string | null,
>   azure_deployment?: string | null,
>   azure_endpoint?: string | null,
>   azure_version?: string | null,
>   batch_size?: number | null,
>   embedding_chunk_size?: number | null,
>   embedding_endpoint?: string | null,
>   handle?: string | null
> } | null
> ```

> [accordion] identities full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   block_ids?: string[] | null,
>   identifier_key?: string | null,
>   identity_type?: string | null,
>   name?: string | null,
>   project_id?: string | null,
>   properties?: {
>     key?: string | null,
>     type?: string | null,
>     value?: string | number | boolean | {
>     } | null
>   }[] | null
> }[] | null
> ```

> [accordion] managed\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] model\_settings full type
>
> ```ts theme={null}
> {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking?: {
>     clear_thinking?: boolean | null,
>     type?: string | null
>   } | null
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   temperature?: number | null
> } | null
> ```

> [accordion] multi\_agent\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] pending\_approval full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   date?: string | null,
>   tool_call?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null,
>   is_err?: boolean | null,
>   message_type?: string | null,
>   name?: string | null,
>   otid?: string | null,
>   run_id?: string | null,
>   sender_id?: string | null,
>   seq_id?: number | null,
>   step_id?: string | null,
>   tool_calls?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   }[] | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null
> } | null
> ```

> [accordion] response\_format full type
>
> ```ts theme={null}
> {
>   type?: string | null
> } | {
>   json_schema?: {
>   } | null,
>   type?: string | null
> } | {
>   type?: string | null
> } | null
> ```

> [accordion] secrets full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_exec\_environment\_variables full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_rules full type
>
> ```ts theme={null}
> (
>   {
>     children?: string[] | null,
>     tool_name?: string | null,
>     child_arg_nodes?: {
>       name?: string | null,
>       args?: {
>       } | null
>     }[] | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     args?: {
>     } | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     child_output_mapping?: Record<string, string> | null,
>     tool_name?: string | null,
>     default_child?: string | null,
>     prompt_template?: string | null,
>     require_output_mapping?: boolean | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     max_count_limit?: number | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     children?: string[] | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   }
> )[] | null
> ```

***

### update

`agents.update`

Update Agent. Update an existing agent. (PATCH /v1/agents/\{agent\_id})

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.agents.update({ agent_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The ID of the agent in the format 'agent-\<uuid4>' |
| `base_template_id` | `string` | No | The base template id of the agent. |
| `block_ids` | `string[]` | No | The ids of the blocks used by the agent. |
| `compaction_settings` | `object` | No | Configuration for conversation compaction / summarization. Per-model settings (temperature, max tokens, etc.) are derived from the default configuration for that handle. |
| `context_window_limit` | `number` | No | The context window limit used by the agent. |
| `description` | `string` | No | The description of the agent. |
| `embedding` | `string` | No | The embedding model handle used by the agent (format: provider/model-name). |
| `embedding_config` | `object` | No | Configuration for embedding model connection and processing parameters. |
| `enable_sleeptime` | `boolean` | No | If set to True, memory management will move to a background agent thread. |
| `folder_ids` | `string[]` | No | The ids of the folders used by the agent. |
| `hidden` | `boolean` | No | If set to True, the agent will be hidden. |
| `identity_ids` | `string[]` | No | The ids of the identities associated with this agent. |
| `last_run_completion` | `string` | No | The timestamp when the agent last completed a run. |
| `last_run_duration_ms` | `number` | No | The duration in milliseconds of the agent's last run. |
| `last_stop_reason` | `end_turn \| error \| llm_api_error \| invalid_llm_response \| invalid_tool_call \| max_steps \| max_tokens_exceeded \| no_tool_call \| tool_rule \| cancelled \| insufficient_credits \| requires_approval \| context_window_overflow_in_system_prompt` | No | — |
| `llm_config` | `object` | No | Configuration for Language Model (LLM) connection and generation parameters. .. deprecated:: LLMConfig is deprecated and should not be used as an input or return type in API calls. Use the schemas in letta.schemas.model (ModelSettings, OpenAIModelSettings, etc.) instead. For conversion, use the \_to\_model() method or Model.\_from\_llm\_config() method. |
| `max_files_open` | `number` | No | Maximum number of files that can be open at once for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `max_tokens` | `number` | No | Deprecated: Use `model` field to configure max output tokens instead. The maximum number of tokens to generate, including reasoning step. |
| `message_buffer_autoclear` | `boolean` | No | If set to True, the agent will not remember previous messages (though the agent will still retain state via core memory blocks and archival/recall memory). Not recommended unless you have an advanced use case. |
| `message_ids` | `string[]` | No | The ids of the messages in the agent's in-context memory. |
| `metadata` | `object` | No | The metadata of the agent. |
| `model` | `string` | No | The model handle used by the agent (format: provider/model-name). |
| `model_settings` | `object` | No | The model settings for the agent. |
| `name` | `string` | No | The name of the agent. |
| `parallel_tool_calls` | `boolean` | No | Deprecated: Use `model_settings` to configure parallel tool calls instead. If set to True, enables parallel tool calling. |
| `per_file_view_window_char_limit` | `number` | No | The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `project_id` | `string` | No | The id of the project the agent belongs to. |
| `reasoning` | `boolean` | No | Deprecated: Use `model` field to configure reasoning instead. Whether to enable reasoning for this agent. |
| `response_format` | `object` | No | Deprecated: Use `model_settings` field to configure response format instead. The response format for the agent. |
| `secrets` | `Record<string, string>` | No | The environment variables for tool execution specific to this agent. |
| `source_ids` | `string[]` | No | Deprecated: Use `folder_ids` field instead. The ids of the sources used by the agent. |
| `system` | `string` | No | The system prompt used by the agent. |
| `tags` | `string[]` | No | The tags associated with the agent. |
| `template_id` | `string` | No | The id of the template the agent belongs to. |
| `timezone` | `string` | No | The timezone of the agent (IANA format). |
| `tool_exec_environment_variables` | `Record<string, string>` | No | Deprecated: use `secrets` field instead |
| `tool_ids` | `string[]` | No | The ids of the tools used by the agent. |
| `tool_rules` | `object[]` | No | The tool rules governing the agent. |

> [accordion] compaction\_settings full type
>
> ```ts theme={null}
> {
>   clip_chars?: number,
>   mode?: all | sliding_window | self_compact_all | self_compact_sliding_window,
>   model?: string,
>   model_settings?: {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: openai,
>     reasoning?: {
>       reasoning_effort?: none | minimal | low | medium | high | xhigh
>     },
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: openai,
>     reasoning?: {
>       reasoning_effort?: none | minimal | low | medium | high | xhigh
>     },
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number
>   } | {
>     effort?: low | medium | high | xhigh | max,
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: anthropic,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number,
>     thinking?: {
>       budget_tokens?: number,
>       type?: enabled | disabled
>     },
>     verbosity?: low | medium | high
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: google_ai,
>     response_schema?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number,
>     thinking_config?: {
>       include_thoughts?: boolean,
>       thinking_budget?: number
>     }
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: google_vertex,
>     response_schema?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number,
>     thinking_config?: {
>       include_thoughts?: boolean,
>       thinking_budget?: number
>     }
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: azure,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: xai,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: moonshot,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: zai,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number,
>     thinking?: {
>       clear_thinking?: boolean,
>       type?: enabled | disabled
>     }
>   } | {
>     effort?: low | medium | high | xhigh | max,
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: moonshot_coding,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number,
>     thinking?: {
>       budget_tokens?: number,
>       type?: enabled | disabled
>     },
>     verbosity?: low | medium | high
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: groq,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: deepseek,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: together,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: bedrock,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: baseten,
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: openrouter,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: chatgpt_oauth,
>     reasoning?: {
>       reasoning_effort?: none | low | medium | high | xhigh
>     },
>     temperature?: number
>   },
>   prompt?: string,
>   prompt_acknowledgement?: boolean,
>   sliding_window_percentage?: number
> }
> ```

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim: number,
>   embedding_endpoint_type: openai | anthropic | bedrock | google_ai | google_vertex | azure | groq | ollama | webui | webui-legacy | lmstudio | lmstudio-legacy | llamacpp | koboldcpp | vllm | hugging-face | mistral | together | pinecone,
>   embedding_model: string,
>   azure_deployment?: string,
>   azure_endpoint?: string,
>   azure_version?: string,
>   batch_size?: number,
>   embedding_chunk_size?: number,
>   embedding_endpoint?: string,
>   handle?: string
> }
> ```

> [accordion] llm\_config full type
>
> ```ts theme={null}
> {
>   context_window: number,
>   model: string,
>   model_endpoint_type: openai | anthropic | google_ai | google_vertex | azure | groq | ollama | webui | webui-legacy | lmstudio | lmstudio-legacy | lmstudio-chatcompletions | llamacpp | koboldcpp | vllm | hugging-face | minimax | moonshot | moonshot_coding | mistral | together | bedrock | deepseek | xai | zai | zai_coding | baseten | fireworks | openrouter | chatgpt_oauth,
>   compatibility_type?: gguf | mlx,
>   display_name?: string,
>   effort?: low | medium | high | xhigh | max,
>   enable_reasoner?: boolean,
>   frequency_penalty?: number,
>   handle?: string,
>   max_reasoning_tokens?: number,
>   max_tokens?: number,
>   model_endpoint?: string,
>   model_wrapper?: string,
>   parallel_tool_calls?: boolean,
>   provider_category?: base | byok,
>   provider_name?: string,
>   put_inner_thoughts_in_kwargs?: boolean,
>   reasoning_effort?: none | minimal | low | medium | high | xhigh,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   return_logprobs?: boolean,
>   return_token_ids?: boolean,
>   strict?: boolean,
>   temperature?: number,
>   tier?: string,
>   tool_call_parser?: string,
>   top_logprobs?: number,
>   verbosity?: low | medium | high
> }
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] model\_settings full type
>
> ```ts theme={null}
> {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: openai,
>   reasoning?: {
>     reasoning_effort?: none | minimal | low | medium | high | xhigh
>   },
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   strict?: boolean,
>   temperature?: number
> } | {
> } | {
>   effort?: low | medium | high | xhigh | max,
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: anthropic,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   strict?: boolean,
>   temperature?: number,
>   thinking?: {
>     budget_tokens?: number,
>     type?: enabled | disabled
>   },
>   verbosity?: low | medium | high
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: google_ai,
>   response_schema?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number,
>   thinking_config?: {
>     include_thoughts?: boolean,
>     thinking_budget?: number
>   }
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: google_vertex,
>   response_schema?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number,
>   thinking_config?: {
>     include_thoughts?: boolean,
>     thinking_budget?: number
>   }
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: azure,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: xai,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: moonshot,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   strict?: boolean,
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: zai,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number,
>   thinking?: {
>     clear_thinking?: boolean,
>     type?: enabled | disabled
>   }
> } | {
>   effort?: low | medium | high | xhigh | max,
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: moonshot_coding,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   strict?: boolean,
>   temperature?: number,
>   thinking?: {
>     budget_tokens?: number,
>     type?: enabled | disabled
>   },
>   verbosity?: low | medium | high
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: groq,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: deepseek,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: together,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: bedrock,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: baseten,
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: openrouter,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: chatgpt_oauth,
>   reasoning?: {
>     reasoning_effort?: none | low | medium | high | xhigh
>   },
>   temperature?: number
> }
> ```

> [accordion] response\_format full type
>
> ```ts theme={null}
> {
>   type?: text
> } | {
>   json_schema: {
>   },
>   type?: json_schema
> } | {
>   type?: json_object
> }
> ```

> [accordion] tool\_rules full type
>
> ```ts theme={null}
> (
>   {
>     children: string[],
>     tool_name: string,
>     child_arg_nodes?: {
>       name: string,
>       args?: {
>       }
>     }[],
>     prompt_template?: string,
>     type?: constrain_child_tools
>   } | {
>     tool_name: string,
>     args?: {
>     },
>     prompt_template?: string,
>     type?: run_first
>   } | {
>     tool_name: string,
>     prompt_template?: string,
>     type?: exit_loop
>   } | {
>     child_output_mapping: Record<string, string>,
>     tool_name: string,
>     default_child?: string,
>     prompt_template?: string,
>     require_output_mapping?: boolean,
>     type?: conditional
>   } | {
>     tool_name: string,
>     prompt_template?: string,
>     type?: continue_loop
>   } | {
>     tool_name: string,
>     prompt_template?: string,
>     type?: required_before_exit
>   } | {
>     max_count_limit: number,
>     tool_name: string,
>     prompt_template?: string,
>     type?: max_count_per_step
>   } | {
>     children: string[],
>     tool_name: string,
>     prompt_template?: string,
>     type?: parent_last_tool
>   } | {
>     tool_name: string,
>     prompt_template?: string,
>     type?: requires_approval
>   }
> )[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The id of the agent. Assigned by the database. |
| `agent_type` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | Enum to represent the type of agent. |
| `blocks` | `object[] \| null` | No | The memory blocks used by the agent. |
| `llm_config` | `object \| null` | No | Configuration for Language Model (LLM) connection and generation parameters. .. deprecated:: LLMConfig is deprecated and should not be used as an input or return type in API calls. Use the schemas in letta.schemas.model (ModelSettings, OpenAIModelSettings, etc.) instead. For conversion, use the \_to\_model() method or Model.\_from\_llm\_config() method. |
| `memory` | `object \| null` | No | Deprecated: Use `blocks` field instead. The in-context memory of the agent. |
| `name` | `string \| null` | No | The name of the agent. |
| `sources` | `object[] \| null` | No | Deprecated: Use `folders` field instead. The sources used by the agent. |
| `system` | `string \| null` | No | The system prompt used by the agent. |
| `tags` | `string[] \| null` | No | The tags associated with the agent. |
| `tools` | `object[] \| null` | No | The tools used by the agent. |
| `base_template_id` | `string \| null` | No | The base template id of the agent. |
| `compaction_settings` | `object \| null` | No | Configuration for conversation compaction / summarization. Per-model settings (temperature, max tokens, etc.) are derived from the default configuration for that handle. |
| `created_at` | `string \| null` | No | The timestamp when the object was created. |
| `created_by_id` | `string \| null` | No | The id of the user that made this object. |
| `deployment_id` | `string \| null` | No | The id of the deployment. |
| `description` | `string \| null` | No | The description of the agent. |
| `embedding` | `string \| null` | No | The embedding model handle used by the agent (format: provider/model-name). |
| `embedding_config` | `object \| null` | No | Configuration for embedding model connection and processing parameters. |
| `enable_sleeptime` | `boolean \| null` | No | If set to True, memory management will move to a background agent thread. |
| `entity_id` | `string \| null` | No | The id of the entity within the template. |
| `hidden` | `boolean \| null` | No | If set to True, the agent will be hidden. |
| `identities` | `object[] \| null` | No | The identities associated with this agent. |
| `identity_ids` | `string[] \| null` | No | Deprecated: Use `identities` field instead. The ids of the identities associated with this agent. |
| `last_run_completion` | `string \| null` | No | The timestamp when the agent last completed a run. |
| `last_run_duration_ms` | `number \| null` | No | The duration in milliseconds of the agent's last run. |
| `last_stop_reason` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | — |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this object. |
| `managed_group` | `object \| null` | No | The multi-agent group that this agent manages |
| `max_files_open` | `number \| null` | No | Maximum number of files that can be open at once for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `message_buffer_autoclear` | `boolean \| null` | No | If set to True, the agent will not remember previous messages (though the agent will still retain state via core memory blocks and archival/recall memory). Not recommended unless you have an advanced use case. |
| `message_ids` | `string[] \| null` | No | The ids of the messages in the agent's in-context memory. |
| `metadata` | `object \| null` | No | The metadata of the agent. |
| `model` | `string \| null` | No | The model handle used by the agent (format: provider/model-name). |
| `model_settings` | `object \| null` | No | The model settings used by the agent. |
| `multi_agent_group` | `object \| null` | No | Deprecated: Use `managed_group` field instead. The multi-agent group that this agent manages. |
| `pending_approval` | `object \| null` | No | A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution). Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional\[str]): The name of the sender of the message tool\_call (ToolCall): The tool call |
| `per_file_view_window_char_limit` | `number \| null` | No | The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent. |
| `project_id` | `string \| null` | No | The id of the project the agent belongs to. |
| `response_format` | `object \| null` | No | The response format used by the agent |
| `secrets` | `object[] \| null` | No | The environment variables for tool execution specific to this agent. |
| `template_id` | `string \| null` | No | The id of the template the agent belongs to. |
| `timezone` | `string \| null` | No | The timezone of the agent (IANA format). |
| `tool_exec_environment_variables` | `object[] \| null` | No | Deprecated: use `secrets` field instead. |
| `tool_rules` | `object[] \| null` | No | The list of tool rules. |
| `updated_at` | `string \| null` | No | The timestamp when the object was last updated. |

> [accordion] blocks full type
>
> ```ts theme={null}
> {
>   value?: string | null,
>   id?: string | null,
>   base_template_id?: string | null,
>   created_by_id?: string | null,
>   deployment_id?: string | null,
>   description?: string | null,
>   entity_id?: string | null,
>   hidden?: boolean | null,
>   is_template?: boolean | null,
>   label?: string | null,
>   last_updated_by_id?: string | null,
>   limit?: number | null,
>   metadata?: {
>   } | null,
>   preserve_on_migration?: boolean | null,
>   project_id?: string | null,
>   read_only?: boolean | null,
>   tags?: string[] | null,
>   template_id?: string | null,
>   template_name?: string | null
> }[] | null
> ```

> [accordion] llm\_config full type
>
> ```ts theme={null}
> {
>   context_window?: number | null,
>   model?: string | null,
>   model_endpoint_type?: string | null,
>   compatibility_type?: string | null,
>   display_name?: string | null,
>   effort?: string | null,
>   enable_reasoner?: boolean | null,
>   frequency_penalty?: number | null,
>   handle?: string | null,
>   max_reasoning_tokens?: number | null,
>   max_tokens?: number | null,
>   model_endpoint?: string | null,
>   model_wrapper?: string | null,
>   parallel_tool_calls?: boolean | null,
>   provider_category?: string | string | null,
>   provider_name?: string | null,
>   put_inner_thoughts_in_kwargs?: boolean | null,
>   reasoning_effort?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   return_logprobs?: boolean | null,
>   return_token_ids?: boolean | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   tier?: string | null,
>   tool_call_parser?: string | null,
>   top_logprobs?: number | null,
>   verbosity?: string | null
> } | null
> ```

> [accordion] memory full type
>
> ```ts theme={null}
> {
>   blocks?: {
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   agent_type?: string | string | string | string | string | string | string | string | string | string | null,
>   file_blocks?: {
>     file_id?: string | null,
>     is_open?: boolean | null,
>     source_id?: string | null,
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_accessed_at?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   git_enabled?: boolean | null,
>   prompt_template?: string | null
> } | null
> ```

> [accordion] sources full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   name?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   instructions?: string | null,
>   last_updated_by_id?: string | null,
>   metadata?: {
>   } | null,
>   updated_at?: string | null,
>   vector_db_provider?: string | string | string | null
> }[] | null
> ```

> [accordion] tools full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   args_json_schema?: {
>   } | null,
>   created_by_id?: string | null,
>   default_requires_approval?: boolean | null,
>   description?: string | null,
>   enable_parallel_execution?: boolean | null,
>   json_schema?: {
>   } | null,
>   last_updated_by_id?: string | null,
>   metadata_?: {
>   } | null,
>   name?: string | null,
>   npm_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   pip_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   project_id?: string | null,
>   return_char_limit?: number | null,
>   source_code?: string | null,
>   source_type?: string | null,
>   tags?: string[] | null,
>   tool_type?: string | string | string | string | string | string | string | string | string | string | string | null
> }[] | null
> ```

> [accordion] compaction\_settings full type
>
> ```ts theme={null}
> {
>   clip_chars?: number | null,
>   mode?: string | null,
>   model?: string | null,
>   model_settings?: {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking?: {
>       clear_thinking?: boolean | null,
>       type?: string | null
>     } | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     temperature?: number | null
>   } | null,
>   prompt?: string | null,
>   prompt_acknowledgement?: boolean | null,
>   sliding_window_percentage?: number | null
> } | null
> ```

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim?: number | null,
>   embedding_endpoint_type?: string | null,
>   embedding_model?: string | null,
>   azure_deployment?: string | null,
>   azure_endpoint?: string | null,
>   azure_version?: string | null,
>   batch_size?: number | null,
>   embedding_chunk_size?: number | null,
>   embedding_endpoint?: string | null,
>   handle?: string | null
> } | null
> ```

> [accordion] identities full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   block_ids?: string[] | null,
>   identifier_key?: string | null,
>   identity_type?: string | null,
>   name?: string | null,
>   project_id?: string | null,
>   properties?: {
>     key?: string | null,
>     type?: string | null,
>     value?: string | number | boolean | {
>     } | null
>   }[] | null
> }[] | null
> ```

> [accordion] managed\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] model\_settings full type
>
> ```ts theme={null}
> {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking?: {
>     clear_thinking?: boolean | null,
>     type?: string | null
>   } | null
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   temperature?: number | null
> } | null
> ```

> [accordion] multi\_agent\_group full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_ids?: string[] | null,
>   description?: string | null,
>   manager_type?: string | null,
>   base_template_id?: string | null,
>   deployment_id?: string | null,
>   hidden?: boolean | null,
>   last_processed_message_id?: string | null,
>   manager_agent_id?: string | null,
>   max_message_buffer_length?: number | null,
>   max_turns?: number | null,
>   min_message_buffer_length?: number | null,
>   project_id?: string | null,
>   shared_block_ids?: string[] | null,
>   sleeptime_agent_frequency?: number | null,
>   template_id?: string | null,
>   termination_token?: string | null,
>   turns_counter?: number | null
> } | null
> ```

> [accordion] pending\_approval full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   date?: string | null,
>   tool_call?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null,
>   is_err?: boolean | null,
>   message_type?: string | null,
>   name?: string | null,
>   otid?: string | null,
>   run_id?: string | null,
>   sender_id?: string | null,
>   seq_id?: number | null,
>   step_id?: string | null,
>   tool_calls?: {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   }[] | {
>     arguments?: string | null,
>     name?: string | null,
>     tool_call_id?: string | null
>   } | null
> } | null
> ```

> [accordion] response\_format full type
>
> ```ts theme={null}
> {
>   type?: string | null
> } | {
>   json_schema?: {
>   } | null,
>   type?: string | null
> } | {
>   type?: string | null
> } | null
> ```

> [accordion] secrets full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_exec\_environment\_variables full type
>
> ```ts theme={null}
> {
>   agent_id?: string | null,
>   key?: string | null,
>   value?: string | null,
>   id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   last_updated_by_id?: string | null,
>   updated_at?: string | null,
>   value_enc?: string | null
> }[] | null
> ```

> [accordion] tool\_rules full type
>
> ```ts theme={null}
> (
>   {
>     children?: string[] | null,
>     tool_name?: string | null,
>     child_arg_nodes?: {
>       name?: string | null,
>       args?: {
>       } | null
>     }[] | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     args?: {
>     } | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     child_output_mapping?: Record<string, string> | null,
>     tool_name?: string | null,
>     default_child?: string | null,
>     prompt_template?: string | null,
>     require_output_mapping?: boolean | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     max_count_limit?: number | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     children?: string[] | null,
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   } | {
>     tool_name?: string | null,
>     prompt_template?: string | null,
>     type?: string | null
>   }
> )[] | null
> ```

***

## Archives

### create

`archives.create`

Create Archive. Create a new archive. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.archives.create({ name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | — |
| `description` | `string` | No | — |
| `embedding` | `string` | No | Embedding model handle for the archive |
| `embedding_config` | `object` | No | Configuration for embedding model connection and processing parameters. |

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim: number,
>   embedding_endpoint_type: openai | anthropic | bedrock | google_ai | google_vertex | azure | groq | ollama | webui | webui-legacy | lmstudio | lmstudio-legacy | llamacpp | koboldcpp | vllm | hugging-face | mistral | together | pinecone,
>   embedding_model: string,
>   azure_deployment?: string,
>   azure_endpoint?: string,
>   azure_version?: string,
>   batch_size?: number,
>   embedding_chunk_size?: number,
>   embedding_endpoint?: string,
>   handle?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The human-friendly ID of the Archive |
| `created_at` | `string \| null` | No | The creation date of the archive |
| `name` | `string \| null` | No | The name of the archive |
| `created_by_id` | `string \| null` | No | The id of the user that made this object. |
| `description` | `string \| null` | No | A description of the archive |
| `embedding_config` | `object \| null` | No | Configuration for embedding model connection and processing parameters. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this object. |
| `metadata` | `object \| null` | No | Additional metadata |
| `updated_at` | `string \| null` | No | The timestamp when the object was last updated. |
| `vector_db_provider` | `string \| string \| string \| null` | No | Supported vector database providers for archival memory |

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim?: number | null,
>   embedding_endpoint_type?: string | null,
>   embedding_model?: string | null,
>   azure_deployment?: string | null,
>   azure_endpoint?: string | null,
>   azure_version?: string | null,
>   batch_size?: number | null,
>   embedding_chunk_size?: number | null,
>   embedding_endpoint?: string | null,
>   handle?: string | null
> } | null
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### delete

`archives.delete`

Delete Archive. Delete an archive by its ID. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.archives.delete({ archive_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `archive_id` | `string` | Yes | The ID of the archive in the format 'archive-\<uuid4>' |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### get

`archives.get`

Retrieve Archive. Get a single archive by its ID. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.archives.get({ archive_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `archive_id` | `string` | Yes | The ID of the archive in the format 'archive-\<uuid4>' |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The human-friendly ID of the Archive |
| `created_at` | `string \| null` | No | The creation date of the archive |
| `name` | `string \| null` | No | The name of the archive |
| `created_by_id` | `string \| null` | No | The id of the user that made this object. |
| `description` | `string \| null` | No | A description of the archive |
| `embedding_config` | `object \| null` | No | Configuration for embedding model connection and processing parameters. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this object. |
| `metadata` | `object \| null` | No | Additional metadata |
| `updated_at` | `string \| null` | No | The timestamp when the object was last updated. |
| `vector_db_provider` | `string \| string \| string \| null` | No | Supported vector database providers for archival memory |

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim?: number | null,
>   embedding_endpoint_type?: string | null,
>   embedding_model?: string | null,
>   azure_deployment?: string | null,
>   azure_endpoint?: string | null,
>   azure_version?: string | null,
>   batch_size?: number | null,
>   embedding_chunk_size?: number | null,
>   embedding_endpoint?: string | null,
>   handle?: string | null
> } | null
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### list

`archives.list`

List Archives. Get a list of all archives for the current organization with optional filters and pagination. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.archives.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | Cursor for pagination (archive ID). Returns results relative to this ID in the specified sort order. Expected format: 'archive-\<uuid4>' |
| `agent_id` | `string` | No | Only archives attached to this agent ID |
| `before` | `string` | No | Cursor for pagination (archive ID). Returns results relative to this ID in the specified sort order. Expected format: 'archive-\<uuid4>' |
| `limit` | `number` | No | Maximum number of archives to return |
| `name` | `string` | No | Filter by archive name (exact match) |
| `order` | `asc \| desc` | No | Sort order for archives by creation time. 'asc' for oldest first, 'desc' for newest first |
| `order_by` | `created_at` | No | Field to sort by |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   created_at?: string | null,
>   name?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   last_updated_by_id?: string | null,
>   metadata?: {
>   } | null,
>   updated_at?: string | null,
>   vector_db_provider?: string | string | string | null
> }[]
> ```

***

### passages.create

`archives.passages.create`

Create Passage In Archive. Create a new passage in an archive. This adds a passage to the archive and creates embeddings for vector storage. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.archives.passages.create({ archive_id: 'example', text: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `archive_id` | `string` | Yes | The ID of the archive in the format 'archive-\<uuid4>' |
| `text` | `string` | Yes | The text content of the passage |
| `created_at` | `string` | No | Optional creation datetime for the passage (ISO 8601 format) |
| `metadata` | `object` | No | Optional metadata for the passage |
| `tags` | `string[]` | No | Optional tags for categorizing the passage |

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> }
> ```

**Output:** `object \| object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   embedding?: number[] | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   text?: string | null,
>   id?: string | null,
>   archive_id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   file_id?: string | null,
>   file_name?: string | null,
>   is_deleted?: boolean | null,
>   last_updated_by_id?: string | null,
>   metadata?: {
>   } | null,
>   source_id?: string | null,
>   tags?: string[] | null,
>   updated_at?: string | null
> } | {
>   embedding?: number[] | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   text?: string | null,
>   id?: string | null,
>   archive_id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   file_id?: string | null,
>   file_name?: string | null,
>   is_deleted?: boolean | null,
>   last_updated_by_id?: string | null,
>   metadata?: {
>   } | null,
>   source_id?: string | null,
>   tags?: string[] | null,
>   updated_at?: string | null
> }[]
> ```

***

### passages.createMany

`archives.passages.createMany`

Create Passages In Archive. Create multiple passages in an archive. This adds passages to the archive and creates embeddings for vector storage. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.archives.passages.createMany({
	archive_id: 'example',
	passages: [{ text: 'example' }],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `archive_id` | `string` | Yes | The ID of the archive in the format 'archive-\<uuid4>' |
| `passages` | `object[]` | Yes | Passages to create in the archive |

> [accordion] passages full type
>
> ```ts theme={null}
> {
>   text: string,
>   created_at?: string,
>   metadata?: {
>   },
>   tags?: string[]
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `embedding` | `number[] \| null` | No | The embedding of the passage. |
| `embedding_config` | `object \| null` | No | Configuration for embedding model connection and processing parameters. |
| `text` | `string \| null` | No | The text of the passage. |
| `id` | `string \| null` | No | The human-friendly ID of the Passage |
| `archive_id` | `string \| null` | No | The unique identifier of the archive containing this passage. |
| `created_at` | `string \| null` | No | The creation date of the passage. |
| `created_by_id` | `string \| null` | No | The id of the user that made this object. |
| `file_id` | `string \| null` | No | The unique identifier of the file associated with the passage. |
| `file_name` | `string \| null` | No | The name of the file (only for source passages). |
| `is_deleted` | `boolean \| null` | No | Whether this passage is deleted or not. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this object. |
| `metadata` | `object \| null` | No | The metadata of the passage. |
| `source_id` | `string \| null` | No | Deprecated: Use `folder_id` field instead. The data source of the passage. |
| `tags` | `string[] \| null` | No | Tags associated with this passage. |
| `updated_at` | `string \| null` | No | The timestamp when the object was last updated. |

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim?: number | null,
>   embedding_endpoint_type?: string | null,
>   embedding_model?: string | null,
>   azure_deployment?: string | null,
>   azure_endpoint?: string | null,
>   azure_version?: string | null,
>   batch_size?: number | null,
>   embedding_chunk_size?: number | null,
>   embedding_endpoint?: string | null,
>   handle?: string | null
> } | null
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### passages.delete

`archives.passages.delete`

Delete Passage From Archive. Delete a passage from an archive. This permanently removes the passage from both the database and vector storage (if applicable). Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.archives.passages.delete({ archive_id: 'example', passage_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `archive_id` | `string` | Yes | The ID of the archive in the format 'archive-\<uuid4>' |
| `passage_id` | `string` | Yes | The ID of the passage in the format 'passage-\<uuid4>' |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### update

`archives.update`

Update Archive. Update an existing archive's name and/or description. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.archives.update({ archive_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `archive_id` | `string` | Yes | The ID of the archive in the format 'archive-\<uuid4>' |
| `description` | `string` | No | — |
| `name` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The human-friendly ID of the Archive |
| `created_at` | `string \| null` | No | The creation date of the archive |
| `name` | `string \| null` | No | The name of the archive |
| `created_by_id` | `string \| null` | No | The id of the user that made this object. |
| `description` | `string \| null` | No | A description of the archive |
| `embedding_config` | `object \| null` | No | Configuration for embedding model connection and processing parameters. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this object. |
| `metadata` | `object \| null` | No | Additional metadata |
| `updated_at` | `string \| null` | No | The timestamp when the object was last updated. |
| `vector_db_provider` | `string \| string \| string \| null` | No | Supported vector database providers for archival memory |

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim?: number | null,
>   embedding_endpoint_type?: string | null,
>   embedding_model?: string | null,
>   azure_deployment?: string | null,
>   azure_endpoint?: string | null,
>   azure_version?: string | null,
>   batch_size?: number | null,
>   embedding_chunk_size?: number | null,
>   embedding_endpoint?: string | null,
>   handle?: string | null
> } | null
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

## Blocks

### agents.list

`blocks.agents.list`

List Agents For Block. Retrieves all agents associated with the specified block. Raises a 404 if the block does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.blocks.agents.list({ block_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `block_id` | `string` | Yes | The ID of the block in the format 'block-\<uuid4>' |
| `after` | `string` | No | Cursor for pagination (agent ID). Returns results relative to this ID in the specified sort order. Expected format: 'agent-\<uuid4>' |
| `before` | `string` | No | Cursor for pagination (agent ID). Returns results relative to this ID in the specified sort order. Expected format: 'agent-\<uuid4>' |
| `include` | `(agent.blocks \| agent.identities \| agent.managed_group \| agent.pending_approval \| agent.secrets \| agent.sources \| agent.tags \| agent.tools)[]` | No | Specify which relational fields to include in the response. No relationships are included by default. |
| `include_relationships` | `string[]` | No | Specify which relational fields (e.g., 'tools', 'sources', 'memory') to include in the response. If not provided, all relationships are loaded by default. Using this can optimize performance by reducing unnecessary joins.This is a legacy parameter, and no longer supported after 1.0.0 SDK versions. |
| `limit` | `number` | No | Maximum number of agents to return |
| `order` | `asc \| desc` | No | Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first |
| `order_by` | `created_at` | No | Field to sort by |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_type?: string | string | string | string | string | string | string | string | string | null,
>   blocks?: {
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   llm_config?: {
>     context_window?: number | null,
>     model?: string | null,
>     model_endpoint_type?: string | null,
>     compatibility_type?: string | null,
>     display_name?: string | null,
>     effort?: string | null,
>     enable_reasoner?: boolean | null,
>     frequency_penalty?: number | null,
>     handle?: string | null,
>     max_reasoning_tokens?: number | null,
>     max_tokens?: number | null,
>     model_endpoint?: string | null,
>     model_wrapper?: string | null,
>     parallel_tool_calls?: boolean | null,
>     provider_category?: string | string | null,
>     provider_name?: string | null,
>     put_inner_thoughts_in_kwargs?: boolean | null,
>     reasoning_effort?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     return_logprobs?: boolean | null,
>     return_token_ids?: boolean | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     tier?: string | null,
>     tool_call_parser?: string | null,
>     top_logprobs?: number | null,
>     verbosity?: string | null
>   } | null,
>   memory?: {
>     blocks?: {
>       value?: string | null,
>       id?: string | null,
>       base_template_id?: string | null,
>       created_by_id?: string | null,
>       deployment_id?: string | null,
>       description?: string | null,
>       entity_id?: string | null,
>       hidden?: boolean | null,
>       is_template?: boolean | null,
>       label?: string | null,
>       last_updated_by_id?: string | null,
>       limit?: number | null,
>       metadata?: {
>       } | null,
>       preserve_on_migration?: boolean | null,
>       project_id?: string | null,
>       read_only?: boolean | null,
>       tags?: string[] | null,
>       template_id?: string | null,
>       template_name?: string | null
>     }[] | null,
>     agent_type?: string | string | string | string | string | string | string | string | string | string | null,
>     file_blocks?: {
>       file_id?: string | null,
>       is_open?: boolean | null,
>       source_id?: string | null,
>       value?: string | null,
>       id?: string | null,
>       base_template_id?: string | null,
>       created_by_id?: string | null,
>       deployment_id?: string | null,
>       description?: string | null,
>       entity_id?: string | null,
>       hidden?: boolean | null,
>       is_template?: boolean | null,
>       label?: string | null,
>       last_accessed_at?: string | null,
>       last_updated_by_id?: string | null,
>       limit?: number | null,
>       metadata?: {
>       } | null,
>       preserve_on_migration?: boolean | null,
>       project_id?: string | null,
>       read_only?: boolean | null,
>       tags?: string[] | null,
>       template_id?: string | null,
>       template_name?: string | null
>     }[] | null,
>     git_enabled?: boolean | null,
>     prompt_template?: string | null
>   } | null,
>   name?: string | null,
>   sources?: {
>     id?: string | null,
>     embedding_config?: {
>       embedding_dim?: number | null,
>       embedding_endpoint_type?: string | null,
>       embedding_model?: string | null,
>       azure_deployment?: string | null,
>       azure_endpoint?: string | null,
>       azure_version?: string | null,
>       batch_size?: number | null,
>       embedding_chunk_size?: number | null,
>       embedding_endpoint?: string | null,
>       handle?: string | null
>     } | null,
>     name?: string | null,
>     created_at?: string | null,
>     created_by_id?: string | null,
>     description?: string | null,
>     instructions?: string | null,
>     last_updated_by_id?: string | null,
>     metadata?: {
>     } | null,
>     updated_at?: string | null,
>     vector_db_provider?: string | string | string | null
>   }[] | null,
>   system?: string | null,
>   tags?: string[] | null,
>   tools?: {
>     id?: string | null,
>     args_json_schema?: {
>     } | null,
>     created_by_id?: string | null,
>     default_requires_approval?: boolean | null,
>     description?: string | null,
>     enable_parallel_execution?: boolean | null,
>     json_schema?: {
>     } | null,
>     last_updated_by_id?: string | null,
>     metadata_?: {
>     } | null,
>     name?: string | null,
>     npm_requirements?: {
>       name?: string | null,
>       version?: string | null
>     }[] | null,
>     pip_requirements?: {
>       name?: string | null,
>       version?: string | null
>     }[] | null,
>     project_id?: string | null,
>     return_char_limit?: number | null,
>     source_code?: string | null,
>     source_type?: string | null,
>     tags?: string[] | null,
>     tool_type?: string | string | string | string | string | string | string | string | string | string | string | null
>   }[] | null,
>   base_template_id?: string | null,
>   compaction_settings?: {
>     clip_chars?: number | null,
>     mode?: string | null,
>     model?: string | null,
>     model_settings?: {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       reasoning?: {
>         reasoning_effort?: string | null
>       } | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       strict?: boolean | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       reasoning?: {
>         reasoning_effort?: string | null
>       } | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       strict?: boolean | null,
>       temperature?: number | null
>     } | {
>       effort?: string | null,
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       strict?: boolean | null,
>       temperature?: number | null,
>       thinking?: {
>         budget_tokens?: number | null,
>         type?: string | null
>       } | null,
>       verbosity?: string | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_schema?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null,
>       thinking_config?: {
>         include_thoughts?: boolean | null,
>         thinking_budget?: number | null
>       } | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_schema?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null,
>       thinking_config?: {
>         include_thoughts?: boolean | null,
>         thinking_budget?: number | null
>       } | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       strict?: boolean | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null,
>       thinking?: {
>         clear_thinking?: boolean | null,
>         type?: string | null
>       } | null
>     } | {
>       effort?: string | null,
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       strict?: boolean | null,
>       temperature?: number | null,
>       thinking?: {
>         budget_tokens?: number | null,
>         type?: string | null
>       } | null,
>       verbosity?: string | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       reasoning?: {
>         reasoning_effort?: string | null
>       } | null,
>       temperature?: number | null
>     } | null,
>     prompt?: string | null,
>     prompt_acknowledgement?: boolean | null,
>     sliding_window_percentage?: number | null
>   } | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   deployment_id?: string | null,
>   description?: string | null,
>   embedding?: string | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   enable_sleeptime?: boolean | null,
>   entity_id?: string | null,
>   hidden?: boolean | null,
>   identities?: {
>     id?: string | null,
>     agent_ids?: string[] | null,
>     block_ids?: string[] | null,
>     identifier_key?: string | null,
>     identity_type?: string | null,
>     name?: string | null,
>     project_id?: string | null,
>     properties?: {
>       key?: string | null,
>       type?: string | null,
>       value?: string | number | boolean | {
>       } | null
>     }[] | null
>   }[] | null,
>   identity_ids?: string[] | null,
>   last_run_completion?: string | null,
>   last_run_duration_ms?: number | null,
>   last_stop_reason?: string | string | string | string | string | string | string | string | string | string | string | string | string | null,
>   last_updated_by_id?: string | null,
>   managed_group?: {
>     id?: string | null,
>     agent_ids?: string[] | null,
>     description?: string | null,
>     manager_type?: string | null,
>     base_template_id?: string | null,
>     deployment_id?: string | null,
>     hidden?: boolean | null,
>     last_processed_message_id?: string | null,
>     manager_agent_id?: string | null,
>     max_message_buffer_length?: number | null,
>     max_turns?: number | null,
>     min_message_buffer_length?: number | null,
>     project_id?: string | null,
>     shared_block_ids?: string[] | null,
>     sleeptime_agent_frequency?: number | null,
>     template_id?: string | null,
>     termination_token?: string | null,
>     turns_counter?: number | null
>   } | null,
>   max_files_open?: number | null,
>   message_buffer_autoclear?: boolean | null,
>   message_ids?: string[] | null,
>   metadata?: {
>   } | null,
>   model?: string | null,
>   model_settings?: {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking?: {
>       clear_thinking?: boolean | null,
>       type?: string | null
>     } | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     temperature?: number | null
>   } | null,
>   multi_agent_group?: {
>     id?: string | null,
>     agent_ids?: string[] | null,
>     description?: string | null,
>     manager_type?: string | null,
>     base_template_id?: string | null,
>     deployment_id?: string | null,
>     hidden?: boolean | null,
>     last_processed_message_id?: string | null,
>     manager_agent_id?: string | null,
>     max_message_buffer_length?: number | null,
>     max_turns?: number | null,
>     min_message_buffer_length?: number | null,
>     project_id?: string | null,
>     shared_block_ids?: string[] | null,
>     sleeptime_agent_frequency?: number | null,
>     template_id?: string | null,
>     termination_token?: string | null,
>     turns_counter?: number | null
>   } | null,
>   pending_approval?: {
>     id?: string | null,
>     date?: string | null,
>     tool_call?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null,
>     tool_calls?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     }[] | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null
>   } | null,
>   per_file_view_window_char_limit?: number | null,
>   project_id?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   secrets?: {
>     agent_id?: string | null,
>     key?: string | null,
>     value?: string | null,
>     id?: string | null,
>     created_at?: string | null,
>     created_by_id?: string | null,
>     description?: string | null,
>     last_updated_by_id?: string | null,
>     updated_at?: string | null,
>     value_enc?: string | null
>   }[] | null,
>   template_id?: string | null,
>   timezone?: string | null,
>   tool_exec_environment_variables?: {
>     agent_id?: string | null,
>     key?: string | null,
>     value?: string | null,
>     id?: string | null,
>     created_at?: string | null,
>     created_by_id?: string | null,
>     description?: string | null,
>     last_updated_by_id?: string | null,
>     updated_at?: string | null,
>     value_enc?: string | null
>   }[] | null,
>   tool_rules?: (
>     {
>       children?: string[] | null,
>       tool_name?: string | null,
>       child_arg_nodes?: {
>         name?: string | null,
>         args?: {
>         } | null
>       }[] | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       tool_name?: string | null,
>       args?: {
>       } | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       child_output_mapping?: Record<string, string> | null,
>       tool_name?: string | null,
>       default_child?: string | null,
>       prompt_template?: string | null,
>       require_output_mapping?: boolean | null,
>       type?: string | null
>     } | {
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       max_count_limit?: number | null,
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       children?: string[] | null,
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     }
>   )[] | null,
>   updated_at?: string | null
> }[]
> ```

***

### create

`blocks.create`

Create Block. (POST /v1/blocks/)

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.blocks.create({ label: 'example', value: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `label` | `string` | Yes | Label of the block. |
| `value` | `string` | Yes | Value of the block. |
| `base_template_id` | `string` | No | The base template id of the block. |
| `deployment_id` | `string` | No | The id of the deployment. |
| `description` | `string` | No | Description of the block. |
| `entity_id` | `string` | No | The id of the entity within the template. |
| `hidden` | `boolean` | No | If set to True, the block will be hidden. |
| `is_template` | `boolean` | No | — |
| `limit` | `number` | No | Character limit of the block. |
| `metadata` | `object` | No | Metadata of the block. |
| `preserve_on_migration` | `boolean` | No | Preserve the block on template migration. |
| `project_id` | `string` | No | The associated project id. |
| `read_only` | `boolean` | No | Whether the agent has read-only access to the block. |
| `tags` | `string[]` | No | The tags to associate with the block. |
| `template_id` | `string` | No | The id of the template. |
| `template_name` | `string` | No | Name of the block if it is a template. |

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The id of the block. |
| `value` | `string \| null` | No | Value of the block. |
| `base_template_id` | `string \| null` | No | (Deprecated) The base template id of the block. |
| `created_by_id` | `string \| null` | No | The id of the user that made this Block. |
| `deployment_id` | `string \| null` | No | (Deprecated) The id of the deployment. |
| `description` | `string \| null` | No | Description of the block. |
| `entity_id` | `string \| null` | No | (Deprecated) The id of the entity within the template. |
| `hidden` | `boolean \| null` | No | (Deprecated) If set to True, the block will be hidden. |
| `is_template` | `boolean \| null` | No | Whether the block is a template (e.g. saved human/persona options). |
| `label` | `string \| null` | No | Label of the block (e.g. 'human', 'persona') in the context window. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that last updated this Block. |
| `limit` | `number \| null` | No | Character limit of the block. |
| `metadata` | `object \| null` | No | Metadata of the block. |
| `preserve_on_migration` | `boolean \| null` | No | (Deprecated) Preserve the block on template migration. |
| `project_id` | `string \| null` | No | The associated project id. |
| `read_only` | `boolean \| null` | No | (Deprecated) Whether the agent has read-only access to the block. |
| `tags` | `string[] \| null` | No | The tags associated with the block. |
| `template_id` | `string \| null` | No | (Deprecated) The id of the template. |
| `template_name` | `string \| null` | No | (Deprecated) The name of the block template (if it is a template). |

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### delete

`blocks.delete`

Delete Block. Cannot be undone. (DELETE /v1/blocks/\{block\_id})

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.blocks.delete({ block_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `block_id` | `string` | Yes | The ID of the block in the format 'block-\<uuid4>' |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### get

`blocks.get`

Retrieve Block. (GET /v1/blocks/\{block\_id})

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.blocks.get({ block_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `block_id` | `string` | Yes | The ID of the block in the format 'block-\<uuid4>' |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The id of the block. |
| `value` | `string \| null` | No | Value of the block. |
| `base_template_id` | `string \| null` | No | (Deprecated) The base template id of the block. |
| `created_by_id` | `string \| null` | No | The id of the user that made this Block. |
| `deployment_id` | `string \| null` | No | (Deprecated) The id of the deployment. |
| `description` | `string \| null` | No | Description of the block. |
| `entity_id` | `string \| null` | No | (Deprecated) The id of the entity within the template. |
| `hidden` | `boolean \| null` | No | (Deprecated) If set to True, the block will be hidden. |
| `is_template` | `boolean \| null` | No | Whether the block is a template (e.g. saved human/persona options). |
| `label` | `string \| null` | No | Label of the block (e.g. 'human', 'persona') in the context window. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that last updated this Block. |
| `limit` | `number \| null` | No | Character limit of the block. |
| `metadata` | `object \| null` | No | Metadata of the block. |
| `preserve_on_migration` | `boolean \| null` | No | (Deprecated) Preserve the block on template migration. |
| `project_id` | `string \| null` | No | The associated project id. |
| `read_only` | `boolean \| null` | No | (Deprecated) Whether the agent has read-only access to the block. |
| `tags` | `string[] \| null` | No | The tags associated with the block. |
| `template_id` | `string \| null` | No | (Deprecated) The id of the template. |
| `template_name` | `string \| null` | No | (Deprecated) The name of the block template (if it is a template). |

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### list

`blocks.list`

List Blocks. (GET /v1/blocks/)

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.blocks.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | Cursor for pagination (block ID). Returns results relative to this ID in the specified sort order. Expected format: 'block-\<uuid4>' |
| `before` | `string` | No | Cursor for pagination (block ID). Returns results relative to this ID in the specified sort order. Expected format: 'block-\<uuid4>' |
| `connected_to_agents_count_eq` | `number[]` | No | Filter blocks by the exact number of connected agents. If provided, returns blocks that have exactly this number of connected agents. |
| `connected_to_agents_count_gt` | `number` | No | Filter blocks by the number of connected agents. If provided, returns blocks that have more than this number of connected agents. |
| `connected_to_agents_count_lt` | `number` | No | Filter blocks by the number of connected agents. If provided, returns blocks that have less than this number of connected agents. |
| `description_search` | `string` | No | Search blocks by description. If provided, returns blocks whose description matches the search query. This is a full-text search on block descriptions. |
| `identifier_keys` | `string[]` | No | Search agents by identifier keys |
| `identity_id` | `string` | No | The ID of the identity in the format 'identity-\<uuid4>' |
| `label` | `string` | No | Label to include (alphanumeric, hyphens, underscores, forward slashes) |
| `label_search` | `string` | No | Search blocks by label. If provided, returns blocks whose label matches the search query. This is a full-text search on block labels. |
| `limit` | `number` | No | Number of blocks to return |
| `match_all_tags` | `boolean` | No | If True, only returns blocks that match ALL given tags. Otherwise, return blocks that have ANY of the passed-in tags. |
| `name` | `string` | No | Name filter (alphanumeric, spaces, hyphens, underscores) |
| `order` | `asc \| desc` | No | Sort order for blocks by creation time. 'asc' for oldest first, 'desc' for newest first |
| `order_by` | `created_at` | No | Field to sort by |
| `project_id` | `string` | No | Search blocks by project id |
| `tags` | `string[]` | No | List of tags to filter blocks by |
| `templates_only` | `boolean` | No | Whether to include only templates |
| `value_search` | `string` | No | Search blocks by value. If provided, returns blocks whose value matches the search query. This is a full-text search on block values. |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   value?: string | null,
>   base_template_id?: string | null,
>   created_by_id?: string | null,
>   deployment_id?: string | null,
>   description?: string | null,
>   entity_id?: string | null,
>   hidden?: boolean | null,
>   is_template?: boolean | null,
>   label?: string | null,
>   last_updated_by_id?: string | null,
>   limit?: number | null,
>   metadata?: {
>   } | null,
>   preserve_on_migration?: boolean | null,
>   project_id?: string | null,
>   read_only?: boolean | null,
>   tags?: string[] | null,
>   template_id?: string | null,
>   template_name?: string | null
> }[]
> ```

***

### update

`blocks.update`

Update Block. (PATCH /v1/blocks/\{block\_id})

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.blocks.update({ block_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `block_id` | `string` | Yes | The ID of the block in the format 'block-\<uuid4>' |
| `base_template_id` | `string` | No | The base template id of the block. |
| `deployment_id` | `string` | No | The id of the deployment. |
| `description` | `string` | No | Description of the block. |
| `entity_id` | `string` | No | The id of the entity within the template. |
| `hidden` | `boolean` | No | If set to True, the block will be hidden. |
| `is_template` | `boolean` | No | Whether the block is a template (e.g. saved human/persona options). |
| `label` | `string` | No | Label of the block (e.g. 'human', 'persona') in the context window. |
| `limit` | `number` | No | Character limit of the block. |
| `metadata` | `object` | No | Metadata of the block. |
| `preserve_on_migration` | `boolean` | No | Preserve the block on template migration. |
| `project_id` | `string` | No | The associated project id. |
| `read_only` | `boolean` | No | Whether the agent has read-only access to the block. |
| `tags` | `string[]` | No | The tags to associate with the block. |
| `template_id` | `string` | No | The id of the template. |
| `template_name` | `string` | No | Name of the block if it is a template. |
| `value` | `string` | No | Value of the block. |

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The id of the block. |
| `value` | `string \| null` | No | Value of the block. |
| `base_template_id` | `string \| null` | No | (Deprecated) The base template id of the block. |
| `created_by_id` | `string \| null` | No | The id of the user that made this Block. |
| `deployment_id` | `string \| null` | No | (Deprecated) The id of the deployment. |
| `description` | `string \| null` | No | Description of the block. |
| `entity_id` | `string \| null` | No | (Deprecated) The id of the entity within the template. |
| `hidden` | `boolean \| null` | No | (Deprecated) If set to True, the block will be hidden. |
| `is_template` | `boolean \| null` | No | Whether the block is a template (e.g. saved human/persona options). |
| `label` | `string \| null` | No | Label of the block (e.g. 'human', 'persona') in the context window. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that last updated this Block. |
| `limit` | `number \| null` | No | Character limit of the block. |
| `metadata` | `object \| null` | No | Metadata of the block. |
| `preserve_on_migration` | `boolean \| null` | No | (Deprecated) Preserve the block on template migration. |
| `project_id` | `string \| null` | No | The associated project id. |
| `read_only` | `boolean \| null` | No | (Deprecated) Whether the agent has read-only access to the block. |
| `tags` | `string[] \| null` | No | The tags associated with the block. |
| `template_id` | `string \| null` | No | (Deprecated) The id of the template. |
| `template_name` | `string \| null` | No | (Deprecated) The name of the block template (if it is a template). |

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

## Client

### health

`client.health`

Check Health. Liveness endpoint; returns 200 when process is responsive.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.client.health({});
```

**Input:** *empty object*

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | — |
| `version` | `string \| null` | No | — |

***

## Conversations

### cancel

`conversations.cancel`

Cancel Conversation. Cancel runs associated with a conversation. Note: To cancel active runs, Redis is required. Agent-direct mode: Pass conversation\_id="default" with agent\_id query parameter to cancel runs for the agent's default conversation.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.conversations.cancel({ conversation_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | The conversation identifier. Can be a conversation ID ('conv-\<uuid4>'), 'default' for agent-direct mode (with agent\_id parameter), or an agent ID ('agent-\<uuid4>') for backwards compatibility (deprecated). |
| `agent_id` | `string` | No | Agent ID for agent-direct mode with 'default' conversation |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### create

`conversations.create`

Create Conversation. Create a new conversation for an agent.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.conversations.create({ agent_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | Yes | The agent ID to create a conversation for |
| `context_window_limit` | `number` | No | The context window limit for this conversation (overrides agent's context window). |
| `description` | `string` | No | A generated description of the conversation used for search and bootstrap context. |
| `hidden` | `boolean` | No | Whether the new conversation should be hidden from listings. |
| `model` | `string` | No | The model handle for this conversation (overrides agent's model). Format: provider/model-name. |
| `model_settings` | `object` | No | The model settings for this conversation (overrides agent's model settings). |
| `summary` | `string` | No | A summary of the conversation. |

> [accordion] model\_settings full type
>
> ```ts theme={null}
> {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: openai,
>   reasoning?: {
>     reasoning_effort?: none | minimal | low | medium | high | xhigh
>   },
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   strict?: boolean,
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: openai,
>   reasoning?: {
>     reasoning_effort?: none | minimal | low | medium | high | xhigh
>   },
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   strict?: boolean,
>   temperature?: number
> } | {
>   effort?: low | medium | high | xhigh | max,
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: anthropic,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   strict?: boolean,
>   temperature?: number,
>   thinking?: {
>     budget_tokens?: number,
>     type?: enabled | disabled
>   },
>   verbosity?: low | medium | high
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: google_ai,
>   response_schema?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number,
>   thinking_config?: {
>     include_thoughts?: boolean,
>     thinking_budget?: number
>   }
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: google_vertex,
>   response_schema?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number,
>   thinking_config?: {
>     include_thoughts?: boolean,
>     thinking_budget?: number
>   }
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: azure,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: xai,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: moonshot,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   strict?: boolean,
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: zai,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number,
>   thinking?: {
>     clear_thinking?: boolean,
>     type?: enabled | disabled
>   }
> } | {
>   effort?: low | medium | high | xhigh | max,
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: moonshot_coding,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   strict?: boolean,
>   temperature?: number,
>   thinking?: {
>     budget_tokens?: number,
>     type?: enabled | disabled
>   },
>   verbosity?: low | medium | high
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: groq,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: deepseek,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: together,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: bedrock,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: baseten,
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: openrouter,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: chatgpt_oauth,
>   reasoning?: {
>     reasoning_effort?: none | low | medium | high | xhigh
>   },
>   temperature?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The unique identifier of the conversation. |
| `agent_id` | `string \| null` | No | The ID of the agent this conversation belongs to. |
| `archived` | `boolean \| null` | No | Whether the conversation is archived. |
| `archived_at` | `string \| null` | No | Timestamp of when the conversation was archived. |
| `context_window_limit` | `number \| null` | No | The context window limit for this conversation (overrides agent's context window). |
| `created_at` | `string \| null` | No | The timestamp when the object was created. |
| `created_by_id` | `string \| null` | No | The id of the user that made this object. |
| `description` | `string \| null` | No | A generated description of the conversation used for search and bootstrap context. |
| `in_context_message_ids` | `string[] \| null` | No | The IDs of in-context messages for the conversation. Null means this field was not retrieved/hydrated for this response. |
| `last_message_at` | `string \| null` | No | Timestamp of the most recent message request sent to this conversation. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this object. |
| `model` | `string \| null` | No | The model handle for this conversation (overrides agent's model). Format: provider/model-name. |
| `model_settings` | `object \| null` | No | The model settings for this conversation (overrides agent's model settings). |
| `summary` | `string \| null` | No | A summary of the conversation. |
| `updated_at` | `string \| null` | No | The timestamp when the object was last updated. |

> [accordion] model\_settings full type
>
> ```ts theme={null}
> {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking?: {
>     clear_thinking?: boolean | null,
>     type?: string | null
>   } | null
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   temperature?: number | null
> } | null
> ```

***

### delete

`conversations.delete`

Delete Conversation. Delete a conversation. The conversation will no longer appear in list operations. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.conversations.delete({ conversation_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | The ID of the conv in the format 'conv-\<uuid4>' |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### fork

`conversations.fork`

Fork Conversation. Fork an existing conversation. Creates a new conversation that shares the same in-context messages as the source conversation, but with a newly compiled system message reflecting the latest memory block values. The forked conversation belongs to the same agent as the source.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.conversations.fork({ conversation_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | The conversation identifier. Can be a conversation ID ('conv-\<uuid4>'), 'default' for agent-direct mode (with agent\_id parameter), or an agent ID ('agent-\<uuid4>') for backwards compatibility (deprecated). |
| `agent_id` | `string` | No | Agent ID for agent-direct mode with 'default' conversation |
| `hidden` | `boolean` | No | Whether the forked conversation should be hidden from listings |
| `message_id` | `string` | No | The ID of the message in the format 'message-\<uuid4>' |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The unique identifier of the conversation. |
| `agent_id` | `string \| null` | No | The ID of the agent this conversation belongs to. |
| `archived` | `boolean \| null` | No | Whether the conversation is archived. |
| `archived_at` | `string \| null` | No | Timestamp of when the conversation was archived. |
| `context_window_limit` | `number \| null` | No | The context window limit for this conversation (overrides agent's context window). |
| `created_at` | `string \| null` | No | The timestamp when the object was created. |
| `created_by_id` | `string \| null` | No | The id of the user that made this object. |
| `description` | `string \| null` | No | A generated description of the conversation used for search and bootstrap context. |
| `in_context_message_ids` | `string[] \| null` | No | The IDs of in-context messages for the conversation. Null means this field was not retrieved/hydrated for this response. |
| `last_message_at` | `string \| null` | No | Timestamp of the most recent message request sent to this conversation. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this object. |
| `model` | `string \| null` | No | The model handle for this conversation (overrides agent's model). Format: provider/model-name. |
| `model_settings` | `object \| null` | No | The model settings for this conversation (overrides agent's model settings). |
| `summary` | `string \| null` | No | A summary of the conversation. |
| `updated_at` | `string \| null` | No | The timestamp when the object was last updated. |

> [accordion] model\_settings full type
>
> ```ts theme={null}
> {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking?: {
>     clear_thinking?: boolean | null,
>     type?: string | null
>   } | null
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   temperature?: number | null
> } | null
> ```

***

### get

`conversations.get`

Retrieve Conversation. Retrieve a specific conversation.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.conversations.get({ conversation_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | The ID of the conv in the format 'conv-\<uuid4>' |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The unique identifier of the conversation. |
| `agent_id` | `string \| null` | No | The ID of the agent this conversation belongs to. |
| `archived` | `boolean \| null` | No | Whether the conversation is archived. |
| `archived_at` | `string \| null` | No | Timestamp of when the conversation was archived. |
| `context_window_limit` | `number \| null` | No | The context window limit for this conversation (overrides agent's context window). |
| `created_at` | `string \| null` | No | The timestamp when the object was created. |
| `created_by_id` | `string \| null` | No | The id of the user that made this object. |
| `description` | `string \| null` | No | A generated description of the conversation used for search and bootstrap context. |
| `in_context_message_ids` | `string[] \| null` | No | The IDs of in-context messages for the conversation. Null means this field was not retrieved/hydrated for this response. |
| `last_message_at` | `string \| null` | No | Timestamp of the most recent message request sent to this conversation. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this object. |
| `model` | `string \| null` | No | The model handle for this conversation (overrides agent's model). Format: provider/model-name. |
| `model_settings` | `object \| null` | No | The model settings for this conversation (overrides agent's model settings). |
| `summary` | `string \| null` | No | A summary of the conversation. |
| `updated_at` | `string \| null` | No | The timestamp when the object was last updated. |

> [accordion] model\_settings full type
>
> ```ts theme={null}
> {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking?: {
>     clear_thinking?: boolean | null,
>     type?: string | null
>   } | null
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   temperature?: number | null
> } | null
> ```

***

### list

`conversations.list`

List Conversations. List all conversations for an agent (or all conversations if agent\_id not provided).

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.conversations.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | Cursor for pagination (conv ID). Returns results relative to this ID in the specified sort order. Expected format: 'conv-\<uuid4>' |
| `agent_id` | `string` | No | The agent ID to list conversations for (optional - returns all conversations if not provided) |
| `archive_status` | `unarchived \| archived \| all` | No | Whether to return unarchived conversations only, archived conversations only, or all conversations |
| `limit` | `number` | No | Maximum number of conversations to return |
| `order` | `asc \| desc` | No | Sort order for conversations. 'asc' for oldest first, 'desc' for newest first |
| `order_by` | `created_at \| last_run_completion \| last_message_at` | No | Field to sort by |
| `summary_search` | `string` | No | Search for text within conversation summaries |

**Output:** `object[] \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_id?: string | null,
>   archived?: boolean | null,
>   archived_at?: string | null,
>   context_window_limit?: number | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   in_context_message_ids?: string[] | null,
>   last_message_at?: string | null,
>   last_updated_by_id?: string | null,
>   model?: string | null,
>   model_settings?: {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking?: {
>       clear_thinking?: boolean | null,
>       type?: string | null
>     } | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     temperature?: number | null
>   } | null,
>   summary?: string | null,
>   updated_at?: string | null
> }[] | {
>   id?: string | null,
>   agent_id?: string | null,
>   archived?: boolean | null,
>   archived_at?: string | null,
>   context_window_limit?: number | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   in_context_message_ids?: string[] | null,
>   last_message_at?: string | null,
>   last_updated_by_id?: string | null,
>   model?: string | null,
>   model_settings?: {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking?: {
>       clear_thinking?: boolean | null,
>       type?: string | null
>     } | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     temperature?: number | null
>   } | null,
>   summary?: string | null,
>   updated_at?: string | null
> }
> ```

***

### messages.compact

`conversations.messages.compact`

Compact Conversation. Compact (summarize) a conversation's message history. This endpoint summarizes the in-context messages for a specific conversation, reducing the message count while preserving important context.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.conversations.messages.compact({ conversation_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | The conversation identifier. Can be a conversation ID ('conv-\<uuid4>'), 'default' for agent-direct mode (with agent\_id parameter), or an agent ID ('agent-\<uuid4>') for backwards compatibility (deprecated). |
| `agent_id` | `string` | No | Agent ID for agent-direct mode with 'default' conversation. Use with conversation\_id='default' in the URL path. |
| `compaction_settings` | `object` | No | Configuration for conversation compaction / summarization. Per-model settings (temperature, max tokens, etc.) are derived from the default configuration for that handle. |

> [accordion] compaction\_settings full type
>
> ```ts theme={null}
> {
>   clip_chars?: number,
>   mode?: all | sliding_window | self_compact_all | self_compact_sliding_window,
>   model?: string,
>   model_settings?: {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: openai,
>     reasoning?: {
>       reasoning_effort?: none | minimal | low | medium | high | xhigh
>     },
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: openai,
>     reasoning?: {
>       reasoning_effort?: none | minimal | low | medium | high | xhigh
>     },
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number
>   } | {
>     effort?: low | medium | high | xhigh | max,
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: anthropic,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number,
>     thinking?: {
>       budget_tokens?: number,
>       type?: enabled | disabled
>     },
>     verbosity?: low | medium | high
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: google_ai,
>     response_schema?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number,
>     thinking_config?: {
>       include_thoughts?: boolean,
>       thinking_budget?: number
>     }
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: google_vertex,
>     response_schema?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number,
>     thinking_config?: {
>       include_thoughts?: boolean,
>       thinking_budget?: number
>     }
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: azure,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: xai,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: moonshot,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: zai,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number,
>     thinking?: {
>       clear_thinking?: boolean,
>       type?: enabled | disabled
>     }
>   } | {
>     effort?: low | medium | high | xhigh | max,
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: moonshot_coding,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number,
>     thinking?: {
>       budget_tokens?: number,
>       type?: enabled | disabled
>     },
>     verbosity?: low | medium | high
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: groq,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: deepseek,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: together,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: bedrock,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: baseten,
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: openrouter,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: chatgpt_oauth,
>     reasoning?: {
>       reasoning_effort?: none | low | medium | high | xhigh
>     },
>     temperature?: number
>   },
>   prompt?: string,
>   prompt_acknowledgement?: boolean,
>   sliding_window_percentage?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `num_messages_after` | `number \| null` | No | — |
| `num_messages_before` | `number \| null` | No | — |
| `summary` | `string \| null` | No | — |

***

### messages.create

`conversations.messages.create`

Send Conversation Message. Send a message to a conversation and get a response. This endpoint sends a message to an existing conversation. By default (streaming=true), returns a streaming response (Server-Sent Events). Set streaming=false to get a complete JSON response. Runs the agent in this conversation: it calls its model and may run tools. Letta streams by default here: the answer is the server-sent event text as a string unless you pass streaming: false.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.conversations.messages.create({ conversation_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | The conversation identifier. Can be a conversation ID ('conv-\<uuid4>'), 'default' for agent-direct mode (with agent\_id parameter), or an agent ID ('agent-\<uuid4>') for backwards compatibility (deprecated). |
| `agent_id` | `string` | No | Agent ID for agent-direct mode with 'default' conversation. Use with conversation\_id='default' in the URL path. |
| `assistant_message_tool_kwarg` | `string` | No | The name of the message argument in the designated message tool. Still supported for legacy agent types, but deprecated for letta\_v1\_agent onward. |
| `assistant_message_tool_name` | `string` | No | The name of the designated message tool. Still supported for legacy agent types, but deprecated for letta\_v1\_agent onward. |
| `background` | `boolean` | No | Whether to process the request in the background (only used when streaming=true). |
| `client_skills` | `object[]` | No | Client-side skills available in the environment. These are rendered in the system prompt's available skills section alongside agent-scoped skills from MemFS. |
| `client_tools` | `object[]` | No | Client-side tools that the agent can call. When the agent calls a client-side tool, execution pauses and returns control to the client to execute the tool and provide the result via a ToolReturn. |
| `enable_thinking` | `string` | No | If set to True, enables reasoning before responses or tool calls from the agent. |
| `include_compaction_messages` | `boolean` | No | If True, compaction events emit structured `SummaryMessage` and `EventMessage` types. If False (default), compaction messages are not included in the response. |
| `include_pings` | `boolean` | No | Whether to include periodic keepalive ping messages in the stream to prevent connection timeouts (only used when streaming=true). |
| `include_return_message_types` | `(system_message \| user_message \| assistant_message \| reasoning_message \| hidden_reasoning_message \| tool_call_message \| tool_return_message \| approval_request_message \| approval_response_message \| summary_message \| event_message)[]` | No | Only return specified message types in the response. If `None` (default) returns all messages. |
| `input` | `string \| object[] \| object` | No | Syntactic sugar for a single user message. Equivalent to messages=\[\{'role': 'user', 'content': input}]. |
| `max_steps` | `number` | No | Maximum number of steps the agent should take to process the request. |
| `messages` | `object[]` | No | The messages to be sent to the agent. |
| `override_model` | `string` | No | Model handle to use for this request instead of the agent's default model. This allows sending a message to a different model without changing the agent's configuration. |
| `override_system` | `string` | No | Optional per-request system prompt override. When set, this is passed directly to the underlying LLM request and bypasses the persisted/compiled system message for that request. |
| `return_logprobs` | `boolean` | No | If True, returns log probabilities of the output tokens in the response. Useful for RL training. Only supported for OpenAI-compatible providers (including SGLang). |
| `return_token_ids` | `boolean` | No | If True, returns token IDs and logprobs for ALL LLM generations in the agent step, not just the last one. Uses SGLang native /generate endpoint. Returns 'turns' field with TurnTokenData for each assistant/tool turn. Required for proper multi-turn RL training with loss masking. |
| `stream_tokens` | `boolean` | No | Flag to determine if individual tokens should be streamed, rather than streaming per step (only used when streaming=true). |
| `streaming` | `boolean` | No | If True (default), returns a streaming response (Server-Sent Events). If False, returns a complete JSON response. |
| `top_logprobs` | `number` | No | Number of most likely tokens to return at each position (0-20). Requires return\_logprobs=True. |
| `use_assistant_message` | `boolean` | No | Whether the server should parse specific tool call arguments (default `send_message`) as `AssistantMessage` objects. Still supported for legacy agent types, but deprecated for letta\_v1\_agent onward. |

> [accordion] client\_skills full type
>
> ```ts theme={null}
> {
>   description: string,
>   location: string,
>   name: string
> }[]
> ```

> [accordion] client\_tools full type
>
> ```ts theme={null}
> {
>   name: string,
>   description?: string,
>   parameters?: {
>   }
> }[]
> ```

> [accordion] input full type
>
> ```ts theme={null}
> string | (
>   {
>     text: string,
>     signature?: string,
>     type?: text
>   } | {
>     source: {
>       url: string,
>       type?: url
>     } | {
>       data: string,
>       media_type: string,
>       detail?: string,
>       type?: base64
>     } | {
>       file_id: string,
>       data?: string,
>       detail?: string,
>       media_type?: string,
>       type?: letta
>     },
>     type?: image
>   } | {
>     id: string,
>     input: {
>     },
>     name: string,
>     signature?: string,
>     type?: tool_call
>   } | {
>     content: string,
>     is_error: boolean,
>     tool_call_id: string,
>     type?: tool_return
>   } | {
>     is_native: boolean,
>     reasoning: string,
>     signature?: string,
>     type?: reasoning
>   } | {
>     data: string,
>     type?: redacted_reasoning
>   } | {
>     signature?: string,
>     type?: omitted_reasoning
>   } | {
>     id: string,
>     summary: {
>       index: number,
>       text: string
>     }[],
>     encrypted_content?: string,
>     type?: summarized_reasoning
>   }
> )[] | {
>   source: {
>     url: string,
>     type?: url
>   } | {
>     data: string,
>     media_type: string,
>     detail?: string,
>     type?: base64
>   } | {
>     file_id: string,
>     data?: string,
>     detail?: string,
>     media_type?: string,
>     type?: letta
>   },
>   type?: image
> } | {
>   id: string,
>   input: {
>   },
>   name: string,
>   signature?: string,
>   type?: tool_call
> }
> ```

> [accordion] messages full type
>
> ```ts theme={null}
> (
>   {
>     content: (
>       {
>         text: string,
>         signature?: string,
>         type?: text
>       } | {
>         source: {
>           url: string,
>           type?: url
>         } | {
>           data: string,
>           media_type: string,
>           detail?: string,
>           type?: base64
>         } | {
>           file_id: string,
>           data?: string,
>           detail?: string,
>           media_type?: string,
>           type?: letta
>         },
>         type?: image
>       } | {
>         id: string,
>         input: {
>         },
>         name: string,
>         signature?: string,
>         type?: tool_call
>       } | {
>         content: string,
>         is_error: boolean,
>         tool_call_id: string,
>         type?: tool_return
>       } | {
>         is_native: boolean,
>         reasoning: string,
>         signature?: string,
>         type?: reasoning
>       } | {
>         data: string,
>         type?: redacted_reasoning
>       } | {
>         signature?: string,
>         type?: omitted_reasoning
>       }
>     )[] | string,
>     role: user | system | assistant,
>     batch_item_id?: string,
>     group_id?: string,
>     name?: string,
>     otid?: string,
>     sender_id?: string,
>     type?: message
>   } | {
>     approval_request_id?: string,
>     approvals?: (
>       {
>         approve: boolean,
>         tool_call_id: string,
>         reason?: string,
>         type?: approval
>       } | {
>         status: success | error,
>         tool_call_id: string,
>         tool_return: (
>           {
>             text: string,
>             signature?: string,
>             type?: text
>           } | {
>             source: {
>               url: string,
>               type?: url
>             } | {
>               data: string,
>               media_type: string,
>               detail?: string,
>               type?: base64
>             } | {
>               file_id: string,
>               data?: string,
>               detail?: string,
>               media_type?: string,
>               type?: letta
>             },
>             type?: image
>           }
>         )[] | string,
>         stderr?: string[],
>         stdout?: string[],
>         type?: tool
>       }
>     )[],
>     approve?: boolean,
>     group_id?: string,
>     otid?: string,
>     reason?: string,
>     type?: approval
>   } | {
>     content: (
>       {
>         text: string,
>         signature?: string,
>         type?: text
>       } | {
>         source: {
>           url: string,
>           type?: url
>         } | {
>           data: string,
>           media_type: string,
>           detail?: string,
>           type?: base64
>         } | {
>           file_id: string,
>           data?: string,
>           detail?: string,
>           media_type?: string,
>           type?: letta
>         },
>         type?: image
>       } | {
>         id: string,
>         input: {
>         },
>         name: string,
>         signature?: string,
>         type?: tool_call
>       } | {
>         content: string,
>         is_error: boolean,
>         tool_call_id: string,
>         type?: tool_return
>       } | {
>         is_native: boolean,
>         reasoning: string,
>         signature?: string,
>         type?: reasoning
>       } | {
>         data: string,
>         type?: redacted_reasoning
>       } | {
>         signature?: string,
>         type?: omitted_reasoning
>       }
>     )[] | string,
>     role: user | system | assistant,
>     batch_item_id?: string,
>     group_id?: string,
>     name?: string,
>     otid?: string,
>     sender_id?: string,
>     type?: message
>   }
> )[]
> ```

**Output:** `object \| string`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   messages?: (
>     {
>       id?: string | null,
>       content?: string | null,
>       date?: string | null,
>       is_err?: boolean | null,
>       message_type?: string | null,
>       name?: string | null,
>       otid?: string | null,
>       run_id?: string | null,
>       sender_id?: string | null,
>       seq_id?: number | null,
>       step_id?: string | null
>     } | {
>       id?: string | null,
>       content?: (
>         {
>           text?: string | null,
>           signature?: string | null,
>           type?: string | null
>         } | {
>           source?: {
>             url?: string | null,
>             type?: string | null
>           } | {
>             data?: string | null,
>             media_type?: string | null,
>             detail?: string | null,
>             type?: string | null
>           } | {
>             file_id?: string | null,
>             data?: string | null,
>             detail?: string | null,
>             media_type?: string | null,
>             type?: string | null
>           } | null,
>           type?: string | null
>         }
>       )[] | string | null,
>       date?: string | null,
>       is_err?: boolean | null,
>       message_type?: string | null,
>       name?: string | null,
>       otid?: string | null,
>       run_id?: string | null,
>       sender_id?: string | null,
>       seq_id?: number | null,
>       step_id?: string | null
>     } | {
>       id?: string | null,
>       date?: string | null,
>       reasoning?: string | null,
>       is_err?: boolean | null,
>       message_type?: string | null,
>       name?: string | null,
>       otid?: string | null,
>       run_id?: string | null,
>       sender_id?: string | null,
>       seq_id?: number | null,
>       signature?: string | null,
>       source?: string | null,
>       step_id?: string | null
>     } | {
>       id?: string | null,
>       date?: string | null,
>       state?: string | null,
>       hidden_reasoning?: string | null,
>       is_err?: boolean | null,
>       message_type?: string | null,
>       name?: string | null,
>       otid?: string | null,
>       run_id?: string | null,
>       sender_id?: string | null,
>       seq_id?: number | null,
>       step_id?: string | null
>     } | {
>       id?: string | null,
>       date?: string | null,
>       tool_call?: {
>         arguments?: string | null,
>         name?: string | null,
>         tool_call_id?: string | null
>       } | {
>         arguments?: string | null,
>         name?: string | null,
>         tool_call_id?: string | null
>       } | null,
>       is_err?: boolean | null,
>       message_type?: string | null,
>       name?: string | null,
>       otid?: string | null,
>       run_id?: string | null,
>       sender_id?: string | null,
>       seq_id?: number | null,
>       step_id?: string | null,
>       tool_calls?: {
>         arguments?: string | null,
>         name?: string | null,
>         tool_call_id?: string | null
>       }[] | {
>         arguments?: string | null,
>         name?: string | null,
>         tool_call_id?: string | null
>       } | null
>     } | {
>       id?: string | null,
>       date?: string | null,
>       status?: string | null,
>       tool_call_id?: string | null,
>       tool_return?: string | null,
>       is_err?: boolean | null,
>       message_type?: string | null,
>       name?: string | null,
>       otid?: string | null,
>       run_id?: string | null,
>       sender_id?: string | null,
>       seq_id?: number | null,
>       stderr?: string[] | null,
>       stdout?: string[] | null,
>       step_id?: string | null,
>       tool_returns?: {
>         status?: string | null,
>         tool_call_id?: string | null,
>         tool_return?: (
>           {
>             text?: string | null,
>             signature?: string | null,
>             type?: string | null
>           } | {
>             source?: {
>               url?: string | null,
>               type?: string | null
>             } | {
>               data?: string | null,
>               media_type?: string | null,
>               detail?: string | null,
>               type?: string | null
>             } | {
>               file_id?: string | null,
>               data?: string | null,
>               detail?: string | null,
>               media_type?: string | null,
>               type?: string | null
>             } | null,
>             type?: string | null
>           }
>         )[] | string | null,
>         stderr?: string[] | null,
>         stdout?: string[] | null,
>         type?: string | null
>       }[] | null
>     } | {
>       id?: string | null,
>       content?: {
>         text?: string | null,
>         signature?: string | null,
>         type?: string | null
>       }[] | string | null,
>       date?: string | null,
>       is_err?: boolean | null,
>       message_type?: string | null,
>       name?: string | null,
>       otid?: string | null,
>       run_id?: string | null,
>       sender_id?: string | null,
>       seq_id?: number | null,
>       step_id?: string | null
>     } | {
>       id?: string | null,
>       date?: string | null,
>       tool_call?: {
>         arguments?: string | null,
>         name?: string | null,
>         tool_call_id?: string | null
>       } | {
>         arguments?: string | null,
>         name?: string | null,
>         tool_call_id?: string | null
>       } | null,
>       is_err?: boolean | null,
>       message_type?: string | null,
>       name?: string | null,
>       otid?: string | null,
>       run_id?: string | null,
>       sender_id?: string | null,
>       seq_id?: number | null,
>       step_id?: string | null,
>       tool_calls?: {
>         arguments?: string | null,
>         name?: string | null,
>         tool_call_id?: string | null
>       }[] | {
>         arguments?: string | null,
>         name?: string | null,
>         tool_call_id?: string | null
>       } | null
>     } | {
>       id?: string | null,
>       date?: string | null,
>       approval_request_id?: string | null,
>       approvals?: (
>         {
>           approve?: boolean | null,
>           tool_call_id?: string | null,
>           reason?: string | null,
>           type?: string | null
>         } | {
>           status?: string | null,
>           tool_call_id?: string | null,
>           tool_return?: (
>             {
>               text?: string | null,
>               signature?: string | null,
>               type?: string | null
>             } | {
>               source?: {
>                 url?: string | null,
>                 type?: string | null
>               } | {
>                 data?: string | null,
>                 media_type?: string | null,
>                 detail?: string | null,
>                 type?: string | null
>               } | {
>                 file_id?: string | null,
>                 data?: string | null,
>                 detail?: string | null,
>                 media_type?: string | null,
>                 type?: string | null
>               } | null,
>               type?: string | null
>             }
>           )[] | string | null,
>           stderr?: string[] | null,
>           stdout?: string[] | null,
>           type?: string | null
>         }
>       )[] | null,
>       approve?: boolean | null,
>       is_err?: boolean | null,
>       message_type?: string | null,
>       name?: string | null,
>       otid?: string | null,
>       reason?: string | null,
>       run_id?: string | null,
>       sender_id?: string | null,
>       seq_id?: number | null,
>       step_id?: string | null
>     } | {
>       id?: string | null,
>       date?: string | null,
>       summary?: string | null,
>       compaction_stats?: {
>         context_window?: number | null,
>         messages_count_after?: number | null,
>         messages_count_before?: number | null,
>         trigger?: string | null,
>         context_tokens_after?: number | null,
>         context_tokens_before?: number | null
>       } | null,
>       is_err?: boolean | null,
>       message_type?: string | null,
>       name?: string | null,
>       otid?: string | null,
>       run_id?: string | null,
>       sender_id?: string | null,
>       seq_id?: number | null,
>       step_id?: string | null
>     } | {
>       id?: string | null,
>       date?: string | null,
>       event_data?: {
>       } | null,
>       event_type?: string | null,
>       is_err?: boolean | null,
>       message_type?: string | null,
>       name?: string | null,
>       otid?: string | null,
>       run_id?: string | null,
>       sender_id?: string | null,
>       seq_id?: number | null,
>       step_id?: string | null
>     }
>   )[] | null,
>   stop_reason?: {
>     stop_reason?: string | string | string | string | string | string | string | string | string | string | string | string | string | null,
>     message_type?: string | null
>   } | null,
>   usage?: {
>     cache_write_tokens?: number | null,
>     cached_input_tokens?: number | null,
>     completion_tokens?: number | null,
>     context_tokens?: number | null,
>     message_type?: string | null,
>     prompt_tokens?: number | null,
>     reasoning_tokens?: number | null,
>     run_ids?: string[] | null,
>     step_count?: number | null,
>     total_tokens?: number | null
>   } | null,
>   logprobs?: {
>     content?: {
>       token?: string | null,
>       logprob?: number | null,
>       top_logprobs?: {
>         token?: string | null,
>         logprob?: number | null,
>         bytes?: number[] | null
>       }[] | null,
>       bytes?: number[] | null
>     }[] | null,
>     refusal?: {
>       token?: string | null,
>       logprob?: number | null,
>       top_logprobs?: {
>         token?: string | null,
>         logprob?: number | null,
>         bytes?: number[] | null
>       }[] | null,
>       bytes?: number[] | null
>     }[] | null
>   } | null,
>   turns?: {
>     role?: string | null,
>     content?: string | null,
>     output_ids?: number[] | null,
>     output_token_logprobs?: any[][] | null,
>     tool_name?: string | null
>   }[] | null
> } | string
> ```

***

### messages.list

`conversations.messages.list`

List Conversation Messages. List all messages in a conversation. Returns LettaMessage objects (UserMessage, AssistantMessage, etc.) for all messages in the conversation, with support for cursor-based pagination.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.conversations.messages.list({ conversation_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | The conversation identifier. Can be a conversation ID ('conv-\<uuid4>'), 'default' for agent-direct mode (with agent\_id parameter), or an agent ID ('agent-\<uuid4>') for backwards compatibility (deprecated). |
| `after` | `string` | No | Cursor for pagination (message ID). Returns results relative to this ID in the specified sort order. Expected format: 'message-\<uuid4>' |
| `agent_id` | `string` | No | Agent ID for agent-direct mode with 'default' conversation |
| `before` | `string` | No | Cursor for pagination (message ID). Returns results relative to this ID in the specified sort order. Expected format: 'message-\<uuid4>' |
| `group_id` | `string` | No | Group ID to filter messages by. |
| `include_err` | `boolean` | No | Whether to include error messages and error statuses. For debugging purposes only. |
| `include_return_message_types` | `(system_message \| user_message \| assistant_message \| reasoning_message \| hidden_reasoning_message \| tool_call_message \| tool_return_message \| approval_request_message \| approval_response_message \| summary_message \| event_message)[]` | No | Message types to include in response. When null, all message types are returned. |
| `limit` | `number` | No | Maximum number of messages to return |
| `order` | `asc \| desc` | No | Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first |
| `order_by` | `created_at` | No | Field to sort by |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> (
>   {
>     id?: string | null,
>     content?: string | null,
>     date?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     content?: (
>       {
>         text?: string | null,
>         signature?: string | null,
>         type?: string | null
>       } | {
>         source?: {
>           url?: string | null,
>           type?: string | null
>         } | {
>           data?: string | null,
>           media_type?: string | null,
>           detail?: string | null,
>           type?: string | null
>         } | {
>           file_id?: string | null,
>           data?: string | null,
>           detail?: string | null,
>           media_type?: string | null,
>           type?: string | null
>         } | null,
>         type?: string | null
>       }
>     )[] | string | null,
>     date?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     reasoning?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     signature?: string | null,
>     source?: string | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     state?: string | null,
>     hidden_reasoning?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     tool_call?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null,
>     tool_calls?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     }[] | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     status?: string | null,
>     tool_call_id?: string | null,
>     tool_return?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     stderr?: string[] | null,
>     stdout?: string[] | null,
>     step_id?: string | null,
>     tool_returns?: {
>       status?: string | null,
>       tool_call_id?: string | null,
>       tool_return?: (
>         {
>           text?: string | null,
>           signature?: string | null,
>           type?: string | null
>         } | {
>           source?: {
>             url?: string | null,
>             type?: string | null
>           } | {
>             data?: string | null,
>             media_type?: string | null,
>             detail?: string | null,
>             type?: string | null
>           } | {
>             file_id?: string | null,
>             data?: string | null,
>             detail?: string | null,
>             media_type?: string | null,
>             type?: string | null
>           } | null,
>           type?: string | null
>         }
>       )[] | string | null,
>       stderr?: string[] | null,
>       stdout?: string[] | null,
>       type?: string | null
>     }[] | null
>   } | {
>     id?: string | null,
>     content?: {
>       text?: string | null,
>       signature?: string | null,
>       type?: string | null
>     }[] | string | null,
>     date?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     tool_call?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null,
>     tool_calls?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     }[] | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     approval_request_id?: string | null,
>     approvals?: (
>       {
>         approve?: boolean | null,
>         tool_call_id?: string | null,
>         reason?: string | null,
>         type?: string | null
>       } | {
>         status?: string | null,
>         tool_call_id?: string | null,
>         tool_return?: (
>           {
>             text?: string | null,
>             signature?: string | null,
>             type?: string | null
>           } | {
>             source?: {
>               url?: string | null,
>               type?: string | null
>             } | {
>               data?: string | null,
>               media_type?: string | null,
>               detail?: string | null,
>               type?: string | null
>             } | {
>               file_id?: string | null,
>               data?: string | null,
>               detail?: string | null,
>               media_type?: string | null,
>               type?: string | null
>             } | null,
>             type?: string | null
>           }
>         )[] | string | null,
>         stderr?: string[] | null,
>         stdout?: string[] | null,
>         type?: string | null
>       }
>     )[] | null,
>     approve?: boolean | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     reason?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     summary?: string | null,
>     compaction_stats?: {
>       context_window?: number | null,
>       messages_count_after?: number | null,
>       messages_count_before?: number | null,
>       trigger?: string | null,
>       context_tokens_after?: number | null,
>       context_tokens_before?: number | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     event_data?: {
>     } | null,
>     event_type?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   }
> )[]
> ```

***

### messages.stream

`conversations.messages.stream`

Retrieve Conversation Stream. Resume the stream for the most recent active run in a conversation. This endpoint allows you to reconnect to an active background stream for a conversation, enabling recovery from network interruptions.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.conversations.messages.stream({ conversation_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | The conversation identifier. Can be a conversation ID ('conv-\<uuid4>'), 'default' for agent-direct mode (with agent\_id parameter), or an agent ID ('agent-\<uuid4>') for backwards compatibility (deprecated). |
| `agent_id` | `string` | No | Agent ID for agent-direct mode with 'default' conversation. Use with conversation\_id='default' in the URL path. |
| `batch_size` | `number` | No | Number of entries to read per batch. |
| `include_pings` | `boolean` | No | Whether to include periodic keepalive ping messages in the stream to prevent connection timeouts. |
| `otid` | `string` | No | Offline threading ID to look up the run\_id. Bypasses active run lookup if run\_id not provided. |
| `poll_interval` | `number` | No | Seconds to wait between polls when no new data. |
| `run_id` | `string` | No | Run ID to stream directly, bypassing run lookup. Use for recovery from duplicate requests. |
| `starting_after` | `number` | No | Sequence id to use as a cursor for pagination. Response will start streaming after this chunk sequence id |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `text` | `string` | Yes | The response body as text. |
| `contentType` | `string \| null` | Yes | The content type Letta answered with. |

***

### recompile

`conversations.recompile`

Recompile Conversation. Manually trigger system prompt recompilation for a conversation.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.conversations.recompile({ conversation_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | The conversation identifier. Can be a conversation ID ('conv-\<uuid4>'), 'default' for agent-direct mode (with agent\_id parameter), or an agent ID ('agent-\<uuid4>') for backwards compatibility (deprecated). |
| `dry_run` | `boolean` | No | If True, do not persist changes; still returns the compiled system prompt. |
| `agent_id` | `string` | No | Agent ID for agent-direct mode with 'default' conversation. Use with conversation\_id='default' in the URL path. |
| `compaction_settings` | `object` | No | Configuration for conversation compaction / summarization. Per-model settings (temperature, max tokens, etc.) are derived from the default configuration for that handle. |

> [accordion] compaction\_settings full type
>
> ```ts theme={null}
> {
>   clip_chars?: number,
>   mode?: all | sliding_window | self_compact_all | self_compact_sliding_window,
>   model?: string,
>   model_settings?: {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: openai,
>     reasoning?: {
>       reasoning_effort?: none | minimal | low | medium | high | xhigh
>     },
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: openai,
>     reasoning?: {
>       reasoning_effort?: none | minimal | low | medium | high | xhigh
>     },
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number
>   } | {
>     effort?: low | medium | high | xhigh | max,
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: anthropic,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number,
>     thinking?: {
>       budget_tokens?: number,
>       type?: enabled | disabled
>     },
>     verbosity?: low | medium | high
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: google_ai,
>     response_schema?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number,
>     thinking_config?: {
>       include_thoughts?: boolean,
>       thinking_budget?: number
>     }
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: google_vertex,
>     response_schema?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number,
>     thinking_config?: {
>       include_thoughts?: boolean,
>       thinking_budget?: number
>     }
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: azure,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: xai,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: moonshot,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: zai,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number,
>     thinking?: {
>       clear_thinking?: boolean,
>       type?: enabled | disabled
>     }
>   } | {
>     effort?: low | medium | high | xhigh | max,
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: moonshot_coding,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     strict?: boolean,
>     temperature?: number,
>     thinking?: {
>       budget_tokens?: number,
>       type?: enabled | disabled
>     },
>     verbosity?: low | medium | high
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: groq,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: deepseek,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: together,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: bedrock,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: baseten,
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: openrouter,
>     response_format?: {
>       type?: text
>     } | {
>       json_schema: {
>       },
>       type?: json_schema
>     } | {
>       type?: json_object
>     },
>     temperature?: number
>   } | {
>     max_output_tokens?: number,
>     parallel_tool_calls?: boolean,
>     provider_type?: chatgpt_oauth,
>     reasoning?: {
>       reasoning_effort?: none | low | medium | high | xhigh
>     },
>     temperature?: number
>   },
>   prompt?: string,
>   prompt_acknowledgement?: boolean,
>   sliding_window_percentage?: number
> }
> ```

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### update

`conversations.update`

Update Conversation. Update a conversation.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.conversations.update({ conversation_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `conversation_id` | `string` | Yes | The ID of the conv in the format 'conv-\<uuid4>' |
| `archived` | `boolean` | No | Whether the conversation is archived. |
| `context_window_limit` | `number` | No | The context window limit for this conversation (overrides agent's context window). |
| `description` | `string` | No | A generated description of the conversation used for search and bootstrap context. |
| `last_message_at` | `string` | No | Timestamp of the most recent message request sent to this conversation. |
| `model` | `string` | No | The model handle for this conversation (overrides agent's model). Format: provider/model-name. |
| `model_settings` | `object` | No | The model settings for this conversation (overrides agent's model settings). |
| `summary` | `string` | No | A summary of the conversation. |

> [accordion] model\_settings full type
>
> ```ts theme={null}
> {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: openai,
>   reasoning?: {
>     reasoning_effort?: none | minimal | low | medium | high | xhigh
>   },
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   strict?: boolean,
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: openai,
>   reasoning?: {
>     reasoning_effort?: none | minimal | low | medium | high | xhigh
>   },
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   strict?: boolean,
>   temperature?: number
> } | {
>   effort?: low | medium | high | xhigh | max,
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: anthropic,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   strict?: boolean,
>   temperature?: number,
>   thinking?: {
>     budget_tokens?: number,
>     type?: enabled | disabled
>   },
>   verbosity?: low | medium | high
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: google_ai,
>   response_schema?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number,
>   thinking_config?: {
>     include_thoughts?: boolean,
>     thinking_budget?: number
>   }
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: google_vertex,
>   response_schema?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number,
>   thinking_config?: {
>     include_thoughts?: boolean,
>     thinking_budget?: number
>   }
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: azure,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: xai,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: moonshot,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   strict?: boolean,
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: zai,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number,
>   thinking?: {
>     clear_thinking?: boolean,
>     type?: enabled | disabled
>   }
> } | {
>   effort?: low | medium | high | xhigh | max,
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: moonshot_coding,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   strict?: boolean,
>   temperature?: number,
>   thinking?: {
>     budget_tokens?: number,
>     type?: enabled | disabled
>   },
>   verbosity?: low | medium | high
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: groq,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: deepseek,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: together,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: bedrock,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: baseten,
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: openrouter,
>   response_format?: {
>     type?: text
>   } | {
>     json_schema: {
>     },
>     type?: json_schema
>   } | {
>     type?: json_object
>   },
>   temperature?: number
> } | {
>   max_output_tokens?: number,
>   parallel_tool_calls?: boolean,
>   provider_type?: chatgpt_oauth,
>   reasoning?: {
>     reasoning_effort?: none | low | medium | high | xhigh
>   },
>   temperature?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The unique identifier of the conversation. |
| `agent_id` | `string \| null` | No | The ID of the agent this conversation belongs to. |
| `archived` | `boolean \| null` | No | Whether the conversation is archived. |
| `archived_at` | `string \| null` | No | Timestamp of when the conversation was archived. |
| `context_window_limit` | `number \| null` | No | The context window limit for this conversation (overrides agent's context window). |
| `created_at` | `string \| null` | No | The timestamp when the object was created. |
| `created_by_id` | `string \| null` | No | The id of the user that made this object. |
| `description` | `string \| null` | No | A generated description of the conversation used for search and bootstrap context. |
| `in_context_message_ids` | `string[] \| null` | No | The IDs of in-context messages for the conversation. Null means this field was not retrieved/hydrated for this response. |
| `last_message_at` | `string \| null` | No | Timestamp of the most recent message request sent to this conversation. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this object. |
| `model` | `string \| null` | No | The model handle for this conversation (overrides agent's model). Format: provider/model-name. |
| `model_settings` | `object \| null` | No | The model settings for this conversation (overrides agent's model settings). |
| `summary` | `string \| null` | No | A summary of the conversation. |
| `updated_at` | `string \| null` | No | The timestamp when the object was last updated. |

> [accordion] model\_settings full type
>
> ```ts theme={null}
> {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_schema?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking_config?: {
>     include_thoughts?: boolean | null,
>     thinking_budget?: number | null
>   } | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null,
>   thinking?: {
>     clear_thinking?: boolean | null,
>     type?: string | null
>   } | null
> } | {
>   effort?: string | null,
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   thinking?: {
>     budget_tokens?: number | null,
>     type?: string | null
>   } | null,
>   verbosity?: string | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   temperature?: number | null
> } | {
>   max_output_tokens?: number | null,
>   parallel_tool_calls?: boolean | null,
>   provider_type?: string | null,
>   reasoning?: {
>     reasoning_effort?: string | null
>   } | null,
>   temperature?: number | null
> } | null
> ```

***

## Environments

### get

`environments.get`

Get Environment Connection. Get a specific environment connection by deviceId.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.environments.get({ deviceId: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `deviceId` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `connectedAt` | `number \| null` | No | — |
| `connectionId` | `string \| null` | No | — |
| `connectionName` | `string \| null` | No | — |
| `deviceId` | `string \| null` | No | — |
| `firstSeenAt` | `number \| null` | No | — |
| `lastHeartbeat` | `number \| null` | No | — |
| `lastSeenAt` | `number \| null` | No | — |
| `organizationId` | `string \| null` | No | — |
| `podId` | `string \| null` | No | — |
| `apiKeyOwner` | `string \| null` | No | — |
| `currentMode` | `string \| null` | No | — |
| `metadata` | `object \| null` | No | — |
| `userId` | `string \| null` | No | — |

> [accordion] metadata full type
>
> ```ts theme={null}
> {
>   gitBranch?: string | null,
>   lettaCodeVersion?: string | null,
>   nodeVersion?: string | null,
>   os?: string | null,
>   self_update?: {
>     supported?: boolean | null,
>     writable?: boolean | null,
>     install_path?: string | null,
>     manual_command?: string | null,
>     reason?: string | null
>   } | null,
>   supported_commands?: string[] | null,
>   workingDirectory?: string | null
> } | null
> ```

***

### list

`environments.list`

List Environment Connections. List all active environment connections for the organization.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.environments.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | — |
| `limit` | `string` | No | — |
| `onlineOnly` | `string` | No | — |
| `source` | `local \| remote` | No | — |
| `userId` | `string` | No | — |

**Output:** `object[] \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   connections?: {
>     id?: string | null,
>     connectedAt?: number | null,
>     connectionId?: string | null,
>     connectionName?: string | null,
>     deviceId?: string | null,
>     firstSeenAt?: number | null,
>     lastHeartbeat?: number | null,
>     lastSeenAt?: number | null,
>     organizationId?: string | null,
>     podId?: string | null,
>     apiKeyOwner?: string | null,
>     currentMode?: string | null,
>     metadata?: {
>       gitBranch?: string | null,
>       lettaCodeVersion?: string | null,
>       nodeVersion?: string | null,
>       os?: string | null,
>       self_update?: {
>         supported?: boolean | null,
>         writable?: boolean | null,
>         install_path?: string | null,
>         manual_command?: string | null,
>         reason?: string | null
>       } | null,
>       supported_commands?: string[] | null,
>       workingDirectory?: string | null
>     } | null,
>     userId?: string | null
>   }[] | null,
>   hasNextPage?: boolean | null
> }[] | {
>   connections?: {
>     id?: string | null,
>     connectedAt?: number | null,
>     connectionId?: string | null,
>     connectionName?: string | null,
>     deviceId?: string | null,
>     firstSeenAt?: number | null,
>     lastHeartbeat?: number | null,
>     lastSeenAt?: number | null,
>     organizationId?: string | null,
>     podId?: string | null,
>     apiKeyOwner?: string | null,
>     currentMode?: string | null,
>     metadata?: {
>       gitBranch?: string | null,
>       lettaCodeVersion?: string | null,
>       nodeVersion?: string | null,
>       os?: string | null,
>       self_update?: {
>         supported?: boolean | null,
>         writable?: boolean | null,
>         install_path?: string | null,
>         manual_command?: string | null,
>         reason?: string | null
>       } | null,
>       supported_commands?: string[] | null,
>       workingDirectory?: string | null
>     } | null,
>     userId?: string | null
>   }[] | null,
>   hasNextPage?: boolean | null
> }
> ```

***

### sendMessage

`environments.sendMessage`

Send Message to Environment. Send a message to a specific environment connection.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.environments.sendMessage({
	connectionId: 'example',
	messages: [{ client_message_id: 'example', content: 'example', role: 'user' }],
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `connectionId` | `string` | Yes | — |
| `messages` | `object[]` | Yes | — |
| `agentId` | `string` | No | — |
| `conversationId` | `string` | No | — |

> [accordion] messages full type
>
> ```ts theme={null}
> (
>   {
>     client_message_id: string,
>     content: string | {
>       text: string,
>       type: text
>     }[],
>     role: user,
>     otid?: string
>   } | {
>     approvals: (
>       {
>         status: success | error,
>         tool_call_id: string,
>         tool_return: string | {
>           text: string,
>           type: text
>         }[],
>         stderr?: string[],
>         stdout?: string[],
>         type?: tool
>       } | {
>         approve: boolean,
>         tool_call_id: string,
>         reason?: string,
>         type?: approval,
>         updated_input?: {
>         }
>       }
>     )[],
>     type: approval
>   }
> )[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `message` | `string \| null` | No | — |
| `success` | `boolean \| null` | No | — |

***

## Folders

### agents.list

`folders.agents.list`

List Agents For Folder. Get all agent IDs that have the specified folder attached. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.folders.agents.list({ folder_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `folder_id` | `string` | Yes | The ID of the source in the format 'source-\<uuid4>' |
| `after` | `string` | No | Cursor for pagination (agent ID). Returns results relative to this ID in the specified sort order. Expected format: 'agent-\<uuid4>' |
| `before` | `string` | No | Cursor for pagination (agent ID). Returns results relative to this ID in the specified sort order. Expected format: 'agent-\<uuid4>' |
| `limit` | `number` | No | Maximum number of agents to return |
| `order` | `asc \| desc` | No | Sort order for agents by creation time. 'asc' for oldest first, 'desc' for newest first |
| `order_by` | `created_at` | No | Field to sort by |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### create

`folders.create`

Create Folder. Create a new data folder. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.folders.create({ name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `string` | Yes | The name of the source. |
| `description` | `string` | No | The description of the source. |
| `embedding` | `string` | No | The handle for the embedding config used by the source. |
| `embedding_chunk_size` | `number` | No | The chunk size of the embedding. |
| `embedding_config` | `object` | No | Configuration for embedding model connection and processing parameters. |
| `instructions` | `string` | No | Instructions for how to use the source. |
| `metadata` | `object` | No | Metadata associated with the source. |

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim: number,
>   embedding_endpoint_type: openai | anthropic | bedrock | google_ai | google_vertex | azure | groq | ollama | webui | webui-legacy | lmstudio | lmstudio-legacy | llamacpp | koboldcpp | vllm | hugging-face | mistral | together | pinecone,
>   embedding_model: string,
>   azure_deployment?: string,
>   azure_endpoint?: string,
>   azure_version?: string,
>   batch_size?: number,
>   embedding_chunk_size?: number,
>   embedding_endpoint?: string,
>   handle?: string
> }
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The human-friendly ID of the Source |
| `embedding_config` | `object \| null` | No | Configuration for embedding model connection and processing parameters. |
| `name` | `string \| null` | No | The name of the folder. |
| `created_at` | `string \| null` | No | The timestamp when the folder was created. |
| `created_by_id` | `string \| null` | No | The id of the user that made this Tool. |
| `description` | `string \| null` | No | The description of the folder. |
| `instructions` | `string \| null` | No | Instructions for how to use the folder. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this Tool. |
| `metadata` | `object \| null` | No | Metadata associated with the folder. |
| `updated_at` | `string \| null` | No | The timestamp when the folder was last updated. |

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim?: number | null,
>   embedding_endpoint_type?: string | null,
>   embedding_model?: string | null,
>   azure_deployment?: string | null,
>   azure_endpoint?: string | null,
>   azure_version?: string | null,
>   batch_size?: number | null,
>   embedding_chunk_size?: number | null,
>   embedding_endpoint?: string | null,
>   handle?: string | null
> } | null
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### delete

`folders.delete`

Delete Folder. Delete a data folder. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.folders.delete({ folder_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `folder_id` | `string` | Yes | The ID of the source in the format 'source-\<uuid4>' |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### files.delete

`folders.files.delete`

Delete File From Folder. Delete a file from a folder. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.folders.files.delete({ folder_id: 'example', file_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `folder_id` | `string` | Yes | The ID of the source in the format 'source-\<uuid4>' |
| `file_id` | `string` | Yes | The ID of the file in the format 'file-\<uuid4>' |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### files.get

`folders.files.get`

Retrieve File. Retrieve a file from a folder by ID. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.folders.files.get({ folder_id: 'example', file_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `folder_id` | `string` | Yes | The ID of the source in the format 'source-\<uuid4>' |
| `file_id` | `string` | Yes | The ID of the file in the format 'file-\<uuid4>' |
| `include_content` | `boolean` | No | Whether to include full file content |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The human-friendly ID of the File |
| `source_id` | `string \| null` | No | Deprecated: Use `folder_id` field instead. The unique identifier of the source associated with the document. |
| `chunks_embedded` | `number \| null` | No | Number of chunks that have been embedded. |
| `content` | `string \| null` | No | Optional full-text content of the file; only populated on demand due to its size. |
| `created_at` | `string \| null` | No | The creation date of the file. |
| `error_message` | `string \| null` | No | Optional error message if the file failed processing. |
| `file_creation_date` | `string \| null` | No | The creation date of the file. |
| `file_last_modified_date` | `string \| null` | No | The last modified date of the file. |
| `file_name` | `string \| null` | No | The name of the file. |
| `file_path` | `string \| null` | No | The path to the file. |
| `file_size` | `number \| null` | No | The size of the file in bytes. |
| `file_type` | `string \| null` | No | The type of the file (MIME type). |
| `original_file_name` | `string \| null` | No | The original name of the file as uploaded. |
| `processing_status` | `string \| null` | No | The current processing status of the file (e.g. pending, parsing, embedding, completed, error). |
| `total_chunks` | `number \| null` | No | Total number of chunks for the file. |
| `updated_at` | `string \| null` | No | The update date of the file. |

***

### files.list

`folders.files.list`

List Files For Folder. List paginated files associated with a data folder. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.folders.files.list({ folder_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `folder_id` | `string` | Yes | The ID of the source in the format 'source-\<uuid4>' |
| `after` | `string` | No | Cursor for pagination (file ID). Returns results relative to this ID in the specified sort order. Expected format: 'file-\<uuid4>' |
| `before` | `string` | No | Cursor for pagination (file ID). Returns results relative to this ID in the specified sort order. Expected format: 'file-\<uuid4>' |
| `include_content` | `boolean` | No | Whether to include full file content |
| `limit` | `number` | No | Maximum number of files to return |
| `order` | `asc \| desc` | No | Sort order for files by creation time. 'asc' for oldest first, 'desc' for newest first |
| `order_by` | `created_at` | No | Field to sort by |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   source_id?: string | null,
>   chunks_embedded?: number | null,
>   content?: string | null,
>   created_at?: string | null,
>   error_message?: string | null,
>   file_creation_date?: string | null,
>   file_last_modified_date?: string | null,
>   file_name?: string | null,
>   file_path?: string | null,
>   file_size?: number | null,
>   file_type?: string | null,
>   original_file_name?: string | null,
>   processing_status?: string | null,
>   total_chunks?: number | null,
>   updated_at?: string | null
> }[]
> ```

***

### files.upload

`folders.files.upload`

Upload File To Folder. Upload a file to a data folder. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.folders.files.upload({
	folder_id: 'example',
	file: { base64: 'SGVsbG8gZnJvbSBDb3JzYWly', filename: 'notes.txt', contentType: 'text/plain' },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `folder_id` | `string` | Yes | The ID of the source in the format 'source-\<uuid4>' |
| `duplicate_handling` | `skip \| error \| suffix \| replace` | No | How to handle duplicate filenames |
| `name` | `string` | No | Optional custom name to override the uploaded file's name |
| `file` | `string \| object \| custom` | Yes | The file to upload. |

> [accordion] file full type
>
> ```ts theme={null}
> string | {
>   url: string,
>   filename?: string,
>   contentType?: string
> } | {
>   base64: string,
>   filename?: string,
>   contentType?: string
> } | custom
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The human-friendly ID of the File |
| `source_id` | `string \| null` | No | Deprecated: Use `folder_id` field instead. The unique identifier of the source associated with the document. |
| `chunks_embedded` | `number \| null` | No | Number of chunks that have been embedded. |
| `content` | `string \| null` | No | Optional full-text content of the file; only populated on demand due to its size. |
| `created_at` | `string \| null` | No | The creation date of the file. |
| `error_message` | `string \| null` | No | Optional error message if the file failed processing. |
| `file_creation_date` | `string \| null` | No | The creation date of the file. |
| `file_last_modified_date` | `string \| null` | No | The last modified date of the file. |
| `file_name` | `string \| null` | No | The name of the file. |
| `file_path` | `string \| null` | No | The path to the file. |
| `file_size` | `number \| null` | No | The size of the file in bytes. |
| `file_type` | `string \| null` | No | The type of the file (MIME type). |
| `original_file_name` | `string \| null` | No | The original name of the file as uploaded. |
| `processing_status` | `string \| null` | No | The current processing status of the file (e.g. pending, parsing, embedding, completed, error). |
| `total_chunks` | `number \| null` | No | Total number of chunks for the file. |
| `updated_at` | `string \| null` | No | The update date of the file. |

***

### get

`folders.get`

Retrieve Folder. Get a folder by ID. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.folders.get({ folder_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `folder_id` | `string` | Yes | The ID of the source in the format 'source-\<uuid4>' |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The human-friendly ID of the Source |
| `embedding_config` | `object \| null` | No | Configuration for embedding model connection and processing parameters. |
| `name` | `string \| null` | No | The name of the folder. |
| `created_at` | `string \| null` | No | The timestamp when the folder was created. |
| `created_by_id` | `string \| null` | No | The id of the user that made this Tool. |
| `description` | `string \| null` | No | The description of the folder. |
| `instructions` | `string \| null` | No | Instructions for how to use the folder. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this Tool. |
| `metadata` | `object \| null` | No | Metadata associated with the folder. |
| `updated_at` | `string \| null` | No | The timestamp when the folder was last updated. |

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim?: number | null,
>   embedding_endpoint_type?: string | null,
>   embedding_model?: string | null,
>   azure_deployment?: string | null,
>   azure_endpoint?: string | null,
>   azure_version?: string | null,
>   batch_size?: number | null,
>   embedding_chunk_size?: number | null,
>   embedding_endpoint?: string | null,
>   handle?: string | null
> } | null
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### list

`folders.list`

List Folders. List all data folders created by a user. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.folders.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | Cursor for pagination (source ID). Returns results relative to this ID in the specified sort order. Expected format: 'source-\<uuid4>' |
| `before` | `string` | No | Cursor for pagination (source ID). Returns results relative to this ID in the specified sort order. Expected format: 'source-\<uuid4>' |
| `limit` | `number` | No | Maximum number of folders to return |
| `name` | `string` | No | Folder name to filter by |
| `order` | `asc \| desc` | No | Sort order for folders by creation time. 'asc' for oldest first, 'desc' for newest first |
| `order_by` | `created_at` | No | Field to sort by |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   name?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   description?: string | null,
>   instructions?: string | null,
>   last_updated_by_id?: string | null,
>   metadata?: {
>   } | null,
>   updated_at?: string | null
> }[]
> ```

***

### update

`folders.update`

Update Folder. Update the name or documentation of an existing data folder. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.folders.update({ folder_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `folder_id` | `string` | Yes | The ID of the source in the format 'source-\<uuid4>' |
| `description` | `string` | No | The description of the source. |
| `embedding_config` | `object` | No | Configuration for embedding model connection and processing parameters. |
| `instructions` | `string` | No | Instructions for how to use the source. |
| `metadata` | `object` | No | Metadata associated with the source. |
| `name` | `string` | No | The name of the source. |

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim: number,
>   embedding_endpoint_type: openai | anthropic | bedrock | google_ai | google_vertex | azure | groq | ollama | webui | webui-legacy | lmstudio | lmstudio-legacy | llamacpp | koboldcpp | vllm | hugging-face | mistral | together | pinecone,
>   embedding_model: string,
>   azure_deployment?: string,
>   azure_endpoint?: string,
>   azure_version?: string,
>   batch_size?: number,
>   embedding_chunk_size?: number,
>   embedding_endpoint?: string,
>   handle?: string
> }
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The human-friendly ID of the Source |
| `embedding_config` | `object \| null` | No | Configuration for embedding model connection and processing parameters. |
| `name` | `string \| null` | No | The name of the folder. |
| `created_at` | `string \| null` | No | The timestamp when the folder was created. |
| `created_by_id` | `string \| null` | No | The id of the user that made this Tool. |
| `description` | `string \| null` | No | The description of the folder. |
| `instructions` | `string \| null` | No | Instructions for how to use the folder. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this Tool. |
| `metadata` | `object \| null` | No | Metadata associated with the folder. |
| `updated_at` | `string \| null` | No | The timestamp when the folder was last updated. |

> [accordion] embedding\_config full type
>
> ```ts theme={null}
> {
>   embedding_dim?: number | null,
>   embedding_endpoint_type?: string | null,
>   embedding_model?: string | null,
>   azure_deployment?: string | null,
>   azure_endpoint?: string | null,
>   azure_version?: string | null,
>   batch_size?: number | null,
>   embedding_chunk_size?: number | null,
>   embedding_endpoint?: string | null,
>   handle?: string | null
> } | null
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

## Mcp Servers

### create

`mcpServers.create`

Create Mcp Server. Add a new MCP server to the Letta MCP server config.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.mcpServers.create({
	config: {
		args: ['example'],
		command: 'example',
	},
	server_name: 'example',
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `config` | `object` | Yes | The MCP server configuration (Stdio, SSE, or Streamable HTTP) |
| `server_name` | `string` | Yes | The name of the MCP server |

> [accordion] config full type
>
> ```ts theme={null}
> {
>   args: string[],
>   command: string,
>   env?: Record<string, string>,
>   mcp_server_type?: stdio
> } | {
>   server_url: string,
>   auth_header?: string,
>   auth_token?: string,
>   custom_headers?: Record<string, string>,
>   mcp_server_type?: sse
> } | {
>   server_url: string,
>   auth_header?: string,
>   auth_token?: string,
>   custom_headers?: Record<string, string>,
>   mcp_server_type?: streamable_http
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `args` | `string[] \| null` | No | The arguments to pass to the command |
| `command` | `string \| null` | No | The command to run (MCP 'local' client will run this command) |
| `server_name` | `string \| null` | No | The name of the MCP server |
| `id` | `string \| null` | No | The human-friendly ID of the Mcp\_server |
| `env` | `Record<string, string> \| null` | No | Environment variables to set |
| `mcp_server_type` | `string \| null` | No | — |

***

### delete

`mcpServers.delete`

Delete Mcp Server. Delete an MCP server by its ID. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.mcpServers.delete({ mcp_server_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `mcp_server_id` | `string` | Yes | — |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### get

`mcpServers.get`

Retrieve Mcp Server. Get a specific MCP server.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.mcpServers.get({ mcp_server_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `mcp_server_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `args` | `string[] \| null` | No | The arguments to pass to the command |
| `command` | `string \| null` | No | The command to run (MCP 'local' client will run this command) |
| `server_name` | `string \| null` | No | The name of the MCP server |
| `id` | `string \| null` | No | The human-friendly ID of the Mcp\_server |
| `env` | `Record<string, string> \| null` | No | Environment variables to set |
| `mcp_server_type` | `string \| null` | No | — |

***

### list

`mcpServers.list`

List Mcp Servers. Get a list of all configured MCP servers.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.mcpServers.list({});
```

**Input:** *empty object*

**Output:** `object[] \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   args?: string[] | null,
>   command?: string | null,
>   server_name?: string | null,
>   id?: string | null,
>   env?: Record<string, string> | null,
>   mcp_server_type?: string | null
> }[] | {
>   args?: string[] | null,
>   command?: string | null,
>   server_name?: string | null,
>   id?: string | null,
>   env?: Record<string, string> | null,
>   mcp_server_type?: string | null
> }
> ```

***

### refresh

`mcpServers.refresh`

Refresh Mcp Server Tools. Refresh tools for an MCP server by: 1. Fetching current tools from the MCP server 1. Deleting tools that no longer exist on the server 1. Updating schemas for existing tools 1. Adding new tools from the server Returns a summary of changes made.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.mcpServers.refresh({ mcp_server_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `mcp_server_id` | `string` | Yes | — |
| `agent_id` | `string` | No | — |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### tools.get

`mcpServers.tools.get`

Retrieve Mcp Tool. Get a specific MCP tool by its ID.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.mcpServers.tools.get({ mcp_server_id: 'example', tool_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `mcp_server_id` | `string` | Yes | — |
| `tool_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The human-friendly ID of the Tool |
| `args_json_schema` | `object \| null` | No | The args JSON schema of the function. |
| `created_by_id` | `string \| null` | No | The id of the user that made this Tool. |
| `default_requires_approval` | `boolean \| null` | No | Default value for whether or not executing this tool requires approval. |
| `description` | `string \| null` | No | The description of the tool. |
| `enable_parallel_execution` | `boolean \| null` | No | If set to True, then this tool will potentially be executed concurrently with other tools. Default False. |
| `json_schema` | `object \| null` | No | The JSON schema of the function. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this Tool. |
| `metadata_` | `object \| null` | No | A dictionary of additional metadata for the tool. |
| `name` | `string \| null` | No | The name of the function. |
| `npm_requirements` | `object[] \| null` | No | Optional list of npm packages required by this tool. |
| `pip_requirements` | `object[] \| null` | No | Optional list of pip packages required by this tool. |
| `project_id` | `string \| null` | No | The project id of the tool. |
| `return_char_limit` | `number \| null` | No | The maximum number of characters in the response. |
| `source_code` | `string \| null` | No | The source code of the function. |
| `source_type` | `string \| null` | No | The type of the source code. |
| `tags` | `string[] \| null` | No | Metadata tags. |
| `tool_type` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | — |

> [accordion] args\_json\_schema full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] json\_schema full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] metadata\_ full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] npm\_requirements full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   version?: string | null
> }[] | null
> ```

> [accordion] pip\_requirements full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   version?: string | null
> }[] | null
> ```

***

### tools.list

`mcpServers.tools.list`

List Tools For Mcp Server. Get a list of all tools for a specific MCP server.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.mcpServers.tools.list({ mcp_server_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `mcp_server_id` | `string` | Yes | — |

**Output:** `object[] \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   args_json_schema?: {
>   } | null,
>   created_by_id?: string | null,
>   default_requires_approval?: boolean | null,
>   description?: string | null,
>   enable_parallel_execution?: boolean | null,
>   json_schema?: {
>   } | null,
>   last_updated_by_id?: string | null,
>   metadata_?: {
>   } | null,
>   name?: string | null,
>   npm_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   pip_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   project_id?: string | null,
>   return_char_limit?: number | null,
>   source_code?: string | null,
>   source_type?: string | null,
>   tags?: string[] | null,
>   tool_type?: string | string | string | string | string | string | string | string | string | string | string | null
> }[] | {
>   id?: string | null,
>   args_json_schema?: {
>   } | null,
>   created_by_id?: string | null,
>   default_requires_approval?: boolean | null,
>   description?: string | null,
>   enable_parallel_execution?: boolean | null,
>   json_schema?: {
>   } | null,
>   last_updated_by_id?: string | null,
>   metadata_?: {
>   } | null,
>   name?: string | null,
>   npm_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   pip_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   project_id?: string | null,
>   return_char_limit?: number | null,
>   source_code?: string | null,
>   source_type?: string | null,
>   tags?: string[] | null,
>   tool_type?: string | string | string | string | string | string | string | string | string | string | string | null
> }
> ```

***

### tools.run

`mcpServers.tools.run`

Run Mcp Tool. Execute a specific MCP tool The request body should contain the tool arguments in the ToolExecuteRequest format. Executes the MCP tool with the arguments given.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.mcpServers.tools.run({ mcp_server_id: 'example', tool_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `mcp_server_id` | `string` | Yes | — |
| `tool_id` | `string` | Yes | — |
| `args` | `object` | No | Arguments to pass to the tool |

> [accordion] args full type
>
> ```ts theme={null}
> {
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `status` | `string \| null` | No | The status of the tool execution and return object |
| `agent_state` | `object \| null` | No | Representation of an agent's state. This is the state of the agent at a given time, and is persisted in the DB backend. The state has all the information needed to recreate a persisted agent. |
| `func_return` | `any \| null` | No | The function return object |
| `sandbox_config_fingerprint` | `string \| null` | No | The fingerprint of the config for the sandbox |
| `stderr` | `string[] \| null` | No | Captured stderr from the function invocation |
| `stdout` | `string[] \| null` | No | Captured stdout (prints, logs) from function invocation |

> [accordion] agent\_state full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_type?: string | string | string | string | string | string | string | string | string | null,
>   blocks?: {
>     value?: string | null,
>     id?: string | null,
>     base_template_id?: string | null,
>     created_by_id?: string | null,
>     deployment_id?: string | null,
>     description?: string | null,
>     entity_id?: string | null,
>     hidden?: boolean | null,
>     is_template?: boolean | null,
>     label?: string | null,
>     last_updated_by_id?: string | null,
>     limit?: number | null,
>     metadata?: {
>     } | null,
>     preserve_on_migration?: boolean | null,
>     project_id?: string | null,
>     read_only?: boolean | null,
>     tags?: string[] | null,
>     template_id?: string | null,
>     template_name?: string | null
>   }[] | null,
>   llm_config?: {
>     context_window?: number | null,
>     model?: string | null,
>     model_endpoint_type?: string | null,
>     compatibility_type?: string | null,
>     display_name?: string | null,
>     effort?: string | null,
>     enable_reasoner?: boolean | null,
>     frequency_penalty?: number | null,
>     handle?: string | null,
>     max_reasoning_tokens?: number | null,
>     max_tokens?: number | null,
>     model_endpoint?: string | null,
>     model_wrapper?: string | null,
>     parallel_tool_calls?: boolean | null,
>     provider_category?: string | string | null,
>     provider_name?: string | null,
>     put_inner_thoughts_in_kwargs?: boolean | null,
>     reasoning_effort?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     return_logprobs?: boolean | null,
>     return_token_ids?: boolean | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     tier?: string | null,
>     tool_call_parser?: string | null,
>     top_logprobs?: number | null,
>     verbosity?: string | null
>   } | null,
>   memory?: {
>     blocks?: {
>       value?: string | null,
>       id?: string | null,
>       base_template_id?: string | null,
>       created_by_id?: string | null,
>       deployment_id?: string | null,
>       description?: string | null,
>       entity_id?: string | null,
>       hidden?: boolean | null,
>       is_template?: boolean | null,
>       label?: string | null,
>       last_updated_by_id?: string | null,
>       limit?: number | null,
>       metadata?: {
>       } | null,
>       preserve_on_migration?: boolean | null,
>       project_id?: string | null,
>       read_only?: boolean | null,
>       tags?: string[] | null,
>       template_id?: string | null,
>       template_name?: string | null
>     }[] | null,
>     agent_type?: string | string | string | string | string | string | string | string | string | string | null,
>     file_blocks?: {
>       file_id?: string | null,
>       is_open?: boolean | null,
>       source_id?: string | null,
>       value?: string | null,
>       id?: string | null,
>       base_template_id?: string | null,
>       created_by_id?: string | null,
>       deployment_id?: string | null,
>       description?: string | null,
>       entity_id?: string | null,
>       hidden?: boolean | null,
>       is_template?: boolean | null,
>       label?: string | null,
>       last_accessed_at?: string | null,
>       last_updated_by_id?: string | null,
>       limit?: number | null,
>       metadata?: {
>       } | null,
>       preserve_on_migration?: boolean | null,
>       project_id?: string | null,
>       read_only?: boolean | null,
>       tags?: string[] | null,
>       template_id?: string | null,
>       template_name?: string | null
>     }[] | null,
>     git_enabled?: boolean | null,
>     prompt_template?: string | null
>   } | null,
>   name?: string | null,
>   sources?: {
>     id?: string | null,
>     embedding_config?: {
>       embedding_dim?: number | null,
>       embedding_endpoint_type?: string | null,
>       embedding_model?: string | null,
>       azure_deployment?: string | null,
>       azure_endpoint?: string | null,
>       azure_version?: string | null,
>       batch_size?: number | null,
>       embedding_chunk_size?: number | null,
>       embedding_endpoint?: string | null,
>       handle?: string | null
>     } | null,
>     name?: string | null,
>     created_at?: string | null,
>     created_by_id?: string | null,
>     description?: string | null,
>     instructions?: string | null,
>     last_updated_by_id?: string | null,
>     metadata?: {
>     } | null,
>     updated_at?: string | null,
>     vector_db_provider?: string | string | string | null
>   }[] | null,
>   system?: string | null,
>   tags?: string[] | null,
>   tools?: {
>     id?: string | null,
>     args_json_schema?: {
>     } | null,
>     created_by_id?: string | null,
>     default_requires_approval?: boolean | null,
>     description?: string | null,
>     enable_parallel_execution?: boolean | null,
>     json_schema?: {
>     } | null,
>     last_updated_by_id?: string | null,
>     metadata_?: {
>     } | null,
>     name?: string | null,
>     npm_requirements?: {
>       name?: string | null,
>       version?: string | null
>     }[] | null,
>     pip_requirements?: {
>       name?: string | null,
>       version?: string | null
>     }[] | null,
>     project_id?: string | null,
>     return_char_limit?: number | null,
>     source_code?: string | null,
>     source_type?: string | null,
>     tags?: string[] | null,
>     tool_type?: string | string | string | string | string | string | string | string | string | string | string | null
>   }[] | null,
>   base_template_id?: string | null,
>   compaction_settings?: {
>     clip_chars?: number | null,
>     mode?: string | null,
>     model?: string | null,
>     model_settings?: {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       reasoning?: {
>         reasoning_effort?: string | null
>       } | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       strict?: boolean | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       reasoning?: {
>         reasoning_effort?: string | null
>       } | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       strict?: boolean | null,
>       temperature?: number | null
>     } | {
>       effort?: string | null,
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       strict?: boolean | null,
>       temperature?: number | null,
>       thinking?: {
>         budget_tokens?: number | null,
>         type?: string | null
>       } | null,
>       verbosity?: string | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_schema?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null,
>       thinking_config?: {
>         include_thoughts?: boolean | null,
>         thinking_budget?: number | null
>       } | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_schema?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null,
>       thinking_config?: {
>         include_thoughts?: boolean | null,
>         thinking_budget?: number | null
>       } | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       strict?: boolean | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null,
>       thinking?: {
>         clear_thinking?: boolean | null,
>         type?: string | null
>       } | null
>     } | {
>       effort?: string | null,
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       strict?: boolean | null,
>       temperature?: number | null,
>       thinking?: {
>         budget_tokens?: number | null,
>         type?: string | null
>       } | null,
>       verbosity?: string | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       response_format?: {
>         type?: string | null
>       } | {
>         json_schema?: {
>         } | null,
>         type?: string | null
>       } | {
>         type?: string | null
>       } | null,
>       temperature?: number | null
>     } | {
>       max_output_tokens?: number | null,
>       parallel_tool_calls?: boolean | null,
>       provider_type?: string | null,
>       reasoning?: {
>         reasoning_effort?: string | null
>       } | null,
>       temperature?: number | null
>     } | null,
>     prompt?: string | null,
>     prompt_acknowledgement?: boolean | null,
>     sliding_window_percentage?: number | null
>   } | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   deployment_id?: string | null,
>   description?: string | null,
>   embedding?: string | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   enable_sleeptime?: boolean | null,
>   entity_id?: string | null,
>   hidden?: boolean | null,
>   identities?: {
>     id?: string | null,
>     agent_ids?: string[] | null,
>     block_ids?: string[] | null,
>     identifier_key?: string | null,
>     identity_type?: string | null,
>     name?: string | null,
>     project_id?: string | null,
>     properties?: {
>       key?: string | null,
>       type?: string | null,
>       value?: string | number | boolean | {
>       } | null
>     }[] | null
>   }[] | null,
>   identity_ids?: string[] | null,
>   last_run_completion?: string | null,
>   last_run_duration_ms?: number | null,
>   last_stop_reason?: string | string | string | string | string | string | string | string | string | string | string | string | string | null,
>   last_updated_by_id?: string | null,
>   managed_group?: {
>     id?: string | null,
>     agent_ids?: string[] | null,
>     description?: string | null,
>     manager_type?: string | null,
>     base_template_id?: string | null,
>     deployment_id?: string | null,
>     hidden?: boolean | null,
>     last_processed_message_id?: string | null,
>     manager_agent_id?: string | null,
>     max_message_buffer_length?: number | null,
>     max_turns?: number | null,
>     min_message_buffer_length?: number | null,
>     project_id?: string | null,
>     shared_block_ids?: string[] | null,
>     sleeptime_agent_frequency?: number | null,
>     template_id?: string | null,
>     termination_token?: string | null,
>     turns_counter?: number | null
>   } | null,
>   max_files_open?: number | null,
>   message_buffer_autoclear?: boolean | null,
>   message_ids?: string[] | null,
>   metadata?: {
>   } | null,
>   model?: string | null,
>   model_settings?: {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_schema?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking_config?: {
>       include_thoughts?: boolean | null,
>       thinking_budget?: number | null
>     } | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null,
>     thinking?: {
>       clear_thinking?: boolean | null,
>       type?: string | null
>     } | null
>   } | {
>     effort?: string | null,
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     strict?: boolean | null,
>     temperature?: number | null,
>     thinking?: {
>       budget_tokens?: number | null,
>       type?: string | null
>     } | null,
>     verbosity?: string | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     response_format?: {
>       type?: string | null
>     } | {
>       json_schema?: {
>       } | null,
>       type?: string | null
>     } | {
>       type?: string | null
>     } | null,
>     temperature?: number | null
>   } | {
>     max_output_tokens?: number | null,
>     parallel_tool_calls?: boolean | null,
>     provider_type?: string | null,
>     reasoning?: {
>       reasoning_effort?: string | null
>     } | null,
>     temperature?: number | null
>   } | null,
>   multi_agent_group?: {
>     id?: string | null,
>     agent_ids?: string[] | null,
>     description?: string | null,
>     manager_type?: string | null,
>     base_template_id?: string | null,
>     deployment_id?: string | null,
>     hidden?: boolean | null,
>     last_processed_message_id?: string | null,
>     manager_agent_id?: string | null,
>     max_message_buffer_length?: number | null,
>     max_turns?: number | null,
>     min_message_buffer_length?: number | null,
>     project_id?: string | null,
>     shared_block_ids?: string[] | null,
>     sleeptime_agent_frequency?: number | null,
>     template_id?: string | null,
>     termination_token?: string | null,
>     turns_counter?: number | null
>   } | null,
>   pending_approval?: {
>     id?: string | null,
>     date?: string | null,
>     tool_call?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null,
>     tool_calls?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     }[] | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null
>   } | null,
>   per_file_view_window_char_limit?: number | null,
>   project_id?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   secrets?: {
>     agent_id?: string | null,
>     key?: string | null,
>     value?: string | null,
>     id?: string | null,
>     created_at?: string | null,
>     created_by_id?: string | null,
>     description?: string | null,
>     last_updated_by_id?: string | null,
>     updated_at?: string | null,
>     value_enc?: string | null
>   }[] | null,
>   template_id?: string | null,
>   timezone?: string | null,
>   tool_exec_environment_variables?: {
>     agent_id?: string | null,
>     key?: string | null,
>     value?: string | null,
>     id?: string | null,
>     created_at?: string | null,
>     created_by_id?: string | null,
>     description?: string | null,
>     last_updated_by_id?: string | null,
>     updated_at?: string | null,
>     value_enc?: string | null
>   }[] | null,
>   tool_rules?: (
>     {
>       children?: string[] | null,
>       tool_name?: string | null,
>       child_arg_nodes?: {
>         name?: string | null,
>         args?: {
>         } | null
>       }[] | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       tool_name?: string | null,
>       args?: {
>       } | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       child_output_mapping?: Record<string, string> | null,
>       tool_name?: string | null,
>       default_child?: string | null,
>       prompt_template?: string | null,
>       require_output_mapping?: boolean | null,
>       type?: string | null
>     } | {
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       max_count_limit?: number | null,
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       children?: string[] | null,
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     } | {
>       tool_name?: string | null,
>       prompt_template?: string | null,
>       type?: string | null
>     }
>   )[] | null,
>   updated_at?: string | null
> } | null
> ```

***

### update

`mcpServers.update`

Update Mcp Server. Update an existing MCP server configuration.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.mcpServers.update({
	mcp_server_id: 'example',
	config: {
		args: ['example'],
		command: 'example',
	},
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `mcp_server_id` | `string` | Yes | — |
| `config` | `object` | Yes | The MCP server configuration updates (Stdio, SSE, or Streamable HTTP) |
| `server_name` | `string` | No | The name of the MCP server |

> [accordion] config full type
>
> ```ts theme={null}
> {
>   args: string[],
>   command: string,
>   env?: Record<string, string>,
>   mcp_server_type?: stdio
> } | {
>   server_url: string,
>   auth_header?: string,
>   auth_token?: string,
>   custom_headers?: Record<string, string>,
>   mcp_server_type?: sse
> } | {
>   server_url: string,
>   auth_header?: string,
>   auth_token?: string,
>   custom_headers?: Record<string, string>,
>   mcp_server_type?: streamable_http
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `args` | `string[] \| null` | No | The arguments to pass to the command |
| `command` | `string \| null` | No | The command to run (MCP 'local' client will run this command) |
| `server_name` | `string \| null` | No | The name of the MCP server |
| `id` | `string \| null` | No | The human-friendly ID of the Mcp\_server |
| `env` | `Record<string, string> \| null` | No | Environment variables to set |
| `mcp_server_type` | `string \| null` | No | — |

***

## Messages

### get

`messages.get`

Retrieve Message. Retrieve a message by ID.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.messages.get({ message_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `message_id` | `string` | Yes | The ID of the message in the format 'message-\<uuid4>' |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> (
>   {
>     id?: string | null,
>     content?: string | null,
>     date?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     content?: (
>       {
>         text?: string | null,
>         signature?: string | null,
>         type?: string | null
>       } | {
>         source?: {
>           url?: string | null,
>           type?: string | null
>         } | {
>           data?: string | null,
>           media_type?: string | null,
>           detail?: string | null,
>           type?: string | null
>         } | {
>           file_id?: string | null,
>           data?: string | null,
>           detail?: string | null,
>           media_type?: string | null,
>           type?: string | null
>         } | null,
>         type?: string | null
>       }
>     )[] | string | null,
>     date?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     reasoning?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     signature?: string | null,
>     source?: string | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     state?: string | null,
>     hidden_reasoning?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     tool_call?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null,
>     tool_calls?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     }[] | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     status?: string | null,
>     tool_call_id?: string | null,
>     tool_return?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     stderr?: string[] | null,
>     stdout?: string[] | null,
>     step_id?: string | null,
>     tool_returns?: {
>       status?: string | null,
>       tool_call_id?: string | null,
>       tool_return?: (
>         {
>           text?: string | null,
>           signature?: string | null,
>           type?: string | null
>         } | {
>           source?: {
>             url?: string | null,
>             type?: string | null
>           } | {
>             data?: string | null,
>             media_type?: string | null,
>             detail?: string | null,
>             type?: string | null
>           } | {
>             file_id?: string | null,
>             data?: string | null,
>             detail?: string | null,
>             media_type?: string | null,
>             type?: string | null
>           } | null,
>           type?: string | null
>         }
>       )[] | string | null,
>       stderr?: string[] | null,
>       stdout?: string[] | null,
>       type?: string | null
>     }[] | null
>   } | {
>     id?: string | null,
>     content?: {
>       text?: string | null,
>       signature?: string | null,
>       type?: string | null
>     }[] | string | null,
>     date?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     tool_call?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null,
>     tool_calls?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     }[] | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     approval_request_id?: string | null,
>     approvals?: (
>       {
>         approve?: boolean | null,
>         tool_call_id?: string | null,
>         reason?: string | null,
>         type?: string | null
>       } | {
>         status?: string | null,
>         tool_call_id?: string | null,
>         tool_return?: (
>           {
>             text?: string | null,
>             signature?: string | null,
>             type?: string | null
>           } | {
>             source?: {
>               url?: string | null,
>               type?: string | null
>             } | {
>               data?: string | null,
>               media_type?: string | null,
>               detail?: string | null,
>               type?: string | null
>             } | {
>               file_id?: string | null,
>               data?: string | null,
>               detail?: string | null,
>               media_type?: string | null,
>               type?: string | null
>             } | null,
>             type?: string | null
>           }
>         )[] | string | null,
>         stderr?: string[] | null,
>         stdout?: string[] | null,
>         type?: string | null
>       }
>     )[] | null,
>     approve?: boolean | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     reason?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     summary?: string | null,
>     compaction_stats?: {
>       context_window?: number | null,
>       messages_count_after?: number | null,
>       messages_count_before?: number | null,
>       trigger?: string | null,
>       context_tokens_after?: number | null,
>       context_tokens_before?: number | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     event_data?: {
>     } | null,
>     event_type?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   }
> )[]
> ```

***

### list

`messages.list`

List All Messages. List messages across all agents for the current user.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.messages.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | Cursor for pagination (message ID). Returns results relative to this ID in the specified sort order. Expected format: 'message-\<uuid4>' |
| `before` | `string` | No | Cursor for pagination (message ID). Returns results relative to this ID in the specified sort order. Expected format: 'message-\<uuid4>' |
| `conversation_id` | `string` | No | Conversation ID to filter messages by |
| `include_return_message_types` | `(system_message \| user_message \| assistant_message \| reasoning_message \| hidden_reasoning_message \| tool_call_message \| tool_return_message \| approval_request_message \| approval_response_message \| summary_message \| event_message)[]` | No | Message types to include in response. When null, all message types are returned. |
| `limit` | `number` | No | Maximum number of messages to return |
| `order` | `asc \| desc` | No | Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> (
>   {
>     id?: string | null,
>     content?: string | null,
>     date?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     content?: (
>       {
>         text?: string | null,
>         signature?: string | null,
>         type?: string | null
>       } | {
>         source?: {
>           url?: string | null,
>           type?: string | null
>         } | {
>           data?: string | null,
>           media_type?: string | null,
>           detail?: string | null,
>           type?: string | null
>         } | {
>           file_id?: string | null,
>           data?: string | null,
>           detail?: string | null,
>           media_type?: string | null,
>           type?: string | null
>         } | null,
>         type?: string | null
>       }
>     )[] | string | null,
>     date?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     reasoning?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     signature?: string | null,
>     source?: string | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     state?: string | null,
>     hidden_reasoning?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     tool_call?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null,
>     tool_calls?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     }[] | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     status?: string | null,
>     tool_call_id?: string | null,
>     tool_return?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     stderr?: string[] | null,
>     stdout?: string[] | null,
>     step_id?: string | null,
>     tool_returns?: {
>       status?: string | null,
>       tool_call_id?: string | null,
>       tool_return?: (
>         {
>           text?: string | null,
>           signature?: string | null,
>           type?: string | null
>         } | {
>           source?: {
>             url?: string | null,
>             type?: string | null
>           } | {
>             data?: string | null,
>             media_type?: string | null,
>             detail?: string | null,
>             type?: string | null
>           } | {
>             file_id?: string | null,
>             data?: string | null,
>             detail?: string | null,
>             media_type?: string | null,
>             type?: string | null
>           } | null,
>           type?: string | null
>         }
>       )[] | string | null,
>       stderr?: string[] | null,
>       stdout?: string[] | null,
>       type?: string | null
>     }[] | null
>   } | {
>     id?: string | null,
>     content?: {
>       text?: string | null,
>       signature?: string | null,
>       type?: string | null
>     }[] | string | null,
>     date?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     tool_call?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null,
>     tool_calls?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     }[] | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     approval_request_id?: string | null,
>     approvals?: (
>       {
>         approve?: boolean | null,
>         tool_call_id?: string | null,
>         reason?: string | null,
>         type?: string | null
>       } | {
>         status?: string | null,
>         tool_call_id?: string | null,
>         tool_return?: (
>           {
>             text?: string | null,
>             signature?: string | null,
>             type?: string | null
>           } | {
>             source?: {
>               url?: string | null,
>               type?: string | null
>             } | {
>               data?: string | null,
>               media_type?: string | null,
>               detail?: string | null,
>               type?: string | null
>             } | {
>               file_id?: string | null,
>               data?: string | null,
>               detail?: string | null,
>               media_type?: string | null,
>               type?: string | null
>             } | null,
>             type?: string | null
>           }
>         )[] | string | null,
>         stderr?: string[] | null,
>         stdout?: string[] | null,
>         type?: string | null
>       }
>     )[] | null,
>     approve?: boolean | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     reason?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     summary?: string | null,
>     compaction_stats?: {
>       context_window?: number | null,
>       messages_count_after?: number | null,
>       messages_count_before?: number | null,
>       trigger?: string | null,
>       context_tokens_after?: number | null,
>       context_tokens_before?: number | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     event_data?: {
>     } | null,
>     event_type?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   }
> )[]
> ```

***

### search

`messages.search`

Search All Messages. Search messages across the organization with optional agent filtering. Returns messages with FTS/vector ranks and total RRF score. This is a cloud-only feature.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.messages.search({ query: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `query` | `string` | Yes | Text query for full-text search |
| `agent_id` | `string` | No | Filter messages by agent ID |
| `conversation_id` | `string` | No | Filter messages by conversation ID |
| `end_date` | `string` | No | Filter messages created on or before this date |
| `limit` | `number` | No | Maximum number of results to return |
| `search_mode` | `vector \| fts \| hybrid` | No | Search mode to use |
| `start_date` | `string` | No | Filter messages created after this date |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
> }[]
> ```

***

## Models

### embeddings.list

`models.embeddings.list`

List Embedding Models. List available embedding models using the asynchronous implementation for improved performance. Returns EmbeddingModel format which extends EmbeddingConfig with additional metadata fields. Legacy EmbeddingConfig fields are marked as deprecated but still available for backward compatibility.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.models.embeddings.list({});
```

**Input:** *empty object*

**Output:** `object[] \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   display_name?: string | null,
>   embedding_dim?: number | null,
>   embedding_endpoint_type?: string | null,
>   embedding_model?: string | null,
>   name?: string | null,
>   provider_name?: string | null,
>   provider_type?: string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | null,
>   azure_deployment?: string | null,
>   azure_endpoint?: string | null,
>   azure_version?: string | null,
>   batch_size?: number | null,
>   embedding_chunk_size?: number | null,
>   embedding_endpoint?: string | null,
>   handle?: string | null,
>   model_type?: string | null
> }[] | {
>   display_name?: string | null,
>   embedding_dim?: number | null,
>   embedding_endpoint_type?: string | null,
>   embedding_model?: string | null,
>   name?: string | null,
>   provider_name?: string | null,
>   provider_type?: string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | null,
>   azure_deployment?: string | null,
>   azure_endpoint?: string | null,
>   azure_version?: string | null,
>   batch_size?: number | null,
>   embedding_chunk_size?: number | null,
>   embedding_endpoint?: string | null,
>   handle?: string | null,
>   model_type?: string | null
> }
> ```

***

### list

`models.list`

List Llm Models. List available LLM models using the asynchronous implementation for improved performance. Returns Model format which extends LLMConfig with additional metadata fields. Legacy LLMConfig fields are marked as deprecated but still available for backward compatibility.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.models.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `provider_category` | `(base \| byok)[]` | No | — |
| `provider_name` | `string` | No | — |
| `provider_type` | `anthropic \| azure \| baseten \| bedrock \| cerebras \| chatgpt_oauth \| deepseek \| fireworks \| google_ai \| google_vertex \| groq \| hugging-face \| letta \| lmstudio_openai \| minimax \| moonshot \| moonshot_coding \| mistral \| ollama \| openai \| together \| vllm \| sglang \| openrouter \| xai \| zai \| zai_coding` | No | — |

**Output:** `object[] \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   context_window?: number | null,
>   max_context_window?: number | null,
>   model?: string | null,
>   model_endpoint_type?: string | null,
>   name?: string | null,
>   provider_type?: string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | null,
>   compatibility_type?: string | null,
>   display_name?: string | null,
>   effort?: string | null,
>   enable_reasoner?: boolean | null,
>   frequency_penalty?: number | null,
>   handle?: string | null,
>   max_reasoning_tokens?: number | null,
>   max_tokens?: number | null,
>   model_endpoint?: string | null,
>   model_type?: string | null,
>   model_wrapper?: string | null,
>   parallel_tool_calls?: boolean | null,
>   provider_category?: string | string | null,
>   provider_name?: string | null,
>   put_inner_thoughts_in_kwargs?: boolean | null,
>   reasoning_effort?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   return_logprobs?: boolean | null,
>   return_token_ids?: boolean | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   tier?: string | null,
>   tool_call_parser?: string | null,
>   top_logprobs?: number | null,
>   verbosity?: string | null
> }[] | {
>   context_window?: number | null,
>   max_context_window?: number | null,
>   model?: string | null,
>   model_endpoint_type?: string | null,
>   name?: string | null,
>   provider_type?: string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | string | null,
>   compatibility_type?: string | null,
>   display_name?: string | null,
>   effort?: string | null,
>   enable_reasoner?: boolean | null,
>   frequency_penalty?: number | null,
>   handle?: string | null,
>   max_reasoning_tokens?: number | null,
>   max_tokens?: number | null,
>   model_endpoint?: string | null,
>   model_type?: string | null,
>   model_wrapper?: string | null,
>   parallel_tool_calls?: boolean | null,
>   provider_category?: string | string | null,
>   provider_name?: string | null,
>   put_inner_thoughts_in_kwargs?: boolean | null,
>   reasoning_effort?: string | null,
>   response_format?: {
>     type?: string | null
>   } | {
>     json_schema?: {
>     } | null,
>     type?: string | null
>   } | {
>     type?: string | null
>   } | null,
>   return_logprobs?: boolean | null,
>   return_token_ids?: boolean | null,
>   strict?: boolean | null,
>   temperature?: number | null,
>   tier?: string | null,
>   tool_call_parser?: string | null,
>   top_logprobs?: number | null,
>   verbosity?: string | null
> }
> ```

***

## Passages

### search

`passages.search`

Search Passages. Search passages across the organization with optional agent and archive filtering. Returns passages with relevance scores. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.passages.search({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_id` | `string` | No | Filter passages by agent ID |
| `archive_id` | `string` | No | Filter passages by archive ID |
| `end_date` | `string` | No | Filter results to passages created before this datetime |
| `limit` | `number` | No | Maximum number of results to return |
| `query` | `string` | No | Text query for semantic search |
| `start_date` | `string` | No | Filter results to passages created after this datetime |
| `tag_match_mode` | `any \| all` | No | How to match tags - 'any' to match passages with any of the tags, 'all' to match only passages with all tags |
| `tags` | `string[]` | No | Optional list of tags to filter search results |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `passage` | `object \| null` | No | Representation of a passage, which is stored in archival memory. |
| `score` | `number \| null` | No | Relevance score |
| `metadata` | `object \| null` | No | Additional metadata about the search result |

> [accordion] passage full type
>
> ```ts theme={null}
> {
>   embedding?: number[] | null,
>   embedding_config?: {
>     embedding_dim?: number | null,
>     embedding_endpoint_type?: string | null,
>     embedding_model?: string | null,
>     azure_deployment?: string | null,
>     azure_endpoint?: string | null,
>     azure_version?: string | null,
>     batch_size?: number | null,
>     embedding_chunk_size?: number | null,
>     embedding_endpoint?: string | null,
>     handle?: string | null
>   } | null,
>   text?: string | null,
>   id?: string | null,
>   archive_id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   file_id?: string | null,
>   file_name?: string | null,
>   is_deleted?: boolean | null,
>   last_updated_by_id?: string | null,
>   metadata?: {
>   } | null,
>   source_id?: string | null,
>   tags?: string[] | null,
>   updated_at?: string | null
> } | null
> ```

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

## Runs

### get

`runs.get`

Retrieve Run. Get the status of a run. (GET /v1/runs/\{run\_id})

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.runs.get({ run_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `run_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The human-friendly ID of the Run |
| `agent_id` | `string \| null` | No | The unique identifier of the agent associated with the run. |
| `background` | `boolean \| null` | No | Whether the run was created in background mode. |
| `base_template_id` | `string \| null` | No | The base template ID that the run belongs to. |
| `callback_error` | `string \| null` | No | Optional error message from attempting to POST the callback endpoint. |
| `callback_sent_at` | `string \| null` | No | Timestamp when the callback was last attempted. |
| `callback_status_code` | `number \| null` | No | HTTP status code returned by the callback endpoint. |
| `callback_url` | `string \| null` | No | If set, POST to this URL when the run completes. |
| `completed_at` | `string \| null` | No | The timestamp when the run was completed. |
| `conversation_id` | `string \| null` | No | The unique identifier of the conversation associated with the run. |
| `created_at` | `string \| null` | No | The timestamp when the run was created. |
| `metadata` | `object \| null` | No | Additional metadata for the run. |
| `request_config` | `object \| null` | No | The request configuration for the run. |
| `status` | `string \| null` | No | The current status of the run. |
| `stop_reason` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | — |
| `total_duration_ns` | `number \| null` | No | Total run duration in nanoseconds |
| `ttft_ns` | `number \| null` | No | Time to first token for a run in nanoseconds |

> [accordion] metadata full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] request\_config full type
>
> ```ts theme={null}
> {
>   assistant_message_tool_kwarg?: string | null,
>   assistant_message_tool_name?: string | null,
>   include_return_message_types?: (string | string | string | string | string | string | string | string | string | string | string)[] | null,
>   use_assistant_message?: boolean | null
> } | null
> ```

***

### list

`runs.list`

List Runs. List all runs. (GET /v1/runs/)

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.runs.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `active` | `boolean` | No | Filter for active runs. |
| `after` | `string` | No | Cursor for pagination (run ID). Returns results relative to this ID in the specified sort order. Expected format: 'run-\<uuid4>' |
| `agent_id` | `string` | No | The unique identifier of the agent associated with the run. |
| `agent_ids` | `string[]` | No | The unique identifiers of the agents associated with the run. Deprecated in favor of agent\_id field. |
| `ascending` | `boolean` | No | Whether to sort agents oldest to newest (True) or newest to oldest (False, default). Deprecated in favor of order field. |
| `background` | `boolean` | No | If True, filters for runs that were created in background mode. |
| `before` | `string` | No | Cursor for pagination (run ID). Returns results relative to this ID in the specified sort order. Expected format: 'run-\<uuid4>' |
| `conversation_id` | `string` | No | Filter runs by conversation ID. |
| `limit` | `number` | No | Maximum number of runs to return |
| `order` | `asc \| desc` | No | Sort order for runs by creation time. 'asc' for oldest first, 'desc' for newest first |
| `order_by` | `created_at` | No | Field to sort by |
| `statuses` | `string[]` | No | Filter runs by status. Can specify multiple statuses. |
| `stop_reason` | `end_turn \| error \| llm_api_error \| invalid_llm_response \| invalid_tool_call \| max_steps \| max_tokens_exceeded \| no_tool_call \| tool_rule \| cancelled \| insufficient_credits \| requires_approval \| context_window_overflow_in_system_prompt` | No | — |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_id?: string | null,
>   background?: boolean | null,
>   base_template_id?: string | null,
>   callback_error?: string | null,
>   callback_sent_at?: string | null,
>   callback_status_code?: number | null,
>   callback_url?: string | null,
>   completed_at?: string | null,
>   conversation_id?: string | null,
>   created_at?: string | null,
>   metadata?: {
>   } | null,
>   request_config?: {
>     assistant_message_tool_kwarg?: string | null,
>     assistant_message_tool_name?: string | null,
>     include_return_message_types?: (string | string | string | string | string | string | string | string | string | string | string)[] | null,
>     use_assistant_message?: boolean | null
>   } | null,
>   status?: string | null,
>   stop_reason?: string | string | string | string | string | string | string | string | string | string | string | string | string | null,
>   total_duration_ns?: number | null,
>   ttft_ns?: number | null
> }[]
> ```

***

### messages.list

`runs.messages.list`

List Messages For Run. Get response messages associated with a run.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.runs.messages.list({ run_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `run_id` | `string` | Yes | — |
| `after` | `string` | No | Cursor for pagination (message ID). Returns results relative to this ID in the specified sort order. Expected format: 'message-\<uuid4>' |
| `before` | `string` | No | Cursor for pagination (message ID). Returns results relative to this ID in the specified sort order. Expected format: 'message-\<uuid4>' |
| `limit` | `number` | No | Maximum number of messages to return |
| `order` | `asc \| desc` | No | Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first |
| `order_by` | `created_at` | No | Field to sort by |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> (
>   {
>     id?: string | null,
>     content?: string | null,
>     date?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     content?: (
>       {
>         text?: string | null,
>         signature?: string | null,
>         type?: string | null
>       } | {
>         source?: {
>           url?: string | null,
>           type?: string | null
>         } | {
>           data?: string | null,
>           media_type?: string | null,
>           detail?: string | null,
>           type?: string | null
>         } | {
>           file_id?: string | null,
>           data?: string | null,
>           detail?: string | null,
>           media_type?: string | null,
>           type?: string | null
>         } | null,
>         type?: string | null
>       }
>     )[] | string | null,
>     date?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     reasoning?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     signature?: string | null,
>     source?: string | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     state?: string | null,
>     hidden_reasoning?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     tool_call?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null,
>     tool_calls?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     }[] | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     status?: string | null,
>     tool_call_id?: string | null,
>     tool_return?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     stderr?: string[] | null,
>     stdout?: string[] | null,
>     step_id?: string | null,
>     tool_returns?: {
>       status?: string | null,
>       tool_call_id?: string | null,
>       tool_return?: (
>         {
>           text?: string | null,
>           signature?: string | null,
>           type?: string | null
>         } | {
>           source?: {
>             url?: string | null,
>             type?: string | null
>           } | {
>             data?: string | null,
>             media_type?: string | null,
>             detail?: string | null,
>             type?: string | null
>           } | {
>             file_id?: string | null,
>             data?: string | null,
>             detail?: string | null,
>             media_type?: string | null,
>             type?: string | null
>           } | null,
>           type?: string | null
>         }
>       )[] | string | null,
>       stderr?: string[] | null,
>       stdout?: string[] | null,
>       type?: string | null
>     }[] | null
>   } | {
>     id?: string | null,
>     content?: {
>       text?: string | null,
>       signature?: string | null,
>       type?: string | null
>     }[] | string | null,
>     date?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     tool_call?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null,
>     tool_calls?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     }[] | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     approval_request_id?: string | null,
>     approvals?: (
>       {
>         approve?: boolean | null,
>         tool_call_id?: string | null,
>         reason?: string | null,
>         type?: string | null
>       } | {
>         status?: string | null,
>         tool_call_id?: string | null,
>         tool_return?: (
>           {
>             text?: string | null,
>             signature?: string | null,
>             type?: string | null
>           } | {
>             source?: {
>               url?: string | null,
>               type?: string | null
>             } | {
>               data?: string | null,
>               media_type?: string | null,
>               detail?: string | null,
>               type?: string | null
>             } | {
>               file_id?: string | null,
>               data?: string | null,
>               detail?: string | null,
>               media_type?: string | null,
>               type?: string | null
>             } | null,
>             type?: string | null
>           }
>         )[] | string | null,
>         stderr?: string[] | null,
>         stdout?: string[] | null,
>         type?: string | null
>       }
>     )[] | null,
>     approve?: boolean | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     reason?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     summary?: string | null,
>     compaction_stats?: {
>       context_window?: number | null,
>       messages_count_after?: number | null,
>       messages_count_before?: number | null,
>       trigger?: string | null,
>       context_tokens_after?: number | null,
>       context_tokens_before?: number | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     event_data?: {
>     } | null,
>     event_type?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   }
> )[]
> ```

***

### messages.stream

`runs.messages.stream`

Retrieve Stream For Run. Reattaches to a background run’s stream; returns the server-sent events as text.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.runs.messages.stream({ run_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `run_id` | `string` | Yes | — |
| `agent_id` | `string` | No | Agent ID for agent-direct mode with 'default' conversation. Use with conversation\_id='default' in the URL path. |
| `batch_size` | `number` | No | Number of entries to read per batch. |
| `include_pings` | `boolean` | No | Whether to include periodic keepalive ping messages in the stream to prevent connection timeouts. |
| `otid` | `string` | No | Offline threading ID to look up the run\_id. Bypasses active run lookup if run\_id not provided. |
| `poll_interval` | `number` | No | Seconds to wait between polls when no new data. |
| `starting_after` | `number` | No | Sequence id to use as a cursor for pagination. Response will start streaming after this chunk sequence id |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `text` | `string` | Yes | The response body as text. |
| `contentType` | `string \| null` | Yes | The content type Letta answered with. |

***

### steps.list

`runs.steps.list`

List Steps For Run. Get steps associated with a run with filtering options. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.runs.steps.list({ run_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `run_id` | `string` | Yes | — |
| `after` | `string` | No | Cursor for pagination (step ID). Returns results relative to this ID in the specified sort order. Expected format: 'step-\<uuid4>' |
| `before` | `string` | No | Cursor for pagination (step ID). Returns results relative to this ID in the specified sort order. Expected format: 'step-\<uuid4>' |
| `limit` | `number` | No | Maximum number of messages to return |
| `order` | `asc \| desc` | No | Sort order for steps by creation time. 'asc' for oldest first, 'desc' for newest first |
| `order_by` | `created_at` | No | Field to sort by |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_id?: string | null,
>   cache_write_tokens?: number | null,
>   cached_input_tokens?: number | null,
>   completion_tokens?: number | null,
>   completion_tokens_details?: {
>   } | null,
>   context_window_limit?: number | null,
>   error_data?: {
>   } | null,
>   error_type?: string | null,
>   feedback?: string | null,
>   messages?: {
>     id?: string | null,
>     role?: string | string | string | string | string | string | string | null,
>     agent_id?: string | null,
>     approval_request_id?: string | null,
>     approvals?: (
>       {
>         approve?: boolean | null,
>         tool_call_id?: string | null,
>         reason?: string | null,
>         type?: string | null
>       } | {
>         approve?: boolean | null,
>         tool_call_id?: string | null,
>         reason?: string | null,
>         type?: string | null
>       }
>     )[] | null,
>     approve?: boolean | null,
>     batch_item_id?: string | null,
>     content?: (
>       {
>         text?: string | null,
>         signature?: string | null,
>         type?: string | null
>       } | {
>         source?: {
>           url?: string | null,
>           type?: string | null
>         } | {
>           data?: string | null,
>           media_type?: string | null,
>           detail?: string | null,
>           type?: string | null
>         } | {
>           file_id?: string | null,
>           data?: string | null,
>           detail?: string | null,
>           media_type?: string | null,
>           type?: string | null
>         } | null,
>         type?: string | null
>       } | {
>         id?: string | null,
>         input?: {
>         } | null,
>         name?: string | null,
>         signature?: string | null,
>         type?: string | null
>       } | {
>         content?: string | null,
>         is_error?: boolean | null,
>         tool_call_id?: string | null,
>         type?: string | null
>       } | {
>         is_native?: boolean | null,
>         reasoning?: string | null,
>         signature?: string | null,
>         type?: string | null
>       } | {
>         data?: string | null,
>         type?: string | null
>       } | {
>         signature?: string | null,
>         type?: string | null
>       } | {
>         id?: string | null,
>         summary?: {
>           index?: number | null,
>           text?: string | null
>         }[] | null,
>         encrypted_content?: string | null,
>         type?: string | null
>       }
>     )[] | null,
>     conversation_id?: string | null,
>     created_at?: string | null,
>     created_by_id?: string | null,
>     denial_reason?: string | null,
>     group_id?: string | null,
>     is_err?: boolean | null,
>     last_updated_by_id?: string | null,
>     model?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     step_id?: string | null,
>     tool_call_id?: string | null,
>     tool_calls?: {
>       id?: string | null,
>       function?: {
>         arguments?: string | null,
>         name?: string | null
>       } | null,
>       type?: string | null
>     }[] | null,
>     tool_returns?: {
>       status?: string | null,
>       func_response?: string | (
>         {
>           text?: string | null,
>           signature?: string | null,
>           type?: string | null
>         } | {
>           source?: {
>             url?: string | null,
>             type?: string | null
>           } | {
>             data?: string | null,
>             media_type?: string | null,
>             detail?: string | null,
>             type?: string | null
>           } | {
>             file_id?: string | null,
>             data?: string | null,
>             detail?: string | null,
>             media_type?: string | null,
>             type?: string | null
>           } | null,
>           type?: string | null
>         }
>       )[] | {
>         source?: {
>           url?: string | null,
>           type?: string | null
>         } | {
>           data?: string | null,
>           media_type?: string | null,
>           detail?: string | null,
>           type?: string | null
>         } | {
>           file_id?: string | null,
>           data?: string | null,
>           detail?: string | null,
>           media_type?: string | null,
>           type?: string | null
>         } | null,
>         type?: string | null
>       } | null,
>       stderr?: string[] | null,
>       stdout?: string[] | null,
>       tool_call_id?: any | null
>     }[] | null,
>     updated_at?: string | null
>   }[] | null,
>   model?: string | null,
>   model_endpoint?: string | null,
>   model_handle?: string | null,
>   origin?: string | null,
>   project_id?: string | null,
>   prompt_tokens?: number | null,
>   prompt_tokens_details?: {
>   } | null,
>   provider_category?: string | null,
>   provider_id?: string | null,
>   provider_name?: string | null,
>   reasoning_tokens?: number | null,
>   request_id?: string | null,
>   run_id?: string | null,
>   status?: string | null,
>   stop_reason?: string | string | string | string | string | string | string | string | string | string | string | string | string | null,
>   tags?: string[] | null,
>   tid?: string | null,
>   total_tokens?: number | null,
>   trace_id?: string | null
> }[]
> ```

***

### trace.get

`runs.trace.get`

Retrieve Trace For Run. Retrieve OTEL trace spans for a run. Returns a filtered set of spans relevant for observability: - agent\_step: Individual agent reasoning steps - tool executions: Tool call spans - Root span: The top-level request span - time\_to\_first\_token: TTFT measurement span Requires ClickHouse to be… Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.runs.trace.get({ run_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `run_id` | `string` | Yes | — |
| `limit` | `number` | No | Maximum number of spans to return |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### usage.get

`runs.usage.get`

Retrieve Usage For Run. Get usage statistics for a run.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.runs.usage.get({ run_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `run_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `completion_tokens` | `number \| null` | No | — |
| `completion_tokens_details` | `object \| null` | No | — |
| `prompt_tokens` | `number \| null` | No | — |
| `prompt_tokens_details` | `object \| null` | No | — |
| `total_tokens` | `number \| null` | No | — |

> [accordion] completion\_tokens\_details full type
>
> ```ts theme={null}
> {
>   reasoning_tokens?: number | null
> } | null
> ```

> [accordion] prompt\_tokens\_details full type
>
> ```ts theme={null}
> {
>   cache_creation_tokens?: number | null,
>   cache_read_tokens?: number | null,
>   cached_tokens?: number | null
> } | null
> ```

***

## Steps

### feedback.create

`steps.feedback.create`

Modify Feedback For Step. Modify feedback for a given step. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.steps.feedback.create({ step_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `step_id` | `string` | Yes | The ID of the step in the format 'step-\<uuid4>' |
| `feedback` | `positive \| negative` | No | Whether this feedback is positive or negative |
| `tags` | `string[]` | No | Feedback tags to add to the step |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The id of the step. Assigned by the database. |
| `agent_id` | `string \| null` | No | The ID of the agent that performed the step. |
| `cache_write_tokens` | `number \| null` | No | The number of input tokens written to cache (Anthropic only). None if not reported by provider. |
| `cached_input_tokens` | `number \| null` | No | The number of input tokens served from cache. None if not reported by provider. |
| `completion_tokens` | `number \| null` | No | The number of tokens generated by the agent during this step. |
| `completion_tokens_details` | `object \| null` | No | Detailed completion token breakdown (e.g., reasoning\_tokens). |
| `context_window_limit` | `number \| null` | No | The context window limit configured for this step. |
| `error_data` | `object \| null` | No | Error details including message, traceback, and additional context |
| `error_type` | `string \| null` | No | The type/class of the error that occurred |
| `feedback` | `string \| null` | No | The feedback for this step. Must be either 'positive' or 'negative'. |
| `messages` | `object[] \| null` | No | The messages generated during this step. Deprecated: use `GET /v1/steps/{step_id}/messages` endpoint instead |
| `model` | `string \| null` | No | The name of the model used for this step. |
| `model_endpoint` | `string \| null` | No | The model endpoint url used for this step. |
| `model_handle` | `string \| null` | No | The model handle (e.g., 'openai/gpt-4o-mini') used for this step. |
| `origin` | `string \| null` | No | The surface that this agent step was initiated from. |
| `project_id` | `string \| null` | No | The project that the agent that executed this step belongs to (cloud only). |
| `prompt_tokens` | `number \| null` | No | The number of tokens in the prompt during this step. |
| `prompt_tokens_details` | `object \| null` | No | Detailed prompt token breakdown (e.g., cached\_tokens, cache\_read\_tokens, cache\_creation\_tokens). |
| `provider_category` | `string \| null` | No | The category of the provider used for this step. |
| `provider_id` | `string \| null` | No | The unique identifier of the provider that was configured for this step |
| `provider_name` | `string \| null` | No | The name of the provider used for this step. |
| `reasoning_tokens` | `number \| null` | No | The number of reasoning/thinking tokens generated. None if not reported by provider. |
| `request_id` | `string \| null` | No | The API request log ID from cloud-api for correlating steps with API requests. |
| `run_id` | `string \| null` | No | The unique identifier of the run that this step belongs to. Only included for async calls. |
| `status` | `string \| null` | No | Status of a step execution |
| `stop_reason` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | — |
| `tags` | `string[] \| null` | No | Metadata tags. |
| `tid` | `string \| null` | No | The unique identifier of the transaction that processed this step. |
| `total_tokens` | `number \| null` | No | The total number of tokens processed by the agent during this step. |
| `trace_id` | `string \| null` | No | The trace id of the agent step. |

> [accordion] completion\_tokens\_details full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] error\_data full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] messages full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   role?: string | string | string | string | string | string | string | null,
>   agent_id?: string | null,
>   approval_request_id?: string | null,
>   approvals?: (
>     {
>       approve?: boolean | null,
>       tool_call_id?: string | null,
>       reason?: string | null,
>       type?: string | null
>     } | {
>       approve?: boolean | null,
>       tool_call_id?: string | null,
>       reason?: string | null,
>       type?: string | null
>     }
>   )[] | null,
>   approve?: boolean | null,
>   batch_item_id?: string | null,
>   content?: (
>     {
>       text?: string | null,
>       signature?: string | null,
>       type?: string | null
>     } | {
>       source?: {
>         url?: string | null,
>         type?: string | null
>       } | {
>         data?: string | null,
>         media_type?: string | null,
>         detail?: string | null,
>         type?: string | null
>       } | {
>         file_id?: string | null,
>         data?: string | null,
>         detail?: string | null,
>         media_type?: string | null,
>         type?: string | null
>       } | null,
>       type?: string | null
>     } | {
>       id?: string | null,
>       input?: {
>       } | null,
>       name?: string | null,
>       signature?: string | null,
>       type?: string | null
>     } | {
>       content?: string | null,
>       is_error?: boolean | null,
>       tool_call_id?: string | null,
>       type?: string | null
>     } | {
>       is_native?: boolean | null,
>       reasoning?: string | null,
>       signature?: string | null,
>       type?: string | null
>     } | {
>       data?: string | null,
>       type?: string | null
>     } | {
>       signature?: string | null,
>       type?: string | null
>     } | {
>       id?: string | null,
>       summary?: {
>         index?: number | null,
>         text?: string | null
>       }[] | null,
>       encrypted_content?: string | null,
>       type?: string | null
>     }
>   )[] | null,
>   conversation_id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   denial_reason?: string | null,
>   group_id?: string | null,
>   is_err?: boolean | null,
>   last_updated_by_id?: string | null,
>   model?: string | null,
>   name?: string | null,
>   otid?: string | null,
>   run_id?: string | null,
>   sender_id?: string | null,
>   step_id?: string | null,
>   tool_call_id?: string | null,
>   tool_calls?: {
>     id?: string | null,
>     function?: {
>       arguments?: string | null,
>       name?: string | null
>     } | null,
>     type?: string | null
>   }[] | null,
>   tool_returns?: {
>     status?: string | null,
>     func_response?: string | (
>       {
>         text?: string | null,
>         signature?: string | null,
>         type?: string | null
>       } | {
>         source?: {
>           url?: string | null,
>           type?: string | null
>         } | {
>           data?: string | null,
>           media_type?: string | null,
>           detail?: string | null,
>           type?: string | null
>         } | {
>           file_id?: string | null,
>           data?: string | null,
>           detail?: string | null,
>           media_type?: string | null,
>           type?: string | null
>         } | null,
>         type?: string | null
>       }
>     )[] | {
>       source?: {
>         url?: string | null,
>         type?: string | null
>       } | {
>         data?: string | null,
>         media_type?: string | null,
>         detail?: string | null,
>         type?: string | null
>       } | {
>         file_id?: string | null,
>         data?: string | null,
>         detail?: string | null,
>         media_type?: string | null,
>         type?: string | null
>       } | null,
>       type?: string | null
>     } | null,
>     stderr?: string[] | null,
>     stdout?: string[] | null,
>     tool_call_id?: any | null
>   }[] | null,
>   updated_at?: string | null
> }[] | null
> ```

> [accordion] prompt\_tokens\_details full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### get

`steps.get`

Retrieve Step. Get a step by ID. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.steps.get({ step_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `step_id` | `string` | Yes | The ID of the step in the format 'step-\<uuid4>' |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The id of the step. Assigned by the database. |
| `agent_id` | `string \| null` | No | The ID of the agent that performed the step. |
| `cache_write_tokens` | `number \| null` | No | The number of input tokens written to cache (Anthropic only). None if not reported by provider. |
| `cached_input_tokens` | `number \| null` | No | The number of input tokens served from cache. None if not reported by provider. |
| `completion_tokens` | `number \| null` | No | The number of tokens generated by the agent during this step. |
| `completion_tokens_details` | `object \| null` | No | Detailed completion token breakdown (e.g., reasoning\_tokens). |
| `context_window_limit` | `number \| null` | No | The context window limit configured for this step. |
| `error_data` | `object \| null` | No | Error details including message, traceback, and additional context |
| `error_type` | `string \| null` | No | The type/class of the error that occurred |
| `feedback` | `string \| null` | No | The feedback for this step. Must be either 'positive' or 'negative'. |
| `messages` | `object[] \| null` | No | The messages generated during this step. Deprecated: use `GET /v1/steps/{step_id}/messages` endpoint instead |
| `model` | `string \| null` | No | The name of the model used for this step. |
| `model_endpoint` | `string \| null` | No | The model endpoint url used for this step. |
| `model_handle` | `string \| null` | No | The model handle (e.g., 'openai/gpt-4o-mini') used for this step. |
| `origin` | `string \| null` | No | The surface that this agent step was initiated from. |
| `project_id` | `string \| null` | No | The project that the agent that executed this step belongs to (cloud only). |
| `prompt_tokens` | `number \| null` | No | The number of tokens in the prompt during this step. |
| `prompt_tokens_details` | `object \| null` | No | Detailed prompt token breakdown (e.g., cached\_tokens, cache\_read\_tokens, cache\_creation\_tokens). |
| `provider_category` | `string \| null` | No | The category of the provider used for this step. |
| `provider_id` | `string \| null` | No | The unique identifier of the provider that was configured for this step |
| `provider_name` | `string \| null` | No | The name of the provider used for this step. |
| `reasoning_tokens` | `number \| null` | No | The number of reasoning/thinking tokens generated. None if not reported by provider. |
| `request_id` | `string \| null` | No | The API request log ID from cloud-api for correlating steps with API requests. |
| `run_id` | `string \| null` | No | The unique identifier of the run that this step belongs to. Only included for async calls. |
| `status` | `string \| null` | No | Status of a step execution |
| `stop_reason` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | — |
| `tags` | `string[] \| null` | No | Metadata tags. |
| `tid` | `string \| null` | No | The unique identifier of the transaction that processed this step. |
| `total_tokens` | `number \| null` | No | The total number of tokens processed by the agent during this step. |
| `trace_id` | `string \| null` | No | The trace id of the agent step. |

> [accordion] completion\_tokens\_details full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] error\_data full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] messages full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   role?: string | string | string | string | string | string | string | null,
>   agent_id?: string | null,
>   approval_request_id?: string | null,
>   approvals?: (
>     {
>       approve?: boolean | null,
>       tool_call_id?: string | null,
>       reason?: string | null,
>       type?: string | null
>     } | {
>       approve?: boolean | null,
>       tool_call_id?: string | null,
>       reason?: string | null,
>       type?: string | null
>     }
>   )[] | null,
>   approve?: boolean | null,
>   batch_item_id?: string | null,
>   content?: (
>     {
>       text?: string | null,
>       signature?: string | null,
>       type?: string | null
>     } | {
>       source?: {
>         url?: string | null,
>         type?: string | null
>       } | {
>         data?: string | null,
>         media_type?: string | null,
>         detail?: string | null,
>         type?: string | null
>       } | {
>         file_id?: string | null,
>         data?: string | null,
>         detail?: string | null,
>         media_type?: string | null,
>         type?: string | null
>       } | null,
>       type?: string | null
>     } | {
>       id?: string | null,
>       input?: {
>       } | null,
>       name?: string | null,
>       signature?: string | null,
>       type?: string | null
>     } | {
>       content?: string | null,
>       is_error?: boolean | null,
>       tool_call_id?: string | null,
>       type?: string | null
>     } | {
>       is_native?: boolean | null,
>       reasoning?: string | null,
>       signature?: string | null,
>       type?: string | null
>     } | {
>       data?: string | null,
>       type?: string | null
>     } | {
>       signature?: string | null,
>       type?: string | null
>     } | {
>       id?: string | null,
>       summary?: {
>         index?: number | null,
>         text?: string | null
>       }[] | null,
>       encrypted_content?: string | null,
>       type?: string | null
>     }
>   )[] | null,
>   conversation_id?: string | null,
>   created_at?: string | null,
>   created_by_id?: string | null,
>   denial_reason?: string | null,
>   group_id?: string | null,
>   is_err?: boolean | null,
>   last_updated_by_id?: string | null,
>   model?: string | null,
>   name?: string | null,
>   otid?: string | null,
>   run_id?: string | null,
>   sender_id?: string | null,
>   step_id?: string | null,
>   tool_call_id?: string | null,
>   tool_calls?: {
>     id?: string | null,
>     function?: {
>       arguments?: string | null,
>       name?: string | null
>     } | null,
>     type?: string | null
>   }[] | null,
>   tool_returns?: {
>     status?: string | null,
>     func_response?: string | (
>       {
>         text?: string | null,
>         signature?: string | null,
>         type?: string | null
>       } | {
>         source?: {
>           url?: string | null,
>           type?: string | null
>         } | {
>           data?: string | null,
>           media_type?: string | null,
>           detail?: string | null,
>           type?: string | null
>         } | {
>           file_id?: string | null,
>           data?: string | null,
>           detail?: string | null,
>           media_type?: string | null,
>           type?: string | null
>         } | null,
>         type?: string | null
>       }
>     )[] | {
>       source?: {
>         url?: string | null,
>         type?: string | null
>       } | {
>         data?: string | null,
>         media_type?: string | null,
>         detail?: string | null,
>         type?: string | null
>       } | {
>         file_id?: string | null,
>         data?: string | null,
>         detail?: string | null,
>         media_type?: string | null,
>         type?: string | null
>       } | null,
>       type?: string | null
>     } | null,
>     stderr?: string[] | null,
>     stdout?: string[] | null,
>     tool_call_id?: any | null
>   }[] | null,
>   updated_at?: string | null
> }[] | null
> ```

> [accordion] prompt\_tokens\_details full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

### list

`steps.list`

List Steps. List steps with optional pagination and date filters. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.steps.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | Cursor for pagination (step ID). Returns results relative to this ID in the specified sort order. Expected format: 'step-\<uuid4>' |
| `agent_id` | `string` | No | Filter by the ID of the agent that performed the step |
| `before` | `string` | No | Cursor for pagination (step ID). Returns results relative to this ID in the specified sort order. Expected format: 'step-\<uuid4>' |
| `end_date` | `string` | No | Return steps before this ISO datetime (e.g. "2025-01-29T15:01:19-08:00") |
| `feedback` | `positive \| negative` | No | Filter by feedback |
| `has_feedback` | `boolean` | No | Filter by whether steps have feedback (true) or not (false) |
| `limit` | `number` | No | Maximum number of steps to return |
| `model` | `string` | No | Filter by the name of the model used for the step |
| `order` | `asc \| desc` | No | Sort order for steps by creation time. 'asc' for oldest first, 'desc' for newest first |
| `order_by` | `created_at` | No | Field to sort by |
| `project_id` | `string` | No | Filter by the project ID that is associated with the step (cloud only). |
| `start_date` | `string` | No | Return steps after this ISO datetime (e.g. "2025-01-29T15:01:19-08:00") |
| `tags` | `string[]` | No | Filter by tags |
| `trace_ids` | `string[]` | No | Filter by trace ids returned by the server |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   agent_id?: string | null,
>   cache_write_tokens?: number | null,
>   cached_input_tokens?: number | null,
>   completion_tokens?: number | null,
>   completion_tokens_details?: {
>   } | null,
>   context_window_limit?: number | null,
>   error_data?: {
>   } | null,
>   error_type?: string | null,
>   feedback?: string | null,
>   messages?: {
>     id?: string | null,
>     role?: string | string | string | string | string | string | string | null,
>     agent_id?: string | null,
>     approval_request_id?: string | null,
>     approvals?: (
>       {
>         approve?: boolean | null,
>         tool_call_id?: string | null,
>         reason?: string | null,
>         type?: string | null
>       } | {
>         approve?: boolean | null,
>         tool_call_id?: string | null,
>         reason?: string | null,
>         type?: string | null
>       }
>     )[] | null,
>     approve?: boolean | null,
>     batch_item_id?: string | null,
>     content?: (
>       {
>         text?: string | null,
>         signature?: string | null,
>         type?: string | null
>       } | {
>         source?: {
>           url?: string | null,
>           type?: string | null
>         } | {
>           data?: string | null,
>           media_type?: string | null,
>           detail?: string | null,
>           type?: string | null
>         } | {
>           file_id?: string | null,
>           data?: string | null,
>           detail?: string | null,
>           media_type?: string | null,
>           type?: string | null
>         } | null,
>         type?: string | null
>       } | {
>         id?: string | null,
>         input?: {
>         } | null,
>         name?: string | null,
>         signature?: string | null,
>         type?: string | null
>       } | {
>         content?: string | null,
>         is_error?: boolean | null,
>         tool_call_id?: string | null,
>         type?: string | null
>       } | {
>         is_native?: boolean | null,
>         reasoning?: string | null,
>         signature?: string | null,
>         type?: string | null
>       } | {
>         data?: string | null,
>         type?: string | null
>       } | {
>         signature?: string | null,
>         type?: string | null
>       } | {
>         id?: string | null,
>         summary?: {
>           index?: number | null,
>           text?: string | null
>         }[] | null,
>         encrypted_content?: string | null,
>         type?: string | null
>       }
>     )[] | null,
>     conversation_id?: string | null,
>     created_at?: string | null,
>     created_by_id?: string | null,
>     denial_reason?: string | null,
>     group_id?: string | null,
>     is_err?: boolean | null,
>     last_updated_by_id?: string | null,
>     model?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     step_id?: string | null,
>     tool_call_id?: string | null,
>     tool_calls?: {
>       id?: string | null,
>       function?: {
>         arguments?: string | null,
>         name?: string | null
>       } | null,
>       type?: string | null
>     }[] | null,
>     tool_returns?: {
>       status?: string | null,
>       func_response?: string | (
>         {
>           text?: string | null,
>           signature?: string | null,
>           type?: string | null
>         } | {
>           source?: {
>             url?: string | null,
>             type?: string | null
>           } | {
>             data?: string | null,
>             media_type?: string | null,
>             detail?: string | null,
>             type?: string | null
>           } | {
>             file_id?: string | null,
>             data?: string | null,
>             detail?: string | null,
>             media_type?: string | null,
>             type?: string | null
>           } | null,
>           type?: string | null
>         }
>       )[] | {
>         source?: {
>           url?: string | null,
>           type?: string | null
>         } | {
>           data?: string | null,
>           media_type?: string | null,
>           detail?: string | null,
>           type?: string | null
>         } | {
>           file_id?: string | null,
>           data?: string | null,
>           detail?: string | null,
>           media_type?: string | null,
>           type?: string | null
>         } | null,
>         type?: string | null
>       } | null,
>       stderr?: string[] | null,
>       stdout?: string[] | null,
>       tool_call_id?: any | null
>     }[] | null,
>     updated_at?: string | null
>   }[] | null,
>   model?: string | null,
>   model_endpoint?: string | null,
>   model_handle?: string | null,
>   origin?: string | null,
>   project_id?: string | null,
>   prompt_tokens?: number | null,
>   prompt_tokens_details?: {
>   } | null,
>   provider_category?: string | null,
>   provider_id?: string | null,
>   provider_name?: string | null,
>   reasoning_tokens?: number | null,
>   request_id?: string | null,
>   run_id?: string | null,
>   status?: string | null,
>   stop_reason?: string | string | string | string | string | string | string | string | string | string | string | string | string | null,
>   tags?: string[] | null,
>   tid?: string | null,
>   total_tokens?: number | null,
>   trace_id?: string | null
> }[]
> ```

***

### messages.list

`steps.messages.list`

List Messages For Step. List messages for a given step. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.steps.messages.list({ step_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `step_id` | `string` | Yes | The ID of the step in the format 'step-\<uuid4>' |
| `after` | `string` | No | Cursor for pagination (message ID). Returns results relative to this ID in the specified sort order. Expected format: 'message-\<uuid4>' |
| `before` | `string` | No | Cursor for pagination (message ID). Returns results relative to this ID in the specified sort order. Expected format: 'message-\<uuid4>' |
| `limit` | `number` | No | Maximum number of messages to return |
| `order` | `asc \| desc` | No | Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first |
| `order_by` | `created_at` | No | Sort by field |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> (
>   {
>     id?: string | null,
>     content?: string | null,
>     date?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     content?: (
>       {
>         text?: string | null,
>         signature?: string | null,
>         type?: string | null
>       } | {
>         source?: {
>           url?: string | null,
>           type?: string | null
>         } | {
>           data?: string | null,
>           media_type?: string | null,
>           detail?: string | null,
>           type?: string | null
>         } | {
>           file_id?: string | null,
>           data?: string | null,
>           detail?: string | null,
>           media_type?: string | null,
>           type?: string | null
>         } | null,
>         type?: string | null
>       }
>     )[] | string | null,
>     date?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     reasoning?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     signature?: string | null,
>     source?: string | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     state?: string | null,
>     hidden_reasoning?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     tool_call?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null,
>     tool_calls?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     }[] | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     status?: string | null,
>     tool_call_id?: string | null,
>     tool_return?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     stderr?: string[] | null,
>     stdout?: string[] | null,
>     step_id?: string | null,
>     tool_returns?: {
>       status?: string | null,
>       tool_call_id?: string | null,
>       tool_return?: (
>         {
>           text?: string | null,
>           signature?: string | null,
>           type?: string | null
>         } | {
>           source?: {
>             url?: string | null,
>             type?: string | null
>           } | {
>             data?: string | null,
>             media_type?: string | null,
>             detail?: string | null,
>             type?: string | null
>           } | {
>             file_id?: string | null,
>             data?: string | null,
>             detail?: string | null,
>             media_type?: string | null,
>             type?: string | null
>           } | null,
>           type?: string | null
>         }
>       )[] | string | null,
>       stderr?: string[] | null,
>       stdout?: string[] | null,
>       type?: string | null
>     }[] | null
>   } | {
>     id?: string | null,
>     content?: {
>       text?: string | null,
>       signature?: string | null,
>       type?: string | null
>     }[] | string | null,
>     date?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     tool_call?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null,
>     tool_calls?: {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     }[] | {
>       arguments?: string | null,
>       name?: string | null,
>       tool_call_id?: string | null
>     } | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     approval_request_id?: string | null,
>     approvals?: (
>       {
>         approve?: boolean | null,
>         tool_call_id?: string | null,
>         reason?: string | null,
>         type?: string | null
>       } | {
>         status?: string | null,
>         tool_call_id?: string | null,
>         tool_return?: (
>           {
>             text?: string | null,
>             signature?: string | null,
>             type?: string | null
>           } | {
>             source?: {
>               url?: string | null,
>               type?: string | null
>             } | {
>               data?: string | null,
>               media_type?: string | null,
>               detail?: string | null,
>               type?: string | null
>             } | {
>               file_id?: string | null,
>               data?: string | null,
>               detail?: string | null,
>               media_type?: string | null,
>               type?: string | null
>             } | null,
>             type?: string | null
>           }
>         )[] | string | null,
>         stderr?: string[] | null,
>         stdout?: string[] | null,
>         type?: string | null
>       }
>     )[] | null,
>     approve?: boolean | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     reason?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     summary?: string | null,
>     compaction_stats?: {
>       context_window?: number | null,
>       messages_count_after?: number | null,
>       messages_count_before?: number | null,
>       trigger?: string | null,
>       context_tokens_after?: number | null,
>       context_tokens_before?: number | null
>     } | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   } | {
>     id?: string | null,
>     date?: string | null,
>     event_data?: {
>     } | null,
>     event_type?: string | null,
>     is_err?: boolean | null,
>     message_type?: string | null,
>     name?: string | null,
>     otid?: string | null,
>     run_id?: string | null,
>     sender_id?: string | null,
>     seq_id?: number | null,
>     step_id?: string | null
>   }
> )[]
> ```

***

### metrics.get

`steps.metrics.get`

Retrieve Metrics For Step. Get step metrics by step ID. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.steps.metrics.get({ step_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `step_id` | `string` | Yes | The ID of the step in the format 'step-\<uuid4>' |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The id of the step this metric belongs to (matches steps.id). |
| `agent_id` | `string \| null` | No | The unique identifier of the agent. |
| `base_template_id` | `string \| null` | No | The base template ID that the step belongs to (cloud only). |
| `llm_request_ns` | `number \| null` | No | Time spent on LLM requests in nanoseconds. |
| `llm_request_start_ns` | `number \| null` | No | The timestamp of the start of the llm request in nanoseconds. |
| `project_id` | `string \| null` | No | The project that the step belongs to (cloud only). |
| `provider_id` | `string \| null` | No | The unique identifier of the provider. |
| `run_id` | `string \| null` | No | The unique identifier of the run. |
| `step_ns` | `number \| null` | No | Total time for the step in nanoseconds. |
| `step_start_ns` | `number \| null` | No | The timestamp of the start of the step in nanoseconds. |
| `template_id` | `string \| null` | No | The template ID that the step belongs to (cloud only). |
| `tool_execution_ns` | `number \| null` | No | Time spent on tool execution in nanoseconds. |

***

### trace.get

`steps.trace.get`

Retrieve Trace For Step. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.steps.trace.get({ step_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `step_id` | `string` | Yes | The ID of the step in the format 'step-\<uuid4>' |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `request_json` | `object \| null` | No | JSON content of the provider request |
| `response_json` | `object \| null` | No | JSON content of the provider response |
| `id` | `string \| null` | No | The human-friendly ID of the Provider\_trace |
| `agent_id` | `string \| null` | No | ID of the agent that generated this trace |
| `agent_tags` | `string[] \| null` | No | Tags associated with the agent for filtering |
| `billing_context` | `object \| null` | No | Billing context for LLM request cost tracking. |
| `call_type` | `string \| null` | No | Type of call (agent\_step, summarization, etc.) |
| `compaction_settings` | `object \| null` | No | Compaction/summarization settings (summarization calls only) |
| `created_at` | `string \| null` | No | The timestamp when the object was created. |
| `created_by_id` | `string \| null` | No | The id of the user that made this object. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this object. |
| `latency_ms` | `number \| null` | No | LLM request latency in milliseconds |
| `llm_config` | `object \| null` | No | LLM configuration used for this call (non-summarization calls only) |
| `org_id` | `string \| null` | No | ID of the organization |
| `run_id` | `string \| null` | No | ID of the run this trace is associated with |
| `source` | `string \| null` | No | Source service that generated this trace (memgpt-server, lettuce-py) |
| `step_id` | `string \| null` | No | ID of the step that this trace is associated with |
| `updated_at` | `string \| null` | No | The timestamp when the object was last updated. |

> [accordion] request\_json full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] response\_json full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] billing\_context full type
>
> ```ts theme={null}
> {
>   cost_source?: string | null,
>   customer_id?: string | null,
>   plan_type?: string | null
> } | null
> ```

> [accordion] compaction\_settings full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] llm\_config full type
>
> ```ts theme={null}
> {
> } | null
> ```

***

## Tags

### list

`tags.list`

List Tags. Get the list of all tags (from agents and blocks) that have been created.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.tags.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | Tag cursor for pagination. Returns tags that come after this tag in the specified sort order |
| `before` | `string` | No | Tag cursor for pagination. Returns tags that come before this tag in the specified sort order |
| `limit` | `number` | No | Maximum number of tags to return |
| `name` | `string` | No | Filter tags by name |
| `order` | `asc \| desc` | No | Sort order for tags. 'asc' for alphabetical order, 'desc' for reverse alphabetical order |
| `order_by` | `name` | No | Field to sort by |
| `query_text` | `string` | No | Filter tags by text search. Deprecated, please use name field instead |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

## Templates

### agents.create

`templates.agents.create`

Create Agents From Template. Creates an Agent or multiple Agents from a template. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.templates.agents.create({ template_version: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `template_version` | `string` | Yes | — |
| `agent_name` | `string` | No | The name of the agent, optional otherwise a random one will be assigned |
| `identity_ids` | `string[]` | No | The identity ids to assign to the agent |
| `initial_message_sequence` | `object[]` | No | Set an initial sequence of messages, if not provided, the agent will start with the default message sequence, if an empty array is provided, the agent will start with no messages |
| `memory_variables` | `Record<string, string>` | No | The memory variables to assign to the agent |
| `tags` | `string[]` | No | The tags to assign to the agent |
| `tool_variables` | `Record<string, string>` | No | The tool variables to assign to the agent |

> [accordion] initial\_message\_sequence full type
>
> ```ts theme={null}
> {
>   content: string,
>   role: user | system | assistant,
>   batch_item_id?: string,
>   group_id?: string,
>   name?: string,
>   otid?: string,
>   sender_id?: string
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `agent_ids` | `string[] \| null` | No | Array of created agent IDs |
| `deployment_id` | `string \| null` | No | The deployment ID for the created agents |
| `group_id` | `string \| null` | No | Optional group ID if agents were created in a group |

***

### create

`templates.create`

Create template (Cloud-only). Creates a new template from an existing agent or agent file. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.templates.create({
	body: { agent_id: 'example', type: 'agent' },
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `body` | `object` | Yes | The type of template to create, currently only agent templates are supported |

> [accordion] body full type
>
> ```ts theme={null}
> {
>   agent_id: string,
>   type: agent,
>   name?: string
> } | {
>   agent_file: {
>   },
>   type: agent_file,
>   name?: string,
>   update_existing_tools?: boolean
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `latest_version` | `string \| null` | No | The latest version of the template |
| `name` | `string \| null` | No | The exact name of the template |
| `project_id` | `string \| null` | No | — |
| `project_slug` | `string \| null` | No | — |
| `template_deployment_slug` | `string \| null` | No | The full name of the template, including version and project slug |
| `updated_at` | `string \| null` | No | When the template was last updated |
| `description` | `string \| null` | No | — |

***

### delete

`templates.delete`

Delete template (Cloud-only). Deletes all versions of a template with the specified name. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.templates.delete({ template_name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `template_name` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |

***

### rollback

`templates.rollback`

Rollback template to previous version (Cloud-only). Rollback the current working version of a template to a previous saved version. If the current version has unsaved changes, they will be automatically saved as a new version before rollback. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.templates.rollback({ template_name: 'example', version: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `template_name` | `string` | Yes | — |
| `version` | `string` | Yes | The target version to rollback to (e.g., "1", "2", "latest"). Cannot be "current" or "dev". |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| null` | No | — |

***

### save

`templates.save`

Save template version (Cloud-only). Saves the current version of the template as a new version. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.templates.save({ template_name: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `template_name` | `string` | Yes | — |
| `block_reconciliation_strategy` | `reconcile-all \| preserve-deleted` | No | Strategy for reconciling memory blocks during migration: "reconcile-all" deletes blocks not in the template, "preserve-deleted" keeps them. Defaults to "preserve-deleted". |
| `message` | `string` | No | A message to describe the changes made in this template version |
| `migrate_agents` | `boolean` | No | If true, existing agents attached to this template will be migrated to the new template version |
| `preserve_core_memories_on_migration` | `boolean` | No | If true, the core memories will be preserved in the template version when migrating agents |
| `preserve_environment_variables_on_migration` | `boolean` | No | If true, the environment variables will be preserved in the template version when migrating agents |
| `preserve_sources_on_migration` | `boolean` | No | If true, existing agent folders/sources will be preserved and merged with template sources during migration. If false, agent sources will be replaced with template sources. |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | — |
| `latest_version` | `string \| null` | No | The latest version of the template |
| `name` | `string \| null` | No | The exact name of the template |
| `project_id` | `string \| null` | No | — |
| `project_slug` | `string \| null` | No | — |
| `template_deployment_slug` | `string \| null` | No | The full name of the template, including version and project slug |
| `updated_at` | `string \| null` | No | When the template was last updated |
| `description` | `string \| null` | No | — |

***

### update

`templates.update`

Update current template from agent file (Cloud-only). Updates the current working version of a template from an agent file. Letta Cloud answered 404 with no such route for this on 11-27 (free account); it may need a paid plan or have been retired.

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.templates.update({
	template_name: 'example',
	agent_file_json: {},
});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `template_name` | `string` | Yes | — |
| `agent_file_json` | `object` | Yes | The agent file to update the current template version from |
| `save_existing_changes` | `boolean` | No | If true, Letta will automatically save any changes as a version before updating the template |
| `update_existing_tools` | `boolean` | No | If true, update existing custom tools source\_code and json\_schema (source\_type cannot be changed) |

> [accordion] agent\_file\_json full type
>
> ```ts theme={null}
> {
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `success` | `boolean \| null` | No | — |
| `message` | `string \| null` | No | — |

***

## Tools

### create

`tools.create`

Create Tool. Create a new tool. (POST /v1/tools/)

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.tools.create({ source_code: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `source_code` | `string` | Yes | The source code of the function. |
| `args_json_schema` | `object` | No | The args JSON schema of the function. |
| `default_requires_approval` | `boolean` | No | Whether or not to require approval before executing this tool. |
| `description` | `string` | No | The description of the tool. |
| `enable_parallel_execution` | `boolean` | No | If set to True, then this tool will potentially be executed concurrently with other tools. Default False. |
| `json_schema` | `object` | No | The JSON schema of the function (auto-generated from source\_code if not provided) |
| `npm_requirements` | `object[]` | No | Optional list of npm packages required by this tool. |
| `pip_requirements` | `object[]` | No | Optional list of pip packages required by this tool. |
| `return_char_limit` | `number` | No | The maximum number of characters in the response. |
| `source_type` | `string` | No | The source type of the function. |
| `tags` | `string[]` | No | Metadata tags. |

> [accordion] args\_json\_schema full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] json\_schema full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] npm\_requirements full type
>
> ```ts theme={null}
> {
>   name: string,
>   version?: string
> }[]
> ```

> [accordion] pip\_requirements full type
>
> ```ts theme={null}
> {
>   name: string,
>   version?: string
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The human-friendly ID of the Tool |
| `args_json_schema` | `object \| null` | No | The args JSON schema of the function. |
| `created_by_id` | `string \| null` | No | The id of the user that made this Tool. |
| `default_requires_approval` | `boolean \| null` | No | Default value for whether or not executing this tool requires approval. |
| `description` | `string \| null` | No | The description of the tool. |
| `enable_parallel_execution` | `boolean \| null` | No | If set to True, then this tool will potentially be executed concurrently with other tools. Default False. |
| `json_schema` | `object \| null` | No | The JSON schema of the function. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this Tool. |
| `metadata_` | `object \| null` | No | A dictionary of additional metadata for the tool. |
| `name` | `string \| null` | No | The name of the function. |
| `npm_requirements` | `object[] \| null` | No | Optional list of npm packages required by this tool. |
| `pip_requirements` | `object[] \| null` | No | Optional list of pip packages required by this tool. |
| `project_id` | `string \| null` | No | The project id of the tool. |
| `return_char_limit` | `number \| null` | No | The maximum number of characters in the response. |
| `source_code` | `string \| null` | No | The source code of the function. |
| `source_type` | `string \| null` | No | The type of the source code. |
| `tags` | `string[] \| null` | No | Metadata tags. |
| `tool_type` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | — |

> [accordion] args\_json\_schema full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] json\_schema full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] metadata\_ full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] npm\_requirements full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   version?: string | null
> }[] | null
> ```

> [accordion] pip\_requirements full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   version?: string | null
> }[] | null
> ```

***

### delete

`tools.delete`

Delete Tool. Delete a tool by ID. Cannot be undone.

**Risk:** `destructive` · **Irreversible**

```ts theme={null}
await corsair.letta.api.tools.delete({ tool_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `tool_id` | `string` | Yes | The ID of the tool in the format 'tool-\<uuid4>' |

**Output:** `any \| object`

> [accordion] Output full type
>
> ```ts theme={null}
> any | {
>   success: true
> }
> ```

***

### get

`tools.get`

Retrieve Tool. Get a tool by ID. (GET /v1/tools/\{tool\_id})

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.tools.get({ tool_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `tool_id` | `string` | Yes | The ID of the tool in the format 'tool-\<uuid4>' |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The human-friendly ID of the Tool |
| `args_json_schema` | `object \| null` | No | The args JSON schema of the function. |
| `created_by_id` | `string \| null` | No | The id of the user that made this Tool. |
| `default_requires_approval` | `boolean \| null` | No | Default value for whether or not executing this tool requires approval. |
| `description` | `string \| null` | No | The description of the tool. |
| `enable_parallel_execution` | `boolean \| null` | No | If set to True, then this tool will potentially be executed concurrently with other tools. Default False. |
| `json_schema` | `object \| null` | No | The JSON schema of the function. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this Tool. |
| `metadata_` | `object \| null` | No | A dictionary of additional metadata for the tool. |
| `name` | `string \| null` | No | The name of the function. |
| `npm_requirements` | `object[] \| null` | No | Optional list of npm packages required by this tool. |
| `pip_requirements` | `object[] \| null` | No | Optional list of pip packages required by this tool. |
| `project_id` | `string \| null` | No | The project id of the tool. |
| `return_char_limit` | `number \| null` | No | The maximum number of characters in the response. |
| `source_code` | `string \| null` | No | The source code of the function. |
| `source_type` | `string \| null` | No | The type of the source code. |
| `tags` | `string[] \| null` | No | Metadata tags. |
| `tool_type` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | — |

> [accordion] args\_json\_schema full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] json\_schema full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] metadata\_ full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] npm\_requirements full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   version?: string | null
> }[] | null
> ```

> [accordion] pip\_requirements full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   version?: string | null
> }[] | null
> ```

***

### list

`tools.list`

List Tools. Get a list of all tools available to agents.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.tools.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `after` | `string` | No | Cursor for pagination (tool ID). Returns results relative to this ID in the specified sort order. Expected format: 'tool-\<uuid4>' |
| `before` | `string` | No | Cursor for pagination (tool ID). Returns results relative to this ID in the specified sort order. Expected format: 'tool-\<uuid4>' |
| `exclude_tool_types` | `string[]` | No | Tool type(s) to exclude - accepts repeated params or comma-separated values |
| `limit` | `number` | No | Maximum number of tools to return |
| `name` | `string` | No | Filter by single tool name |
| `names` | `string[]` | No | Filter by specific tool names |
| `order` | `asc \| desc` | No | Sort order for tools by creation time. 'asc' for oldest first, 'desc' for newest first |
| `order_by` | `created_at` | No | Field to sort by |
| `return_only_letta_tools` | `boolean` | No | Return only tools with tool\_type starting with 'letta\_' |
| `search` | `string` | No | Search tool names (case-insensitive partial match) |
| `tool_ids` | `string[]` | No | Filter by specific tool IDs - accepts repeated params or comma-separated values |
| `tool_types` | `string[]` | No | Filter by tool type(s) - accepts repeated params or comma-separated values |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   id?: string | null,
>   args_json_schema?: {
>   } | null,
>   created_by_id?: string | null,
>   default_requires_approval?: boolean | null,
>   description?: string | null,
>   enable_parallel_execution?: boolean | null,
>   json_schema?: {
>   } | null,
>   last_updated_by_id?: string | null,
>   metadata_?: {
>   } | null,
>   name?: string | null,
>   npm_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   pip_requirements?: {
>     name?: string | null,
>     version?: string | null
>   }[] | null,
>   project_id?: string | null,
>   return_char_limit?: number | null,
>   source_code?: string | null,
>   source_type?: string | null,
>   tags?: string[] | null,
>   tool_type?: string | string | string | string | string | string | string | string | string | string | string | null
> }[]
> ```

***

### search

`tools.search`

Search Tools. Search tools using semantic search. Requires tool embedding to be enabled (embed\_tools=True). Uses vector search, full-text search, or hybrid mode to find tools matching the query. Returns tools ranked by relevance with their search scores.

**Risk:** `read`

```ts theme={null}
await corsair.letta.api.tools.search({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `limit` | `number` | No | Maximum number of results to return. |
| `query` | `string` | No | Text query for semantic search. |
| `search_mode` | `vector \| fts \| hybrid` | No | Search mode: vector, fts, or hybrid. |
| `tags` | `string[]` | No | Filter by tags (match any). |
| `tool_types` | `string[]` | No | Filter by tool types (e.g., 'custom', 'letta\_core'). |

**Output:** `object[]`

> [accordion] Output full type
>
> ```ts theme={null}
> {
>   combined_score?: number | null,
>   tool?: {
>     id?: string | null,
>     args_json_schema?: {
>     } | null,
>     created_by_id?: string | null,
>     default_requires_approval?: boolean | null,
>     description?: string | null,
>     enable_parallel_execution?: boolean | null,
>     json_schema?: {
>     } | null,
>     last_updated_by_id?: string | null,
>     metadata_?: {
>     } | null,
>     name?: string | null,
>     npm_requirements?: {
>       name?: string | null,
>       version?: string | null
>     }[] | null,
>     pip_requirements?: {
>       name?: string | null,
>       version?: string | null
>     }[] | null,
>     project_id?: string | null,
>     return_char_limit?: number | null,
>     source_code?: string | null,
>     source_type?: string | null,
>     tags?: string[] | null,
>     tool_type?: string | string | string | string | string | string | string | string | string | string | string | null
>   } | null,
>   embedded_text?: string | null,
>   fts_rank?: number | null,
>   vector_rank?: number | null
> }[]
> ```

***

### update

`tools.update`

Update Tool. Update an existing tool. (PATCH /v1/tools/\{tool\_id})

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.tools.update({ tool_id: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `tool_id` | `string` | Yes | The ID of the tool in the format 'tool-\<uuid4>' |
| `args_json_schema` | `object` | No | The args JSON schema of the function. |
| `default_requires_approval` | `boolean` | No | Whether or not to require approval before executing this tool. |
| `description` | `string` | No | The description of the tool. |
| `enable_parallel_execution` | `boolean` | No | If set to True, then this tool will potentially be executed concurrently with other tools. Default False. |
| `json_schema` | `object` | No | The JSON schema of the function (auto-generated from source\_code if not provided) |
| `metadata_` | `object` | No | A dictionary of additional metadata for the tool. |
| `npm_requirements` | `object[]` | No | Optional list of npm packages required by this tool. |
| `pip_requirements` | `object[]` | No | Optional list of pip packages required by this tool. |
| `return_char_limit` | `number` | No | The maximum number of characters in the response. |
| `source_code` | `string` | No | The source code of the function. |
| `source_type` | `string` | No | The type of the source code. |
| `tags` | `string[]` | No | Metadata tags. |

> [accordion] args\_json\_schema full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] json\_schema full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] metadata\_ full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] npm\_requirements full type
>
> ```ts theme={null}
> {
>   name: string,
>   version?: string
> }[]
> ```

> [accordion] pip\_requirements full type
>
> ```ts theme={null}
> {
>   name: string,
>   version?: string
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The human-friendly ID of the Tool |
| `args_json_schema` | `object \| null` | No | The args JSON schema of the function. |
| `created_by_id` | `string \| null` | No | The id of the user that made this Tool. |
| `default_requires_approval` | `boolean \| null` | No | Default value for whether or not executing this tool requires approval. |
| `description` | `string \| null` | No | The description of the tool. |
| `enable_parallel_execution` | `boolean \| null` | No | If set to True, then this tool will potentially be executed concurrently with other tools. Default False. |
| `json_schema` | `object \| null` | No | The JSON schema of the function. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this Tool. |
| `metadata_` | `object \| null` | No | A dictionary of additional metadata for the tool. |
| `name` | `string \| null` | No | The name of the function. |
| `npm_requirements` | `object[] \| null` | No | Optional list of npm packages required by this tool. |
| `pip_requirements` | `object[] \| null` | No | Optional list of pip packages required by this tool. |
| `project_id` | `string \| null` | No | The project id of the tool. |
| `return_char_limit` | `number \| null` | No | The maximum number of characters in the response. |
| `source_code` | `string \| null` | No | The source code of the function. |
| `source_type` | `string \| null` | No | The type of the source code. |
| `tags` | `string[] \| null` | No | Metadata tags. |
| `tool_type` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | — |

> [accordion] args\_json\_schema full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] json\_schema full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] metadata\_ full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] npm\_requirements full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   version?: string | null
> }[] | null
> ```

> [accordion] pip\_requirements full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   version?: string | null
> }[] | null
> ```

***

### upsert

`tools.upsert`

Upsert Tool. Create or update a tool. (PUT /v1/tools/)

**Risk:** `write`

```ts theme={null}
await corsair.letta.api.tools.upsert({ source_code: 'example' });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `source_code` | `string` | Yes | The source code of the function. |
| `args_json_schema` | `object` | No | The args JSON schema of the function. |
| `default_requires_approval` | `boolean` | No | Whether or not to require approval before executing this tool. |
| `description` | `string` | No | The description of the tool. |
| `enable_parallel_execution` | `boolean` | No | If set to True, then this tool will potentially be executed concurrently with other tools. Default False. |
| `json_schema` | `object` | No | The JSON schema of the function (auto-generated from source\_code if not provided) |
| `npm_requirements` | `object[]` | No | Optional list of npm packages required by this tool. |
| `pip_requirements` | `object[]` | No | Optional list of pip packages required by this tool. |
| `return_char_limit` | `number` | No | The maximum number of characters in the response. |
| `source_type` | `string` | No | The source type of the function. |
| `tags` | `string[]` | No | Metadata tags. |

> [accordion] args\_json\_schema full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] json\_schema full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] npm\_requirements full type
>
> ```ts theme={null}
> {
>   name: string,
>   version?: string
> }[]
> ```

> [accordion] pip\_requirements full type
>
> ```ts theme={null}
> {
>   name: string,
>   version?: string
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string \| null` | No | The human-friendly ID of the Tool |
| `args_json_schema` | `object \| null` | No | The args JSON schema of the function. |
| `created_by_id` | `string \| null` | No | The id of the user that made this Tool. |
| `default_requires_approval` | `boolean \| null` | No | Default value for whether or not executing this tool requires approval. |
| `description` | `string \| null` | No | The description of the tool. |
| `enable_parallel_execution` | `boolean \| null` | No | If set to True, then this tool will potentially be executed concurrently with other tools. Default False. |
| `json_schema` | `object \| null` | No | The JSON schema of the function. |
| `last_updated_by_id` | `string \| null` | No | The id of the user that made this Tool. |
| `metadata_` | `object \| null` | No | A dictionary of additional metadata for the tool. |
| `name` | `string \| null` | No | The name of the function. |
| `npm_requirements` | `object[] \| null` | No | Optional list of npm packages required by this tool. |
| `pip_requirements` | `object[] \| null` | No | Optional list of pip packages required by this tool. |
| `project_id` | `string \| null` | No | The project id of the tool. |
| `return_char_limit` | `number \| null` | No | The maximum number of characters in the response. |
| `source_code` | `string \| null` | No | The source code of the function. |
| `source_type` | `string \| null` | No | The type of the source code. |
| `tags` | `string[] \| null` | No | Metadata tags. |
| `tool_type` | `string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| string \| null` | No | — |

> [accordion] args\_json\_schema full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] json\_schema full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] metadata\_ full type
>
> ```ts theme={null}
> {
> } | null
> ```

> [accordion] npm\_requirements full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   version?: string | null
> }[] | null
> ```

> [accordion] pip\_requirements full type
>
> ```ts theme={null}
> {
>   name?: string | null,
>   version?: string | null
> }[] | null
> ```

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.