openapi: 3.1.0 info: title: Letta Admin Internal Runs API version: 1.0.0 description: REST API for Letta, the stateful agents platform. Manage agents, memory blocks, archival passages, sources, custom tools, MCP servers, multi-agent groups, runs, and streaming responses. Available as Letta Cloud (managed) at https://api.letta.com/v1 and as the self-hosted open-source server (Apache-2.0) typically run at http://localhost:8283. contact: name: Letta url: https://www.letta.com/ email: support@letta.com license: name: Apache-2.0 url: https://github.com/letta-ai/letta/blob/main/LICENSE x-logo: url: https://www.letta.com/favicon.ico servers: - url: https://api.letta.com description: Letta Cloud (managed) - url: https://app.letta.com description: Letta Cloud (app) - url: http://localhost:8283 description: Self-hosted Letta server security: - bearerAuth: [] tags: - name: Internal Runs description: Internal Runs operations. paths: /v1/_internal_runs/: get: tags: - Internal Runs summary: List Runs description: List all runs. operationId: list_internal_runs parameters: - name: run_id in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter by a specific run ID. title: Run Id description: Filter by a specific run ID. - name: agent_id in: query required: false schema: anyOf: - type: string - type: 'null' description: The unique identifier of the agent associated with the run. title: Agent Id description: The unique identifier of the agent associated with the run. - name: agent_ids in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: The unique identifiers of the agents associated with the run. Deprecated in favor of agent_id field. deprecated: true title: Agent Ids description: The unique identifiers of the agents associated with the run. Deprecated in favor of agent_id field. deprecated: true - name: statuses in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Filter runs by status. Can specify multiple statuses. title: Statuses description: Filter runs by status. Can specify multiple statuses. - name: background in: query required: false schema: anyOf: - type: boolean - type: 'null' description: If True, filters for runs that were created in background mode. title: Background description: If True, filters for runs that were created in background mode. - name: stop_reason in: query required: false schema: anyOf: - $ref: '#/components/schemas/StopReasonType' - type: 'null' description: Filter runs by stop reason. title: Stop Reason description: Filter runs by stop reason. - name: template_family in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter runs by template family (base_template_id). title: Template Family description: Filter runs by template family (base_template_id). - name: step_count in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter runs by step count. Must be provided with step_count_operator. title: Step Count description: Filter runs by step count. Must be provided with step_count_operator. - name: step_count_operator in: query required: false schema: $ref: '#/components/schemas/ComparisonOperator' description: 'Operator for step_count filter: ''eq'' for equals, ''gte'' for greater than or equal, ''lte'' for less than or equal.' default: eq description: 'Operator for step_count filter: ''eq'' for equals, ''gte'' for greater than or equal, ''lte'' for less than or equal.' - name: tools_used in: query required: false schema: anyOf: - type: array items: type: string - type: 'null' description: Filter runs that used any of the specified tools. title: Tools Used description: Filter runs that used any of the specified tools. - name: before in: query required: false schema: anyOf: - type: string - type: 'null' description: Run ID cursor for pagination. Returns runs that come before this run ID in the specified sort order title: Before description: Run ID cursor for pagination. Returns runs that come before this run ID in the specified sort order - name: after in: query required: false schema: anyOf: - type: string - type: 'null' description: Run ID cursor for pagination. Returns runs that come after this run ID in the specified sort order title: After description: Run ID cursor for pagination. Returns runs that come after this run ID in the specified sort order - name: limit in: query required: false schema: anyOf: - type: integer maximum: 1000 minimum: 1 - type: 'null' description: Maximum number of runs to return default: 100 title: Limit description: Maximum number of runs to return - name: order in: query required: false schema: enum: - asc - desc type: string description: Sort order for runs by creation time. 'asc' for oldest first, 'desc' for newest first default: desc title: Order description: Sort order for runs by creation time. 'asc' for oldest first, 'desc' for newest first - name: order_by in: query required: false schema: enum: - created_at - duration type: string description: Field to sort by default: created_at title: Order By description: Field to sort by - name: active in: query required: false schema: type: boolean description: Filter for active runs. default: false title: Active description: Filter for active runs. - name: ascending in: query required: false schema: type: boolean description: Whether to sort agents oldest to newest (True) or newest to oldest (False, default). Deprecated in favor of order field. deprecated: true default: false title: Ascending description: Whether to sort agents oldest to newest (True) or newest to oldest (False, default). Deprecated in favor of order field. deprecated: true - name: project_id in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter runs by project ID. title: Project Id description: Filter runs by project ID. - name: conversation_id in: query required: false schema: anyOf: - type: string - type: 'null' description: Filter runs by conversation ID. title: Conversation Id description: Filter runs by conversation ID. - name: duration_percentile in: query required: false schema: anyOf: - type: integer - type: 'null' description: Filter runs by duration percentile (1-100). Returns runs slower than this percentile. title: Duration Percentile description: Filter runs by duration percentile (1-100). Returns runs slower than this percentile. - name: duration_value in: query required: false schema: anyOf: - type: integer - type: 'null' description: Duration value in nanoseconds for filtering. Must be used with duration_operator. title: Duration Value description: Duration value in nanoseconds for filtering. Must be used with duration_operator. - name: duration_operator in: query required: false schema: anyOf: - enum: - gt - lt - eq type: string - type: 'null' description: 'Comparison operator for duration filter: ''gt'' (greater than), ''lt'' (less than), ''eq'' (equals).' title: Duration Operator description: 'Comparison operator for duration filter: ''gt'' (greater than), ''lt'' (less than), ''eq'' (equals).' - name: start_date in: query required: false schema: anyOf: - type: string format: date-time - type: 'null' description: Filter runs created on or after this date (ISO 8601 format). title: Start Date description: Filter runs created on or after this date (ISO 8601 format). - name: end_date in: query required: false schema: anyOf: - type: string format: date-time - type: 'null' description: Filter runs created on or before this date (ISO 8601 format). title: End Date description: Filter runs created on or before this date (ISO 8601 format). responses: '200': description: Successful Response content: application/json: schema: type: array items: $ref: '#/components/schemas/Run' title: Response List Internal Runs '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: ComparisonOperator: type: string enum: - eq - gte - lte title: ComparisonOperator description: Comparison operators for filtering numeric values ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type type: object required: - loc - msg - type title: ValidationError LettaRequestConfig: properties: use_assistant_message: type: boolean title: Use Assistant Message description: Whether the server should parse specific tool call arguments (default `send_message`) as `AssistantMessage` objects. default: true assistant_message_tool_name: type: string title: Assistant Message Tool Name description: The name of the designated message tool. default: send_message assistant_message_tool_kwarg: type: string title: Assistant Message Tool Kwarg description: The name of the message argument in the designated message tool. default: message include_return_message_types: anyOf: - items: $ref: '#/components/schemas/MessageType' type: array - type: 'null' title: Include Return Message Types description: Only return specified message types in the response. If `None` (default) returns all messages. type: object title: LettaRequestConfig MessageType: type: string enum: - 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 title: MessageType RunStatus: type: string enum: - created - running - completed - failed - cancelled title: RunStatus description: Status of the run. Run: properties: id: type: string pattern: ^(job|run)-[a-fA-F0-9]{8} title: Id description: The human-friendly ID of the Run examples: - run-123e4567-e89b-12d3-a456-426614174000 status: $ref: '#/components/schemas/RunStatus' description: The current status of the run. default: created created_at: type: string format: date-time title: Created At description: The timestamp when the run was created. completed_at: anyOf: - type: string format: date-time - type: 'null' title: Completed At description: The timestamp when the run was completed. agent_id: type: string title: Agent Id description: The unique identifier of the agent associated with the run. conversation_id: anyOf: - type: string - type: 'null' title: Conversation Id description: The unique identifier of the conversation associated with the run. base_template_id: anyOf: - type: string - type: 'null' title: Base Template Id description: The base template ID that the run belongs to. background: anyOf: - type: boolean - type: 'null' title: Background description: Whether the run was created in background mode. metadata: anyOf: - additionalProperties: true type: object - type: 'null' title: Metadata description: Additional metadata for the run. request_config: anyOf: - $ref: '#/components/schemas/LettaRequestConfig' - type: 'null' description: The request configuration for the run. stop_reason: anyOf: - $ref: '#/components/schemas/StopReasonType' - type: 'null' description: The reason why the run was stopped. callback_url: anyOf: - type: string - type: 'null' title: Callback Url description: If set, POST to this URL when the run completes. callback_sent_at: anyOf: - type: string format: date-time - type: 'null' title: Callback Sent At description: Timestamp when the callback was last attempted. callback_status_code: anyOf: - type: integer - type: 'null' title: Callback Status Code description: HTTP status code returned by the callback endpoint. callback_error: anyOf: - type: string - type: 'null' title: Callback Error description: Optional error message from attempting to POST the callback endpoint. ttft_ns: anyOf: - type: integer - type: 'null' title: Ttft Ns description: Time to first token for a run in nanoseconds total_duration_ns: anyOf: - type: integer - type: 'null' title: Total Duration Ns description: Total run duration in nanoseconds additionalProperties: false type: object required: - agent_id title: Run description: Representation of a run - a conversation or processing session for an agent. Runs track when agents process messages and maintain the relationship between agents, steps, and messages. StopReasonType: type: string enum: - 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 title: StopReasonType HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError securitySchemes: bearerAuth: type: http scheme: bearer