> This page is for version v2026-02-09 (default).
> For other versions, use one of these documentation indexes:
> - v2026-02-09 (default): https://docs.extend.ai/2026-02-09/llms.txt
> - v2025-04-21: https://docs.extend.ai/2025-04-21/llms.txt
> - v2024-12-23: https://docs.extend.ai/2024-12-23/llms.txt

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.extend.ai/llms.txt
> Use this file to discover all available pages before exploring further.
>
> ## API version
> The current API version is `2026-02-09`, served at the site root (no version prefix in URLs).
> If this page URL contains `/2025-04-21/` or `/2024-12-23/`, you are reading an older API version.
> Prefer the current docs at https://docs.extend.ai/llms.txt unless the user explicitly needs that older version.
> Do not treat older-version pages as the source of truth for new integrations.

# Parsed Output Caching

> Reuse parsed output with config.useCache, poll with parseRuns.createAndPoll or parse_runs.create_and_poll, and inspect cacheHit using Python, TypeScript, Java, Go, or Extend Studio.

Parsed output caching reuses a completed parse when you submit the same document with the same parsing settings. It is **opt-in**: set `config.useCache` to `true` on both the initial run and subsequent requests. A cache hit creates a new run with its own ID and returns the reused output with **zero parsing credits**.

Caching is available for direct Parse API requests, batch parse runs, and the Studio parser playground. It does not enable caching for parsing performed inside extraction, classification, splitting, or workflows.

## Via the API

Set `config.useCache: true` when calling `POST /parse_runs`, `POST /parse`, or `POST /parse_runs/batch`. Omit it or set it to `false` to bypass parsed output caching for that request.

```json
{
  "file": { "id": "file_YOUR_FILE_ID" },
  "config": {
    "engine": "parse_performance",
    "useCache": true
  }
}
```

The SDK examples below create a run and wait for completion. Set `EXTEND_API_KEY` and replace the file ID with an [uploaded file](/api-reference/endpoints/file/upload-file). Run the same code again after the first run completes to request reuse.

> **Note**
>
> SDK versions that do not yet expose typed `useCache` and `cacheHit` fields can send and read them as extra JSON fields, as shown below. Use the exact wire names `useCache` and `cacheHit` for these extra fields, including in Python.

#### Python

```python
from typing import cast
from extend_ai import Extend
from extend_ai.requests.parse_config import ParseConfigParams

client = Extend()
config = cast(ParseConfigParams, {
    "engine": "parse_performance",
    "useCache": True,
})

run = client.parse_runs.create_and_poll(
    file={"id": "file_YOUR_FILE_ID"},
    config=config,
)
print(run.id, run.status, getattr(run, "cacheHit", False))
if run.status != "PROCESSED":
    raise RuntimeError(run.failure_message or str(run.status))
print(run.output)
```

#### TypeScript

```typescript
import { ExtendClient, type Extend } from "extend-ai";

const client = new ExtendClient();
const config: Extend.ParseConfig & { useCache: boolean } = {
  engine: "parse_performance",
  useCache: true,
};

const run = await client.parseRuns.createAndPoll({
  file: { id: "file_YOUR_FILE_ID" },
  config,
});
const cacheHit = (run as Extend.ParseRun & { cacheHit?: boolean }).cacheHit;
console.log(run.id, run.status, cacheHit ?? false);
if (run.status !== "PROCESSED") {
  throw new Error(run.failureMessage ?? run.status);
}
console.log(run.output);
```

#### Java

```java
import ai.extend.ExtendClient;
import ai.extend.resources.parseruns.requests.ParseRunsCreateRequest;
import ai.extend.resources.parseruns.types.ParseRunsCreateRequestFile;
import ai.extend.types.FileFromId;
import ai.extend.types.ParseConfig;

ExtendClient client = ExtendClient.builder().build();
ParseConfig config = ParseConfig.builder().build();
config.getAdditionalProperties().put("useCache", true);

var run = client.parseRuns().createAndPoll(ParseRunsCreateRequest.builder()
    .file(ParseRunsCreateRequestFile.of(FileFromId.builder()
        .id("file_YOUR_FILE_ID")
        .build()))
    .config(config)
    .build());
System.out.println(run.getId());
System.out.println(run.getStatus());
System.out.println(run.getAdditionalProperties().getOrDefault("cacheHit", false));
if (!"PROCESSED".equals(run.getStatus().toString())) {
    throw new IllegalStateException(run.getFailureMessage().orElse("Parse did not complete"));
}
System.out.println(run.getOutput());
```

