---
title: LlamaParse Platform Quickstart | Developer Documentation
description: Install the SDK, get an API key, and run your first call against Parse, Extract, Classify, Split, or Index — all from one platform.
---

**Build document agents powered by agentic OCR.**

LlamaParse is the enterprise platform from LlamaIndex for turning documents into production AI pipelines. One API key, one SDK, and five composable products: **Parse** (agentic OCR), **Extract** (structured data), **Classify**, **Split**, and **Index**.

Using a coding agent?

Give your AI agent access to these docs: `claude mcp add llama-index-docs --transport http https://developers.llamaindex.ai/mcp` — or supercharge your agent with LlamaParse [MCP tools and Skills](/for-agents/index.md).

## Install

- [Python](#tab-panel-0-0)
- [TypeScript](#tab-panel-0-1)
- [Go](#tab-panel-0-2)
- [Java](#tab-panel-0-3)
- [CLI](#tab-panel-0-4)

Terminal window

```
pip install "llama-cloud>=2.8"
```

Terminal window

```
npm install @llamaindex/llama-cloud zod
```

Terminal window

```
# Skip go mod init if the directory already has a go.mod
go mod init quickstart
go get github.com/run-llama/llama-parse-go
```

```
implementation("ai.llamaindex:llama-cloud:1.3.0")
```

Terminal window

```
go install github.com/run-llama/llama-parse-cli/cmd/llp@latest
```

Set your API key:

Terminal window

```
export LLAMA_CLOUD_API_KEY=llx-...
```

[Get an API key](../general/api_key/) from the [LlamaParse dashboard](https://cloud.llamaindex.ai).

---

## Which product do I want?

Map what you’re trying to do to the right product:

| I want to…                                                                                                            | Use                                             |
| --------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
| Turn PDFs, scans, or images into clean LLM-ready text                                                                 | **[Parse](../parse/)**                          |
| Pull structured JSON out of documents that matches my schema                                                          | **[Extract](../extract/)**                      |
| Route documents into categories with natural-language rules                                                           | **[Classify](../classify/)**                    |
| Split concatenated documents into their logical parts                                                                 | **[Split](../split/)**                          |
| Build a hosted vector search pipeline for RAG                                                                         | **[Index](../cloud-index-v2/getting_started/)** |
| New here? Start with **Parse**—it’s the foundation most pipelines build on. Or explore the product quickstarts below. |                                                 |

---

## Quick Start

- [Parse](#tab-panel-1-0)
- [Extract](#tab-panel-1-1)
- [Classify](#tab-panel-1-2)
- [Split](#tab-panel-1-3)
- [Index](#tab-panel-1-4)

Agentic OCR and parsing for 130+ formats. Turn PDFs and scans into LLM-ready text—the foundation for document agents.

Download the U.S. Treasury’s FY 2024 financial report executive summary as `document.pdf`:

Terminal window

```
curl -fL -o document.pdf https://fiscal.treasury.gov/system/files/files/reports-statements/financial-report/2024/executive-summary-2024.pdf
```

Python (python)

Copy as agent context

```
from llama_cloud import LlamaCloud


client = LlamaCloud()  # Uses LLAMA_CLOUD_API_KEY env var


# Upload and parse a document
file = client.files.create(file="document.pdf", purpose="parse")
result = client.parsing.parse(
    file_id=file.id,
    tier="agentic",
    version="latest",
    expand=["markdown"],
)


# Get markdown output
print(result.markdown.pages[0].markdown)
```

Copy as agent context

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


const client = new LlamaCloud(); // Uses LLAMA_CLOUD_API_KEY env var


// Upload and parse a document
const file = await client.files.create({
  file: fs.createReadStream('document.pdf'),
  purpose: 'parse',
});
const result = await client.parsing.parse({
  file_id: file.id,
  tier: 'agentic',
  version: 'latest',
  expand: ['markdown']
});


// Get markdown output
const [page] = result.markdown?.pages ?? [];
if (page?.success) console.log(page.markdown);
```

Copy as agent context

```
package main


import (
  "context"
  "fmt"
  "log"
  "os"
  "time"


  llamacloud "github.com/run-llama/llama-parse-go"
)


func main() {
  ctx := context.Background()
  client := llamacloud.NewClient() // Uses LLAMA_CLOUD_API_KEY env var


  // Upload and parse a document
  f, err := os.Open("document.pdf")
  if err != nil {
    log.Fatal(err)
  }
  defer f.Close()


  file, err := client.Files.New(ctx, llamacloud.FileNewParams{
    File:    f,
    Purpose: "parse",
  })
  if err != nil {
    log.Fatal(err)
  }


  job, err := client.Parsing.New(ctx, llamacloud.ParsingNewParams{
    FileID:  llamacloud.String(file.ID),
    Tier:    llamacloud.ParsingNewParamsTierAgentic,
    Version: llamacloud.ParsingNewParamsVersionLatest,
  })
  if err != nil {
    log.Fatal(err)
  }


  // Poll until the job reaches a terminal state
  getParams := llamacloud.ParsingGetParams{Expand: []string{"markdown"}}
  result, err := client.Parsing.Get(ctx, job.ID, getParams)
  if err != nil {
    log.Fatal(err)
  }
  for result.Job.Status == "PENDING" || result.Job.Status == "RUNNING" {
    time.Sleep(2 * time.Second)
    result, err = client.Parsing.Get(ctx, job.ID, getParams)
    if err != nil {
      log.Fatal(err)
    }
  }


  // Get markdown output
  fmt.Println(result.Markdown.Pages[0].Markdown)
}
```

Copy as agent context

```
import ai.llamaindex.llamacloud.client.LlamaCloudClient;
import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient;
import ai.llamaindex.llamacloud.models.files.FileCreateParams;
import ai.llamaindex.llamacloud.models.files.FileCreateResponse;
import ai.llamaindex.llamacloud.models.parsing.ParsingCreateParams;
import ai.llamaindex.llamacloud.models.parsing.ParsingCreateResponse;
import ai.llamaindex.llamacloud.models.parsing.ParsingGetParams;
import ai.llamaindex.llamacloud.models.parsing.ParsingGetResponse;
import java.nio.file.Paths;


public class ParseQuickStart {
    public static void main(String[] args) throws Exception {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv(); // Uses LLAMA_CLOUD_API_KEY env var


        // Upload and parse a document
        FileCreateResponse file = client.files().create(FileCreateParams.builder()
                .file(Paths.get("document.pdf"))
                .purpose("parse")
                .build());


        ParsingCreateResponse job = client.parsing().create(ParsingCreateParams.builder()
                .fileId(file.id())
                .tier(ParsingCreateParams.Tier.AGENTIC)
                .version(ParsingCreateParams.Version.LATEST)
                .build());


        // Poll until the job reaches a terminal state
        ParsingGetParams getParams = ParsingGetParams.builder()
                .jobId(job.id())
                .addExpand("markdown")
                .build();
        ParsingGetResponse result = client.parsing().get(getParams);
        while (result.job().status().equals(ParsingGetResponse.Job.Status.PENDING)
                || result.job().status().equals(ParsingGetResponse.Job.Status.RUNNING)) {
            Thread.sleep(2000);
            result = client.parsing().get(getParams);
        }


        // Get markdown output
        System.out.println(result.markdown().get().pages().get(0).asMarkdownResult().markdown());
    }
}
```

Copy as agent context

Terminal window

```
# Upload and parse a document
FILE_ID=$(llp files create --file document.pdf --purpose parse | jq -r '.id')
JOB_ID=$(llp parsing create --file-id "$FILE_ID" --tier agentic --version latest | jq -r '.id')


# Poll until the job reaches a terminal state
while true; do
  STATUS=$(llp parsing get --job-id "$JOB_ID" | jq -er '.job.status') || break
  case "$STATUS" in COMPLETED|FAILED|CANCELLED) break ;; esac
  sleep 2
done


# Get markdown output
llp parsing get --job-id "$JOB_ID" --expand markdown | jq -r 'if .job.status == "COMPLETED" then .markdown.pages[0].markdown
  else "Parse job failed: \(.job.error_message // .)" end'
```

[Full Guide](../parse/getting_started/) | [Examples](../parse/examples/) | [Tiers & Pricing](../parse/guides/tiers/)

Structured data from documents with custom schemas. Feed agents with clean entities, tables, and fields.

Download a sample resume as `resume.pdf`:

Terminal window

```
curl -fL -o resume.pdf https://raw.githubusercontent.com/run-llama/llama_cloud_services/main/examples/extract/data/resumes/software_architect.pdf
```

Python (python)

Copy as agent context

```
from pydantic import BaseModel, Field
from llama_cloud import LlamaCloud


# Define your schema
class Resume(BaseModel):
    name: str = Field(description="Full name of candidate")
    email: str = Field(description="Email address")
    skills: list[str] = Field(description="Technical skills")


client = LlamaCloud()


# Upload and extract
file = client.files.create(file="resume.pdf", purpose="extract")
job = client.extract.run(
    file_input=file.id,
    configuration={
        "data_schema": Resume.model_json_schema(),
        "tier": "agentic",
    },
)
print(job.extract_result)
```

Copy as agent context

```
import LlamaCloud from '@llamaindex/llama-cloud';
import { z } from 'zod';
import fs from 'fs';


// Define your schema with Zod
const ResumeSchema = z.object({
  name: z.string().describe('Full name of candidate'),
  email: z.string().describe('Email address'),
  skills: z.array(z.string()).describe('Technical skills'),
});


const client = new LlamaCloud();


// Upload and extract
const file = await client.files.create({
  file: fs.createReadStream('resume.pdf'),
  purpose: 'extract',
});
let job = await client.extract.run({
  file_input: file.id,
  configuration: {
    data_schema: z.toJSONSchema(ResumeSchema) as LlamaCloud.Extract.ExtractConfiguration['data_schema'],
    tier: 'agentic',
  },
});
console.log(job.extract_result);
```

Copy as agent context

```
package main


import (
  "context"
  "fmt"
  "log"
  "os"
  "time"


  llamacloud "github.com/run-llama/llama-parse-go"
)


func main() {
  ctx := context.Background()
  client := llamacloud.NewClient()


  // Define your schema
  dataSchema := map[string]*llamacloud.ExtractConfigurationDataSchemaUnionParam{
    "type": {OfString: llamacloud.String("object")},
    "properties": {OfAnyMap: map[string]any{
      "name":  map[string]any{"type": "string", "description": "Full name of candidate"},
      "email": map[string]any{"type": "string", "description": "Email address"},
      "skills": map[string]any{
        "type":        "array",
        "items":       map[string]any{"type": "string"},
        "description": "Technical skills",
      },
    }},
  }


  // Upload and extract
  f, err := os.Open("resume.pdf")
  if err != nil {
    log.Fatal(err)
  }
  defer f.Close()


  file, err := client.Files.New(ctx, llamacloud.FileNewParams{
    File:    f,
    Purpose: "extract",
  })
  if err != nil {
    log.Fatal(err)
  }


  job, err := client.Extract.New(ctx, llamacloud.ExtractNewParams{
    ExtractV2JobCreate: llamacloud.ExtractV2JobCreateParam{
      FileInput: file.ID,
      Configuration: llamacloud.ExtractConfigurationParam{
        DataSchema: dataSchema,
        Tier:       llamacloud.ExtractConfigurationTierAgentic,
      },
    },
  })
  if err != nil {
    log.Fatal(err)
  }


  // Poll until the job reaches a terminal state
  for job.Status == "PENDING" || job.Status == "RUNNING" {
    time.Sleep(2 * time.Second)
    job, err = client.Extract.Get(ctx, job.ID, llamacloud.ExtractGetParams{})
    if err != nil {
      log.Fatal(err)
    }
  }


  fmt.Println(job.ExtractResult.RawJSON())
}
```

Copy as agent context

```
import ai.llamaindex.llamacloud.client.LlamaCloudClient;
import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient;
import ai.llamaindex.llamacloud.core.JsonValue;
import ai.llamaindex.llamacloud.models.extract.ExtractConfiguration;
import ai.llamaindex.llamacloud.models.extract.ExtractCreateParams;
import ai.llamaindex.llamacloud.models.extract.ExtractGetParams;
import ai.llamaindex.llamacloud.models.extract.ExtractV2Job;
import ai.llamaindex.llamacloud.models.extract.ExtractV2JobCreate;
import ai.llamaindex.llamacloud.models.files.FileCreateParams;
import ai.llamaindex.llamacloud.models.files.FileCreateResponse;
import java.nio.file.Paths;
import java.util.Map;


public class ExtractQuickStart {
    public static void main(String[] args) throws Exception {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();


        // Define your schema
        ExtractConfiguration.DataSchema dataSchema = ExtractConfiguration.DataSchema.builder()
                .putAdditionalProperty("type", JsonValue.from("object"))
                .putAdditionalProperty("properties", JsonValue.from(Map.of(
                        "name", Map.of("type", "string", "description", "Full name of candidate"),
                        "email", Map.of("type", "string", "description", "Email address"),
                        "skills", Map.of("type", "array", "items", Map.of("type", "string"), "description", "Technical skills"))))
                .build();


        // Upload and extract
        FileCreateResponse file = client.files().create(FileCreateParams.builder()
                .file(Paths.get("resume.pdf"))
                .purpose("extract")
                .build());


        ExtractV2Job job = client.extract().create(ExtractCreateParams.builder()
                .extractV2JobCreate(ExtractV2JobCreate.builder()
                        .fileInput(file.id())
                        .configuration(ExtractConfiguration.builder()
                                .dataSchema(dataSchema)
                                .tier(ExtractConfiguration.Tier.AGENTIC)
                                .build())
                        .build())
                .build());


        // Poll until the job reaches a terminal state
        while (job.status().equals("PENDING") || job.status().equals("RUNNING")) {
            Thread.sleep(2000);
            job = client.extract().get(ExtractGetParams.builder().jobId(job.id()).build());
        }


        System.out.println(job.extractResult());
    }
}
```

Copy as agent context

Terminal window

```
# Define your schema
SCHEMA='{type: object, properties: {name: {type: string, description: "Full name of candidate"}, email: {type: string, description: "Email address"}, skills: {type: array, items: {type: string}, description: "Technical skills"}}}'


# Upload and extract
FILE_ID=$(llp files create --file resume.pdf --purpose extract | jq -r '.id')
JOB_ID=$(llp extract create \
  --file-input "$FILE_ID" \
  --configuration.tier agentic \
  --configuration.data-schema "$SCHEMA" | jq -r '.id')


# Poll until the job reaches a terminal state
while true; do
  JOB=$(llp extract get --job-id "$JOB_ID") || break
  STATUS=$(printf '%s\n' "$JOB" | jq -r '.status')
  case "$STATUS" in COMPLETED|FAILED|CANCELLED) break ;; esac
  sleep 2
done


printf '%s\n' "$JOB" | jq -r 'if .status == "COMPLETED" then .extract_result
  else "Extract job failed: \(.error_message // .)" end'
```

[Full Guide](../extract/sdk/) | [Examples](../extract/examples/) | [Configuring Extract](../extract/guides/configuring-extract/)

Categorize documents with natural-language rules. Pre-processing for extraction, parsing, or indexing.

Download a sample invoice as `invoice.pdf`:

Terminal window

```
curl -fL -o invoice.pdf https://media.githubusercontent.com/media/run-llama/llama-datasets/main/llama_agents/invoice-contracts/invoice-2-1.pdf
```

Python (python)

Copy as agent context

```
from llama_cloud import LlamaCloud


client = LlamaCloud()


# Upload a document
file = client.files.create(file="invoice.pdf", purpose="classify")


# Run Classify with natural-language rules and wait for the result
job = client.classify.run(
    file_input=file.id,
    configuration={
        "rules": [
            {
                "type": "invoice",
                "description": "Documents with invoice numbers, line items, and totals",
            },
            {
                "type": "receipt",
                "description": "Short POS receipts with merchant and total",
            },
            {
                "type": "contract",
                "description": "Legal agreements with terms and signatures",
            },
        ],
    },
)


# `run` raises PollingError if the job fails, so reaching here means it succeeded
print(f"Type: {job.result.type}, Confidence: {job.result.confidence}")
```

Copy as agent context

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


const client = new LlamaCloud();


// Upload a document
const file = await client.files.create({
  file: fs.createReadStream('invoice.pdf'),
  purpose: 'classify',
});


// Run Classify with natural-language rules and wait for the result
const job = await client.classify.run({
  file_input: file.id,
  configuration: {
    rules: [
      {
        type: 'invoice',
        description: 'Documents with invoice numbers, line items, and totals',
      },
      {
        type: 'receipt',
        description: 'Short POS receipts with merchant and total',
      },
      {
        type: 'contract',
        description: 'Legal agreements with terms and signatures',
      },
    ],
  },
});


// `run` throws if the job fails, so reaching here means it succeeded
console.log(`Type: ${job.result!.type}, Confidence: ${job.result!.confidence}`);
```

Copy as agent context

```
package main


import (
  "context"
  "fmt"
  "log"
  "os"
  "time"


  llamacloud "github.com/run-llama/llama-parse-go"
)


func main() {
  ctx := context.Background()
  client := llamacloud.NewClient()


  // Upload a document
  f, err := os.Open("invoice.pdf")
  if err != nil {
    log.Fatal(err)
  }
  defer f.Close()


  file, err := client.Files.New(ctx, llamacloud.FileNewParams{
    File:    f,
    Purpose: "classify",
  })
  if err != nil {
    log.Fatal(err)
  }


  // Run Classify with natural-language rules
  job, err := client.Classify.New(ctx, llamacloud.ClassifyNewParams{
    ClassifyCreateRequest: llamacloud.ClassifyCreateRequestParam{
      FileInput: llamacloud.String(file.ID),
      Configuration: llamacloud.ClassifyConfigurationParam{
        Rules: []llamacloud.ClassifyConfigurationRuleParam{
          {Type: "invoice", Description: "Documents with invoice numbers, line items, and totals"},
          {Type: "receipt", Description: "Short POS receipts with merchant and total"},
          {Type: "contract", Description: "Legal agreements with terms and signatures"},
        },
      },
    },
  })
  if err != nil {
    log.Fatal(err)
  }


  // Poll until the job reaches a terminal state
  result, err := client.Classify.Get(ctx, job.ID, llamacloud.ClassifyGetParams{})
  if err != nil {
    log.Fatal(err)
  }
  for result.Status == llamacloud.ClassifyGetResponseStatusPending ||
    result.Status == llamacloud.ClassifyGetResponseStatusRunning {
    time.Sleep(2 * time.Second)
    result, err = client.Classify.Get(ctx, job.ID, llamacloud.ClassifyGetParams{})
    if err != nil {
      log.Fatal(err)
    }
  }


  if !result.JSON.Result.Valid() {
    log.Fatalf("Classification failed: %s", result.ErrorMessage)
  }
  fmt.Printf("Type: %s, Confidence: %v\n", result.Result.Type, result.Result.Confidence)
}
```

Copy as agent context

```
import ai.llamaindex.llamacloud.client.LlamaCloudClient;
import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient;
import ai.llamaindex.llamacloud.models.classify.ClassifyConfiguration;
import ai.llamaindex.llamacloud.models.classify.ClassifyCreateRequest;
import ai.llamaindex.llamacloud.models.classify.ClassifyCreateResponse;
import ai.llamaindex.llamacloud.models.classify.ClassifyGetResponse;
import ai.llamaindex.llamacloud.models.classify.ClassifyResult;
import ai.llamaindex.llamacloud.models.files.FileCreateParams;
import ai.llamaindex.llamacloud.models.files.FileCreateResponse;
import java.nio.file.Paths;
import java.util.Arrays;


public class ClassifyQuickStart {
    public static void main(String[] args) throws Exception {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();


        // Upload a document
        FileCreateResponse file = client.files().create(FileCreateParams.builder()
                .file(Paths.get("invoice.pdf"))
                .purpose("classify")
                .build());


        // Run Classify with natural-language rules
        ClassifyCreateResponse job = client.classify().create(ClassifyCreateRequest.builder()
                .fileInput(file.id())
                .configuration(ClassifyConfiguration.builder()
                        .rules(Arrays.asList(
                                ClassifyConfiguration.Rule.builder()
                                        .type("invoice")
                                        .description("Documents with invoice numbers, line items, and totals")
                                        .build(),
                                ClassifyConfiguration.Rule.builder()
                                        .type("receipt")
                                        .description("Short POS receipts with merchant and total")
                                        .build(),
                                ClassifyConfiguration.Rule.builder()
                                        .type("contract")
                                        .description("Legal agreements with terms and signatures")
                                        .build()))
                        .build())
                .build());


        // Poll until the job reaches a terminal state
        ClassifyGetResponse result = client.classify().get(job.id());
        while (result.status().equals(ClassifyGetResponse.Status.PENDING)
                || result.status().equals(ClassifyGetResponse.Status.RUNNING)) {
            Thread.sleep(2000);
            result = client.classify().get(job.id());
        }


        if (result.result().isPresent()) {
            ClassifyResult r = result.result().get();
            System.out.println("Type: " + r.type().orElse("") + ", Confidence: " + r.confidence());
        } else {
            System.out.println("Classification failed: " + result.errorMessage().orElse(""));
        }
    }
}
```

Copy as agent context

Terminal window

```
# Upload a document
FILE_ID=$(llp files create --file invoice.pdf --purpose classify | jq -r '.id')


# Run Classify with natural-language rules
JOB_ID=$(llp classify create \
  --file-input "$FILE_ID" \
  --configuration '{rules: [{type: invoice, description: "Documents with invoice numbers, line items, and totals"}, {type: receipt, description: "Short POS receipts with merchant and total"}, {type: contract, description: "Legal agreements with terms and signatures"}]}' \
  | jq -r '.id')


# Poll until the job reaches a terminal state
while true; do
  RESULT=$(llp classify get "$JOB_ID") || break
  STATUS=$(printf '%s\n' "$RESULT" | jq -r '.status')
  [ "$STATUS" = "PENDING" ] || [ "$STATUS" = "RUNNING" ] || break
  sleep 2
done


printf '%s\n' "$RESULT" | jq -r 'if .status == "COMPLETED" then .result.type, .result.confidence
  else "Classification failed: \(.error_message // .)" end'
```

[Full Guide](../classify/sdk/) | [Examples](../classify/examples/)

Segment concatenated PDFs into logical sections. AI-powered classification to split combined documents.

Download a sample bundle of shipping documents, which includes invoices and export certificates, as `combined.pdf`:

Terminal window

```
curl -fL -o combined.pdf https://cloud.llamaindex.ai/assets/demos/split/shipping.pdf
```

Python (python)

Copy as agent context

```
import time


from llama_cloud import LlamaCloud


client = LlamaCloud()


# Upload a combined PDF
file = client.files.create(file="combined.pdf", purpose="split")


# Split into logical sections
job = client.beta.split.create(
    document_input={"type": "file_id", "value": file.id},
    configuration={
        "categories": [
            {
                "name": "invoice",
                "description": "Commercial document with line items and totals"
            },
            {
                "name": "certificate",
                "description": "Certificate of origin or other export certificate"
            },
        ]
    },
)


# Poll until the job reaches a terminal state (Split statuses are lowercase)
result = client.beta.split.get(job.id)
while result.status in ("pending", "processing"):
    time.sleep(2)
    result = client.beta.split.get(job.id)


for segment in result.result.segments:
    print(f"Pages {segment.pages}: {segment.category} ({segment.confidence_category})")
```

Copy as agent context

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


const client = new LlamaCloud();


// Upload a combined PDF
const file = await client.files.create({
  file: fs.createReadStream('combined.pdf'),
  purpose: 'split',
});


// Split into logical sections
const job = await client.beta.split.create({
  document_input: { type: 'file_id', value: file.id },
  configuration: {
    categories: [
      {
        name: 'invoice',
        description: 'Commercial document with line items and totals',
      },
      {
        name: 'certificate',
        description: 'Certificate of origin or other export certificate',
      },
    ],
  },
});


// Poll until the job reaches a terminal state (Split statuses are lowercase)
let result = await client.beta.split.get(job.id);
while (result.status === 'pending' || result.status === 'processing') {
  await new Promise((resolve) => setTimeout(resolve, 2000));
  result = await client.beta.split.get(job.id);
}


for (const segment of result.result?.segments ?? []) {
  console.log(`Pages ${segment.pages}: ${segment.category} (${segment.confidence_category})`);
}
```

Copy as agent context

```
package main


import (
  "context"
  "fmt"
  "log"
  "os"
  "time"


  llamacloud "github.com/run-llama/llama-parse-go"
)


func main() {
  ctx := context.Background()
  client := llamacloud.NewClient()


  // Upload a combined PDF
  f, err := os.Open("combined.pdf")
  if err != nil {
    log.Fatal(err)
  }
  defer f.Close()


  file, err := client.Files.New(ctx, llamacloud.FileNewParams{
    File:    f,
    Purpose: "split",
  })
  if err != nil {
    log.Fatal(err)
  }


  // Split into logical sections
  job, err := client.Beta.Split.New(ctx, llamacloud.BetaSplitNewParams{
    DocumentInput: llamacloud.SplitDocumentInputParam{Type: "file_id", Value: file.ID},
    Configuration: llamacloud.BetaSplitNewParamsConfiguration{
      Categories: []llamacloud.SplitCategoryParam{
        {Name: "invoice", Description: llamacloud.String("Commercial document with line items and totals")},
        {Name: "certificate", Description: llamacloud.String("Certificate of origin or other export certificate")},
      },
    },
  })
  if err != nil {
    log.Fatal(err)
  }


  // Poll until the job reaches a terminal state (Split statuses are lowercase)
  result, err := client.Beta.Split.Get(ctx, job.ID, llamacloud.BetaSplitGetParams{})
  if err != nil {
    log.Fatal(err)
  }
  for result.Status == "pending" || result.Status == "processing" {
    time.Sleep(2 * time.Second)
    result, err = client.Beta.Split.Get(ctx, job.ID, llamacloud.BetaSplitGetParams{})
    if err != nil {
      log.Fatal(err)
    }
  }


  for _, segment := range result.Result.Segments {
    fmt.Printf("Pages %v: %s (%s)\n", segment.Pages, segment.Category, segment.ConfidenceCategory)
  }
}
```

Copy as agent context

```
import ai.llamaindex.llamacloud.client.LlamaCloudClient;
import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient;
import ai.llamaindex.llamacloud.models.beta.split.SplitCategory;
import ai.llamaindex.llamacloud.models.beta.split.SplitCreateParams;
import ai.llamaindex.llamacloud.models.beta.split.SplitCreateResponse;
import ai.llamaindex.llamacloud.models.beta.split.SplitDocumentInput;
import ai.llamaindex.llamacloud.models.beta.split.SplitGetResponse;
import ai.llamaindex.llamacloud.models.beta.split.SplitSegmentResponse;
import ai.llamaindex.llamacloud.models.files.FileCreateParams;
import ai.llamaindex.llamacloud.models.files.FileCreateResponse;
import java.nio.file.Paths;


public class SplitQuickStart {
    public static void main(String[] args) throws Exception {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();


        // Upload a combined PDF
        FileCreateResponse file = client.files().create(FileCreateParams.builder()
                .file(Paths.get("combined.pdf"))
                .purpose("split")
                .build());


        // Split into logical sections
        SplitCreateResponse job = client.beta().split().create(SplitCreateParams.builder()
                .documentInput(SplitDocumentInput.builder().type("file_id").value(file.id()).build())
                .configuration(SplitCreateParams.Configuration.builder()
                        .addCategory(SplitCategory.builder()
                                .name("invoice")
                                .description("Commercial document with line items and totals")
                                .build())
                        .addCategory(SplitCategory.builder()
                                .name("certificate")
                                .description("Certificate of origin or other export certificate")
                                .build())
                        .build())
                .build());


        // Poll until the job reaches a terminal state (Split statuses are lowercase)
        SplitGetResponse result = client.beta().split().get(job.id());
        while (result.status().equals("pending") || result.status().equals("processing")) {
            Thread.sleep(2000);
            result = client.beta().split().get(job.id());
        }


        for (SplitSegmentResponse segment : result.result().get().segments()) {
            System.out.println("Pages " + segment.pages() + ": " + segment.category()
                    + " (" + segment.confidenceCategory() + ")");
        }
    }
}
```

Copy as agent context

Terminal window

```
# Upload a combined PDF
FILE_ID=$(llp files create --file combined.pdf --purpose split | jq -r '.id')


# Split into logical sections
JOB_ID=$(llp beta:split create \
  --document-input "{type: file_id, value: $FILE_ID}" \
  --configuration '{categories: [{name: invoice, description: "Commercial document with line items and totals"}, {name: certificate, description: "Certificate of origin or other export certificate"}]}' \
  | jq -r '.id')


# Poll until the job reaches a terminal state. Split statuses are lowercase.
while true; do
  STATUS=$(llp beta:split get --split-job-id "$JOB_ID" | jq -er '.status') || break
  case "$STATUS" in completed|failed|cancelled) break ;; esac
  sleep 2
done


llp beta:split get --split-job-id "$JOB_ID" | jq -rc 'if .status == "completed" then .result.segments[]
  else "Split job failed: \(.error_message // .)" end'
```

[Full Guide](../split/getting_started/) | [Examples](../split/examples/)

Build searchable indexes over your documents for RAG and document agents. Follow the [Index v2 getting started guide](../cloud-index-v2/getting_started/) to upload documents and create an index, then use the [retrieval guide](../cloud-index-v2/retrieval/) to query it.

---

## LlamaParse Agent Skills

[Download Skills](https://github.com/run-llama/llamaparse-agent-skills/releases/download/latest/skills-latest.zip)

### Available Skills

- **llamaparse**: Advanced parsing for PDFs, docs, presentations and images (charts, tables, embedded visuals). Requires `LLAMA_CLOUD_API_KEY` and Node 18+.
- **liteparse**: Local-first, fast parsing for text-dense PDFs and docs. No API key needed, requires `@llamaindex/liteparse` globally installed and Node 18+.

### Installation

Install both skills with the [`skills`](https://skills.sh) CLI:

Terminal window

```
npx skills add run-llama/llamaparse-agent-skills
```

For single-skill installs, the agent plugins that bundle these skills, and Codex setup, see [Skills and Plugins](/llamaparse/for-agents/skills/index.md).

---

## Resources

[Python SDK](https://github.com/run-llama/llama-parse-py)pip install "llama-cloud>=2.8"

[TypeScript SDK](https://github.com/run-llama/llama-cloud-ts)npm install @llamaindex/llama-cloud

[Go SDK](https://github.com/run-llama/llama-parse-go)go get github.com/run-llama/llama-parse-go

[Java SDK](https://github.com/run-llama/llama-parse-java)implementation("ai.llamaindex:llama-cloud:1.3.0")

[CLI](https://github.com/run-llama/llama-parse-cli)go install github.com/run-llama/llama-parse-cli/cmd/llp\@latest
