Skip to content
Guide
Parse

Getting Started

Quick start guide for Parse, covering API key generation and document parsing using Python, TypeScript, the REST API, or the Web UI.

Get your first parse job running in under a minute—whether you prefer Python, TypeScript, the REST API, or the Web UI.

You’ll need a LlamaCloud API key. Get your API key →

Set it as an environment variable so the SDKs pick it up automatically:

Terminal window
export LLAMA_CLOUD_API_KEY="llx-..."

Install the SDK:

Terminal window
pip install llama-cloud>=2.1

Parse a document:

from llama_cloud import LlamaCloud
client = LlamaCloud() # reads LLAMA_CLOUD_API_KEY from the environment
# Upload and parse a document
file = client.files.create(file="./attention_is_all_you_need.pdf", purpose="parse")
result = client.parsing.parse(
file_id=file.id,
tier="agentic",
version="latest",
expand=["markdown"],
)
# Print the markdown for the first page
print(result.markdown.pages[0].markdown)

That’s it. The SDK handles job polling for you—client.parsing.parse() blocks until the job finishes and returns the full result.

Prefer async? Swap LlamaCloud for AsyncLlamaCloud and await the calls:

from llama_cloud import AsyncLlamaCloud
import asyncio
async def main():
client = AsyncLlamaCloud()
file = await client.files.create(file="./attention_is_all_you_need.pdf", purpose="parse")
result = await client.parsing.parse(file_id=file.id, tier="agentic", version="latest", expand=["markdown"])
print(result.markdown.pages[0].markdown)
asyncio.run(main())

The snippet above uses defaults. When you’re ready to tune the output, add input_options, output_options, or processing_options:

result = client.parsing.parse(
file_id=file.id,
tier="agentic",
version="latest",
output_options={
"markdown": {"tables": {"output_tables_as_markdown": True}},
"images_to_save": ["screenshot"],
},
processing_options={
"ocr_parameters": {"languages": ["en"]},
},
expand=["text", "markdown", "items", "images_content_metadata"],
)

Each group has a dedicated reference page:

  • Input Options — page ranges, crop boxes, file-type-specific controls, and cache behavior
  • Output Options — markdown styling, spatial text, screenshots, tables-as-spreadsheet, and more
  • Processing Options — OCR languages, ignore rules, chart parsing, cost optimizer
  • Retrieving Results — every expand value and how to control what comes back

If you’re already using Claude Code, Cursor, or another coding agent, you can skip the SDK entirely. Install the Parse agent skill and your agent can parse documents on the fly:

Terminal window
npx skills add run-llama/llamaparse-agent-skills --skill llamaparse

Then just ask your agent things like:

  • “Parse this PDF and extract the text as markdown.”
  • “Extract every table from each invoice in ./invoices and save them as CSVs.”
  • “Parse this financial report with cost optimizer enabled.”

The agent writes the SDK calls for you. It picks the right tier, configures options, and saves output — without you needing to remember API details.

Requirements: Node 18+, LLAMA_CLOUD_API_KEY in the environment, and a coding agent that supports Vercel-style skills.

Two skills are available:

SkillWhat it does
llamaparseFull parsing via the LlamaCloud API — charts, tables, images, complex layouts
liteparseLocal-first, no API key needed — best for plain text and simple layouts

Install both with npx skills add run-llama/llamaparse-agent-skills (no --skill flag). Source on GitHub →

  • Choose the right tierTiers explains when to use Agentic Plus vs. Agentic vs. Cost Effective vs. Fast.
  • Learn to configure optionsConfiguring Parse covers every knob — input, output, and processing options.
  • Save money on long documentsCost Optimizer routes each page to the right tier automatically.
  • See real examplesParse Examples — runnable tutorials for common use cases.