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

# Get all user chats via API key

> Get all chats for the user associated with the API key. Requires CHAT scope.



## OpenAPI

````yaml get /api/chats
openapi: 3.0.0
info:
  title: LeanMCP SDK API
  description: >-
    API endpoints for LeanMCP SDK integration. These endpoints use API key
    authentication and are designed for programmatic access from the CLI and
    SDK.
  version: 1.0.0
servers:
  - url: https://api.leanmcp.com
    description: Production
  - url: http://localhost:3001
    description: Local Development
security: []
tags:
  - name: builds-sdk
  - name: chat-messages-api-key
  - name: chats-api-key
  - name: deployments-api-key
  - name: deployments-sdk
  - name: mapping-sdk
  - name: projects-api-key
paths:
  /api/chats:
    get:
      tags:
        - chats-api-key
      summary: Get all user chats via API key
      description: >-
        Get all chats for the user associated with the API key. Requires CHAT
        scope.
      operationId: ChatsApiKeyController_getUserChats
      parameters: []
      responses:
        '200':
          description: Chat list retrieved successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ChatSummary'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ChatSummary:
      type: object
      properties:
        id:
          type: string
          description: Chat unique identifier
          example: c1a83d84-7154-464c-bd19-a9f10e0a067f
        title:
          type: string
          description: Chat title
          example: Help with TypeScript
        messageCount:
          type: number
          description: Number of messages in the chat
          example: 8
        lastMessageAt:
          type: string
          description: Timestamp of the last message
          example: '2025-06-16T20:15:00.000Z'
        createdAt:
          type: string
          description: When the chat was created
          example: '2025-06-16T19:30:00.000Z'
        modelUsed:
          type: string
          description: Model used in this chat
          example: claude-3-sonnet
        summary:
          type: string
          description: Chat summary
          example: Discussion about TypeScript best practices
        metadata:
          type: object
          description: Chat metadata
          example: Discussion about TypeScript best practices
      required:
        - id
        - title
        - messageCount
        - createdAt
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: Enter your LeanMCP API key

````