Skip to navigation

Parsed Output Caching

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.

{
"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. Run the same code again after the first run completes to request reuse.

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.

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)

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.

ResultMeaningParsing credits
cacheHit: trueThe run reused eligible parsed output.usage.credits is 0.
cacheHit: falseThe 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 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