Submit approved documents, code, records, and supported media observations.
Better answers from sources too large to prompt.
Give your models focused, source-grounded context from material that will not fit in a context window—without rebuilding or resending the full source for every task. Validate answer quality on your own representative work before rollout.
Demonstrated scale: up to one billion source tokens.
Prepare once. Use the handle where it helps.
Distil is designed for stable source material that must support many focused tasks. It complements your current prompts, retrieval systems, source records, permissions, and review process.
Keep a persistent handle in your application instead of copying hosted context state.
Send task-specific prompts through the handle when the workflow needs that context.
Promote only after your own facts, format, safety, and quality checks pass.
Recover value already being spent.
Stop paying to resend large, noisy operating environments into repeated planning, review, support, and coordination turns.
Unlock work that was previously uneconomic.
Use compact context as a first-turn operating layer for longer agent loops, parallel specialist sessions, personalization, verification, and autonomous planning.
Fit is workflow-specific. Evaluate Distil against your current production path using representative tasks and your own acceptance criteria. Keep authoritative evidence in your source systems and preserve a fallback path during rollout. Open the evaluation guide.
Compress once. Activate repeatedly.
Distil is one component inside an existing AI workflow. It creates a hosted handle for reusable context, then lets your application activate that handle for individual tasks.
Create handle
Send stable source material to /v1/compress: documents, code, records, and supported media observations.
Get a handle
Receive a persistent context_handle. The compressed context stays hosted server-side; the handle is a reference, not a downloadable copy.
Activate repeatedly
Run the handle again and again through /v1/context/run with task-specific prompts. Account-visible credits are reported in the console.
Keep controls separate
Your app owns the task and user flow. Distil owns the hosted context handle and customer-visible run status.
Caching keeps your tokens warm. Distil makes them smaller and reusable.
Native prompt caching and Distil solve different halves of repeated context. Many teams use both: cache within a session, and hand Distil the source that outlives it.
Native prompt caching
Your provider keeps the exact tokens you already sent warm, so a repeat hit is cheaper.
- Stores your verbatim source — nothing is dropped.
- Warm for a short window, on one provider and model family.
- You still send the full source on the first call, every session.
- Best when the exact bytes must stay and you re-hit them quickly.
Distil hosted context
You send the source once and get a smaller, reusable handle you activate by reference.
- Returns a compact handle, not the original bytes.
- Reusable for 365 days and provider-neutral — not locked to one vendor's cache.
- After creation you stop resending the source at all.
- Spans text, documents, images, audio, and video in one handle.
- Gated on your own quality contract before you promote it.
The workflow audit runs a raw-plus-caching arm alongside the hosted-context arm, so you can measure the delta on your own workflow instead of taking either claim on faith.
Evaluate Distil inside the workflow that matters.
Use representative source material, fixed task requirements, and your existing review process. Keep the current path available until the hosted-context path meets your quality, safety, and operational gates.
Define acceptance first
Choose the facts, citations, structure, latency, and review criteria that make an answer usable for this workflow.
Compare like for like
Use the same tasks, model settings, and reviewers for the current path and the hosted-context candidate.
Roll out safely
Begin in shadow or limited traffic, observe failures, and retain a tested fallback before broader adoption.
Compress, poll, then activate by handle.
The public contract is intentionally small. Your app sends a stable source package, receives a hosted context handle, and runs task-specific questions against that handle.
const api = "https://dev.primarydesignco.com/api/v1";
const headers = {
"Authorization": `Bearer ${process.env.DISTIL_API_KEY}`,
"Content-Type": "application/json"
};
const stableSourceBundle = {
text: projectDocsAndTickets,
sources: [
{ type: "document", name: "runbook.md", text: runbookText },
{ type: "image", name: "diagram.png", data: base64Diagram },
{ type: "audio", name: "standup.m4a", data: base64Audio }
]
};
const created = await fetch(`${api}/compress`, {
method: "POST",
headers,
body: JSON.stringify({
...stableSourceBundle,
task: "Answer production rollout questions.",
rubric: ["preserve blockers", "preserve owners", "preserve dates"]
})
}).then(r => r.json());
const handle = created.data.context_handle;
const answer = await fetch(`${api}/context/run`, {
method: "POST",
headers,
body: JSON.stringify({
context_handle: handle,
task: "What blocks the next rollout?",
output_contract: "Answer as a short bulleted list."
})
}).then(r => r.json());
Two public endpoints. One scoped key.
Base URL: https://dev.primarydesignco.com/api/v1. Authenticate with Authorization: Bearer <key>.
Public contract
API-only integration. Compress a packet, store the handle, and run task-specific prompts against it. The hosted context remains server-side.
The public scope is compress:write. Use distil-public-contract.js with a stableSourceBundle to create a hosted context and run task-specific questions.
Source preparation happens inside the managed service. Large runs expose public progress, elapsed time, ETA, and account-visible metrics.
Response fields include context_handle, public status, credits, measured latency, and deletion metadata where available.
Lifecycle: handles are accessible for 365 days by default, only to the account and exact API key that created them; delete early with DELETE /v1/context/{context_handle} at no charge. Rate limits use a rolling one-minute window. Account-specific controls are handled in the developer console.
Packet fit
Built for reusable packages. Use your own workflow and review criteria before publishing results.
Distil is designed for source material that needs to be reused across many task-specific activations.
/v1/compressCreate a hosted handle for large stable context.
{
"text": "<large source context>",
"task": "Compare Dijkstra and A* search.",
"rubric": ["Preserve shortest-path facts", "Preserve heuristic/use-case differences"],
"must_preserve": ["Dijkstra", "A* search", "heuristic"]
}Multimodal operational packets can include text, documents, code, images, audio, video, and supported media observations.
Returns a hosted context_handle and metrics, not downloadable compressed text. Returns a hosted context_handle and customer-visible status, not downloadable transformed context.
Create: prepare the handle once. Reuse: activate it through /v1/context/run for each task.
/v1/context/runAsk task-specific questions against a hosted context handle without resending the full source packet.
{
"context_handle": "ctx_...",
"task": "Which implementation constraints affect rollout?",
"output_contract": "Bulleted list; include constraints, risks, and next steps."
}Runtime: /v1/context/run applies the hosted handle to the requested task and returns customer-visible usage.
Use a scoped key and account credits.
Open the developer console to mint a scoped key, add credits, and view hosted contexts, run status, and usage.
Prepaid credits
Prepay for API credits and draw them down as you use the API.
- Usage draws down your balance in real time.
- Top up when the balance approaches zero.
- At zero, credit-mode requests pause until you top up.
Start with one workflow
Start with one reusable package and one representative task set. Promote only after quality and usage are visible in the account console.
- Create a scoped key.
- Compress one stable package.
- Run representative activations.
- Review quality, status, and account-visible usage.
Start with one source package and one real workflow.
Generate a scoped key, define representative tasks, and let your own quality requirements decide whether the handle belongs in production.
Open the developer console Read integration docs