# Extraction Agents

## List Extract Agents

`client.extractionAgents.list(ExtractionAgentListParamsquery?, RequestOptionsoptions?): PaginatedCursor<ExtractAgent>`

**get** `/api/v1/beta/extraction-agents`

List the extraction agents in a project, newest first.

### Parameters

- `query: ExtractionAgentListParams`

  - `include_default?: boolean`

    Whether to include default agents in the results

  - `organization_id?: string | null`

  - `page_size?: number`

    Number of items per page

  - `page_token?: string | null`

    Cursor from the previous page's `next_page_token`.

  - `project_id?: string | null`

### Returns

- `ExtractAgent`

  Schema and configuration for an extraction agent.

  - `id: string`

    The id of the extraction agent.

  - `config: Config`

    The configuration parameters for the extraction agent.

    - `chunk_mode?: "PAGE" | "SECTION"`

      The mode to use for chunking the document.

      - `"PAGE"`

      - `"SECTION"`

    - `citation_bbox?: boolean`

      Whether to fetch citation bounding boxes for the extraction. Only available in PREMIUM mode. Deprecated: this is now synonymous with cite_sources.

    - `cite_sources?: boolean`

      Whether to cite sources for the extraction.

    - `confidence_scores?: boolean`

      Whether to fetch confidence scores for the extraction.

    - `extract_model?: "gemini-2.0-flash" | "gemini-2.5-flash" | "gemini-2.5-flash-lite" | 8 more | (string & {}) | null`

      The extract model to use for data extraction. If not provided, uses the default for the extraction mode.

      - `"gemini-2.0-flash" | "gemini-2.5-flash" | "gemini-2.5-flash-lite" | 8 more`

        - `"gemini-2.0-flash"`

        - `"gemini-2.5-flash"`

        - `"gemini-2.5-flash-lite"`

        - `"gemini-2.5-pro"`

        - `"openai-gpt-4-1"`

        - `"openai-gpt-4-1-mini"`

        - `"openai-gpt-4-1-nano"`

        - `"openai-gpt-4o"`

        - `"openai-gpt-4o-mini"`

        - `"openai-gpt-5"`

        - `"openai-gpt-5-mini"`

      - `(string & {})`

    - `extraction_mode?: "BALANCED" | "FAST" | "MULTIMODAL" | "PREMIUM"`

      The extraction mode specified (FAST, BALANCED, MULTIMODAL, PREMIUM).

      - `"BALANCED"`

      - `"FAST"`

      - `"MULTIMODAL"`

      - `"PREMIUM"`

    - `extraction_target?: "PER_DOC" | "PER_PAGE" | "PER_TABLE_ROW"`

      The extraction target specified.

      - `"PER_DOC"`

      - `"PER_PAGE"`

      - `"PER_TABLE_ROW"`

    - `high_resolution_mode?: boolean`

      Whether to use high resolution mode for the extraction.

    - `invalidate_cache?: boolean`

      Whether to invalidate the cache for the extraction.

    - `multimodal_fast_mode?: boolean`

      DEPRECATED: Whether to use fast mode for multimodal extraction.

    - `num_pages_context?: number | null`

      Number of pages to pass as context on long document extraction.

    - `page_range?: string | null`

      Comma-separated list of page numbers or ranges to extract from (1-based, e.g., '1,3,5-7,9' or '1-3,8-10').

    - `parse_model?: "anthropic-haiku-3.5" | "anthropic-haiku-4.5" | "anthropic-sonnet-3.5" | 22 more | null`

      Public model names.

      - `"anthropic-haiku-3.5"`

      - `"anthropic-haiku-4.5"`

      - `"anthropic-sonnet-3.5"`

      - `"anthropic-sonnet-3.5-v2"`

      - `"anthropic-sonnet-3.7"`

      - `"anthropic-sonnet-4.0"`

      - `"anthropic-sonnet-4.5"`

      - `"gemini-2.0-flash"`

      - `"gemini-2.0-flash-lite"`

      - `"gemini-2.5-flash"`

      - `"gemini-2.5-flash-lite"`

      - `"gemini-2.5-pro"`

      - `"gemini-3.0-pro"`

      - `"gemini-3.1-pro"`

      - `"openai-gpt-4-1"`

      - `"openai-gpt-4-1-mini"`

      - `"openai-gpt-4-1-nano"`

      - `"openai-gpt-4o"`

      - `"openai-gpt-4o-mini"`

      - `"openai-gpt-5"`

      - `"openai-gpt-5-mini"`

      - `"openai-gpt-5-nano"`

      - `"openai-text-embedding-3-large"`

      - `"openai-text-embedding-3-small"`

      - `"openai-whisper-1"`

    - `priority?: "critical" | "high" | "low" | "medium" | null`

      The priority for the request. This field may be ignored or overwritten depending on the organization tier.

      - `"critical"`

      - `"high"`

      - `"low"`

      - `"medium"`

    - `system_prompt?: string | null`

      The system prompt to use for the extraction.

    - `use_reasoning?: boolean`

      Whether to use reasoning for the extraction.

  - `data_schema: Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null>`

    The schema of the data.

    - `Record<string, unknown>`

    - `Array<unknown>`

    - `string`

    - `number`

    - `boolean`

  - `name: string`

    The name of the extraction agent.

  - `project_id: string`

    The ID of the project that the extraction agent belongs to.

  - `created_at?: string | null`

    The creation time of the extraction agent.

  - `custom_configuration?: "default" | null`

    Custom configuration type for the extraction agent. Currently supports 'default'.

    - `"default"`

  - `updated_at?: string | null`

    The last update time of the extraction agent.

