App Builders Bonus PlaybookThe Outcome API Starter Playbook
Engineers and product teams building generative content features must own the final output quality shipped to end users. This playbook explains how to integrate an asynchronous verification and refinement pipeline so every generated artifact ships with structured acceptance evidence.
Contents
- 1Why should the outcome be your primary product?
- 2What does the refinery do to an artifact?
- 3What are the three core integration patterns?
- 4How do you design for asynchronous refinement?
- 5How do you wire the receipt into your feature logic?
- 6What do the five dimensions of a LUCID receipt measure?
- 7How do you preserve protected fields and handle flagged content?
- 8How do you enforce spend caps and calculate unit economics?
- 9How does the Material Improvement Guarantee work?
- 10What is Lucidry not?
- 11The integration checklist
- 12Frequently asked questions
Why should the outcome be your primary product?
When an application exposes generative text to end users, the foundation model functions as a raw compute component rather than a finished product. Foundation models generate statistical continuations based on prompt context, but they lack deterministic guarantees regarding tone, organizational structure, or textual integrity.
Engineering teams that build production software remain fully responsible for every sentence shipped by their features. Relying on raw model output transfers quality control directly to the end user, which introduces reputational risk and increases support volume over time.
To treat the final outcome as your true product, your application pipeline must separate raw text generation from post-generation quality assurance. The model serves as the initial drafting engine, while a dedicated refinery validates and refines the draft before presentation or storage. This separation allows developers to enforce rigorous acceptance standards without over-engineering complex prompt chains or forcing models into fragile formatting rules.
By inserting a verification and refinement stage directly after the model, software teams establish an explicit contract for output quality. Every generated document is evaluated against measurable benchmarks before reaching downstream consumers. If an artifact fails to meet established parameters, the application can programmatically pause, reroute, or adjust the content based on structured feedback.
Viewing generated text through the lens of product engineering changes how teams approach architecture. Quality becomes a measurable pipeline property rather than an unpredictable model side effect. This mindset shift enables applications to deliver reliable content experiences consistently.
What does the refinery do to an artifact?
The refinery operates as an isolated verification and refinement service that accepts raw model output and returns an optimized artifact accompanied by a structured receipt. Positioned directly after the text generation stage in your application pipeline, the service analyzes the input text against source context to improve clarity, structure, and professional tone while preserving underlying intent.
Refinement begins with an initial evaluation stage that measures the draft across five structural and stylistic dimensions. The refinery then applies targeted editing passes based on the selected profile, such as Cleanup, Clarity, Professional, Write Like Me, or Write For Me.
Throughout these passes, the system maintains strict boundary rules around critical factual elements. Numerical values, proper names, direct quotes, and citations are preserved verbatim to prevent accidental distortion or hallucination during refinement.
If the refinery encounters ambiguous phrasing or potentially problematic content, it does not attempt a speculative rewrite. Instead, the service flags the affected section with a needs_review status and parks the item for human oversight. This design ensures that automated editing never introduces silent errors or unauthorized modifications into sensitive documents.
Once editing passes conclude, an independent scoring stage evaluates the refined artifact to quantify improvement. The final output consists of the refined artifact alongside a complete LUCID receipt that details score progression, modified passages, protected elements, and active flags.
What are the three core integration patterns?
Integrating the outcome refinery into your software application centers on three primary architectural patterns: gate, route, and log. These patterns define how your feature logic consumes the structured receipt returned alongside each refined artifact.
The gate pattern uses receipt metadata to control document publication or delivery. Your application inspects the composite overall score or specific sub-scores before allowing content to pass to the next stage.
For example, an automated email drafting tool can verify that the overall quality score exceeds eighty points before sending a message. If the score falls below the threshold, the system halts delivery and prompts the author for manual approval or additional context.
The route pattern directs content through different operational workflows based on receipt flags. When the refinery identifies ambiguous passages, it sets the needs_review field to true and identifies the specific risk factor. Your application can catch this flag and automatically route the artifact to an internal review queue or support dashboard, bypassing immediate customer exposure.
The log pattern stores the complete receipt payload alongside the generated artifact in your application database. Retaining structured receipt data creates an immutable audit trail for every piece of content shipped by your system. Engineering teams use these logs to track output quality over time, investigate customer support tickets, analyze model performance, and conduct postmortem evaluations on failed generations.
How do you design for asynchronous refinement?
Because text refinement and verification perform deep structural analysis, processing jobs typically require minutes to complete rather than milliseconds. Designing an effective user experience requires handling this asynchronous operational cadence gracefully within your application interface.
Rather than blocking user interactions during refinement, applications should adopt non-blocking asynchronous patterns. When a user triggers a content generation feature, the backend initiates the raw text generation and immediately dispatches the job to the refinery REST API. The interface should instantly acknowledge the request and present a clear progress indicator, temporary working draft, or background status message to keep the user informed throughout execution.
Applications can poll the job status endpoint or pick up completed jobs from a background queue to track completion. While refinement is in progress, the user interface can display a functional preview of the initial raw draft tagged with a processing badge, or allow the user to continue working on other tasks within the workspace. Once the refinery returns the completed artifact and receipt, the interface updates seamlessly via reactive state management.
For automated background tasks, such as nightly batch summary generation or scheduled report drafting, asynchronous execution fits naturally into standard queue architectures. Background workers submit text artifacts, pick up completed jobs, and update database records without impacting frontend responsiveness or introducing timeout risks into the workflow.
How do you wire the receipt into your feature logic?
Wiring the structured receipt into your application logic transforms raw text outputs into actionable data points. The LUCID receipt is returned as a machine-readable JSON object containing evaluation scores, status flags, and modification metadata.
Your application code parses this payload to drive conditional control flow immediately after the API call completes. The top-level overall field provides the composite quality score recorded after refinement.
Comparing this value against your feature baseline allows your code to make immediate branching decisions. Sub-scores such as integrity or coherence offer granular signals for specialized business logic and automated validation rules.
In addition to numerical scores, the receipt contains boolean flags and metadata arrays. Your application logic should specifically inspect the needs_review boolean. When this field evaluates to true, your application can inspect the associated flags array to determine why the content was flagged, such as high risk of ambiguity, structural inconsistency, or missing context.
The receipt also provides explicit lists of protected elements that were preserved verbatim, alongside a summary of textual modifications made between the raw input and refined output. Mapping these fields into your local application state allows you to highlight changes in the user interface or log exact diffs for compliance tracking across system runs.
What do the five dimensions of a LUCID receipt measure?
A LUCID receipt evaluates content across five distinct dimensions: Lineage, Understanding, Coherence, Integrity, and Delivery. Understanding how each dimension is calculated and reported enables engineering teams to construct precise acceptance criteria tailored to their specific application requirements.
Lineage tracks the structural provenance and contextual alignment of the text relative to the input prompt and source documents. Understanding measures how accurately the draft captures core concepts and logical relationships without dropping essential information. Coherence evaluates narrative flow, paragraph transitions, sentence rhythm, and syntactic consistency across the entire artifact.
Integrity measures adherence to factual boundaries, verifying that names, numbers, citations, and quotes remain accurate to the source context. Delivery assesses tone, formatting, conciseness, and stylistic appropriateness for the target audience profile selected for the job.
Every job receives a composite score from zero to one hundred calculated both before and after the refinement process. Crucially, these scores are generated by an independent scoring stage that operates separately from the editing engine.
Comparing the before and after composite scores provides a clear quantitative delta that proves measurable improvement across the five evaluation dimensions. Evaluating these signals allows software engineers to build robust automated gates before publishing content.
How do you preserve protected fields and handle flagged content?
Maintaining content fidelity requires strict rules around sensitive textual elements. The refinery enforces protected field boundaries that keep names, numerical values, direct quotes, and citations completely verbatim across every refinement pass.
During processing, the engine identifies protected elements and locks them against alteration. Whether a document contains financial figures, technical specifications, legal citations, or customer names, these exact strings pass through the refinery unchanged. The receipt explicitly lists all protected fields, allowing your application to verify programmatically that critical data remained intact throughout editing.
When content contains ambiguous phrasing, unverified claims, or boundary risks, the refinery does not attempt speculative edits. Instead, it marks the job with a needs_review status, sets the overall needs_review flag to true, and parks the artifact for human review.
Your application must handle flagged content deliberately. Rather than publishing flagged text directly, your system should route the artifact to an internal dashboard where a human operator can review the flagged passages and make informed publishing decisions.
This architecture guarantees that automated processing never quietly alters high-risk content or introduces silent errors into client-facing deliverables. Retaining flagged items in a review queue protects application integrity.
How do you enforce spend caps and calculate unit economics?
Managing unit economics for automated content features requires transparent pricing models and predictable cost controls. Lucidry publishes per-word profile rates in an open service catalog and enforces hard spend caps via a dedicated Budgets API.
Processing costs depend directly on the chosen profile rate per one thousand words: Cleanup at $2.40, Clarity at $4.50, Professional at $6.00, Write Like Me at $9.00, and Write For Me at $15.00. Volume discounts ranging from 5 to 25 percent apply automatically to usage exceeding 10,000 words.
Calculating feature unit costs relies on straightforward math based on these published rates. For example, processing a two thousand word document using the Professional profile costs exactly twelve dollars before any applicable volume discounts.
Unused credits are held in a prepaid wallet, never expire, and require no recurring subscription commitment. The first one thousand words are free without requiring credit card details.
To prevent cost overruns from runaway automation loops or unexpected usage spikes, developers can configure the Budgets API. The Budgets API enforces hard spend caps, blocking further processing once limits are reached. Establishing strict budget boundaries ensures that unit costs remain predictable across all application environments.
How does the Material Improvement Guarantee work?
Lucidry includes a Material Improvement Guarantee designed to eliminate financial risk for application developers. Under this guarantee, if a refined artifact fails to achieve at least a ten percent score improvement over its baseline, the job is free and refunded automatically without requiring a claim form.
The guarantee applies to the Clarity, Professional, Write Like Me, and Write For Me profiles; the basic Cleanup profile is excluded. Improvement is measured by comparing the composite score calculated before refinement against the composite score calculated after refinement during the independent scoring stage.
To prevent systemic gaming, the refinery architecture enforces strict separation between editing and scoring. The refine stage never sees the baseline score during processing, ensuring that editing passes cannot artificially manipulate text to pass the ten percent threshold.
This guarantee establishes a zero-risk unit economic model for developers. If the refinery delivers meaningful, measurable quality gains, your application pays the published per-word rate.
If the refinery fails to improve the artifact by at least ten percent, the processing cost is zero by construction, ensuring complete alignment between price and performance. Automatic refunds eliminate administrative burden for product teams managing high-volume features.
What is Lucidry not?
Integrating Lucidry effectively requires a clear understanding of the service boundaries and explicit design goals. Lucidry is a post-generation verification and refinement engine; it is not a general-purpose fact-checker or world-truth oracle.
The refinery verifies fidelity to the source context provided in your API request. It checks whether the generated draft accurately reflects, organizes, and formats the input text.
It does not query external web databases, cross-reference external facts, or determine whether source claims are objectively true in the real world. Real-world truth verification remains the responsibility of your upstream data sourcing and prompt context pipeline.
Additionally, Lucidry makes no claims regarding copyright ownership, intellectual property rights, AI detection evasion, or content authorship. The service does not attempt to obfuscate text to bypass AI detectors, nor does it certify legal copyright status for generated artifacts.
By maintaining focus on source fidelity, structural coherence, and verbatim field protection, Lucidry provides a deterministic refinement layer. Understanding these boundaries ensures that engineering teams deploy the service for its intended purpose: guaranteeing textual quality and structural integrity for application outputs without overstepping operational constraints.
The integration checklist
- Configure acceptance gates using top-level overall receipt scores before publishing generated content.
- Direct flagged artifacts to internal human review queues whenever needs_review evaluates to true.
- Log full LUCID receipt JSON objects alongside application artifacts for support and auditing postmortems.
- Set hard spend caps using the Budgets API to prevent unexpected usage overruns.
- Verify that numeric values, proper names, direct quotes, and citations are preserved verbatim across refinement passes.
- Design non-blocking asynchronous user interfaces with clear progress indicators while background refinement runs.
- Monitor background job status with polling or a background queue to handle completed receipts.
- Validate baseline composite score deltas against the Material Improvement Guarantee threshold for automatic refund tracking.
- Audit dimension sub-scores including integrity and coherence to continuously monitor model output health.
Frequently asked questions
Will processing through the refinery slow down my feature response time?
Processing typically requires a few minutes because the refinery executes deep structural analysis and independent scoring passes. Your application should run refinement asynchronously using background queues and status polling. The final LUCID receipt arrives together with the refined artifact, ensuring that your feature receives complete verification data as soon as background processing completes.
Is a dedicated software development kit package required to integrate Lucidry?
No SDK package is required. Integration uses a single standard REST API call that sends raw text in and returns a refined artifact plus a structured receipt. Developers can also access Model Context Protocol tools and per-word profile pricing published directly in the open service catalog using standard HTTP clients or backend frameworks.
What does the LUCID receipt actually prove to my development team?
The LUCID receipt provides machine-readable proof of fidelity to the source text and quantifies quality improvement across five dimensions. It records before and after composite scores evaluated by an independent scoring stage, lists protected verbatim fields, and details changes made during editing passes. It serves as objective acceptance evidence for feature logic.
How are processing costs calculated and managed across application workloads?
Pricing is based on published per-word profile rates ranging from $2.40 to $15.00 per one thousand words, with volume discounts up to 25 percent. Credits are stored in a non-expiring prepaid wallet without subscriptions. Developers enforce strict financial controls by setting hard spend limits through the Budgets API.
What happens when content receives a needs-review flag from the refinery?
When content contains high ambiguity or structural risk, the refinery sets the needs_review flag to true and parks the artifact for human review. The refinery never silently rewrites or makes speculative edits on high-risk passages. Your application can catch this flag and route the document directly to a review queue.
The cheapest integration test is one real artifact. Send a sample through the refinery from your sandbox, a single REST call, and read the receipt that comes back with it. Your first 1,000 words are free, no card required. Run your first artifact.
LUCID Receipt
- Lineage
- 79/100
- Understanding
- 90/100
- Coherence
- 91/100
- Integrity
- 83/100
- Delivery
- 87/100
The article was organized into a structured developer guide with headers, a checklist, and an FAQ, presenting Lucidry's refinery architecture, receipt fields, pricing, and guarantee terms in a clear, internally consistent, and professionally written format.
About the Author
Refined through the Lucidry pipeline, with editorial review & human-in-the-loop guidance by Daniel Stouffer.
Read the origin story: lucidry.io/origin-story
Try It Free
lucidry.io/try-freeThis white paper was built to be passed along. Share it at lucidry.io/help/resources/automation-teams/outcome-api-starter-playbook
Read the web edition: lucidry.io/help/resources/automation-teams/outcome-api-starter-playbook
