主题
Parse 提供四个档位,在成本、延迟与准确度之间做取舍。每次解析请求都要选一个档位,外加一个 version,以便行为保持可复现。本页是每个档位做什么、何时选它、以及版本化模型如何运作的权威参考。
我该选哪个档位?
把下表当作起点。你随时可以用另一个档位重新解析同一份文件 —— 切换没有额外成本。
| 我的文档大致是这样 | 建议选 |
|---|---|
| 纯文本、单栏、无表格 —— 我只需要原始文本或保留版面的空间文本 | Fast |
| 以文字为主、表格简单,需要干净的 markdown,且想控制成本 | Cost Effective |
| 扫描页、多栏版式、真实表格、内嵌图表 | Agentic |
| 密集的财务报告、复杂表格、图表与示意图,准确度至关重要 | Agentic Plus |
| 混合 —— 多数页简单但少数复杂 | Agentic or Agentic Plus with Cost Optimizer 开启 |
复杂度混合的文档:用成本优化器
如果你的文档既有简单的纯文本页、又有几页含表格或图表的复杂页,最省钱的通常不是只选一个档位,而是在 agentic 或 agentic_plus 之上开启 成本优化器。它会逐页自动路由到合适的档位,并让两组并行运行,于是你在该花的地方拿到 premium 级质量、在简单页上按 cost_effective 计价 —— 且不牺牲延迟。
每页的 credit 开销
credit 开销随档位能力递增 —— Fast 最便宜,Agentic Plus 最贵。当前费率、批量折扣以及其他 Parse 输出选项(例如版面抽取)的价格见定价页。
缓存是免费的。 48 小时内重新解析同一文件不花任何 credit —— Parse 默认会缓存结果。需要全新解析时如何不走缓存,见缓存控制。
版本化与可复现
Parse v2 的档位是有版本的。当你为某个档位指定带日期的具体版本(例如 "agentic" 配 version="2026-01-08"),解析行为就被锁定:同样的模型、同样的提示词、同样的配置,每次如此。正是这份约定让 Parse 可以安心用于生产 —— 不会因为我们要发布新模型,你的输出就悄悄变了。
开发期用 "version": "latest" 始终拿最新的稳定发布。生产环境请固定一个已发布的版本日期。 只有对应真实发布的日期会被接受 —— 随意填的日期会返回校验错误。
{
"tier": "agentic",
"version": "2026-01-08"
}当新版本发布后,何时(甚至是否)升级由你决定。我们不会破坏既有的固定版本 —— 它们在可预见的未来仍然可用,因此你可以按自己的节奏升级,也可以在新版本不合用时回退。
tier 与 version 在每次解析请求上都必填。漏掉任意一个都会返回校验错误。
可用的档位
每个档位都是「某个模型 + 提示词 + 配置」组合的一份快照。档位之间不共用模型 —— 选 agentic_plus 并不是在 agentic 之上多开几个选项,而是另一条解析流水线。
完整的 API 请求示例见快速上手 或 REST API 指南。
Agentic Plus
适合: 最难的文档 —— 密集的财务报告、含公式与插图的科研论文、复杂多栏版式,以及任何准确度至关重要的场合。
值得注意的默认值: 专门的图表解析 在这个档位默认开启 —— 无需额外配置。
{
"tier": "agentic_plus",
"version": "latest"
}生产环境显式固定版本的写法:
{
"tier": "agentic_plus",
"version": "2026-01-08"
}Agentic
适合: 复杂但不至于极端的文档 —— 多数含表格的真实世界 PDF、扫描页、多栏版式、图表与示意图。对需要高质量结构化输出的多数场景,这是默认推荐。
在长短不一、复杂度混合的长文档上,可与成本优化器 搭配,把简单页的每页开销降下来。
{
"tier": "agentic",
"version": "latest"
}Cost Effective
适合: 以文字为主、表格简单、视觉结构很少的文档 —— 你仍想要干净的 markdown 与表格保留,但可以为了更便宜的运行舍弃最深的版面推理。
{
"tier": "cost_effective",
"version": "latest"
}Fast
适合: 高量的纯文本文档,且你只需要文本与保留版面的空间文本。它是最快的档位,每页开销也最低。
限制: fast 不对页面调用任何 AI 模型,因此它不接受 agentic_options(自定义提示词及其他智能体模型控件),也不接受 processing_options.forms,还不抽取图表数据。当前的 fast 版本会返回 markdown 与 items;只有固定在 2026-06-15 之前版本的 fast 任务才是纯文本,对那种任务请求 expand=["markdown"] 会返回校验错误。若你需要图表数据、自定义提示词或表单,请用 Cost Effective 或更高档位。
{
"tier": "fast",
"version": "latest"
}请求示例
先下载一份样例 PDF —— 财政服务局的 FY2024 执行摘要,存为 example_file.pdf:
终端窗口
curl -fL -o example_file.pdf https://fiscal.treasury.gov/system/files/files/reports-statements/financial-report/2024/executive-summary-2024.pdf下面是一段完整的、体现「档位 + 版本」写法的请求:
- Python
- TypeScript
- Go
- Java
- CLI
- cURL
from llama_cloud import LlamaCloud
client = LlamaCloud() # reads LLAMA_CLOUD_API_KEY from the environment
result = client.parsing.parse(
upload_file="example_file.pdf",
tier="agentic_plus",
version="latest",
expand=["markdown"],
)import fs from "fs";
import { LlamaCloud } from "@llamaindex/llama-cloud";
const client = new LlamaCloud(); // reads LLAMA_CLOUD_API_KEY from the environment
const result = await client.parsing.parse({
upload_file: fs.createReadStream("example_file.pdf"),
tier: "agentic_plus",
version: "latest",
expand: ["markdown"],
});SDK 没有一次性阻塞式解析,所以要先上传文件、用 Tier + Version 启动任务,再轮询:
package main
import (
"context"
"fmt"
"log"
"os"
"time"
llamacloud "github.com/run-llama/llama-parse-go"
)
func main() {
ctx := context.Background()
client := llamacloud.NewClient() // reads LLAMA_CLOUD_API_KEY from the environment
f, err := os.Open("./example_file.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.ParsingNewParamsTierAgenticPlus,
Version: llamacloud.ParsingNewParamsVersionLatest,
})
if err != nil {
log.Fatal(err)
}
// Poll until the job reaches a terminal status
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 != "COMPLETED" && result.Job.Status != "FAILED" && result.Job.Status != "CANCELLED" {
time.Sleep(2 * time.Second)
result, err = client.Parsing.Get(ctx, job.ID, getParams)
if err != nil {
log.Fatal(err)
}
}
if result.Job.Status != "COMPLETED" {
log.Fatalf("parse ended as %s", result.Job.Status)
}
if len(result.Markdown.Pages) == 0 {
log.Fatal("parse completed with no markdown pages")
}
fmt.Println(result.Markdown.Pages[0].Markdown)
}SDK 没有一次性阻塞式解析,所以要先上传文件、用 tier + version 启动任务,再轮询:
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 ParseExample {
public static void main(String[] args) throws Exception {
// reads LLAMA_CLOUD_API_KEY from the environment
LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();
FileCreateResponse file = client.files().create(FileCreateParams.builder()
.file(Paths.get("./example_file.pdf"))
.purpose("parse")
.build());
ParsingCreateResponse job = client.parsing().create(ParsingCreateParams.builder()
.fileId(file.id())
.tier(ParsingCreateParams.Tier.AGENTIC_PLUS)
.version(ParsingCreateParams.Version.LATEST)
.build());
// Poll until the job reaches a terminal status
ParsingGetParams getParams = ParsingGetParams.builder()
.jobId(job.id())
.addExpand("markdown")
.build();
ParsingGetResponse result = client.parsing().get(getParams);
while (!result.job().status().equals(ParsingGetResponse.Job.Status.COMPLETED)
&& !result.job().status().equals(ParsingGetResponse.Job.Status.FAILED)
&& !result.job().status().equals(ParsingGetResponse.Job.Status.CANCELLED)) {
Thread.sleep(2000);
result = client.parsing().get(getParams);
}
if (!result.job().status().equals(ParsingGetResponse.Job.Status.COMPLETED)) {
throw new RuntimeException("parse ended as " + result.job().status());
}
System.out.println(result.markdown().get().pages().get(0).asMarkdownResult().markdown());
}
}CLI 也没有阻塞式解析,所以要先上传文件、用 --tier + --version 启动任务,再轮询:
终端窗口
# Upload the document
FILE_ID=$(llp files create \
--file ./example_file.pdf \
--purpose parse | jq -r '.id')
# Start a parse job
JOB_ID=$(llp parsing create \
--file-id "$FILE_ID" \
--tier agentic_plus \
--version latest | jq -r '.id')
# Poll until the job reaches a terminal status
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
# Print the markdown for the first page
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'终端窗口
curl -X 'POST' \
'https://api.cloud.llamaindex.ai/api/v2/parse' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
--data '{
"file_id": "<file_id>",
"tier": "agentic_plus",
"version": "latest"
}'新进展
Parse 使用带日期的档位版本 —— 一次发布通常是四个档位中某一个的新日期版本。被固定的版本会持续可用,以便你按自己的节奏升级。
Parse 团队大约每月发布新的档位版本。
"latest"究竟解析到哪个版本,权威来源是 API 本身 —— 用"version": "latest"发一次解析请求,再看响应里的metadata.version。
值得注意的能力发布
- 成本优化器 —— 在
agentic或agentic_plus上做逐页档位路由。见成本优化器。 - Agent Skill —— 面向编码智能体的原生文档解析。见快速上手 → Agent Skill。
- Agentic Plus 下图表解析默认开启 ——
specialized_chart_parsing在agentic_plus上默认启用。见专门的图表解析。 - v2 API —— 用结构化 JSON 取代了 v1 那 70 多个平铺表单参数。
tier与version现在必填。见 REST API 指南。