### Example

```typescript
import LlamaCloud from '@llamaindex/llama-cloud';

const client = new LlamaCloud({
  apiKey: process.env['LLAMA_CLOUD_API_KEY'], // This is the default and can be omitted
});

// Automatically fetches more pages as needed.
for await (const extractAgent of client.extractionAgents.list()) {
  console.log(extractAgent.id);
}
```

#### Response

```json
{
  "items": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "config": {
        "chunk_mode": "PAGE",
        "citation_bbox": true,
        "cite_sources": true,
        "confidence_scores": true,
        "extract_model": "gemini-2.0-flash",
        "extraction_mode": "BALANCED",
        "extraction_target": "PER_DOC",
        "high_resolution_mode": true,
        "invalidate_cache": true,
        "multimodal_fast_mode": true,
        "num_pages_context": 1,
        "page_range": "page_range",
        "parse_model": "anthropic-haiku-3.5",
        "priority": "critical",
        "system_prompt": "system_prompt",
        "use_reasoning": true
      },
      "data_schema": {
        "foo": {
          "foo": "bar"
        }
      },
      "name": "name",
      "project_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "created_at": "2019-12-27T18:11:19.117Z",
      "custom_configuration": "default",
      "updated_at": "2019-12-27T18:11:19.117Z"
    }
  ],
  "next_page_token": "next_page_token",
  "total_size": 0
}
```

## Domain Types

### Extract Agent

