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

# List Chunks

> List chunks with cursor-based pagination.

Cursor-based pagination is more efficient than offset-based for large datasets:
- Consistent results even when data changes
- Better performance (no offset scanning)
- No "missed items" when new chunks are added

Args:
    collection_id: Optional filter by collection
    content_id: Optional filter by parent content
    cursor: Cursor from previous response for next page (None for first page)
    limit: Number of items to return (default: 50, max: 500)
    include_embedding: Include embedding vectors in response

Returns:
    ChunksListResponse with chunks, next_cursor, and has_more flag

Examples:
    First page of all chunks:
        GET /chunks?limit=50
    
    Next page (using cursor from previous response):
        GET /chunks?cursor=chunk_xyz123&limit=50
    
    List chunks for a specific collection:
        GET /chunks?collection_id=col_123&limit=50
    
    Continue pagination for collection:
        GET /chunks?collection_id=col_123&cursor=chunk_abc456&limit=50
    
    List chunks for specific content:
        GET /chunks?content_id=content_456&limit=20
    
    List with embeddings:
        GET /chunks?collection_id=col_123&include_embedding=true&limit=10



## OpenAPI

````yaml api-reference/openapi.json get /api/v1/chunks
openapi: 3.1.0
info:
  title: FastAPI app
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/chunks:
    get:
      tags:
        - Chunks
      summary: List Chunks
      description: >-
        List chunks with cursor-based pagination.


        Cursor-based pagination is more efficient than offset-based for large
        datasets:

        - Consistent results even when data changes

        - Better performance (no offset scanning)

        - No "missed items" when new chunks are added


        Args:
            collection_id: Optional filter by collection
            content_id: Optional filter by parent content
            cursor: Cursor from previous response for next page (None for first page)
            limit: Number of items to return (default: 50, max: 500)
            include_embedding: Include embedding vectors in response

        Returns:
            ChunksListResponse with chunks, next_cursor, and has_more flag

        Examples:
            First page of all chunks:
                GET /chunks?limit=50
            
            Next page (using cursor from previous response):
                GET /chunks?cursor=chunk_xyz123&limit=50
            
            List chunks for a specific collection:
                GET /chunks?collection_id=col_123&limit=50
            
            Continue pagination for collection:
                GET /chunks?collection_id=col_123&cursor=chunk_abc456&limit=50
            
            List chunks for specific content:
                GET /chunks?content_id=content_456&limit=20
            
            List with embeddings:
                GET /chunks?collection_id=col_123&include_embedding=true&limit=10
      operationId: list_chunks_api_v1_chunks_get
      parameters:
        - name: collection_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by collection ID
            title: Collection Id
          description: Filter by collection ID
        - name: content_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by content ID
            title: Content Id
          description: Filter by content ID
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Cursor for pagination (use next_cursor from previous response)
            title: Cursor
          description: Cursor for pagination (use next_cursor from previous response)
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 500
            minimum: 1
            description: Number of items to return
            default: 50
            title: Limit
          description: Number of items to return
        - name: include_embedding
          in: query
          required: false
          schema:
            type: boolean
            description: Include embedding vectors
            default: false
            title: Include Embedding
          description: Include embedding vectors
        - name: X-Workspace-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: The workspace ID
            title: X-Workspace-Id
          description: The workspace ID
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChunksListResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - DualAuthScheme: []
components:
  schemas:
    ChunksListResponse:
      properties:
        chunks:
          items:
            $ref: '#/components/schemas/ChunkResponse'
          type: array
          title: Chunks
          description: List of chunks
        total_count:
          type: integer
          title: Total Count
          description: Number of chunks returned in this request
          default: 0
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: Cursor for next page. None if no more pages.
        has_more:
          type: boolean
          title: Has More
          description: Whether there are more chunks to fetch
          default: false
      type: object
      title: ChunksListResponse
      description: Response model for listing chunks with cursor-based pagination.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ChunkResponse:
      properties:
        id:
          type: string
          title: Id
          description: Unique chunk ID
        content_id:
          type: string
          title: Content Id
          description: Parent content ID
        collection_id:
          type: string
          title: Collection Id
          description: Collection ID
        content:
          type: string
          title: Content
          description: Chunk text content
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
          description: Chunk metadata
        chunk_index:
          anyOf:
            - type: integer
            - type: 'null'
          title: Chunk Index
          description: Index of this chunk within the document
        size:
          anyOf:
            - type: integer
            - type: 'null'
          title: Size
          description: Size of chunk in bytes
        created_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Created At
          description: Creation timestamp
      type: object
      required:
        - id
        - content_id
        - collection_id
        - content
      title: ChunkResponse
      description: Response model for a single chunk.
    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
  securitySchemes:
    DualAuthScheme:
      type: http
      scheme: bearer

````