---
title: "Retrieve Agent Context Window"
method: GET
path: "/v1/agents/{agent_id}/context"
tags: ["agents"]
---

# Retrieve Agent Context Window

`GET /v1/agents/{agent_id}/context`

Retrieve the context window of a specific agent.

## Path parameters

- `agent_id` string, required

## Response `200`

Successful Response

- ContextWindowOverview — Overview of the context window, including the number of messages and tokens.
  - `context_window_size_max` integer, required — The maximum amount of tokens the context window can hold.
  - `context_window_size_current` integer, required — The current number of tokens in the context window.
  - `num_messages` integer, required — The number of messages in the context window.
  - `num_archival_memory` integer, required — The number of messages in the archival memory.
  - `num_recall_memory` integer, required — The number of messages in the recall memory.
  - `num_tokens_external_memory_summary` integer, required — The number of tokens in the external memory summary (archival + recall metadata).
  - `external_memory_summary` string, required — The metadata summary of the external memory sources (archival + recall metadata).
  - `num_tokens_system` integer, required — The number of tokens in the system prompt.
  - `system_prompt` string, required — The content of the system prompt.
  - `num_tokens_core_memory` integer, required — The number of tokens in the core memory.
  - `core_memory` string, required — The content of the core memory.
  - `num_tokens_summary_memory` integer, required — The number of tokens in the summary memory.
  - `summary_memory` string, nullable — The content of the summary memory.
  - `num_tokens_functions_definitions` integer, required — The number of tokens in the functions definitions.
  - `functions_definitions` FunctionTool[], nullable, required — The content of the functions definitions.
    - `function` FunctionDefinition, required
      - `name` string, required
      - `description` string, nullable
      - `parameters` object, nullable
      - `strict` boolean, nullable
    - `type` 'function', required
  - `num_tokens_messages` integer, required — The number of tokens in the messages list.
  - `messages` Message[], required — The messages in the context window.
    - `created_by_id` string, nullable — The id of the user that made this object.
    - `last_updated_by_id` string, nullable — The id of the user that made this object.
    - `created_at` string, date-time — The timestamp when the object was created.
    - `updated_at` string, date-time, nullable — The timestamp when the object was last updated.
    - `id` string — The human-friendly ID of the Message
    - `agent_id` string, nullable — The unique identifier of the agent.
    - `model` string, nullable — The model used to make the function call.
    - `role` 'assistant' | 'user' | 'tool' | 'function' | 'system' | 'approval', required
    - `content` union[], nullable — The content of the message.
      - union
        - TextContent
          - `type` 'text' — The type of the message.
          - `text` string, required — The text content of the message.
          - `signature` string, nullable — Stores a unique identifier for any reasoning associated with this text content.
        - ImageContent
          - `type` 'image' — The type of the message.
          - `source` union, required — The source of the image.
            - UrlImage
              - …
            - Base64Image
              - …
            - LettaImage
              - …
        - ToolCallContent
          - `type` 'tool_call' — Indicates this content represents a tool call event.
          - `id` string, required — A unique identifier for this specific tool call instance.
          - `name` string, required — The name of the tool being called.
          - `input` object, required — The parameters being passed to the tool, structured as a dictionary of parameter names to values.
          - `signature` string, nullable — Stores a unique identifier for any reasoning associated with this tool call.
        - ToolReturnContent
          - `type` 'tool_return' — Indicates this content represents a tool return event.
          - `tool_call_id` string, required — References the ID of the ToolCallContent that initiated this tool call.
          - `content` string, required — The content returned by the tool execution.
          - `is_error` boolean, required — Indicates whether the tool execution resulted in an error.
        - ReasoningContent — Sent via the Anthropic Messages API
          - `type` 'reasoning' — Indicates this is a reasoning/intermediate step.
          - `is_native` boolean, required — Whether the reasoning content was generated by a reasoner model that processed this step.
          - `reasoning` string, required — The intermediate reasoning or thought process content.
          - `signature` string, nullable — A unique identifier for this reasoning step.
        - RedactedReasoningContent — Sent via the Anthropic Messages API
          - `type` 'redacted_reasoning' — Indicates this is a redacted thinking step.
          - `data` string, required — The redacted or filtered intermediate reasoning content.
        - OmittedReasoningContent — A placeholder for reasoning content we know is present, but isn't returned by the provider (e.g. OpenAI GPT-5 on ChatCompletions)
          - `type` 'omitted_reasoning' — Indicates this is an omitted reasoning step.
          - `signature` string, nullable — A unique identifier for this reasoning step.
        - SummarizedReasoningContent — The style of reasoning content returned by the OpenAI Responses API
          - `type` 'summarized_reasoning' — Indicates this is a summarized reasoning step.
          - `id` string, required — The unique identifier for this reasoning step.
          - `summary` SummarizedReasoningContentPart[], required — Summaries of the reasoning content.
            - `index` integer, required — The index of the summary part.
            - `text` string, required — The text of the summary part.
          - `encrypted_content` string — The encrypted reasoning content.
    - `name` string, nullable — For role user/assistant: the (optional) name of the participant. For role tool/function: the name of the function called.
    - `tool_calls` ChatCompletionMessageFunctionToolCall[], nullable — The list of tool calls requested. Only applicable for role assistant.
      - `id` string, required
      - `function` Function, required
        - `arguments` string, required
        - `name` string, required
      - `type` 'function', required
    - `tool_call_id` string, nullable — The ID of the tool call. Only applicable for role tool.
    - `step_id` string, nullable — The id of the step that this message was created in.
    - `run_id` string, nullable — The id of the run that this message was created in.
    - `otid` string, nullable — The offline threading id associated with this message
    - `tool_returns` LettaSchemasMessageToolReturn[], nullable — Tool execution return information for prior tool calls
      - `tool_call_id` unknown
      - `status` 'success' | 'error', required — The status of the tool call
      - `stdout` string[], nullable — Captured stdout (e.g. prints, logs) from the tool invocation
      - `stderr` string[], nullable — Captured stderr from the tool invocation
      - `func_response` string, nullable — The function response string
    - `group_id` string, nullable — The multi-agent group that the message was sent in
    - `sender_id` string, nullable — The id of the sender of the message, can be an identity id or agent id
    - `batch_item_id` string, nullable — The id of the LLMBatchItem that this message is associated with
    - `is_err` boolean, nullable — Whether this message is part of an error step. Used only for debugging purposes.
    - `approval_request_id` string, nullable — The id of the approval request if this message is associated with a tool call request.
    - `approve` boolean, nullable — Whether tool call is approved.
    - `denial_reason` string, nullable — The reason the tool call request was denied.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/yu-code666/apis/letta-api.md) · [All operations](https://skmtc.net/yu-code666/apis/letta-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/yu-code666/letta-api/versions/6cec99480c13/schema)