- `ExtractAgent`

  Schema and configuration for an extraction agent.

  - `id: string`

    The id of the extraction agent.

  - `config: Config`

    The configuration parameters for the extraction agent.

    - `chunk_mode?: "PAGE" | "SECTION"`

      The mode to use for chunking the document.

      - `"PAGE"`

      - `"SECTION"`

    - `citation_bbox?: boolean`

      Whether to fetch citation bounding boxes for the extraction. Only available in PREMIUM mode. Deprecated: this is now synonymous with cite_sources.

    - `cite_sources?: boolean`

      Whether to cite sources for the extraction.

    - `confidence_scores?: boolean`

      Whether to fetch confidence scores for the extraction.

    - `extract_model?: "gemini-2.0-flash" | "gemini-2.5-flash" | "gemini-2.5-flash-lite" | 8 more | (string & {}) | null`

      The extract model to use for data extraction. If not provided, uses the default for the extraction mode.

      - `"gemini-2.0-flash" | "gemini-2.5-flash" | "gemini-2.5-flash-lite" | 8 more`

        - `"gemini-2.0-flash"`

        - `"gemini-2.5-flash"`

        - `"gemini-2.5-flash-lite"`

        - `"gemini-2.5-pro"`

        - `"openai-gpt-4-1"`

        - `"openai-gpt-4-1-mini"`

        - `"openai-gpt-4-1-nano"`

        - `"openai-gpt-4o"`

        - `"openai-gpt-4o-mini"`

        - `"openai-gpt-5"`

        - `"openai-gpt-5-mini"`

      - `(string & {})`

    - `extraction_mode?: "BALANCED" | "FAST" | "MULTIMODAL" | "PREMIUM"`

      The extraction mode specified (FAST, BALANCED, MULTIMODAL, PREMIUM).

      - `"BALANCED"`

      - `"FAST"`

      - `"MULTIMODAL"`

      - `"PREMIUM"`

    - `extraction_target?: "PER_DOC" | "PER_PAGE" | "PER_TABLE_ROW"`

      The extraction target specified.

      - `"PER_DOC"`

      - `"PER_PAGE"`

      - `"PER_TABLE_ROW"`

    - `high_resolution_mode?: boolean`

      Whether to use high resolution mode for the extraction.

    - `invalidate_cache?: boolean`

      Whether to invalidate the cache for the extraction.

    - `multimodal_fast_mode?: boolean`

      DEPRECATED: Whether to use fast mode for multimodal extraction.

    - `num_pages_context?: number | null`

      Number of pages to pass as context on long document extraction.

    - `page_range?: string | null`

      Comma-separated list of page numbers or ranges to extract from (1-based, e.g., '1,3,5-7,9' or '1-3,8-10').

    - `parse_model?: "anthropic-haiku-3.5" | "anthropic-haiku-4.5" | "anthropic-sonnet-3.5" | 22 more | null`

      Public model names.

      - `"anthropic-haiku-3.5"`

      - `"anthropic-haiku-4.5"`

      - `"anthropic-sonnet-3.5"`

      - `"anthropic-sonnet-3.5-v2"`

      - `"anthropic-sonnet-3.7"`

      - `"anthropic-sonnet-4.0"`

      - `"anthropic-sonnet-4.5"`

      - `"gemini-2.0-flash"`

      - `"gemini-2.0-flash-lite"`

      - `"gemini-2.5-flash"`

      - `"gemini-2.5-flash-lite"`

      - `"gemini-2.5-pro"`

      - `"gemini-3.0-pro"`

      - `"gemini-3.1-pro"`

      - `"openai-gpt-4-1"`

      - `"openai-gpt-4-1-mini"`

      - `"openai-gpt-4-1-nano"`

      - `"openai-gpt-4o"`

      - `"openai-gpt-4o-mini"`

      - `"openai-gpt-5"`

      - `"openai-gpt-5-mini"`

      - `"openai-gpt-5-nano"`

      - `"openai-text-embedding-3-large"`

      - `"openai-text-embedding-3-small"`

      - `"openai-whisper-1"`

    - `priority?: "critical" | "high" | "low" | "medium" | null`

      The priority for the request. This field may be ignored or overwritten depending on the organization tier.

      - `"critical"`

      - `"high"`

      - `"low"`

      - `"medium"`

    - `system_prompt?: string | null`

      The system prompt to use for the extraction.

    - `use_reasoning?: boolean`

      Whether to use reasoning for the extraction.

  - `data_schema: Record<string, Record<string, unknown> | Array<unknown> | string | 2 more | null>`

    The schema of the data.

    - `Record<string, unknown>`

    - `Array<unknown>`

    - `string`

    - `number`

    - `boolean`

  - `name: string`

    The name of the extraction agent.

  - `project_id: string`

    The ID of the project that the extraction agent belongs to.

  - `created_at?: string | null`

    The creation time of the extraction agent.

  - `custom_configuration?: "default" | null`

    Custom configuration type for the extraction agent. Currently supports 'default'.

    - `"default"`

  - `updated_at?: string | null`

    The last update time of the extraction agent.