#### Go

```go
package main

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

    extend "github.com/extend-hq/extend-go-sdk"
    "github.com/extend-hq/extend-go-sdk/client"
    "github.com/extend-hq/extend-go-sdk/option"
)

func main() {
    c := client.NewClient()
    ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
    defer cancel()

    run, err := c.ParseRuns.Create(ctx, &extend.ParseRunsCreateRequest{
        File: &extend.ParseRunsCreateRequestFile{
            FileFromID: &extend.FileFromID{ID: "file_YOUR_FILE_ID"},
        },
    }, option.WithBodyProperties(map[string]interface{}{
        "config": map[string]interface{}{
            "engine": "parse_performance",
            "useCache": true,
        },
    }))
    if err != nil {
        log.Fatal(err)
    }

    for run.Status == "PENDING" || run.Status == "PROCESSING" || run.Status == "CANCELLING" {
        select {
        case <-ctx.Done():
            log.Fatal(ctx.Err())
        case <-time.After(2 * time.Second):
        }
        run, err = c.ParseRuns.Retrieve(ctx, run.ID, &extend.ParseRunsRetrieveRequest{})
        if err != nil {
            log.Fatal(err)
        }
    }
    cacheHit, _ := run.GetExtraProperties()["cacheHit"].(bool)
    fmt.Println(run.ID, run.Status, cacheHit)
    if run.Status != "PROCESSED" {
        log.Fatalf("Parse ended with status %s", run.Status)
    }
    fmt.Println(run.Output)
}
```

### Read the result

`cacheHit` is a top-level response field, alongside `status` and `usage`. It is also present on list summaries and the minimal parse-run status objects used in webhooks.

| Result            | Meaning                                                                        | Parsing credits             |
| ----------------- | ------------------------------------------------------------------------------ | --------------------------- |
| `cacheHit: true`  | The run reused eligible parsed output.                                         | `usage.credits` is `0`.     |
| `cacheHit: false` | The run did not reuse parsed output. On a completed run, parsing ran normally. | Normal parsing rates apply. |

Read `cacheHit` after the run completes. Enabling `useCache` does not guarantee a hit: the initial request usually populates the cache, and a missing, expired, unavailable, or incompatible entry falls back to normal parsing. Only successful, cache-enabled parses can populate reusable entries.

## Matching and expiration

* **Same content and settings:** Matching uses document content and the effective parsing configuration, including the resolved engine version, chunking, block options, and page filtering. Re-uploading identical content can reuse output; a file ID or URL alone does not establish a match. Organization settings can also affect matching.
* **Isolated scope:** Entries are scoped to the organization, workspace, and environment. A test run does not populate the production cache.
* **Up to seven days:** Reuse is limited to seven days, or the applicable retention period if shorter. Both the source run and its file must still be within that window. A cache hit does not extend the source entry's lifetime.
* **Zero data retention:** Caching is unavailable when the run or input file uses zero data retention, or an applicable retention policy requires it. Setting `useCache: true` does not override retention.
* **Source availability:** Deleted or purged source runs and files cannot supply cached output. Cache expiration ends reuse; retained run results remain subject to their normal retention policy.

Keep caching disabled when measuring fresh parsing latency or evaluating repeated model outputs. To reproduce settings across runs, pin `engineVersion`; `latest` can resolve to a different version after a release.

## Via Extend Studio

1. Open the [parser playground](https://dashboard.extend.ai/studio/parsers) and sign in.
2. In the configuration builder, turn on **Use cache** before running the document.
3. Run the same document again with the same settings after the first run completes.
4. Look for the **Cache hit** indicator beside the run metrics. Its tooltip confirms that parsed output was reused.

The toggle is disabled when the workspace has zero data retention enabled or Studio cannot verify the retention settings. The run detail view also shows the configuration used for that run.

## Reference

* [Parsing configuration](/parsing/configuration#parsed-output-caching)
* [Parsing response format](/parsing/response-format)
* [Create Parse Run](/api-reference/endpoints/parse/create-parse-run)
* [Get Parse Run](/api-reference/endpoints/parse/get-parse-run)
* [Data handling](/security/data-handling)